Skip to content

feat(cli): install lifecycle, templates, localization, MCP, and a catalog composer - #442

Merged
Ducksss merged 1 commit into
devfrom
claude/cli-lifecycle-features
Aug 9, 2026
Merged

Ducksss merged 1 commit into
devfrom
claude/cli-lifecycle-features

Conversation

@Ducksss

@Ducksss Ducksss commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Six features that take Payload Components past a one-way add. Each is complete
in the repo's sense — source, tests, and docs together.

1. Install lifecycle — list, diff, update, remove

add was the only verb. Manifests already carried a version and
.payload-components/state.json already recorded manifestVersion per install,
but nothing consumed either, so a consumer who installed [email protected] had
no upgrade path and no way to know they were stale.

  • list joins the shipped catalog with what the project recorded. Works in
    any directory, including one that was never initialized. --json.
  • diff reports version, file-content, and wiring drift, and exits 1 so
    CI can gate on install drift. Content comparison is normalized, so line
    endings and a trailing newline are never reported as edits. --json.
  • update re-installs recorded components at the version the CLI ships.
    Files are deleted first so the registry install rewrites them — add treats a
    present file as satisfied, which is right for a fresh install and wrong for an
    upgrade. A component with a locally edited file is skipped, named, and the
    command exits 1
    until --force.
  • remove is the exact inverse of the fragment patcher (proved by a
    byte-for-byte round-trip test) plus deletion of only the files no other
    recorded component ships — so a shared family base survives while a sibling
    variant is installed. It leaves package dependencies and stored Page content
    alone, and skips the generators when a repeat run changes nothing.

Shared logic lives in inventory.ts (catalog × state) and component-files.ts
(canonical content + file ownership).

2. Install targets are path-resolved

The real blocker to any second target: host file paths were hardcoded constants.
support-matrix.json now declares candidate paths and required anchors per role
(renderBlocks, pagesLayout); detectProject resolves them into
DetectedProject.hostFiles, and apply/remove/verify patch those paths.
Manifests still declare canonical starter paths in recovery.patchedFiles;
resolveRecoveryPatchedFiles maps them onto the resolved ones.

Adds payload-blocks-app for the same page-blocks shape at non-starter paths —
a flat Pages.ts, a renderer under src/components, or a repo without src/.

Deliberately not claimed: a bare create-payload-app project. Installed
block components import starter primitives (@/components/Media,
@/components/Link, @/fields/linkGroup, @/utilities/ui) a blank app does not
have, so widening supportedTargets there would produce installs that do not
compile. Shipping those as a base bundle is the natural follow-on and is now the
only thing in the way; noted in ROADMAP.md.

3. Localization

add <block> --localized installs a shipped localizeFields helper and wraps
the installed block config's field list in it. Because the wrap sits outside the
shared family base's spread, one call covers shared and variant fields together.

Leaves only (text, textarea, richText), never containers — Payload rejects
a localized field nested inside a localized parent. A field that already declares
localized is untouched. The choice is recorded in install state so update
re-applies it, and drift detection compares against the localized canonical
form so a localized install does not read as permanently modified.

4. Templates are installable

payload-components/templates/*.json is generated from src/lib/templates by
pnpm templates:build, committed, and reproducibility-gated the same way the
public registry is. add-template <slug> installs the union of a concept's
blocks and prints its page plan; templates lists them.

It installs blocks, not content — the curated copy in the previews is not seeded.
The site copy and /llms.txt were updated to say exactly that instead of the old
"not an installable template yet".

5. MCP server

payload-components mcp — hand-rolled JSON-RPC 2.0 over stdio, no SDK, because
the published CLI ships only ajv and semver at runtime by design.

Every tool is read-only. stdout is the transport, and the install pipeline
both prints to stdout and spawns children that inherit it, so a mutating tool
would corrupt the protocol stream. It is also the better boundary: the server
answers which block and what will it change, and installing stays an explicit
payload-components add in the user's shell where the change is visible.
Reporting tools capture the stdout their handlers would have written and return
it as the tool result.

6. Catalog composer

Tick blocks across families on /components and get one install command in a
docked tray. add takes any number of names, so this is a real single command.
The selection is shareable via ?add= and survives back/forward; unknown slugs
in a hand-edited URL can never reach the command.

Packaging bug this surfaced

payload-components/templates/ was not in the npm files allowlist, so
add-template would have failed only once published — every local test would
have passed. test:pack now asserts each runtime asset actually ships, which
required fixing listFilesRecursive: it was dropping path prefixes for nested
entries and could not have caught this.

Review fixes

Three defects found reviewing the branch before opening this, all now covered by
tests:

  • diff checked the canonical starter paths regardless of the detected target,
    so every install on a non-starter layout reported as unwired.
  • add --dry-run printed canonical host paths instead of the ones it would
    actually patch.
  • get_component over MCP did not pass the localized flag, so a localized
    install showed as modified.

Verification

pnpm test:release green on this branch, on the dev base:

Step Result
lint · format:check · tsc 0
test:registry 0
test:int 460 passed, 1 skipped
test:e2e (production mode) all batches passed
test:pack 0

The MCP server was also smoked as a real spawned process (initialize →
tools/call), not just through its module.

Note for reviewers: three committed blog figures changed. tools/blog/visual-system/catalog.ts
excerpts live CLI source by anchor, so reshaping an excerpted function requires
pnpm blog:visuals:figures.

🤖 Generated with Claude Code

…alog composer

Six features that extend Payload Components past a one-way `add`.

**Install lifecycle** — `list`, `diff`, `update`, `remove`. The manifest
`version` and `.payload-components/state.json` already recorded everything
needed for an upgrade path; nothing consumed it. `diff` reports version, file,
and wiring drift and exits non-zero so CI can gate on it. `update` re-installs
stale components and refuses any file the consumer edited unless `--force`.
`remove` is the exact inverse of the fragment patcher plus deletion of the files
no other recorded component ships, so a shared family base survives while a
sibling variant is installed; it leaves package dependencies and stored content
alone, and skips the generators when nothing changed.

**Path-resolved install targets** — the actual blocker to a second target.
support-matrix.json now declares candidate paths and anchors per host-file role;
detectProject resolves them into DetectedProject.hostFiles and the patchers
write those paths. Adds `payload-blocks-app` for the same page-blocks shape at
non-starter paths. A bare create-payload-app is still unsupported on purpose:
installed blocks import starter primitives a blank app lacks.

**Localization** — `add <block> --localized` installs a shipped localizeFields
helper and wraps the block config's field list in it, covering the shared family
base for free. Leaves only, never containers, since Payload rejects nested
localization. Recorded in state so `update` re-applies it, and drift detection
compares against the localized canonical form.

**Templates** — payload-components/templates/*.json is generated from
src/lib/templates by `pnpm templates:build`, committed, and reproducibility
gated. `add-template <slug>` installs the union of a concept's blocks and prints
its page plan. It installs blocks, not content.

**MCP** — `payload-components mcp` is a hand-rolled JSON-RPC 2.0 stdio server so
the published CLI keeps shipping only ajv and semver. Every tool is read-only:
stdout is the transport, and installing belongs in the user's shell where the
change is visible.

**Catalog composer** — tick blocks across families on /components and get one
install command in a docked tray, with the selection shareable via ?add=.

Also fixes a packaging bug the new template manifests exposed: the npm files
allowlist did not ship them, so `add-template` would have failed only once
published. test:pack now asserts every runtime asset ships, which needed
listFilesRecursive fixed — it was dropping path prefixes for nested entries and
could not have caught this.

Co-Authored-By: Claude Opus 5 <[email protected]>
Copilot AI lite review requested due to automatic review settings August 9, 2026 09:17
@vercel

vercel Bot commented Aug 9, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
payload-components Ready Ready Preview Aug 9, 2026 9:20am
payload-components-97bf Ready Ready Preview Aug 9, 2026 9:20am

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 129 files, which is 29 over the limit of 100.

To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch.

Upgrade to a paid plan to raise the limit.

This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: d9ab8c4a-d18c-43d0-a099-a6ba692223e6

📥 Commits

Reviewing files that changed from the base of the PR and between b8b1209 and cfab34a.

⛔ Files ignored due to path filters (3)
  • public/blog/idempotent-code-installer/figure-01-convergence-state.svg is excluded by !**/*.svg
  • public/blog/payload-block-not-rendering/figure-01-debug-tree.svg is excluded by !**/*.svg
  • public/blog/payload-components-doctor/figure-01-doctor-report.svg is excluded by !**/*.svg
📒 Files selected for processing (129)
  • AGENTS.md
  • README.md
  • ROADMAP.md
  • content/docs/cli.mdx
  • content/docs/meta.json
  • package.json
  • payload-components/manifests/call-to-action-boxed.json
  • payload-components/manifests/call-to-action-centered.json
  • payload-components/manifests/call-to-action-signup.json
  • payload-components/manifests/comparator-grid.json
  • payload-components/manifests/comparator-stack.json
  • payload-components/manifests/comparator-table.json
  • payload-components/manifests/contact-routing-form.json
  • payload-components/manifests/content-columns.json
  • payload-components/manifests/content-community.json
  • payload-components/manifests/content-feature-media.json
  • payload-components/manifests/content-feature-split.json
  • payload-components/manifests/content-image-frame.json
  • payload-components/manifests/content-image-lead.json
  • payload-components/manifests/content-list-columns.json
  • payload-components/manifests/content-list-icons.json
  • payload-components/manifests/content-list.json
  • payload-components/manifests/content-quote.json
  • payload-components/manifests/content-rows.json
  • payload-components/manifests/content-showcase.json
  • payload-components/manifests/content-split-rows.json
  • payload-components/manifests/content-stats.json
  • payload-components/manifests/embed-basic.json
  • payload-components/manifests/faq-accordion.json
  • payload-components/manifests/faq-card.json
  • payload-components/manifests/faq-grid.json
  • payload-components/manifests/faq-grouped.json
  • payload-components/manifests/faq-icons.json
  • payload-components/manifests/faq-split.json
  • payload-components/manifests/feature-accordion.json
  • payload-components/manifests/feature-bento.json
  • payload-components/manifests/feature-cards-media.json
  • payload-components/manifests/feature-grid-basic.json
  • payload-components/manifests/feature-icon-grid.json
  • payload-components/manifests/feature-split.json
  • payload-components/manifests/feature-steps.json
  • payload-components/manifests/hero-aurora.json
  • payload-components/manifests/hero-basic.json
  • payload-components/manifests/hero-kinetic.json
  • payload-components/manifests/hero-product-tilt.json
  • payload-components/manifests/hero-video.json
  • payload-components/manifests/integration-cluster.json
  • payload-components/manifests/integration-connect.json
  • payload-components/manifests/integration-grid.json
  • payload-components/manifests/integration-list.json
  • payload-components/manifests/integration-marquee.json
  • payload-components/manifests/integration-orbit.json
  • payload-components/manifests/integration-split.json
  • payload-components/manifests/integration-testimonial.json
  • payload-components/manifests/logo-cloud-grid.json
  • payload-components/manifests/logo-cloud-hover.json
  • payload-components/manifests/logo-cloud-inline-wrap.json
  • payload-components/manifests/logo-cloud-inline.json
  • payload-components/manifests/logo-cloud-marquee.json
  • payload-components/manifests/pricing-cards-cta.json
  • payload-components/manifests/pricing-cards-muted.json
  • payload-components/manifests/pricing-cards.json
  • payload-components/manifests/pricing-enterprise.json
  • payload-components/manifests/pricing-split.json
  • payload-components/manifests/stats-proof.json
  • payload-components/manifests/team-grid.json
  • payload-components/manifests/team-roster.json
  • payload-components/manifests/testimonials-bento.json
  • payload-components/manifests/testimonials-grid.json
  • payload-components/manifests/testimonials-quote.json
  • payload-components/manifests/testimonials-rating.json
  • payload-components/manifests/testimonials-spotlight.json
  • payload-components/manifests/testimonials-wall.json
  • payload-components/registry.json
  • payload-components/source/blocks/shared/localizeFields.ts
  • payload-components/support-matrix.json
  • payload-components/templates/agency-studio.json
  • payload-components/templates/commerce-brand.json
  • payload-components/templates/education-course.json
  • payload-components/templates/event-conference.json
  • payload-components/templates/fintech-trust.json
  • payload-components/templates/healthcare-clinic.json
  • payload-components/templates/nonprofit-cause.json
  • payload-components/templates/portfolio-solo.json
  • payload-components/templates/saas-launch.json
  • payload-components/templates/trade-service.json
  • src/app/llms.txt/route.ts
  • src/components/site/ComponentCard.tsx
  • src/components/site/ComponentCatalogBrowser.tsx
  • src/components/site/ComponentRequirements.tsx
  • src/lib/site.ts
  • src/lib/templates/registry.ts
  • src/lib/templates/types.ts
  • tests/e2e/frontend.e2e.spec.ts
  • tests/int/payload-components-add-command.int.spec.ts
  • tests/int/payload-components-add-template.int.spec.ts
  • tests/int/payload-components-cli.int.spec.ts
  • tests/int/payload-components-doctor-orchestration.int.spec.ts
  • tests/int/payload-components-lifecycle.int.spec.ts
  • tests/int/payload-components-localization.int.spec.ts
  • tests/int/payload-components-manifest.int.spec.ts
  • tests/int/payload-components-mcp.int.spec.ts
  • tests/int/payload-components-pack.int.spec.ts
  • tests/int/payload-components-remove-fragment.int.spec.ts
  • tests/int/payload-components-target-detection.int.spec.ts
  • tests/int/payload-components-update-command.int.spec.ts
  • tests/int/public-registry.int.spec.ts
  • tests/int/template-install-manifests.int.spec.ts
  • tools/payload-components/cli.ts
  • tools/payload-components/commands/add-template.ts
  • tools/payload-components/commands/add.ts
  • tools/payload-components/commands/diff.ts
  • tools/payload-components/commands/doctor.ts
  • tools/payload-components/commands/list.ts
  • tools/payload-components/commands/mcp.ts
  • tools/payload-components/commands/remove.ts
  • tools/payload-components/commands/seed.ts
  • tools/payload-components/commands/templates.ts
  • tools/payload-components/commands/update.ts
  • tools/payload-components/component-files.ts
  • tools/payload-components/inventory.ts
  • tools/payload-components/manifest.ts
  • tools/payload-components/mcp/server.ts
  • tools/payload-components/post-install.ts
  • tools/payload-components/project.ts
  • tools/payload-components/state.ts
  • tools/payload-components/templates.ts
  • tools/payload-components/types.ts
  • tools/templates/build-install-manifests.ts

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Ducksss
Ducksss merged commit 2f80da7 into dev Aug 9, 2026
12 checks passed
@Ducksss
Ducksss deleted the claude/cli-lifecycle-features branch August 9, 2026 12:54
Ducksss added a commit that referenced this pull request Aug 9, 2026
…tries, and template seeding

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]>
Ducksss added a commit that referenced this pull request Aug 9, 2026
`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]>
Ducksss added a commit that referenced this pull request Aug 9, 2026
…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]>
Ducksss added a commit that referenced this pull request Aug 9, 2026
`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]>
Ducksss added a commit that referenced this pull request Aug 9, 2026
`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]>
Ducksss added a commit that referenced this pull request Aug 9, 2026
#443 caught something this branch missed. postcss is declared TWICE —
as a direct devDependency and as a pnpm override — and the original
commit only moved the override.

Dependabot raised GHSA-fxqj-rqcc-2cmp against both manifest paths for
exactly that reason: one alert on pnpm-lock.yaml (the resolution) and a
second on package.json (the declared devDependency range). The override
already forced the tree to 8.5.23, so nothing was actually resolving
vulnerable — but the declaration was still an exact pin on 8.5.18, and
the package.json alert tracks the declaration.

Also merges origin/dev, which has moved to 1.3.0 (#442, #447, #448,
#449) since this branch was cut.

Verified against current dev: lint, format:check, source:build,
tsc --noEmit, test:registry all clean, and 505 int tests passing.
pnpm install --frozen-lockfile passes, so the lockfile and manifest
agree the way CI checks them.

Co-Authored-By: Claude Opus 5 <[email protected]>
Ducksss added a commit that referenced this pull request Aug 9, 2026
…ble pins (#444)

* security(deps): unstick the js-yaml and postcss overrides off vulnerable pins

Both pins had gone stale the same way fast-uri did in #441: the override
version that was patched when it was written now sits inside the
advisory's widened range, so the pin was holding the tree ON a known
vulnerable version rather than off one.

  js-yaml   pin 4.3.0   GHSA-5p4m-2wfm-xmqj (high)   >= 4.0.0, < 4.3.1
  postcss   pin 8.5.18  GHSA-fxqj-rqcc-2cmp (medium) <= 8.5.22

Bumps js-yaml to 4.3.1 and postcss to 8.5.23, and widens the js-yaml
range key from <4.3.0 to <4.3.1 so the override still covers everything
the advisory does.

Both surfaced on main the moment #437 promoted, because Dependabot only
reports against the default branch. They will not close until this
reaches main in turn.

Verified: lint, format:check, source:build, tsc --noEmit clean, and
381 int tests passing.

Co-Authored-By: Claude Opus 5 <[email protected]>

* security(deps): bump the postcss devDependency alongside the override

#443 caught something this branch missed. postcss is declared TWICE —
as a direct devDependency and as a pnpm override — and the original
commit only moved the override.

Dependabot raised GHSA-fxqj-rqcc-2cmp against both manifest paths for
exactly that reason: one alert on pnpm-lock.yaml (the resolution) and a
second on package.json (the declared devDependency range). The override
already forced the tree to 8.5.23, so nothing was actually resolving
vulnerable — but the declaration was still an exact pin on 8.5.18, and
the package.json alert tracks the declaration.

Also merges origin/dev, which has moved to 1.3.0 (#442, #447, #448,
#449) since this branch was cut.

Verified against current dev: lint, format:check, source:build,
tsc --noEmit, test:registry all clean, and 505 int tests passing.
pnpm install --frozen-lockfile passes, so the lockfile and manifest
agree the way CI checks them.

Co-Authored-By: Claude Opus 5 <[email protected]>

---------

Co-authored-by: Claude Opus 5 <[email protected]>

This branch was successfully deployed

2 active deployments
Preview – payload-components — cfab34ad Deployed Aug 9, 2026 by vercel[bot]
Preview – payload-components-97bf — cfab34ad Deployed Aug 9, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants