Repository navigation
test(cli): compile-check the shipped target source in the fast gate - #461
Conversation
v1.3.0 shipped a starter base that could not compile. Nothing caught it because nothing could: `payload-components/source` is excluded from tsc and this repo has no `payload` dependency, so no local gate ever looked at the bytes being installed. The bugs surfaced only when the bare smoke scenario was added — a seven-minute run needing network and a database. Add an int spec that closes the fast half of that gap: - parse every `.ts`/`.tsx` under `payload-components/source` (162 files, enumerated so new ones are covered on sight) - apply real manifest fragments from two components to the shipped `RenderBlocks.tsx` and `Pages/index.ts`, then re-parse the result and assert the entries landed inside the structures they belong to - typecheck the renderer with a populated block map, using a real TS program (React is its only import, so it resolves here) Verified by reverting each fix in turn: the same-line-object patcher bug fails the patch check, and the `never`-typed block lookup fails the typecheck. Both reproduce in milliseconds instead of only in the smoke. The bare smoke stays the full proof — it compiles inside a real Payload app. This is the check that runs on every save. Co-Authored-By: Claude Opus 5 <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
Next review available in: 51 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Why
v1.3.0 shipped a starter base that could not compile —
init --scaffoldproduced a project that failedtscthe moment a block was installed into it. It passed every gate, because no gate could see it:payload-components/sourceis excluded from tsc and this repo has nopayloaddependency, so nothing local ever compiled the code being shipped.The bugs only surfaced once #458 added the bare smoke scenario — a ~7-minute run needing network and a database. That's the right full proof, but it's the wrong place for the only proof. This PR adds the fast half.
What
One new int spec,
tests/int/payload-components-source-compiles.int.spec.ts:.ts/.tsxunderpayload-components/source— 162 files, enumerated by walking the directory so a new shipped file is covered the moment it's added, not when someone remembers to list it. Parsing needs no dependencies, so it covers the whole tree.hero-basicandfaq-cardto the shippedRenderBlocks.tsxandPages/index.ts, then re-parses the patched result and asserts the entries landed inside the structures they belong to — not merely somewhere in a file that happens to parse.Plus a paragraph in
AGENTS.mdrecording the rule: shipped target code must be compile-checked, not just reviewed.Verification
Negative controls — each fix reverted in turn, then restored:
= {}source shapenever-typed direct block lookupexpression of type 'string' can't be used to index type '{ heroBasic: …; faqCard: … }'Both reproduce in milliseconds what previously took a 7-minute network+DB run.
Local gate:
pnpm lint && pnpm format:check && pnpm exec tsc --noEmit && pnpm test:registry && pnpm run test:int— exit 0, 512 int tests passed.e2e not re-run. The diff is one new test file and one markdown paragraph; no site, CLI, registry, or component code changed. Say the word if you'd rather have the full
test:releaseon it.Scope note
This does not replace
pnpm test:fresh -- --scenario bare— that stays the full proof, since it compiles the bundle inside a real Payload app against realpayloadtypes. This is the check that runs on every save, and it would have caught two of the three bugs on the first run.🤖 Generated with Claude Code