create-apollo-monorepo 0.6.0 → 0.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.mjs +29 -2
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -246,6 +246,20 @@ function preflight(flags) {
246
246
  success("pnpm found");
247
247
  }
248
248
 
249
+ // bun is required at runtime by apps/backend (apollo-cms): db:push, db:seed,
250
+ // dev:cron, plugins:build, the upgrade pipeline, and pre-commit hooks all
251
+ // shell out to `bun`. The scaffold itself works without bun, but `pnpm dev`,
252
+ // `pnpm backend:setup`, and `pnpm backend:upgrade` will fail without it.
253
+ if (!commandExists("bun")) {
254
+ warn(
255
+ "bun not found — required by apps/backend for db:push, db:seed, dev:cron,\n" +
256
+ " plugins:build, and the upgrade pipeline.\n" +
257
+ " Install: curl -fsSL https://bun.sh/install | bash (or: brew install bun)",
258
+ );
259
+ } else {
260
+ success("bun found");
261
+ }
262
+
249
263
  const targetDir = resolve(flags.directory);
250
264
  if (existsSync(targetDir)) {
251
265
  fatal(`Directory already exists: ${targetDir}\n Choose a different name or remove it first.`);
@@ -352,6 +366,11 @@ function writeRootPackageJson(targetDir, dirName) {
352
366
  // `pnpm setup` is pnpm's CLI bootstrap built-in — must use `run` to
353
367
  // forward to the workspace's setup script (apollo-cms's db:push + db:seed).
354
368
  "backend:setup": "pnpm --filter ./apps/backend run setup",
369
+ // Full apollo-cms upgrade pipeline: drizzle push + replay
370
+ // src/upgrades/0.1.*.ts data migrations + seed. Run this after
371
+ // `pnpm backend:update` so any data-migration step from the new
372
+ // apollo-cms version is applied — `backend:setup` alone skips it.
373
+ "backend:upgrade": "pnpm --filter ./apps/backend exec bun run upgrade",
355
374
  },
356
375
  devDependencies: {
357
376
  concurrently: "^9.0.0",
@@ -1003,12 +1022,20 @@ folder + \`plugin.json#name\`.
1003
1022
 
1004
1023
  ## Updating the backend
1005
1024
 
1006
- Apollo CMS is tracked as a git submodule. Pull the latest:
1025
+ Apollo CMS is tracked as a git submodule. Full upgrade flow:
1007
1026
 
1008
1027
  \`\`\`bash
1009
- pnpm backend:update
1028
+ pnpm backend:update # fast-forward apps/backend to the latest apollo-cms commit
1029
+ pnpm install # in case the submodule changed package.json
1030
+ pnpm backend:upgrade # drizzle push + replay version migrations + seed
1010
1031
  \`\`\`
1011
1032
 
1033
+ | Script | What it does |
1034
+ | --- | --- |
1035
+ | \`pnpm backend:update\` | \`git submodule update --remote --merge apps/backend\` — code only |
1036
+ | \`pnpm backend:setup\` | First-time bootstrap: \`db:push\` + \`db:seed\` only |
1037
+ | \`pnpm backend:upgrade\` | Full pipeline: \`db:push\` + replay \`src/upgrades/0.1.*.ts\` data migrations + \`db:seed\`. **Use this** after \`backend:update\` — \`backend:setup\` skips the data-migration phase. |
1038
+
1012
1039
  Do **not** edit files inside \`apps/backend\`. Open issues / PRs in the
1013
1040
  \`apollo-cms\` repository upstream.
1014
1041
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-apollo-monorepo",
3
- "version": "0.6.0",
3
+ "version": "0.6.2",
4
4
  "description": "Scaffold a monorepo with a frontend app and Apollo CMS as a git submodule backend (single-origin via Next.js rewrites + assetPrefix)",
5
5
  "bin": {
6
6
  "create-apollo-monorepo": "index.mjs"