create-apollo-suite-monorepo 1.0.1593 → 1.0.1655

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 +22 -11
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -351,11 +351,15 @@ export const CONSUMER_PACKAGES = "--filter './apps/frontend' --filter './apps/ex
351
351
 
352
352
  export function rootScripts() {
353
353
  return {
354
- // We bypass apollo-cms's own `dev` script ("bun install && bun run
355
- // plugins:build && next dev") and run plugins:build (both ours and
356
- // apollo-cms's) and `next dev` directly. Nothing extra to start for
357
- // scheduled jobs — the backend drives its scheduler queue in-process.
358
- "predev:setup": "bun run extensions:build && bun run --cwd apps/backend plugins:build",
354
+ // We bypass apollo-cms's own `dev` script (scripts/dev.sh) and run
355
+ // plugins:build (both ours and apollo-cms's) and `next dev` directly.
356
+ // dev.sh is also what runs `gen:app-pages`, so it is called here: without
357
+ // it src/generated/*.gen.* never exist and the backend's first dev start
358
+ // dies on `Can't resolve '@/generated/demo-lock-home.gen'`. Nothing extra
359
+ // to start for scheduled jobs — the backend drives its scheduler queue
360
+ // in-process.
361
+ "predev:setup":
362
+ "bun run extensions:build && bun run --cwd apps/backend gen:app-pages && bun run --cwd apps/backend plugins:build",
359
363
  // `bun run dev` starts FE + BE Next.js dev servers (which watch their own
360
364
  // src/) plus a parallel extensions watcher, so editing
361
365
  // apps/extensions/<slug>/index.ts triggers an esbuild incremental rebuild
@@ -948,11 +952,16 @@ The Node proxy is intended for dev and small self-hosted deploys.
948
952
  writeFileSync(resolve(dir, "README.md"), readme);
949
953
  }
950
954
 
951
- function writeRootGitignore(targetDir) {
952
- // NOTE: .env.local is intentionally NOT ignored — it holds shared dev port
953
- // defaults (PROXY_PORT/FRONTEND_PORT/BACKEND_PORT) and other non-secret
954
- // workspace knobs that should travel with the repo. Keep real secrets in
955
- // .env (ignored) or apps/backend/.env.local (ignored by the submodule).
955
+ /**
956
+ * Root .gitignore lines that keep the secrets file out of git. writeRootEnv
957
+ * puts APOLLO_SECRET and DATABASE_URL in .env.local; `.env*.local` has no
958
+ * slash, so it also covers the apps/<name>/.env.local symlinks.
959
+ * sync-root-workspace.mjs appends whichever is missing to an existing project.
960
+ */
961
+ export const ENV_LOCAL_IGNORES = [".env.local", ".env*.local"];
962
+
963
+ export function writeRootGitignore(targetDir) {
964
+ // .env.local IS ignored — see ENV_LOCAL_IGNORES.
956
965
  const ignore = [
957
966
  "node_modules",
958
967
  ".turbo",
@@ -960,6 +969,7 @@ function writeRootGitignore(targetDir) {
960
969
  "dist",
961
970
  "build",
962
971
  ".env",
972
+ ...ENV_LOCAL_IGNORES,
963
973
  "*.log",
964
974
  ".DS_Store",
965
975
  // `bun run apl` writes the new app list here and renames it over the real
@@ -1217,7 +1227,8 @@ export default config;
1217
1227
 
1218
1228
  writeFileSync(
1219
1229
  resolve(dir, ".gitignore"),
1220
- // .env.local is intentionally committed — it only contains dev port hints.
1230
+ // apps/frontend/.env.local links to the root file; the root .gitignore's
1231
+ // `.env*.local` keeps it out of git.
1221
1232
  ["node_modules", ".next", "dist", ""].join("\n"),
1222
1233
  );
1223
1234
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-apollo-suite-monorepo",
3
- "version": "1.0.1593",
3
+ "version": "1.0.1655",
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-suite-monorepo": "index.mjs"