fix(cli): make clean source checkouts start reliably

This commit is contained in:
morluto
2026-07-15 14:44:04 +00:00
parent 70e1a0f532
commit 6ba97656ca
5 changed files with 88 additions and 10 deletions
+12 -1
View File
@@ -8,7 +8,15 @@ import { PRODUCT_IDENTITY } from "../src/identity.js";
describe("package identity", () => {
it("keeps the manifest, executable, and floating MCP command aligned", async () => {
const packageJson = z
.object({ name: z.string(), bin: z.record(z.string(), z.string()) })
.object({
name: z.string(),
bin: z.record(z.string(), z.string()),
scripts: z.object({
start: z.string(),
prepare: z.string(),
prepack: z.string().optional(),
}),
})
.parse(
JSON.parse(
await readFile(
@@ -20,5 +28,8 @@ describe("package identity", () => {
expect(packageJson.name).toBe(PRODUCT_IDENTITY.packageName);
expect(Object.keys(packageJson.bin)).toEqual([PRODUCT_IDENTITY.cliBinary]);
expect(PRODUCT_IDENTITY.mcpCommand).toBe(`npx -y ${packageJson.name} mcp`);
expect(packageJson.scripts.start).toBe("node scripts/rea.mjs mcp");
expect(packageJson.scripts.prepare).toBe("npm run build && husky");
expect(packageJson.scripts.prepack).toBeUndefined();
});
});