* refactor(tools): organize internal CLI workflows - Group visual-oracle commands behind a Citty CLI and domain folders\n- Add imported-document visual comparison manifests and pixel-diff outputs\n- Consolidate package-quality checks behind stable check, smoke, and verify commands\n- Remove obsolete visual root aliases and compatibility scripts * fix(tools): validate visual oracle target scope - Validate manifest records, required strings, and optional field types\n- Reject explicit OpenPencil nodes outside the configured page * fix(tools): validate packaged runtime exports
17 lines
510 B
TypeScript
17 lines
510 B
TypeScript
import { defineCommand } from 'citty'
|
|
|
|
export function operationCommand(name: string, description: string, entrypoint: string) {
|
|
return defineCommand({
|
|
meta: { name, description },
|
|
async run({ rawArgs }) {
|
|
const process = Bun.spawn(['bun', entrypoint, ...rawArgs], {
|
|
stdin: 'inherit',
|
|
stdout: 'inherit',
|
|
stderr: 'inherit'
|
|
})
|
|
const exitCode = await process.exited
|
|
if (exitCode !== 0) throw new Error(`${name} exited with code ${exitCode}`)
|
|
}
|
|
})
|
|
}
|