mirror of
https://github.com/simstudioai/sim.git
synced 2026-09-24 15:45:35 +08:00
fix(zustand): v5 selector stability issues (#4539)
* fix(zustand): v5 selector stability issues * address comments
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import { spawnSync } from 'node:child_process'
|
||||
|
||||
export function formatGeneratedSource(source: string, stdinFilePath: string, cwd: string): string {
|
||||
const result = spawnSync('bunx', ['biome', 'format', '--stdin-file-path', stdinFilePath], {
|
||||
cwd,
|
||||
encoding: 'utf8',
|
||||
input: source,
|
||||
})
|
||||
|
||||
if (result.status !== 0) {
|
||||
throw new Error(
|
||||
`Failed to format generated source for ${stdinFilePath}:\n${
|
||||
result.stderr || result.stdout || 'unknown error'
|
||||
}`
|
||||
)
|
||||
}
|
||||
|
||||
return result.stdout
|
||||
}
|
||||
Reference in New Issue
Block a user