create-apollo-monorepo 0.9.6 → 0.9.8
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 +18 -0
- package/index.mjs +32 -25
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -106,3 +106,21 @@ pnpm backend:update # git submodule update --remote --merge apps/backend
|
|
|
106
106
|
|
|
107
107
|
Don't edit files inside `apps/backend` — open issues / PRs against the
|
|
108
108
|
`apollo-cms` repository upstream.
|
|
109
|
+
|
|
110
|
+
## Deploying to production
|
|
111
|
+
|
|
112
|
+
The scaffold pins `packageManager: "pnpm@11.0.0"` so Corepack picks the right
|
|
113
|
+
pnpm. If your CI / deploy host installs pnpm separately, **make sure it's
|
|
114
|
+
pnpm 11+** — pnpm 11 sets `strictDepBuilds: true` by default and reads the
|
|
115
|
+
allow-list from `allowBuilds` in `pnpm-workspace.yaml`. pnpm 10 silently
|
|
116
|
+
ignores `allowBuilds`; pnpm 11 silently ignores the deprecated
|
|
117
|
+
`onlyBuiltDependencies`. Mixing the two leads to `sharp` (and `esbuild`,
|
|
118
|
+
`@swc/core`, …) skipping their postinstalls, which surfaces at runtime as:
|
|
119
|
+
|
|
120
|
+
```
|
|
121
|
+
Failed to load external module sharp-<hash>:
|
|
122
|
+
Error: Cannot find module 'sharp-<hash>'
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
The scaffold's `pnpm-workspace.yaml` already lists the binaries Apollo CMS
|
|
126
|
+
needs in `allowBuilds`. If you add a new native dep, append it there.
|
package/index.mjs
CHANGED
|
@@ -398,7 +398,13 @@ function writeRootPackageJson(targetDir, dirName) {
|
|
|
398
398
|
devDependencies: {
|
|
399
399
|
concurrently: "^9.0.0",
|
|
400
400
|
},
|
|
401
|
-
|
|
401
|
+
// Pin to pnpm 11 because `pnpm-workspace.yaml` uses the `allowBuilds`
|
|
402
|
+
// map format introduced in v11 (deprecated `onlyBuiltDependencies` is
|
|
403
|
+
// silently ignored on v11 — sharp/esbuild postinstalls then no-op and
|
|
404
|
+
// /admin/media crashes at runtime with "Cannot find module sharp-…").
|
|
405
|
+
// Corepack uses this field to auto-fetch the right pnpm.
|
|
406
|
+
packageManager: "pnpm@11.0.0",
|
|
407
|
+
engines: { node: ">=22", pnpm: ">=11" },
|
|
402
408
|
};
|
|
403
409
|
writeFileSync(resolve(targetDir, "package.json"), JSON.stringify(pkg, null, 2) + "\n");
|
|
404
410
|
|
|
@@ -441,35 +447,36 @@ function linkRootEnvLocal(targetDir, appRelPath, fallbackLines) {
|
|
|
441
447
|
}
|
|
442
448
|
|
|
443
449
|
function writePnpmWorkspace(targetDir) {
|
|
444
|
-
// pnpm
|
|
445
|
-
//
|
|
446
|
-
//
|
|
447
|
-
//
|
|
448
|
-
//
|
|
449
|
-
//
|
|
450
|
-
//
|
|
450
|
+
// pnpm 11 replaced `onlyBuiltDependencies` (list) with `allowBuilds`
|
|
451
|
+
// (map of package -> bool). apollo-cms transitively pulls multiple
|
|
452
|
+
// esbuild versions (0.18, 0.25, 0.27); pnpm's binary symlink can pick
|
|
453
|
+
// the wrong platform binary for esbuild's postinstall version check,
|
|
454
|
+
// failing with "Expected X.Y.Z but got A.B.C". Allow listed packages
|
|
455
|
+
// to run their build/postinstall scripts; the rest are skipped
|
|
456
|
+
// (pnpm 11 default is `strictDepBuilds: true`, empty allow-map).
|
|
457
|
+
// See https://pnpm.io/blog/releases/11.0.
|
|
451
458
|
const yaml = [
|
|
452
459
|
"packages:",
|
|
453
460
|
" - 'apps/*'",
|
|
454
461
|
" - 'apps/cms-plugins/*'",
|
|
455
462
|
"",
|
|
456
|
-
"
|
|
457
|
-
"
|
|
458
|
-
"
|
|
459
|
-
"
|
|
460
|
-
"
|
|
461
|
-
"
|
|
462
|
-
"
|
|
463
|
-
"
|
|
464
|
-
"
|
|
465
|
-
"
|
|
466
|
-
"
|
|
467
|
-
"
|
|
468
|
-
"
|
|
469
|
-
"
|
|
470
|
-
"
|
|
471
|
-
"
|
|
472
|
-
"
|
|
463
|
+
"allowBuilds:",
|
|
464
|
+
" '@parcel/watcher': true",
|
|
465
|
+
" '@rolldown/binding-darwin-arm64': true",
|
|
466
|
+
" '@rolldown/binding-linux-arm64-gnu': true",
|
|
467
|
+
" '@rolldown/binding-linux-x64-gnu': true",
|
|
468
|
+
" '@swc/core': true",
|
|
469
|
+
" '@swc/core-darwin-arm64': true",
|
|
470
|
+
" '@swc/core-darwin-x64': true",
|
|
471
|
+
" '@swc/core-linux-arm64-gnu': true",
|
|
472
|
+
" '@swc/core-linux-x64-gnu': true",
|
|
473
|
+
" 'better-sqlite3': true",
|
|
474
|
+
" 'core-js': true",
|
|
475
|
+
" 'core-js-pure': true",
|
|
476
|
+
" 'esbuild': true",
|
|
477
|
+
" 'msw': true",
|
|
478
|
+
" 'sharp': true",
|
|
479
|
+
" 'unrs-resolver': true",
|
|
473
480
|
"",
|
|
474
481
|
].join("\n");
|
|
475
482
|
writeFileSync(resolve(targetDir, "pnpm-workspace.yaml"), yaml);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-apollo-monorepo",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.8",
|
|
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"
|