Repository navigation
fix(cli): make the starter base actually compile, and prove it with a bare-app smoke - #458
Conversation
… bare-app smoke #448 shipped the starter base bundle with a stated gap: it is target code this repository cannot typecheck, because payload-components/source is excluded from tsc and there is no `payload` dependency here. Coverage proved the bundle made an undetectable project detectable, was idempotent, and never clobbered — it did not prove the copied code compiles. This adds the scenario that proves it, and it found three real bugs on its first run. Two of them shipped in v1.3.0. **The base renderer corrupted itself on install.** `RenderBlocks.tsx` declared `const blockComponents = {}` with both braces on one line, so the fragment patcher — which inserts a block's entry on the line above the closing brace — wrote the entry *above the declaration*. Two installs produced a file that does not parse. Fixed by shipping the multi-line shape the patcher assumes. **The patcher could do that to any consumer.** `const blockComponents = {}` satisfies the detection anchor, so a real project written that way passed detection and got a corrupted file. The patcher now breaks a same-line object open instead of inserting above it, with a regression test. **The base renderer did not typecheck once populated.** Indexing the object literal types as `never` while the map is empty, which is the only state this repository could ever see, and stops compiling the moment a block is installed. The lookup now widens to `unknown` and narrows back through a real runtime check. **`init --scaffold` reported success on a half-initialized project.** `shadcn init` can exit 0 without writing components.json — a declined prompt, or a non-interactive shell that cannot answer one. The command scaffolded on top of that and printed next steps for a project that still could not install anything. It now stops and says what to do. It also skips shadcn init entirely when components.json already exists, which makes the command idempotent. **Documented prerequisite.** Every installed block is Tailwind-classed and `shadcn init` refuses without a Tailwind config, which the blank create-payload-app template does not ship. That was always true of the registry; the website starter simply hid it. It is now stated where a bare-app user reads. The scenario runs as `pnpm test:fresh -- --scenario bare`: scaffold a blank project, assert it really is bare, install the packed CLI, set up Tailwind and shadcn, run `init --scaffold`, install two blocks chosen to exercise all four consumer primitives, and stop at `tsc --noEmit`. It skips seed, build, boot, and Playwright — roughly a third of the website scenario's runtime for the one thing that could not be checked anywhere else. `--scenario website` keeps the old behaviour and `all` runs both, which is the default. 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: 32 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 (8)
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 |
#448 shipped the starter base bundle with a stated gap: it is target code this repository cannot typecheck —
payload-components/sourceis excluded from tsc and there is nopayloaddependency here. The tests proved the bundle made an undetectable project detectable, was idempotent, and never clobbered. They did not prove the copied code compiles.This adds the scenario that proves it. It found three real bugs on its first run. Two shipped in v1.3.0.
What it caught
1. The base renderer corrupted itself on install — shipped in v1.3.0
RenderBlocks.tsxdeclaredconst blockComponents = {}with both braces on one line. The fragment patcher inserts a block's entry on the line above the closing brace — which here is the same line as the opening one, so the entry landed above the declaration:Two installs produced a file that does not parse. Fixed by shipping the multi-line shape the patcher assumes.
2. The patcher could do that to any consumer — pre-existing
const blockComponents = {}satisfies the detection anchor, so a real project written that way passed detection and got a corrupted file. The patcher now breaks a same-line object open rather than inserting above it, with a regression test.3. The base renderer did not typecheck once populated — shipped in v1.3.0
Indexing the object literal types as
neverwhile the map is empty — the only state this repository could ever observe — and stops compiling the moment a block is installed into it. The lookup now widens tounknownand narrows back through a real runtime check.4.
init --scaffoldreported success on a half-initialized projectshadcn initcan exit 0 without writingcomponents.json(a declined prompt, or a non-interactive shell that cannot answer one). The command scaffolded on top of that and printed next steps for a project that still could not install anything. It now stops and says what to do — and skipsshadcn initentirely whencomponents.jsonalready exists, which makes it idempotent.Documented prerequisite
Every installed block is Tailwind-classed, and
shadcn initrefuses without a Tailwind config — which the blankcreate-payload-apptemplate does not ship. That was always true of the registry; the website starter simply hid it. It is now stated where a bare-app user reads.The scenario
Scaffold a blank project → assert it really is bare → install the packed CLI → set up Tailwind and shadcn →
init --scaffold→ install two blocks chosen to exercise all four consumer primitives (hero-basiccoverscn+CMSLink+linkGroup,content-image-leadaddsMedia) → stop attsc --noEmit.It skips seed, build, boot, and Playwright — roughly a third of the website scenario's runtime for the one thing that could not be checked anywhere else.
--scenario websitekeeps the old behaviour;allruns both and is the default, so CI gains the coverage without changing how it is invoked.A spec asserts the chosen blocks really do import all four primitives, so the scenario cannot quietly stop exercising one.
Verification
lint·format:check·tsc·test:registryall 0 · 509 int (+4) · 397 e2e across all five batches ·pnpm test:fresh -- --scenario baregreen end to end.Follow-up
Bugs 1 and 3 are live in
[email protected]:init --scaffoldfollowed by anyaddproduces aRenderBlocks.tsxthat does not compile. This warrants a 1.3.1 patch once merged.🤖 Generated with Claude Code