cli(feat): add safe opt-in demo seed scripts#147
Open
Ducksss wants to merge 1 commit into
Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Owner
Author
|
Retargeted to |
6 tasks
af3b6f5 to
0eda9b1
Compare
0eda9b1 to
e462cd4
Compare
e462cd4 to
199cbea
Compare
Summary: - Add strict seed and add --demo orchestration that generates a reviewable Payload script only after a complete component install. - Fail closed on partial installs, path escapes, symlinks, unowned output, ownership conflicts, drafts-disabled Pages, and mutation failures. - Make Page and media reruns idempotent, atomic, marker-scoped, and safe across interrupted writes, with complete CLI and consumer documentation. Rationale: - Give contributors useful demo content without adding database access or runtime dependencies to the distribution CLI. - Keep elevated Local API access explicit and operator-run while preventing implicit publication or unrelated content and file mutations. Tests: - lint, source build, TypeScript, registry and integration checks - 111 integration tests passed; 1 skipped - packed CLI contract passed with add --demo - 14 focused browser tests and 275-page production build passed - fresh Payload 3.85.2 hero-basic seed smoke passed end to end - CodeQL security-and-quality found no diff-scoped findings - full fresh smoke reached all 31 installs, then hit an unchanged existing pricing-enterprise identifier-length limit
199cbea to
fd2a7db
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
payload-components seed <component> [--cwd <path>]andpayload-components add <component> [--cwd <path>] [--demo]interfaces.payload-components/seed-<component>.tsonly after rejecting unknown flags, extra arguments, unsupported components/targets, recorded partial installs, missing files, and missing Payload fragments.Why
Demo content is useful only if it cannot silently publish, overwrite consumer files, or mutate unrelated Payload documents. This design keeps elevated Local API access visible in an explicit operator-run script while preserving the CLI's existing dependency and trust boundary.
Security contract
--demoruns only after all five install stages and installed-state recording succeed.overrideAccess: trueexists only in the explicit operator-run script, with the existing revalidation-safe context.Verification
npx pnpm@10 lintnpx pnpm@10 source:buildnpx pnpm@10 exec tsc --noEmitnpx pnpm@10 run test:int— 111 passed, 1 skippednpx pnpm@10 run test:pack— packed CLI, dependency boundary, andadd --demopassednpx pnpm@10 run test:fresh -- --components hero-basic— real Payload 3.85.2 install, seed, build, route, and Playwright assertion passedtest:freshreached all 31 direct installs and all 31 CLI installs; final schema initialization is blocked by the unchanged pre-existing 64-characterpricing-enterpriseidentifier (Payload/Drizzle maximum: 63)Scope note
The original incomplete admin-field-hints sweep was removed. This PR now contains demo seeding, its tests, its smoke-harness reuse, and its documentation only.