Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
e87fc2b to
3d5208a
Compare
77d91ea to
83b167b
Compare
…tries, and template seeding (#447) Five features that close gaps the install lifecycle work opened, stacked on #442. **doctor --json + exit codes.** `list` and `diff` gained `--json`; `doctor` did not, so the install story was not fully CI-checkable. Findings are now collected rather than printed as they happen, so one run renders either the human report (byte-identical to before) or JSON. Every finding carries a scope — project, scripts, state, or a component name — and the exit code separates the two failures that need different responses: 2 means the project cannot accept installs at all, 1 means a recorded install drifted. **Changelogs and content-breaking upgrades.** `update` could move a consumer from 0.1.0 to 0.2.0 with no way to say what changed, and no way to signal that stored Payload data needed migrating first. Manifests now carry release notes, validated on load: real semver, ordered newest first, the manifest's own version present, and a `breaking` entry must declare its migration — otherwise `update` could refuse an upgrade without being able to explain why. `diff` prints pending entries; `update` holds a breaking component back entirely until --accept-breaking. That is deliberately not --force: one means "discard my local edits", the other means "I have migrated my content". Seeded from real history — stats-proof and content-quote were already at 0.2.0 from the logoLabel change. **payload-components new.** Adding a component touches a dozen files whose shape is entirely derivable from the slug. The generator writes those, appends to the mechanical lists, and prints the decisions it refuses to guess: where the component ranks in the curated catalog order, its dbName abbreviation (checked against every existing block), the Content model prose, the demo copy. **Third-party registries.** `add @scope/name` was documented in content/docs/registry.mdx and never implemented; the pinned shadcn supports it natively. The boundary is explicit: files only, https only, no Payload wiring, no install state, and --demo/--localized rejected, because a third-party item has no manifest to record a contract against. **add-template --demo.** One draft Page per page of a concept, reusing writeSeedScript unchanged. The blocker was that the ownership record was keyed to the first manifest, and every shipped template starts three to five of its pages with the same block — so those pages would all have claimed the same record. Ownership identity is now an optional, explicit part of SeedTarget that defaults to the old behavior, leaving all 27 pinned seed tests untouched. Also fixes two things found while mapping the authoring surface: hero-aurora and hero-kinetic existed as doc pages but were missing from the sidebar (the meta check only ran one direction — now it runs both), and the component-template README still named four files that have since become derived. Co-authored-by: Claude Opus 5 <[email protected]>
`payload-components add` has always required a repo shaped like the official Payload website starter. A project scaffolded by `create-payload-app` fails detection before any block is even considered: no blocks renderer, no Pages collection with a `layout` field, and none of the primitives installed blocks import. PR #442 removed the hardcoded-path blocker; this removes the last one. `payload-components init --scaffold` copies eight files and registers two collections. The surface is small because the research narrowed it: across all 154 shipped source files there are exactly four consumer imports outside shadcn UI — `cn` (69 files), `Media` (38), `CMSLink` (30), `linkGroup` (22) — and `Media` is used with exactly two props at all 46 of its call sites. Three deliberate choices: - **It reproduces the starter's shape, so it needs no target of its own.** A scaffolded project detects as `payload-website-starter`, because that is honestly what it now is. An earlier draft added a third support-matrix target and widened `supportedTargets` across all 67 manifests; that turned out to be pure churn and was dropped. - **Nothing is overwritten.** A project that already has its own `cn`, `Media`, or Pages collection keeps it, and a re-run creates nothing. Files are copied through the same guarded helper `--localized` uses, not through shadcn — these are not catalog components and must never appear in the catalog. - **A config it cannot parse is reported, not rewritten.** Registering the collections is text-anchored on `collections: [`; without that anchor the command prints the two lines to add rather than guessing at the shape of someone's `buildConfig` call. The primitives are intentionally thinner than the starter's: `CMSLink` renders through `next/link` and `cn` rather than a `Button` a bare app does not have, and `Media` covers the two props blocks actually pass. They are the consumer's code after install — the CLI does not track or update them. Known limitation: this is target code that cannot be typechecked in this repository (payload-components/source is excluded from tsc, and there is no `payload` dependency here). Coverage proves the bundle turns an undetectable project into a detected one, that it is idempotent, and that it never clobbers. Proving it *compiles* against a real Payload app needs a fresh-smoke scenario — network plus a database — which is not in this change. Co-Authored-By: Claude Opus 5 <[email protected]>
83b167b to
0c8d260
Compare
|
Superseded by a PR targeting |
payload-components addhas always required a repo shaped like the officialPayload website starter. A project scaffolded by
create-payload-appfailsdetection before any block is even considered: no blocks renderer, no Pages
collection with a
layoutfield, and none of the primitives installed blocksimport. #442 removed the hardcoded-path blocker and explicitly deferred this one.
What it ships
payload-components init --scaffoldcopies eight files and registers twocollections:
src/utilities/ui.tscn()— imported by 69 of the shipped source filessrc/fields/link.ts,src/fields/linkGroup.tssrc/components/Link/index.tsxCMSLink, which renders a stored link (30)src/components/Media/index.tsxMedia, which renders an upload (38)src/collections/Media.tsmediacollection those uploads live insrc/collections/Pages/index.tslayoutblocks field installs register intosrc/blocks/RenderBlocks.tsxThe surface is this small because the research narrowed it: across all 154 shipped
source files there are exactly four consumer imports outside shadcn UI, and
Mediais used with exactly two props at all 46 of its call sites.Three deliberate choices
It reproduces the starter's shape, so it needs no target of its own. A
scaffolded project detects as
payload-website-starter, because that is honestlywhat it now is. An earlier draft of this change added a third support-matrix
target and widened
supportedTargetsacross all 67 manifests — that turned out tobe pure churn once the test showed detection already succeeding, and was dropped.
Nothing is overwritten. A project that already has its own
cn,Media, orPages collection keeps it, and a re-run creates nothing. Files are copied through
the same guarded helper
--localizedalready uses — not through shadcn, becausethese are not catalog components and must never appear in the catalog.
A config it cannot parse is reported, not rewritten. Registering the
collections is text-anchored on
collections: [. Without that anchor the commandprints the two lines to add rather than guessing at the shape of someone's
buildConfigcall — that is precisely the kind of edit nobody could review.The primitives are intentionally thinner than the starter's:
CMSLinkrendersthrough
next/linkandcnrather than aButtona bare app does not have, andMediacovers the two props blocks actually pass, falling back to a plainimgwhen the upload has no intrinsic dimensions.
Known limitation — please weigh this
This is target code that cannot be typechecked in this repository.
payload-components/sourceis excluded from tsc and there is nopayloaddependency here, by design.
Coverage proves the bundle turns an undetectable project into a detected one, that
it is idempotent, that it never clobbers, and that the config patch is correct in
all three branches. It does not prove the copied code compiles against a
real Payload app. That needs a
test:freshscenario — scaffold a blank app,init --scaffold, install a block, stop attsc --noEmit— which needs networkand a database and is not in this change.
getCreatePayloadAppArgsalreadyhardcodes
-t websiteas a one-line seam for it.It is also worth saying plainly: this duplicates code the official Payload website
starter owns, and that is a real maintenance burden and a divergence risk. It is
why #442 deferred it. If you would rather point bare-app users at the website
starter instead, this PR is the thing to drop.
Verification
lint·format:check·tsc·test:registrytest:inttest:e2e(production mode)🤖 Generated with Claude Code