Skip to content

feat(create-ideal-cms): add npx scaffolding CLI#14

Merged
dogfrogfog merged 1 commit into
mainfrom
feature/add-npx-create-package
May 27, 2026
Merged

feat(create-ideal-cms): add npx scaffolding CLI#14
dogfrogfog merged 1 commit into
mainfrom
feature/add-npx-create-package

Conversation

@dogfrogfog
Copy link
Copy Markdown
Member

Summary

  • Introduce @focus-reactive/create-ideal-cms — an npx-runnable CLI that scaffolds a Payload + Next.js monorepo from this repo's apps/cms template, pinning the @focus-reactive plugin suite as published npm deps.
  • Add source-side overrides so consumers of the published plugins don't get a flood of peer-warning noise (single source of truth for react, react-dom, @payloadcms/plugin-mcp, @modelcontextprotocol/sdk versions).
  • Bump @payloadcms/plugin-mcp 3.84.0 → 3.84.1 in apps/cms to align with payload 3.84.1.
  • Pick up in-progress UI tweaks across apps/cms/src/... and packages/ui/components/... from pending working-tree state.

What the CLI does

Interactive prompts:

  • Project name → target directory
  • Brand color (hex, applied as a --color-primary overlay in packages/tailwind-config/base.css)
  • Postgres DATABASE_URL, NEXT_PUBLIC_SERVER_URL
  • Optional OpenAI / Vercel Blob / OIDC tokens
  • Git init + package manager (bun/pnpm/npm/skip)
  • Optional initial DB migration

Under the hood:

  • Fetches the monorepo via giget (GitHub tarball) or copies a local checkout with --from-local
  • Prunes plugin source packages, the dev sandbox, release machinery, lockfile
  • Rewrites workspace:* plugin refs in apps/cms/package.json to pinned published versions
  • Empties the migrations dir + stubs it, runs payload migrate:create init post-install
  • Auto-generates PAYLOAD_SECRET; writes OPENAI_API_KEY placeholder so the translator plugin instantiates cleanly without a real key

Test plan

  • bun run lint — clean (0/0)
  • bun run check-types — clean (pre-push hook passed)
  • bun run build in packages/create-ideal-cms — outputs 16 KB ESM with shebang
  • bun run test:local — scaffolds into .test-output/<name>/, install + migration run cleanly
  • Fresh scaffold bun install — 0 peer warnings (verified)
  • After merge: first manual npm publish --access public (one-time) → configure npm Trusted Publisher → gh release create @focus-reactive/create-ideal-cms@1.0.0 → push docs commit to let CI auto-publish 1.0.1

Follow-ups (post-merge, see payload-plugins-add-package skill)

  1. From packages/create-ideal-cms/ run npm publish --access public
  2. On npmjs.com → @focus-reactive/create-ideal-cms → Publishing → add Trusted Publisher (focusreactive/payload-plugins + release.yml + main)
  3. gh release create "@focus-reactive/create-ideal-cms@1.0.0" --target <merge-commit-sha> --title "create-ideal-cms v1.0.0" --notes "Initial release"
  4. Push a docs: commit touching the package → CI publishes 1.0.1 automatically

Introduce @focus-reactive/create-ideal-cms — an interactive CLI that
scaffolds a new Payload + Next.js monorepo from this repo's apps/cms
template, pinning the @focus-reactive plugin suite as published npm deps.

Highlights:
- Manual recursive local copy that handles the dest-inside-src case
  (so `bun run test:local` can scaffold into .test-output/)
- Initial DB migration runner with an OpenAI placeholder so the
  translator plugin instantiates cleanly when no real key is provided
- --from-local flag for testing against an in-progress source repo
- Brand color overlay + interactive prompts for project name, env values,
  package manager, and migration step

Source-side overrides added to silence peer-warning noise when consuming
the published plugins (vs workspace:* in source):
- root overrides: + react, react-dom, @payloadcms/plugin-mcp,
  @modelcontextprotocol/sdk
- apps/cms: @payloadcms/plugin-mcp 3.84.0 -> 3.84.1

Also: in-progress UI tweaks across apps/cms and packages/ui from pending
working-tree state.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 25, 2026

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

Project Deployment Actions Updated (UTC)
turbo-cms-kit-payload Error Error May 25, 2026 2:24pm

Request Review

@dogfrogfog dogfrogfog merged commit b7acd56 into main May 27, 2026
1 of 2 checks passed
@dogfrogfog dogfrogfog deleted the feature/add-npx-create-package branch May 27, 2026 12:01
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.

1 participant