feat(cli): fail the update when a project needs manual review

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-20 12:12:38 +05:30
co-authored by Claude Opus 5
parent 4aa0973352
commit 6bb3ab5fe7
8 changed files with 767 additions and 1 deletions
@@ -102,6 +102,27 @@ test("a mode block mixing api entries with other content is skipped, not partial
expect(result.skip).toContain("functions");
});
test("a legacy bare-body api entry is left alone instead of producing a bogus parse failure", () => {
// No request/response/error sections -- this is the legacy bare-body form
// that `report-legacy-api-bodies` handles for manual review. Folding it
// into `apis { }` as-is would produce source the grammar rejects, so this
// migration must leave it untouched rather than attempt the rewrite.
const source = `page Hello {
ssr {
api ssrUsers GET /api/users/ssr {
return userNames(users)
}
}
view { <main>x</main> }
}
`;
const result = migrateApisBlock(source) as { source: string; changed: boolean };
expect(result.changed).toBe(false);
expect(result.source).toBe(source);
});
test("a brace inside a string literal in a section body does not truncate the entry", () => {
const source = `page P {
client {