create-apollo-monorepo 0.9.5 → 0.9.7
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.
- package/README.md +0 -1
- package/index.mjs +27 -40
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -47,7 +47,6 @@ collide:
|
|
|
47
47
|
| `/admin/*` | `apps/backend` (admin pages **and** their JS chunks) |
|
|
48
48
|
| `/api/auth/*`, `/api/v1/*`, `/api/admin/*`, `/api/email/*`, `/api/cron`, `/api/health`, `/api/mcp`, `/api/editing-presence/*` | `apps/backend` |
|
|
49
49
|
| `/uploads/*` | `apps/backend` (media) |
|
|
50
|
-
| `/monitoring` | `apps/backend` (Sentry tunnel, no-op without DSN) |
|
|
51
50
|
|
|
52
51
|
Apollo CMS reads `APOLLO_ASSET_PREFIX` (default `/admin`) and serves its built
|
|
53
52
|
JS under `<prefix>/_next/static/`. Because the prefix coincides with the admin
|
package/index.mjs
CHANGED
|
@@ -412,15 +412,6 @@ function writeRootPackageJson(targetDir, dirName) {
|
|
|
412
412
|
"strict-peer-dependencies=false",
|
|
413
413
|
"public-hoist-pattern[]=*esbuild*",
|
|
414
414
|
"public-hoist-pattern[]=*types*",
|
|
415
|
-
// Next.js 16's instrumentation hook (used by Sentry / OpenTelemetry
|
|
416
|
-
// shipped via apollo-cms) loads require-in-the-middle / import-in-the-middle
|
|
417
|
-
// at runtime via a bare require. Under pnpm's strict node_modules these
|
|
418
|
-
// sit deep inside .pnpm/ and the resolver can't see them — Next then
|
|
419
|
-
// crashes on boot with "Failed to load external module require-in-the-middle".
|
|
420
|
-
// Hoisting them (plus their `shimmer` dep) to the root node_modules fixes it.
|
|
421
|
-
"public-hoist-pattern[]=*require-in-the-middle*",
|
|
422
|
-
"public-hoist-pattern[]=*import-in-the-middle*",
|
|
423
|
-
"public-hoist-pattern[]=*shimmer*",
|
|
424
415
|
"shell-emulator=true",
|
|
425
416
|
"",
|
|
426
417
|
].join("\n"),
|
|
@@ -450,36 +441,36 @@ function linkRootEnvLocal(targetDir, appRelPath, fallbackLines) {
|
|
|
450
441
|
}
|
|
451
442
|
|
|
452
443
|
function writePnpmWorkspace(targetDir) {
|
|
453
|
-
// pnpm
|
|
454
|
-
//
|
|
455
|
-
//
|
|
456
|
-
//
|
|
457
|
-
//
|
|
458
|
-
//
|
|
459
|
-
//
|
|
444
|
+
// pnpm 11 replaced `onlyBuiltDependencies` (list) with `allowBuilds`
|
|
445
|
+
// (map of package -> bool). apollo-cms transitively pulls multiple
|
|
446
|
+
// esbuild versions (0.18, 0.25, 0.27); pnpm's binary symlink can pick
|
|
447
|
+
// the wrong platform binary for esbuild's postinstall version check,
|
|
448
|
+
// failing with "Expected X.Y.Z but got A.B.C". Allow listed packages
|
|
449
|
+
// to run their build/postinstall scripts; the rest are skipped
|
|
450
|
+
// (pnpm 11 default is `strictDepBuilds: true`, empty allow-map).
|
|
451
|
+
// See https://pnpm.io/blog/releases/11.0.
|
|
460
452
|
const yaml = [
|
|
461
453
|
"packages:",
|
|
462
454
|
" - 'apps/*'",
|
|
463
455
|
" - 'apps/cms-plugins/*'",
|
|
464
456
|
"",
|
|
465
|
-
"
|
|
466
|
-
"
|
|
467
|
-
"
|
|
468
|
-
"
|
|
469
|
-
"
|
|
470
|
-
"
|
|
471
|
-
"
|
|
472
|
-
"
|
|
473
|
-
"
|
|
474
|
-
"
|
|
475
|
-
"
|
|
476
|
-
"
|
|
477
|
-
"
|
|
478
|
-
"
|
|
479
|
-
"
|
|
480
|
-
"
|
|
481
|
-
" -
|
|
482
|
-
" - 'unrs-resolver'",
|
|
457
|
+
"allowBuilds:",
|
|
458
|
+
" '@parcel/watcher': true",
|
|
459
|
+
" '@rolldown/binding-darwin-arm64': true",
|
|
460
|
+
" '@rolldown/binding-linux-arm64-gnu': true",
|
|
461
|
+
" '@rolldown/binding-linux-x64-gnu': true",
|
|
462
|
+
" '@swc/core': true",
|
|
463
|
+
" '@swc/core-darwin-arm64': true",
|
|
464
|
+
" '@swc/core-darwin-x64': true",
|
|
465
|
+
" '@swc/core-linux-arm64-gnu': true",
|
|
466
|
+
" '@swc/core-linux-x64-gnu': true",
|
|
467
|
+
" 'better-sqlite3': true",
|
|
468
|
+
" 'core-js': true",
|
|
469
|
+
" 'core-js-pure': true",
|
|
470
|
+
" 'esbuild': true",
|
|
471
|
+
" 'msw': true",
|
|
472
|
+
" 'sharp': true",
|
|
473
|
+
" 'unrs-resolver': true",
|
|
483
474
|
"",
|
|
484
475
|
].join("\n");
|
|
485
476
|
writeFileSync(resolve(targetDir, "pnpm-workspace.yaml"), yaml);
|
|
@@ -510,11 +501,10 @@ server {
|
|
|
510
501
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
511
502
|
proxy_set_header X-Forwarded-Host $host;
|
|
512
503
|
|
|
513
|
-
# Backend — admin UI + chunks (APOLLO_ASSET_PREFIX=${prefix}), media
|
|
504
|
+
# Backend — admin UI + chunks (APOLLO_ASSET_PREFIX=${prefix}), media
|
|
514
505
|
location = ${prefix} { proxy_pass http://apollo_backend; }
|
|
515
506
|
location ^~ ${prefix}/ { proxy_pass http://apollo_backend; }
|
|
516
507
|
location ^~ /uploads/ { proxy_pass http://apollo_backend; }
|
|
517
|
-
location = /monitoring { proxy_pass http://apollo_backend; }
|
|
518
508
|
|
|
519
509
|
# Backend SSE — long-lived, no buffering
|
|
520
510
|
location ^~ /api/editing-presence/ {
|
|
@@ -548,7 +538,7 @@ function writeProxyApp(targetDir, dirName, adminPrefix) {
|
|
|
548
538
|
// Mirrors ../../nginx.conf.sample. Run via \`pnpm dev:rp\` from the repo root.
|
|
549
539
|
//
|
|
550
540
|
// Routes (in order):
|
|
551
|
-
// ${prefix}, ${prefix}/*, /uploads
|
|
541
|
+
// ${prefix}, ${prefix}/*, /uploads/* → backend
|
|
552
542
|
// /api/editing-presence/* → backend (SSE)
|
|
553
543
|
// /api/{auth,v1,cron,email,health,mcp,admin,...}/* → backend
|
|
554
544
|
// /__proxy/health → 200 OK (proxy itself)
|
|
@@ -634,7 +624,6 @@ function pickUpstream(url) {
|
|
|
634
624
|
if (url === ADMIN_PREFIX || url.startsWith(\`\${ADMIN_PREFIX}/\`))
|
|
635
625
|
return { ...BACKEND, agent: backendAgent };
|
|
636
626
|
if (url.startsWith("/uploads/")) return { ...BACKEND, agent: backendAgent };
|
|
637
|
-
if (url === "/monitoring") return { ...BACKEND, agent: backendAgent };
|
|
638
627
|
if (BACKEND_API.test(url)) return { ...BACKEND, agent: backendAgent };
|
|
639
628
|
return { ...FRONTEND, agent: frontendAgent };
|
|
640
629
|
}
|
|
@@ -1076,8 +1065,6 @@ const config: NextConfig = {
|
|
|
1076
1065
|
{ source: "/api/admin/:path*", destination: \`\${BACKEND}/api/admin/:path*\` },
|
|
1077
1066
|
// Media uploads
|
|
1078
1067
|
{ source: "/uploads/:path*", destination: \`\${BACKEND}/uploads/:path*\` },
|
|
1079
|
-
// Sentry tunnel (no-op if SENTRY_DSN isn't set on the backend)
|
|
1080
|
-
{ source: "/monitoring", destination: \`\${BACKEND}/monitoring\` },
|
|
1081
1068
|
${extraPrefixRewrite} ];
|
|
1082
1069
|
},
|
|
1083
1070
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-apollo-monorepo",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.7",
|
|
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"
|