@catladder/cli 0.0.0-next-a2f59d07 → 0.0.0-next-cf4e99eb

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 (24) hide show
  1. package/dist/bundles/catenv/index.js +92 -102
  2. package/dist/bundles/cli/index.js +92 -102
  3. package/dist/bundles/skills/catladder-builds/references/build-types.md +10 -0
  4. package/dist/bundles/skills/catladder-migrate-package-manager/SKILL.md +15 -9
  5. package/dist/bundles/skills/catladder-migrate-package-manager/references/yarn-to-pnpm-differences.md +30 -4
  6. package/dist/bundles/skills/catladder-pipelines/SKILL.md +7 -6
  7. package/dist/packages/pipeline/src/build/node/buildJob.js +11 -14
  8. package/dist/packages/pipeline/src/build/node/buildJob.js.map +1 -1
  9. package/dist/packages/pipeline/src/build/node/cache.d.ts +8 -3
  10. package/dist/packages/pipeline/src/build/node/cache.js +34 -47
  11. package/dist/packages/pipeline/src/build/node/cache.js.map +1 -1
  12. package/dist/packages/pipeline/src/build/node/packageManagerInstall.d.ts +7 -4
  13. package/dist/packages/pipeline/src/build/node/packageManagerInstall.js +32 -26
  14. package/dist/packages/pipeline/src/build/node/packageManagerInstall.js.map +1 -1
  15. package/dist/packages/pipeline/src/build/node/testJob.js +14 -14
  16. package/dist/packages/pipeline/src/build/node/testJob.js.map +1 -1
  17. package/dist/packages/pipeline/src/build/types.d.ts +17 -3
  18. package/dist/packages/pipeline/src/build/types.js.map +1 -1
  19. package/dist/skills/catladder-builds/references/build-types.md +10 -0
  20. package/dist/skills/catladder-migrate-package-manager/SKILL.md +15 -9
  21. package/dist/skills/catladder-migrate-package-manager/references/yarn-to-pnpm-differences.md +30 -4
  22. package/dist/skills/catladder-pipelines/SKILL.md +7 -6
  23. package/dist/tsconfig.tsbuildinfo +1 -1
  24. package/package.json +1 -1
@@ -12028,11 +12028,14 @@ const createNodeDockerJobDefinition = async (context) => {
12028
12028
  (0, packageManagerInstall_1.getDockerAppCopyAndBuildScript)(context),
12029
12029
  context.packageManagerInfo,
12030
12030
  ]);
12031
- // the pnpm store (pulled via the cache above) is copied into the
12032
- // image so the prod install works offline — like the yarn zip cache,
12033
- // which travels inside the copied `.yarn` config folder
12034
- const copyPnpmStore = packageManagerInfo.type === "pnpm" &&
12035
- packageManagerInfo.componentIsInWorkspace;
12031
+ // The pnpm store is deliberately NOT copied into the image. It used
12032
+ // to be, so the prod install could link instead of hitting the
12033
+ // registry — but the store lands in an earlier layer than
12034
+ // node_modules, so pnpm cannot hardlink across the overlay boundary
12035
+ // and copies every package instead. Measured on one component: the
12036
+ // in-image install was *slower* that way (28s vs 10s from the
12037
+ // registry), the store added 3GB to the build context and the final
12038
+ // image, and the build took 339s instead of 27s.
12036
12039
  // pnpm copies every workspace manifest into the image — as individual
12037
12040
  // COPY instructions that many layers exceed docker's depth limit, so
12038
12041
  // the job tars them up and a single ADD extracts them
@@ -12040,8 +12043,6 @@ const createNodeDockerJobDefinition = async (context) => {
12040
12043
  const WORKSPACE_FILES_TAR = ".catladder-workspace-files.tar";
12041
12044
  return {
12042
12045
  script: [
12043
- // the COPY source must exist even when the cache was cold
12044
- ...(copyPnpmStore ? ["mkdir -p .pnpm-store"] : []),
12045
12046
  ...(isPnpm
12046
12047
  ? [
12047
12048
  `tar -cf ${WORKSPACE_FILES_TAR} ${packageManagerInfo.pathsToCopyInDocker.join(" ")}`,
@@ -12058,14 +12059,10 @@ const createNodeDockerJobDefinition = async (context) => {
12058
12059
  `ADD ${WORKSPACE_FILES_TAR} /app/`,
12059
12060
  // ADD does not apply --chown to extracted tars, and parent
12060
12061
  // dirs of the entries come out root-owned — fix ownership
12061
- // while the stage still runs as root (store not copied yet,
12062
- // so this only touches the small manifest tree). Custom
12063
- // base images without a node user run as root and don't
12064
- // need it, hence the fallback
12062
+ // while the stage still runs as root (this only touches the
12063
+ // small manifest tree). Custom base images without a node
12064
+ // user run as root and don't need it, hence the fallback
12065
12065
  `RUN chown -R node:node /app || true`,
12066
- ...(copyPnpmStore
12067
- ? [`COPY --chown=node:node .pnpm-store /app/.pnpm-store`]
12068
- : []),
12069
12066
  ].join("\n")
12070
12067
  : packageManagerInfo.pathsToCopyInDocker
12071
12068
  .map((dir) => `COPY --chown=node:node ${dir} /app/${dir}`)
@@ -12099,10 +12096,9 @@ const lodash_es_1 = __nccwpck_require__(50210);
12099
12096
  const path_1 = __nccwpck_require__(16928);
12100
12097
  const slugify_1 = __importDefault(__nccwpck_require__(84007));
12101
12098
  /**
12102
- * stable reference between the two node caches: the package-manager
12103
- * (yarn zip / pnpm store) cache declares itself redundant when the
12104
- * node_modules cache scored an exact-lockfile hit (github skips the
12105
- * ~0.6GB download on warm runs)
12099
+ * stable reference between the two yarn caches: the zip cache declares
12100
+ * itself redundant when the node_modules cache scored an exact-lockfile
12101
+ * hit (github skips the ~0.6GB download on warm runs)
12106
12102
  */
12107
12103
  const NODE_MODULES_CACHE_ID = "node-modules";
12108
12104
  /**
@@ -12130,36 +12126,36 @@ const getCacheBaseDir = async (context) => {
12130
12126
  : ".";
12131
12127
  };
12132
12128
  /**
12133
- * the package manager's download cache: yarn's `.yarn` zip cache, or
12134
- * pnpm's content-addressable store (which catladder points at a
12135
- * project-local `.pnpm-store`, see the install script)
12129
+ * the package manager's download cache: yarn's `.yarn` zip cache.
12130
+ *
12131
+ * pnpm gets nothing. Its store is a content-addressable tree of
12132
+ * hundreds of thousands of small files, and moving it costs more than
12133
+ * the install it saves: measured on a 3800-package monorepo, restoring
12134
+ * the 1 GB store took ~53s on gitlab (which zips file by file) and
12135
+ * ~23s on github, against a from-registry install of ~30-40s. See
12136
+ * getNodeModulesCache for the node_modules half of the same finding.
12136
12137
  */
12137
12138
  const getYarnCache = async (context, policy = "pull-push") => {
12138
12139
  const packageManagerInfo = await context.packageManagerInfo;
12139
- const isPnpm = packageManagerInfo.type === "pnpm";
12140
+ if (packageManagerInfo.type === "pnpm")
12141
+ return [];
12140
12142
  const baseDir = await getCacheBaseDir(context);
12141
- // pnpm keeps its store in a format-versioned subdir (v10, v11, ...)
12142
- // and never cleans old ones up — scope the cache slot by major so a
12143
- // pnpm upgrade starts a fresh slot instead of dragging the dead old
12144
- // store tree along in every cache transfer (formats change only on
12145
- // majors)
12146
- const pnpmStoreKey = `pnpm-v${packageManagerInfo.version.split(".")[0]}`;
12147
12143
  return [
12148
12144
  {
12149
12145
  scope: "buildDir",
12150
12146
  pathMode: "relative",
12151
12147
  buildDir: baseDir,
12152
- key: isPnpm ? pnpmStoreKey : "yarn",
12148
+ key: "yarn",
12153
12149
  policy,
12154
- paths: [isPnpm ? ".pnpm-store" : ".yarn"],
12150
+ paths: [".yarn"],
12155
12151
  // content-key for immutable-cache backends (github); the lockfile
12156
12152
  // decides whether the cached content could have changed
12157
- keyFiles: [isPnpm ? "pnpm-lock.yaml" : "yarn.lock"],
12158
- // the package manager's download cache (~hundreds of MB) is only
12159
- // read when packages have to be (re)installed. When the
12160
- // node_modules cache hit for the same lockfile, install verifies
12161
- // its state file and never touches the store — so github skips
12162
- // downloading this cache entirely
12153
+ keyFiles: ["yarn.lock"],
12154
+ // the yarn zip cache (~hundreds of MB) is only read when packages
12155
+ // have to be (re)installed. When the node_modules cache hit for
12156
+ // the same lockfile, install verifies its state file and never
12157
+ // touches the zips — so github skips downloading this cache
12158
+ // entirely
12163
12159
  redundantOnExactHitOf: NODE_MODULES_CACHE_ID,
12164
12160
  },
12165
12161
  ];
@@ -12168,12 +12164,18 @@ exports.getYarnCache = getYarnCache;
12168
12164
  const getNodeModulesCache = async (context, policy = "pull-push") => {
12169
12165
  const packageManagerInfo = await context.packageManagerInfo;
12170
12166
  const baseDir = await getCacheBaseDir(context);
12171
- const { workspaces } = packageManagerInfo;
12172
- const isPnpm = packageManagerInfo.type === "pnpm";
12173
- const lockFileName = isPnpm ? "pnpm-lock.yaml" : "yarn.lock";
12174
- // yarn berry tracks install state in .yarn/install-state.gz (pnpm's
12175
- // equivalent lives inside node_modules and is covered by the paths)
12176
- const hasInstallState = packageManagerInfo.type === "yarn" && !packageManagerInfo.isClassic;
12167
+ // pnpm gets no node_modules cache either: archiving the tree (root
12168
+ // plus every workspace's symlink farm, >1GB in real monorepos) costs
12169
+ // ~190s per saving job to spare ~6s of install, and a safe pnpm slot
12170
+ // must be keyed by lockfile hash (a pnpm install over a node_modules
12171
+ // from a different lockfile leaves orphaned .pnpm dirs that break
12172
+ // type identity), so it misses on every dependency change anyway.
12173
+ // pnpm projects run entirely uncached — see getYarnCache
12174
+ if (packageManagerInfo.type === "pnpm")
12175
+ return [];
12176
+ const lockFileName = "yarn.lock";
12177
+ // yarn berry tracks install state in .yarn/install-state.gz
12178
+ const hasInstallState = !packageManagerInfo.isClassic;
12177
12179
  // We intentionally do not use the contents of the lockfile as a cache key, as install should always guarantee that the files are updated, but it can still use part of the cache if not all packages are up-to-date.
12178
12180
  // It would slow down all pipelines whenever one adds a new dependency as it will need to download all node_modules again.
12179
12181
  return [
@@ -12181,19 +12183,7 @@ const getNodeModulesCache = async (context, policy = "pull-push") => {
12181
12183
  scope: "global",
12182
12184
  pathMode: "absolute",
12183
12185
  // we use the dirname, not the component name, because in certain cases we have two apps in the same directory and want to share the cache, e.g. when having storybook in the same package.json
12184
- //
12185
- // pnpm gets its own, lockfile-keyed cache: node_modules layouts
12186
- // are not compatible between package managers (a migrating
12187
- // project must not inherit the yarn slot), and unlike yarn, a
12188
- // pnpm install on top of a node_modules from a different lockfile
12189
- // leaves orphaned .pnpm dirs behind that break type identity —
12190
- // so the slot changes whenever the lockfile changes
12191
- key: isPnpm
12192
- ? {
12193
- prefix: "pnpm-" + (0, slugify_1.default)(baseDir) + "-node-modules",
12194
- files: [(0, path_1.join)(baseDir, "pnpm-lock.yaml")],
12195
- }
12196
- : (0, slugify_1.default)(baseDir) + "-node-modules",
12186
+ key: (0, slugify_1.default)(baseDir) + "-node-modules",
12197
12187
  // content-key for immutable-cache backends (github); the lockfile
12198
12188
  // decides whether the cached content could have changed (absolute
12199
12189
  // pathMode: resolve the lockfile explicitly)
@@ -12204,12 +12194,6 @@ const getNodeModulesCache = async (context, policy = "pull-push") => {
12204
12194
  policy,
12205
12195
  paths: (0, lodash_es_1.uniq)([
12206
12196
  (0, path_1.join)(baseDir, "node_modules"),
12207
- // pnpm's per-package node_modules are symlink farms worth
12208
- // keeping warm (yarn hoists into the root, so root-only
12209
- // matches its historical behavior)
12210
- ...(isPnpm
12211
- ? workspaces.map((w) => (0, path_1.join)(w.location, "node_modules"))
12212
- : []),
12213
12197
  ...(hasInstallState ? [(0, path_1.join)(baseDir, ".yarn/install-state.gz")] : []),
12214
12198
  ]),
12215
12199
  },
@@ -12377,7 +12361,7 @@ exports.createMeteorBuildJobs = createMeteorBuildJobs;
12377
12361
  "use strict";
12378
12362
 
12379
12363
  Object.defineProperty(exports, "__esModule", ({ value: true }));
12380
- exports.getDockerAppCopyAndBuildScript = exports.getPackageManagerInstall = exports.ensureNodeVersion = exports.getDefaultAuditCommand = void 0;
12364
+ exports.getDockerAppCopyAndBuildScript = exports.getPackageManagerInstall = exports.ensureNodeVersion = exports.getDefaultAuditCommand = exports.DEFAULT_AUDIT_LEVEL = void 0;
12381
12365
  const bash_1 = __nccwpck_require__(94143);
12382
12366
  const utils_1 = __nccwpck_require__(49401);
12383
12367
  const gitlab_1 = __nccwpck_require__(86962);
@@ -12401,33 +12385,38 @@ const isInWorkspace = (context, packageManagerInfo) => context.type === "workspa
12401
12385
  */
12402
12386
  const getEnsurePnpmCommand = (version) => `if ! command -v pnpm &> /dev/null; then corepack enable pnpm 2>/dev/null || npm install -g pnpm@${version}; fi`;
12403
12387
  /**
12404
- * pnpm's store is global by default; point it at a project-local
12405
- * directory so CI can cache it (the pnpm equivalent of the `.yarn`
12406
- * zip cache). Passed as the --store-dir flag: pnpm 11 stopped reading
12407
- * the npm_config_store_dir env var (settings only come from
12408
- * pnpm-workspace.yaml / global config / CLI flags), the flag works on
12409
- * v10 and v11
12410
- */
12411
- const getPnpmStoreDirExpression = (inWorkspace) => inWorkspace
12412
- ? `"$(git rev-parse --show-toplevel 2>/dev/null || pwd)/.pnpm-store"`
12413
- : `"$PWD/.pnpm-store"`;
12414
- const getPnpmInstallCommands = (context, packageManagerInfo) => [
12388
+ * pnpm jobs use pnpm's own (global, per-runner) store location. There
12389
+ * used to be a `--store-dir` pointing at a project-local
12390
+ * `.pnpm-store`, so CI could cache it — that cache is gone (see
12391
+ * getYarnCache), and keeping the store inside the repo only meant it
12392
+ * landed in docker build contexts.
12393
+ */
12394
+ const getPnpmInstallCommands = (packageManagerInfo) => [
12415
12395
  getEnsurePnpmCommand(packageManagerInfo.version),
12416
- `pnpm install --frozen-lockfile --store-dir ${getPnpmStoreDirExpression(isInWorkspace(context, packageManagerInfo))}`,
12396
+ `pnpm install --frozen-lockfile`,
12417
12397
  ];
12398
+ exports.DEFAULT_AUDIT_LEVEL = "critical";
12418
12399
  /**
12419
- * default `audit` job command per package manager. Exhaustive on the
12420
- * package-manager type and throws for anything unsupported, so adding a
12421
- * new package manager surfaces every place that needs a command here.
12400
+ * default `audit` job command per package manager, failing on advisories
12401
+ * of `level` and above. Exhaustive on the package-manager type and throws
12402
+ * for anything unsupported, so adding a new package manager surfaces every
12403
+ * place that needs a command here.
12422
12404
  */
12423
- const getDefaultAuditCommand = (packageManagerInfo) => {
12405
+ const getDefaultAuditCommand = (packageManagerInfo, level = exports.DEFAULT_AUDIT_LEVEL) => {
12424
12406
  switch (packageManagerInfo.type) {
12425
12407
  case "pnpm":
12426
- return "pnpm audit --prod --audit-level critical";
12408
+ return `pnpm audit --prod --audit-level ${level}`;
12427
12409
  case "yarn":
12428
12410
  return packageManagerInfo.isClassic
12429
- ? "yarn audit --level critical"
12430
- : "yarn npm audit --environment production --severity critical"; // yarn 2+
12411
+ ? // classic walks the whole tree; --groups limits it to production
12412
+ `yarn audit --level ${level} --groups dependencies`
12413
+ : // yarn 2+ audits only the CURRENT workspace's DIRECT dependencies
12414
+ // by default — in a monorepo that is the root manifest, which
12415
+ // usually has no production dependencies at all, so the job passed
12416
+ // without checking anything. --all covers every workspace,
12417
+ // --recursive the transitive dependencies (what `pnpm audit` and
12418
+ // `yarn audit` classic do on their own).
12419
+ `yarn npm audit --environment production --severity ${level} --all --recursive`;
12431
12420
  default:
12432
12421
  throw new Error(`no audit command implemented for package manager "${packageManagerInfo.type}"`);
12433
12422
  }
@@ -12448,7 +12437,7 @@ const getPackageManagerInstall = async (context, options) => {
12448
12437
  ? context.build.config.postInstall
12449
12438
  : null;
12450
12439
  const installSection = packageManagerInfo.type === "pnpm"
12451
- ? (0, gitlab_1.collapseableSection)("pnpminstall", "pnpm install")(getPnpmInstallCommands(context, packageManagerInfo))
12440
+ ? (0, gitlab_1.collapseableSection)("pnpminstall", "pnpm install")(getPnpmInstallCommands(packageManagerInfo))
12452
12441
  : (0, gitlab_1.collapseableSection)("yarninstall", "Yarn install")([getYarnInstallCommand(packageManagerInfo)]);
12453
12442
  return [
12454
12443
  ...(0, exports.ensureNodeVersion)(context),
@@ -12461,11 +12450,12 @@ const getPackageManagerInstall = async (context, options) => {
12461
12450
  exports.getPackageManagerInstall = getPackageManagerInstall;
12462
12451
  const DOCKER_COPY_FILES = `COPY --chown=node:node $APP_DIR .`;
12463
12452
  const getPnpmDockerAppCopyAndBuildScript = (packageManagerInfo) => {
12464
- // the store was copied into the image (like the yarn zip cache), so
12465
- // the prod install links from it instead of hitting the registry
12466
- const storeDir = packageManagerInfo.componentIsInWorkspace
12467
- ? "/app/.pnpm-store"
12468
- : "/app/$APP_DIR/.pnpm-store";
12453
+ // the prod install downloads from the registry: nothing is copied
12454
+ // into the image to link from (see createNodeDockerJobDefinition).
12455
+ // The store it fills is scratch space outside /app, dropped in the
12456
+ // same layer so the packages ship once — node_modules holds
12457
+ // hardlinks, so removing the store keeps the files alive
12458
+ const storeDir = "/tmp/pnpm-store";
12469
12459
  // in a workspace, only install the component (and its workspace
12470
12460
  // dependencies) — the pnpm equivalent of `yarn workspaces focus`.
12471
12461
  // npm package names are shell-safe unquoted (the whole script is
@@ -12477,7 +12467,7 @@ const getPnpmDockerAppCopyAndBuildScript = (packageManagerInfo) => {
12477
12467
  return new bash_1.BashExpression(`
12478
12468
  ${DOCKER_COPY_FILES}
12479
12469
  RUN command -v pnpm >/dev/null 2>&1 || npm install -g pnpm@${packageManagerInfo.version}
12480
- RUN pnpm install --prod --frozen-lockfile --store-dir ${storeDir}${filter}
12470
+ RUN pnpm install --prod --frozen-lockfile --store-dir ${storeDir}${filter} && rm -rf ${storeDir}
12481
12471
  `.trim());
12482
12472
  };
12483
12473
  const getDockerAppCopyAndBuildScript = async (context) => {
@@ -12540,7 +12530,7 @@ const cache_1 = __nccwpck_require__(74559);
12540
12530
  const constants_1 = __nccwpck_require__(5576);
12541
12531
  const packageManagerInstall_1 = __nccwpck_require__(28419);
12542
12532
  const createNodeTestJobs = async (context) => {
12543
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3;
12533
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4;
12544
12534
  // don't run tests after release
12545
12535
  // TODO: this will be replaced by using rules
12546
12536
  if (context.trigger === "taggedRelease") {
@@ -12586,11 +12576,11 @@ const createNodeTestJobs = async (context) => {
12586
12576
  script: [
12587
12577
  `cd ${context.build.dir}`,
12588
12578
  ...((_f = (0, utils_1.ensureArrayOrNull)((_e = buildConfig.audit) === null || _e === void 0 ? void 0 : _e.command)) !== null && _f !== void 0 ? _f : [
12589
- (0, packageManagerInstall_1.getDefaultAuditCommand)(packageManagerInfo),
12579
+ (0, packageManagerInstall_1.getDefaultAuditCommand)(packageManagerInfo, (_g = buildConfig.audit) === null || _g === void 0 ? void 0 : _g.level),
12590
12580
  ]),
12591
12581
  ],
12592
- allow_failure: (_h = (_g = buildConfig.audit) === null || _g === void 0 ? void 0 : _g.allowFailure) !== null && _h !== void 0 ? _h : true,
12593
- ...(0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (_j = buildConfig.audit) === null || _j === void 0 ? void 0 : _j.artifactsReports, (_k = buildConfig.audit) === null || _k === void 0 ? void 0 : _k.artifacts),
12582
+ allow_failure: (_j = (_h = buildConfig.audit) === null || _h === void 0 ? void 0 : _h.allowFailure) !== null && _j !== void 0 ? _j : true,
12583
+ ...(0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (_k = buildConfig.audit) === null || _k === void 0 ? void 0 : _k.artifactsReports, (_l = buildConfig.audit) === null || _l === void 0 ? void 0 : _l.artifacts),
12594
12584
  })
12595
12585
  : null;
12596
12586
  const lintJob = buildConfig.lint !== false
@@ -12599,20 +12589,20 @@ const createNodeTestJobs = async (context) => {
12599
12589
  ...base,
12600
12590
  runnerVariables: {
12601
12591
  ...constants_1.NODE_RUNNER_BUILD_VARIABLES,
12602
- ...((_m = (_l = buildConfig.lint) === null || _l === void 0 ? void 0 : _l.runnerVariables) !== null && _m !== void 0 ? _m : {}),
12592
+ ...((_o = (_m = buildConfig.lint) === null || _m === void 0 ? void 0 : _m.runnerVariables) !== null && _o !== void 0 ? _o : {}),
12603
12593
  },
12604
- image: (_p = (_o = buildConfig.lint) === null || _o === void 0 ? void 0 : _o.jobImage) !== null && _p !== void 0 ? _p : defaultImage,
12594
+ image: (_q = (_p = buildConfig.lint) === null || _p === void 0 ? void 0 : _p.jobImage) !== null && _q !== void 0 ? _q : defaultImage,
12605
12595
  caches: nodeCache,
12606
12596
  script: [
12607
12597
  ...(0, packageManagerInstall_1.ensureNodeVersion)(context),
12608
12598
  `cd ${context.build.dir}`,
12609
12599
  ...packageManagerInstall,
12610
- ...((_r = (0, utils_1.ensureArrayOrNull)((_q = buildConfig.lint) === null || _q === void 0 ? void 0 : _q.command)) !== null && _r !== void 0 ? _r : [
12600
+ ...((_s = (0, utils_1.ensureArrayOrNull)((_r = buildConfig.lint) === null || _r === void 0 ? void 0 : _r.command)) !== null && _s !== void 0 ? _s : [
12611
12601
  (0, runScript_1.runScript)(packageManagerInfo.type, "lint"),
12612
12602
  ]),
12613
12603
  ],
12614
- allow_failure: (_s = buildConfig.lint) === null || _s === void 0 ? void 0 : _s.allowFailure,
12615
- ...(0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (_t = buildConfig.lint) === null || _t === void 0 ? void 0 : _t.artifactsReports, (_u = buildConfig.lint) === null || _u === void 0 ? void 0 : _u.artifacts),
12604
+ allow_failure: (_t = buildConfig.lint) === null || _t === void 0 ? void 0 : _t.allowFailure,
12605
+ ...(0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (_u = buildConfig.lint) === null || _u === void 0 ? void 0 : _u.artifactsReports, (_v = buildConfig.lint) === null || _v === void 0 ? void 0 : _v.artifacts),
12616
12606
  })
12617
12607
  : null;
12618
12608
  const testJob = buildConfig.test !== false
@@ -12621,22 +12611,22 @@ const createNodeTestJobs = async (context) => {
12621
12611
  ...base,
12622
12612
  runnerVariables: {
12623
12613
  ...constants_1.NODE_RUNNER_BUILD_VARIABLES,
12624
- ...((_w = (_v = buildConfig.test) === null || _v === void 0 ? void 0 : _v.runnerVariables) !== null && _w !== void 0 ? _w : {}),
12614
+ ...((_x = (_w = buildConfig.test) === null || _w === void 0 ? void 0 : _w.runnerVariables) !== null && _x !== void 0 ? _x : {}),
12625
12615
  },
12626
12616
  // browser tests need a jobImage carrying the browser, e.g. the
12627
12617
  // official playwright image (version-matched to the project)
12628
- image: (_y = (_x = buildConfig.test) === null || _x === void 0 ? void 0 : _x.jobImage) !== null && _y !== void 0 ? _y : (0, runner_1.getRunnerImage)("jobs-default"),
12618
+ image: (_z = (_y = buildConfig.test) === null || _y === void 0 ? void 0 : _y.jobImage) !== null && _z !== void 0 ? _z : (0, runner_1.getRunnerImage)("jobs-default"),
12629
12619
  caches: nodeCache,
12630
12620
  script: [
12631
12621
  ...(0, packageManagerInstall_1.ensureNodeVersion)(context),
12632
12622
  `cd ${context.build.dir}`,
12633
12623
  ...packageManagerInstall,
12634
- ...((_0 = (0, utils_1.ensureArrayOrNull)((_z = buildConfig.test) === null || _z === void 0 ? void 0 : _z.command)) !== null && _0 !== void 0 ? _0 : [
12624
+ ...((_1 = (0, utils_1.ensureArrayOrNull)((_0 = buildConfig.test) === null || _0 === void 0 ? void 0 : _0.command)) !== null && _1 !== void 0 ? _1 : [
12635
12625
  (0, runScript_1.runScript)(packageManagerInfo.type, "test"),
12636
12626
  ]),
12637
12627
  ],
12638
- allow_failure: (_1 = buildConfig.test) === null || _1 === void 0 ? void 0 : _1.allowFailure,
12639
- ...(0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (_2 = buildConfig.test) === null || _2 === void 0 ? void 0 : _2.artifactsReports, (_3 = buildConfig.test) === null || _3 === void 0 ? void 0 : _3.artifacts),
12628
+ allow_failure: (_2 = buildConfig.test) === null || _2 === void 0 ? void 0 : _2.allowFailure,
12629
+ ...(0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (_3 = buildConfig.test) === null || _3 === void 0 ? void 0 : _3.artifactsReports, (_4 = buildConfig.test) === null || _4 === void 0 ? void 0 : _4.artifacts),
12640
12630
  })
12641
12631
  : null;
12642
12632
  return [auditJob, lintJob, testJob].filter(utils_1.notNil);
@@ -26,6 +26,16 @@ generated pipeline files.
26
26
  `artifactsReports`, `artifacts`, `runnerVariables`, `allowFailure`
27
27
  (`allowFailure` defaults to `true` for `audit`).
28
28
 
29
+ `audit` additionally takes `level`: `"info" | "low" | "moderate" | "high" |
30
+ "critical"` (default `"critical"`) — the lowest severity that fails the job,
31
+ translated to the package manager's own flag (`pnpm audit --audit-level`,
32
+ `yarn npm audit --severity`, classic `yarn audit --level`). Ignored when
33
+ `command` spells out its own command:
34
+
35
+ ```ts
36
+ audit: { level: "high" }, // fail on high and critical advisories
37
+ ```
38
+
29
39
  ## Per-type options & defaults
30
40
 
31
41
  ### `node`
@@ -40,13 +40,19 @@ change needed:
40
40
 
41
41
  | | yarn | pnpm |
42
42
  |---|---|---|
43
- | CI install | `yarn install --immutable` | `pnpm install --frozen-lockfile --store-dir …` |
44
- | download cache | `.yarn` zip cache | project-local `.pnpm-store`, cache slot scoped by pnpm major |
45
- | node_modules cache | mutable slot per build dir | **lockfile-keyed** slot (a pnpm install over a foreign tree leaves orphaned `.pnpm` dirs) |
43
+ | CI install | `yarn install --immutable` | `pnpm install --frozen-lockfile` |
44
+ | download cache | `.yarn` zip cache | **none** — installing from the registry is cheaper than moving the store |
45
+ | node_modules cache | mutable slot per build dir | **none** (measured: the archive costs more than the install it saves) |
46
46
  | docker prod install | `yarn workspaces focus --production` | `pnpm install --prod --frozen-lockfile --filter <pkg>...` |
47
- | audit job | `yarn npm audit …` | `pnpm audit --prod --audit-level critical` |
47
+ | audit job | `yarn npm audit … --all --recursive` | `pnpm audit --prod --audit-level critical` |
48
48
  | build/start defaults | `yarn build` / `yarn start` | `pnpm build` / `pnpm start` |
49
49
 
50
+ The audit job is the one place where the two are not equivalent in
51
+ practice: it is easy to have a yarn pipeline whose audit checked nothing
52
+ (before catladder 5 the generated command lacked `--all --recursive`), so
53
+ the pnpm job can turn up long-standing vulnerabilities. Read them as
54
+ pre-existing, not as caused by the migration.
55
+
50
56
  Because the cache keys differ per package manager, the first pnpm
51
57
  pipeline runs **cold** (and rebuilds job images). Judge speed on the
52
58
  second run, not the first.
@@ -140,9 +146,9 @@ skip it and run a bare `pnpm install` — that silently upgrades hundreds
140
146
  of transitive dependencies at the same time as the package manager
141
147
  changes, and you will not know which change broke what.
142
148
 
143
- Then set the `packageManager` field, and update `.gitignore`:
144
- `.pnpm-store/` in, `.yarn/*` entries out (keep `.yarn/patches` only if
145
- you left the patches there).
149
+ Then set the `packageManager` field, and update `.gitignore`: `.yarn/*`
150
+ entries out (keep `.yarn/patches` only if you left the patches there).
151
+ Nothing pnpm-specific needs ignoring — the store lives outside the repo.
146
152
 
147
153
  ## Step 4 — fix the fallout locally
148
154
 
@@ -225,8 +231,8 @@ Mirrored, with one loss to state up front: **there is no importer back**.
225
231
  every range — the migration necessarily bumps transitive versions.
226
232
  Do it deliberately:
227
233
 
228
- 1. Delete `pnpm-lock.yaml`, `pnpm-workspace.yaml`, `.pnpm-store`, and the
229
- `node_modules` trees.
234
+ 1. Delete `pnpm-lock.yaml`, `pnpm-workspace.yaml`, and the `node_modules`
235
+ trees.
230
236
  2. Move `packages:` back into package.json `workspaces`, `overrides` →
231
237
  `resolutions`, `patchedDependencies` → yarn's patch protocol,
232
238
  `allowBuilds` → (yarn runs build scripts by default; nothing needed).
@@ -19,7 +19,7 @@ here has bitten a real catladder project during a migration.
19
19
  | `yarn run -T x` / `yarn -T x` (berry top-level) | `x` (root `node_modules/.bin` is on the script PATH) |
20
20
  | `yarn dlx x` | `pnpm dlx x` |
21
21
  | `yarn node x` / `yarn exec x` | `pnpm exec x` |
22
- | `yarn npm audit --environment production` | `pnpm audit --prod` |
22
+ | `yarn npm audit --environment production --all --recursive` | `pnpm audit --prod` |
23
23
  | `yarn bin x` | `pnpm bin x` |
24
24
 
25
25
  ## Configuration mapping
@@ -82,9 +82,26 @@ the docker build context.
82
82
 
83
83
  **Version drift in `--prod` installs.** `pnpm install --prod` on a
84
84
  node_modules tree from a *different* lockfile does not prune orphaned
85
- `.pnpm` directories. That is why catladder keys the pnpm node_modules
86
- cache by the lockfile instead of reusing a mutable slot — and why you
87
- should never reuse a yarn branch's cache for a pnpm branch.
85
+ `.pnpm` directories — never reuse one branch's node_modules for another
86
+ lockfile, and never a yarn tree for a pnpm branch.
87
+
88
+ **Nothing is cached.** A yarn pipeline caches its zip cache and
89
+ node_modules; a pnpm pipeline caches neither, and does not copy a store
90
+ into docker images either. pnpm installs a 3800-package monorepo from
91
+ the registry in 30-40s, which is less than it costs to move a 1 GB
92
+ store or a 1.3 GB node_modules tree through a CI cache — measured
93
+ side-by-side, caching made jobs about twice as slow on gitlab. Two
94
+ consequences when migrating: CI pulls more from the registry than the
95
+ yarn setup did (worth a registry proxy if that matters to you), and
96
+ `.pnpm-store` should not appear anywhere in the repo or a build
97
+ context.
98
+
99
+ **Docker images must not carry the store.** If a store is copied into
100
+ an image, it lands in a layer below `node_modules`, pnpm cannot hardlink
101
+ across the overlay boundary, and every package is copied instead — the
102
+ install gets *slower* (28s vs 10s from the registry) and the image
103
+ carries the packages twice. Let the `--prod` install download, into a
104
+ store outside the app directory that the same `RUN` layer deletes.
88
105
 
89
106
  **pnpm 11 needs node ≥ 22.13** (pnpm 10: ≥ 18.12), and it does not fail
90
107
  politely: it prints a `warn:` line and then crashes on
@@ -92,6 +109,15 @@ politely: it prints a `warn:` line and then crashes on
92
109
  job image ships node 22 — the jobs run `nvm install` from `.nvmrc`, so
93
110
  an `.nvmrc` of `20` downgrades the image right before the install.
94
111
 
112
+ **`pnpm audit` needs no scope flags.** It audits every workspace and the
113
+ whole transitive tree by default, which is what `yarn npm audit` only does
114
+ with `--all --recursive` (without them it checks the current workspace's
115
+ *direct* dependencies — in a monorepo root that is usually nothing at all).
116
+ Expect the pnpm audit job to surface vulnerabilities the yarn one never
117
+ reported. In return `--prod` is stricter than yarn's
118
+ `--environment production`: yarn still reports a devDependency of a
119
+ workspace, pnpm does not.
120
+
95
121
  **`minimumReleaseAge`** defaults to 1440 minutes on pnpm 11: freshly
96
122
  published versions are refused. Set it to `0` while migrating (it is a
97
123
  supply-chain feature worth enabling deliberately later, not something to
@@ -58,12 +58,13 @@ the registry.
58
58
 
59
59
  ## Caching
60
60
 
61
- Cache configuration is generated per build type; node builds cache
62
- `node_modules` and the package manager's download cache (the `.yarn`
63
- zip cache, or for pnpm projects a project-local `.pnpm-store`). GitLab
64
- uses mutable caches with
65
- fallback keys (review branches fall back to the dev cache); GitHub uses
66
- immutable lockfile-keyed caches where only the build job writes.
61
+ Cache configuration is generated per build type. **yarn** node builds
62
+ cache `node_modules` and the `.yarn` zip cache; GitLab uses mutable
63
+ caches with fallback keys (review branches fall back to the dev cache),
64
+ GitHub immutable lockfile-keyed caches where only the build job writes.
65
+ **pnpm** builds cache nothing: measured on a 3800-package monorepo,
66
+ moving the store or node_modules through a CI cache costs more than
67
+ pnpm's from-registry install.
67
68
  Caching behavior is changed via the build config in `catladder.ts`,
68
69
  not in the YAML.
69
70
 
@@ -44,11 +44,14 @@ const createNodeDockerJobDefinition = async (context) => {
44
44
  (0, packageManagerInstall_1.getDockerAppCopyAndBuildScript)(context),
45
45
  context.packageManagerInfo,
46
46
  ]);
47
- // the pnpm store (pulled via the cache above) is copied into the
48
- // image so the prod install works offline — like the yarn zip cache,
49
- // which travels inside the copied `.yarn` config folder
50
- const copyPnpmStore = packageManagerInfo.type === "pnpm" &&
51
- packageManagerInfo.componentIsInWorkspace;
47
+ // The pnpm store is deliberately NOT copied into the image. It used
48
+ // to be, so the prod install could link instead of hitting the
49
+ // registry — but the store lands in an earlier layer than
50
+ // node_modules, so pnpm cannot hardlink across the overlay boundary
51
+ // and copies every package instead. Measured on one component: the
52
+ // in-image install was *slower* that way (28s vs 10s from the
53
+ // registry), the store added 3GB to the build context and the final
54
+ // image, and the build took 339s instead of 27s.
52
55
  // pnpm copies every workspace manifest into the image — as individual
53
56
  // COPY instructions that many layers exceed docker's depth limit, so
54
57
  // the job tars them up and a single ADD extracts them
@@ -56,8 +59,6 @@ const createNodeDockerJobDefinition = async (context) => {
56
59
  const WORKSPACE_FILES_TAR = ".catladder-workspace-files.tar";
57
60
  return {
58
61
  script: [
59
- // the COPY source must exist even when the cache was cold
60
- ...(copyPnpmStore ? ["mkdir -p .pnpm-store"] : []),
61
62
  ...(isPnpm
62
63
  ? [
63
64
  `tar -cf ${WORKSPACE_FILES_TAR} ${packageManagerInfo.pathsToCopyInDocker.join(" ")}`,
@@ -74,14 +75,10 @@ const createNodeDockerJobDefinition = async (context) => {
74
75
  `ADD ${WORKSPACE_FILES_TAR} /app/`,
75
76
  // ADD does not apply --chown to extracted tars, and parent
76
77
  // dirs of the entries come out root-owned — fix ownership
77
- // while the stage still runs as root (store not copied yet,
78
- // so this only touches the small manifest tree). Custom
79
- // base images without a node user run as root and don't
80
- // need it, hence the fallback
78
+ // while the stage still runs as root (this only touches the
79
+ // small manifest tree). Custom base images without a node
80
+ // user run as root and don't need it, hence the fallback
81
81
  `RUN chown -R node:node /app || true`,
82
- ...(copyPnpmStore
83
- ? [`COPY --chown=node:node .pnpm-store /app/.pnpm-store`]
84
- : []),
85
82
  ].join("\n")
86
83
  : packageManagerInfo.pathsToCopyInDocker
87
84
  .map((dir) => `COPY --chown=node:node ${dir} /app/${dir}`)
@@ -1 +1 @@
1
- {"version":3,"file":"buildJob.js","sourceRoot":"","sources":["../../../../../../../../packages/pipeline/src/build/node/buildJob.ts"],"names":[],"mappings":";;;AAKA,iDAG6B;AAM7B,kCAA6E;AAC7E,+EAA4E;AAC5E,sCAAsE;AAEtE,mCAAqD;AACrD,mEAGiC;AAE1B,MAAM,mBAAmB,GAAG,KAAK,EACtC,OAAqD,EAC5B,EAAE;IAC3B,IAAI,OAAO,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;QACjC,OAAO,IAAA,+BAAwB,EAAC,OAAO,EAAE;YACvC,QAAQ,EAAE,MAAM,IAAA,oCAA4B,EAAC,OAAO,CAAC;SACtD,CAAC,CAAC;IACL,CAAC;IACD,OAAO,IAAA,+BAAwB,EAAC,OAAO,EAAE;QACvC,QAAQ,EAAE,IAAA,2CAAiC,EAAC,OAAO,CAAC;YAClD,CAAC,CAAC,MAAM,IAAA,oCAA4B,EAAC,OAAO,CAAC;YAC7C,CAAC,CAAC,SAAS;QAEb,WAAW,EAAE,MAAM,IAAA,qCAA6B,EAAC,OAAO,CAAC;KAC1D,CAAC,CAAC;AACL,CAAC,CAAC;AAfW,QAAA,mBAAmB,uBAe9B;AAEK,MAAM,4BAA4B,GAAG,KAAK,EAC/C,OAAoE,EACxB,EAAE;IAC9C,MAAM,WAAW,GAAG,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC;IAEzC,MAAM,CAAC,qBAAqB,EAAE,SAAS,CAAC,GAAG,MAAM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AW,mBAAmB,IAAI,kBAAkB,CAAC,mBAAmB,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;iBACrF;gBACH,CAAC,CAAC,EAAE,CAAC;YACP,GAAG,IAAA,kDAAyC,EAC1C,OAAO,EACP,oBAAoB,CACrB;SACF;QACD,KAAK,EAAE,CAAC,GAAG,SAAS,CAAC;QACrB,SAAS,EAAE;YACT,+BAA+B;YAC/B,2BAA2B,EAAE,2BAA2B;YACxD,2BAA2B,EAAE,MAAM;gBACjC,CAAC,CAAC;oBACE,OAAO,mBAAmB,QAAQ;oBAClC,2DAA2D;oBAC3D,0DAA0D;oBAC1D,4DAA4D;oBAC5D,wDAAwD;oBACxD,wDAAwD;oBACxD,8BAA8B;oBAC9B,qCAAqC;oBACrC,GAAG,CAAC,aAAa;wBACf,CAAC,CAAC,CAAC,qDAAqD,CAAC;wBACzD,CAAC,CAAC,EAAE,CAAC;iBACR,CAAC,IAAI,CAAC,IAAI,CAAC;gBACd,CAAC,CAAC,kBAAkB,CAAC,mBAAmB;qBACnC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,0BAA0B,GAAG,SAAS,GAAG,EAAE,CAAC;qBACzD,IAAI,CAAC,IAAI,CAAC;YACjB,iEAAiE;YACjE,kDAAkD;YAClD,GAAG,CAAC,MAAM;gBACR,CAAC,CAAC;oBACE,4BAA4B,EAAE,2BAA2B,kBAAkB,CAAC,OAAO,EAAE;iBACtF;gBACH,CAAC,CAAC,EAAE,CAAC;SACR;KACF,CAAC;AACJ,CAAC,CAAC;AA1EW,QAAA,6BAA6B,iCA0ExC"}
1
+ {"version":3,"file":"buildJob.js","sourceRoot":"","sources":["../../../../../../../../packages/pipeline/src/build/node/buildJob.ts"],"names":[],"mappings":";;;AAKA,iDAG6B;AAM7B,kCAA6E;AAC7E,+EAA4E;AAC5E,sCAAsE;AAEtE,mCAAqD;AACrD,mEAGiC;AAE1B,MAAM,mBAAmB,GAAG,KAAK,EACtC,OAAqD,EAC5B,EAA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AC,MAAM;gBACR,CAAC,CAAC;oBACE,4BAA4B,EAAE,2BAA2B,kBAAkB,CAAC,OAAO,EAAE;iBACtF;gBACH,CAAC,CAAC,EAAE,CAAC;SACR;KACF,CAAC;AACJ,CAAC,CAAC;AAtEW,QAAA,6BAA6B,iCAsExC"}
@@ -1,9 +1,14 @@
1
1
  import type { Context } from "../../types/context";
2
2
  import type { CacheConfig } from "../types";
3
3
  /**
4
- * the package manager's download cache: yarn's `.yarn` zip cache, or
5
- * pnpm's content-addressable store (which catladder points at a
6
- * project-local `.pnpm-store`, see the install script)
4
+ * the package manager's download cache: yarn's `.yarn` zip cache.
5
+ *
6
+ * pnpm gets nothing. Its store is a content-addressable tree of
7
+ * hundreds of thousands of small files, and moving it costs more than
8
+ * the install it saves: measured on a 3800-package monorepo, restoring
9
+ * the 1 GB store took ~53s on gitlab (which zips file by file) and
10
+ * ~23s on github, against a from-registry install of ~30-40s. See
11
+ * getNodeModulesCache for the node_modules half of the same finding.
7
12
  */
8
13
  export declare const getYarnCache: (context: Context, policy?: string) => Promise<CacheConfig[]>;
9
14
  export declare const getNodeModulesCache: (context: Context, policy?: string) => Promise<CacheConfig[]>;