@catladder/cli 0.0.0-next-d71e41ba → 0.0.0-next-b3e567e8
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/dist/apps/cli/src/scripts/generateCliSkillReference.js +3 -2
- package/dist/apps/cli/src/scripts/generateCliSkillReference.js.map +1 -1
- package/dist/bundles/catenv/index.js +546 -205
- package/dist/bundles/cli/index.js +546 -205
- package/dist/bundles/runner-images/docker-build/scripts/ensureNodeDockerfile +8 -1
- package/dist/bundles/runner-images/jobs-default/Dockerfile +4 -0
- package/dist/bundles/skills/catladder-builds/SKILL.md +19 -3
- package/dist/bundles/skills/catladder-builds/references/build-types.md +6 -4
- package/dist/bundles/skills/catladder-cli/references/commands.md +3 -2
- package/dist/bundles/skills/catladder-config/SKILL.md +5 -0
- package/dist/bundles/skills/catladder-deploys/SKILL.md +1 -1
- package/dist/bundles/skills/catladder-deploys/references/deploy-types.md +2 -2
- package/dist/bundles/skills/catladder-pipelines/SKILL.md +3 -1
- package/dist/packages/pipeline/src/build/base/createAppBuildJob.js +2 -2
- package/dist/packages/pipeline/src/build/base/createAppBuildJob.js.map +1 -1
- package/dist/packages/pipeline/src/build/index.d.ts +3 -3
- package/dist/packages/pipeline/src/build/index.js +16 -11
- package/dist/packages/pipeline/src/build/index.js.map +1 -1
- package/dist/packages/pipeline/src/build/node/buildJob.js +49 -8
- package/dist/packages/pipeline/src/build/node/buildJob.js.map +1 -1
- package/dist/packages/pipeline/src/build/node/cache.d.ts +5 -0
- package/dist/packages/pipeline/src/build/node/cache.js +58 -19
- package/dist/packages/pipeline/src/build/node/cache.js.map +1 -1
- package/dist/packages/pipeline/src/build/node/meteor.js +9 -4
- package/dist/packages/pipeline/src/build/node/meteor.js.map +1 -1
- package/dist/packages/pipeline/src/build/node/packageManagerInstall.d.ts +14 -0
- package/dist/packages/pipeline/src/build/node/packageManagerInstall.js +145 -0
- package/dist/packages/pipeline/src/build/node/packageManagerInstall.js.map +1 -0
- package/dist/packages/pipeline/src/build/node/testJob.js +9 -11
- package/dist/packages/pipeline/src/build/node/testJob.js.map +1 -1
- package/dist/packages/pipeline/src/context/createComponentContext.js +3 -2
- package/dist/packages/pipeline/src/context/createComponentContext.js.map +1 -1
- package/dist/packages/pipeline/src/context/createWorkspaceContext.js +3 -2
- package/dist/packages/pipeline/src/context/createWorkspaceContext.js.map +1 -1
- package/dist/packages/pipeline/src/deploy/custom/deployJob.js +7 -6
- package/dist/packages/pipeline/src/deploy/custom/deployJob.js.map +1 -1
- package/dist/packages/pipeline/src/deploy/pages/deployJob.js +6 -4
- package/dist/packages/pipeline/src/deploy/pages/deployJob.js.map +1 -1
- package/dist/packages/pipeline/src/deploy/types/custom.d.ts +7 -1
- package/dist/packages/pipeline/src/deploy/types/pages.d.ts +7 -1
- package/dist/packages/pipeline/src/pipeline/detectPackageManager.d.ts +18 -0
- package/dist/packages/pipeline/src/pipeline/detectPackageManager.js +76 -0
- package/dist/packages/pipeline/src/pipeline/detectPackageManager.js.map +1 -0
- package/dist/packages/pipeline/src/pipeline/packageManager.d.ts +1 -1
- package/dist/packages/pipeline/src/pipeline/packageManager.js +43 -9
- package/dist/packages/pipeline/src/pipeline/packageManager.js.map +1 -1
- package/dist/packages/pipeline/src/pipeline/pnpm/pnpmUtils.d.ts +14 -0
- package/dist/packages/pipeline/src/pipeline/pnpm/pnpmUtils.js +93 -0
- package/dist/packages/pipeline/src/pipeline/pnpm/pnpmUtils.js.map +1 -0
- package/dist/packages/pipeline/src/types/config.d.ts +8 -1
- package/dist/packages/pipeline/src/types/context.d.ts +11 -3
- package/dist/packages/pipeline/src/types/context.js.map +1 -1
- package/dist/packages/pipeline/src/verify/createVerifyJobs.js +5 -5
- package/dist/packages/pipeline/src/verify/createVerifyJobs.js.map +1 -1
- package/dist/runner-images/docker-build/scripts/ensureNodeDockerfile +8 -1
- package/dist/runner-images/jobs-default/Dockerfile +4 -0
- package/dist/skills/catladder-builds/SKILL.md +19 -3
- package/dist/skills/catladder-builds/references/build-types.md +6 -4
- package/dist/skills/catladder-cli/references/commands.md +3 -2
- package/dist/skills/catladder-config/SKILL.md +5 -0
- package/dist/skills/catladder-deploys/SKILL.md +1 -1
- package/dist/skills/catladder-deploys/references/deploy-types.md +2 -2
- package/dist/skills/catladder-pipelines/SKILL.md +3 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/scripts/generateCliSkillReference.ts +3 -2
- package/dist/packages/pipeline/src/build/node/yarn.d.ts +0 -8
- package/dist/packages/pipeline/src/build/node/yarn.js +0 -78
- package/dist/packages/pipeline/src/build/node/yarn.js.map +0 -1
|
@@ -7,12 +7,23 @@ exports.getPackageManagerInfoBase = exports.getPackageManagerInfoForComponent =
|
|
|
7
7
|
const fs_1 = require("fs");
|
|
8
8
|
const path_1 = require("path");
|
|
9
9
|
const path_equal_1 = require("path-equal");
|
|
10
|
+
const detectPackageManager_1 = require("./detectPackageManager");
|
|
11
|
+
const pnpmUtils_1 = require("./pnpm/pnpmUtils");
|
|
10
12
|
const yarnUtils_1 = require("./yarn/yarnUtils");
|
|
11
13
|
const memoizee_1 = __importDefault(require("memoizee"));
|
|
14
|
+
const PACKAGE_MANAGER_FILES = {
|
|
15
|
+
yarn: {
|
|
16
|
+
lockFile: "yarn.lock",
|
|
17
|
+
configFiles: [".yarnrc", ".yarnrc.yml", ".npmrc", ".yarn"], // ".yarn" is yarn 2 folder
|
|
18
|
+
},
|
|
19
|
+
pnpm: {
|
|
20
|
+
lockFile: "pnpm-lock.yaml",
|
|
21
|
+
configFiles: ["pnpm-workspace.yaml", ".npmrc", ".pnpmfile.cjs"],
|
|
22
|
+
},
|
|
23
|
+
};
|
|
12
24
|
const getPackageManagerInfoForComponent = async (config, componentName) => {
|
|
13
|
-
const baseInfo = await (0, exports.getPackageManagerInfoBase)();
|
|
25
|
+
const baseInfo = await (0, exports.getPackageManagerInfoBase)(config);
|
|
14
26
|
const { workspaces } = baseInfo;
|
|
15
|
-
// currently only supports yarn
|
|
16
27
|
const component = config.components[componentName];
|
|
17
28
|
const currentWorkspace = workspaces.find((w) => (0, path_equal_1.pathEqual)(component.dir, w.location));
|
|
18
29
|
const componentIsInWorkspace = Boolean(currentWorkspace);
|
|
@@ -21,10 +32,10 @@ const getPackageManagerInfoForComponent = async (config, componentName) => {
|
|
|
21
32
|
const workspacePackageJson = componentIsInWorkspace
|
|
22
33
|
? (0, path_1.join)(workspaceRoot, "package.json")
|
|
23
34
|
: null;
|
|
35
|
+
const { lockFile: lockFileName, configFiles } = PACKAGE_MANAGER_FILES[baseInfo.type];
|
|
24
36
|
const lockFile = componentIsInWorkspace
|
|
25
|
-
? (0, path_1.join)(workspaceRoot,
|
|
26
|
-
: (0, path_1.join)(component.dir,
|
|
27
|
-
const configFiles = [".yarnrc", ".yarnrc.yml", ".npmrc", ".yarn"]; // ".yarn" is yarn 2 folder
|
|
37
|
+
? (0, path_1.join)(workspaceRoot, lockFileName)
|
|
38
|
+
: (0, path_1.join)(component.dir, lockFileName);
|
|
28
39
|
// copy all those configFiles from workspace root and/or component folder
|
|
29
40
|
const configFilePaths = [
|
|
30
41
|
...configFiles,
|
|
@@ -35,12 +46,27 @@ const getPackageManagerInfoForComponent = async (config, componentName) => {
|
|
|
35
46
|
const currentWorkspaceDependencies = currentWorkspace
|
|
36
47
|
? (0, yarnUtils_1.getWorkspaceDependencies)(currentWorkspace, workspaces)
|
|
37
48
|
: [];
|
|
49
|
+
// pnpm's --frozen-lockfile check requires every importer of the
|
|
50
|
+
// lockfile to exist on disk, so all workspace manifests (not just the
|
|
51
|
+
// dependency workspaces, which are copied entirely) go into the image
|
|
52
|
+
const allWorkspaceManifests = baseInfo.type === "pnpm" && componentIsInWorkspace
|
|
53
|
+
? workspaces
|
|
54
|
+
.map((w) => (0, path_1.join)(w.location, "package.json"))
|
|
55
|
+
.filter((f) => (0, fs_1.existsSync)(f))
|
|
56
|
+
: [];
|
|
57
|
+
// patch files referenced by patchedDependencies must exist in the
|
|
58
|
+
// image, or pnpm's frozen install fails verifying them
|
|
59
|
+
const patchFiles = baseInfo.type === "pnpm"
|
|
60
|
+
? (0, pnpmUtils_1.getPnpmPatchFiles)(componentIsInWorkspace ? workspaceRoot : component.dir)
|
|
61
|
+
: [];
|
|
38
62
|
const pathsToCopyInDocker = [
|
|
39
63
|
...new Set([
|
|
40
64
|
packageJson,
|
|
41
65
|
...(workspacePackageJson ? [workspacePackageJson] : []),
|
|
42
66
|
lockFile,
|
|
43
67
|
...configFilePaths,
|
|
68
|
+
...allWorkspaceManifests,
|
|
69
|
+
...patchFiles,
|
|
44
70
|
...currentWorkspaceDependencies,
|
|
45
71
|
]),
|
|
46
72
|
];
|
|
@@ -53,11 +79,17 @@ const getPackageManagerInfoForComponent = async (config, componentName) => {
|
|
|
53
79
|
};
|
|
54
80
|
};
|
|
55
81
|
exports.getPackageManagerInfoForComponent = getPackageManagerInfoForComponent;
|
|
56
|
-
const _getPackageManagerInfoBase = async () => {
|
|
57
|
-
|
|
58
|
-
const version = await (0, yarnUtils_1.getYarnVersion)();
|
|
82
|
+
const _getPackageManagerInfoBase = async (config) => {
|
|
83
|
+
const { type, version } = await (0, detectPackageManager_1.detectPackageManager)(config === null || config === void 0 ? void 0 : config.packageManager);
|
|
59
84
|
if (!version)
|
|
60
|
-
throw new Error(
|
|
85
|
+
throw new Error(`could not get ${type} version`);
|
|
86
|
+
if (type === "pnpm") {
|
|
87
|
+
return {
|
|
88
|
+
type: "pnpm",
|
|
89
|
+
workspaces: await (0, pnpmUtils_1.getPnpmWorkspaces)(),
|
|
90
|
+
version,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
61
93
|
const isClassic = version.startsWith("1");
|
|
62
94
|
const workspaces = await (0, yarnUtils_1.getWorkspaces)(isClassic);
|
|
63
95
|
return {
|
|
@@ -69,5 +101,7 @@ const _getPackageManagerInfoBase = async () => {
|
|
|
69
101
|
};
|
|
70
102
|
exports.getPackageManagerInfoBase = (0, memoizee_1.default)(_getPackageManagerInfoBase, {
|
|
71
103
|
promise: true,
|
|
104
|
+
// memoize per explicit packageManager choice, not per config identity
|
|
105
|
+
normalizer: ([config]) => { var _a; return (_a = config === null || config === void 0 ? void 0 : config.packageManager) !== null && _a !== void 0 ? _a : ""; },
|
|
72
106
|
});
|
|
73
107
|
//# sourceMappingURL=packageManager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageManager.js","sourceRoot":"","sources":["../../../../../../../packages/pipeline/src/pipeline/packageManager.ts"],"names":[],"mappings":";;;;;;AAAA,2BAAgC;AAChC,+BAA4B;AAC5B,2CAAuC;AAMvC,
|
|
1
|
+
{"version":3,"file":"packageManager.js","sourceRoot":"","sources":["../../../../../../../packages/pipeline/src/pipeline/packageManager.ts"],"names":[],"mappings":";;;;;;AAAA,2BAAgC;AAChC,+BAA4B;AAC5B,2CAAuC;AAMvC,iEAA8D;AAC9D,gDAAwE;AACxE,gDAA2E;AAC3E,wDAAgC;AAEhC,MAAM,qBAAqB,GAAG;IAC5B,IAAI,EAAE;QACJ,QAAQ,EAAE,WAAW;QACrB,WAAW,EAAE,CAAC,SAAS,EAAE,aAAa,EAAE,QAAQ,EAAE,OAAO,CAAC,EAAE,2BAA2B;KACxF;IACD,IAAI,EAAE;QACJ,QAAQ,EAAE,gBAAgB;QAC1B,WAAW,EAAE,CAAC,qBAAqB,EAAE,QAAQ,EAAE,eAAe,CAAC;KAChE;CACO,CAAC;AAEJ,MAAM,iCAAiC,GAAG,KAAK,EACpD,MAAc,EACd,aAAqB,EACiB,EAAE;IACxC,MAAM,QAAQ,GAAG,MAAM,IAAA,iCAAyB,EAAC,MAAM,CAAC,CAAC;IACzD,MAAM,EAAE,UAAU,EAAE,GAAG,QAAQ,CAAC;IAEhC,MAAM,SAAS,GAAG,MAAM,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IACnD,MAAM,gBAAgB,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAC7C,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EAAE,MAAM;YACZ,UAAU,EAAE,MAAM,IAAA,6BAAiB,GAAE;YACrC,OAAO;SACR,CAAC;IACJ,CAAC;IAED,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IAC1C,MAAM,UAAU,GAAG,MAAM,IAAA,yBAAa,EAAC,SAAS,CAAC,CAAC;IAElD,OAAO;QACL,IAAI,EAAE,MAAM;QACZ,UAAU;QACV,OAAO;QACP,SAAS;KACV,CAAC;AACJ,CAAC,CAAC;AAEW,QAAA,yBAAyB,GAAG,IAAA,kBAAQ,EAAC,0BAA0B,EAAE;IAC5E,OAAO,EAAE,IAAI;IACb,sEAAsE;IACtE,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,WAAC,OAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,cAAc,mCAAI,EAAE,CAAA,EAAA;CACvD,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import memoizee from "memoizee";
|
|
2
|
+
import type { YarnWorkspace } from "../../types";
|
|
3
|
+
/**
|
|
4
|
+
* patch files referenced by `patchedDependencies` (pnpm-workspace.yaml
|
|
5
|
+
* or the root package.json's `pnpm` section) — they must travel into
|
|
6
|
+
* the docker build context, or the prod install fails to verify them
|
|
7
|
+
*/
|
|
8
|
+
export declare const getPnpmPatchFiles: (root?: string) => string[];
|
|
9
|
+
/**
|
|
10
|
+
* list pnpm workspace projects in the same shape yarn berry reports them
|
|
11
|
+
* (locations relative to the project root, workspace dependencies as
|
|
12
|
+
* locations). Outside a pnpm workspace this returns [].
|
|
13
|
+
*/
|
|
14
|
+
export declare const getPnpmWorkspaces: (() => Promise<Array<YarnWorkspace>>) & memoizee.Memoized<() => Promise<Array<YarnWorkspace>>>;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getPnpmWorkspaces = exports.getPnpmPatchFiles = void 0;
|
|
7
|
+
const child_process_promise_1 = require("child-process-promise");
|
|
8
|
+
const fs_1 = require("fs");
|
|
9
|
+
const promises_1 = require("fs/promises");
|
|
10
|
+
const path_1 = require("path");
|
|
11
|
+
const memoizee_1 = __importDefault(require("memoizee"));
|
|
12
|
+
const yaml_1 = require("yaml");
|
|
13
|
+
const jsonParse_1 = require("../../utils/jsonParse");
|
|
14
|
+
const readWorkspaceDependencyLocations = async (location, locationByName) => {
|
|
15
|
+
var _a, _b, _c;
|
|
16
|
+
try {
|
|
17
|
+
const pkg = JSON.parse(await (0, promises_1.readFile)((0, path_1.join)(location, "package.json"), "utf-8"));
|
|
18
|
+
const depNames = [
|
|
19
|
+
...Object.keys((_a = pkg.dependencies) !== null && _a !== void 0 ? _a : {}),
|
|
20
|
+
...Object.keys((_b = pkg.devDependencies) !== null && _b !== void 0 ? _b : {}),
|
|
21
|
+
...Object.keys((_c = pkg.optionalDependencies) !== null && _c !== void 0 ? _c : {}),
|
|
22
|
+
];
|
|
23
|
+
return [
|
|
24
|
+
...new Set(depNames
|
|
25
|
+
.map((name) => locationByName.get(name))
|
|
26
|
+
.filter((l) => Boolean(l) && l !== location)),
|
|
27
|
+
];
|
|
28
|
+
}
|
|
29
|
+
catch (_d) {
|
|
30
|
+
return [];
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* patch files referenced by `patchedDependencies` (pnpm-workspace.yaml
|
|
35
|
+
* or the root package.json's `pnpm` section) — they must travel into
|
|
36
|
+
* the docker build context, or the prod install fails to verify them
|
|
37
|
+
*/
|
|
38
|
+
const getPnpmPatchFiles = (root = ".") => {
|
|
39
|
+
var _a, _b, _c;
|
|
40
|
+
const patchedDependencies = {};
|
|
41
|
+
try {
|
|
42
|
+
const ws = (0, yaml_1.parse)((0, fs_1.readFileSync)((0, path_1.join)(root, "pnpm-workspace.yaml"), "utf-8"));
|
|
43
|
+
Object.assign(patchedDependencies, (_a = ws === null || ws === void 0 ? void 0 : ws.patchedDependencies) !== null && _a !== void 0 ? _a : {});
|
|
44
|
+
}
|
|
45
|
+
catch (_d) {
|
|
46
|
+
// no workspace file
|
|
47
|
+
}
|
|
48
|
+
try {
|
|
49
|
+
const pkg = JSON.parse((0, fs_1.readFileSync)((0, path_1.join)(root, "package.json"), "utf-8"));
|
|
50
|
+
Object.assign(patchedDependencies, (_c = (_b = pkg === null || pkg === void 0 ? void 0 : pkg.pnpm) === null || _b === void 0 ? void 0 : _b.patchedDependencies) !== null && _c !== void 0 ? _c : {});
|
|
51
|
+
}
|
|
52
|
+
catch (_e) {
|
|
53
|
+
// no package.json
|
|
54
|
+
}
|
|
55
|
+
return [
|
|
56
|
+
...new Set(Object.values(patchedDependencies)
|
|
57
|
+
.map((p) => (0, path_1.join)(root, p))
|
|
58
|
+
.filter((p) => (0, fs_1.existsSync)(p))),
|
|
59
|
+
];
|
|
60
|
+
};
|
|
61
|
+
exports.getPnpmPatchFiles = getPnpmPatchFiles;
|
|
62
|
+
/**
|
|
63
|
+
* list pnpm workspace projects in the same shape yarn berry reports them
|
|
64
|
+
* (locations relative to the project root, workspace dependencies as
|
|
65
|
+
* locations). Outside a pnpm workspace this returns [].
|
|
66
|
+
*/
|
|
67
|
+
// export for mocking
|
|
68
|
+
exports.getPnpmWorkspaces = (0, memoizee_1.default)(async () => {
|
|
69
|
+
let output;
|
|
70
|
+
try {
|
|
71
|
+
output = (await (0, child_process_promise_1.exec)("pnpm m ls --json --depth -1")).stdout;
|
|
72
|
+
}
|
|
73
|
+
catch (_a) {
|
|
74
|
+
return [];
|
|
75
|
+
}
|
|
76
|
+
const projects = (0, jsonParse_1.jsonParseOrThrow)(output.trim() || "[]");
|
|
77
|
+
if (!Array.isArray(projects))
|
|
78
|
+
return [];
|
|
79
|
+
const withLocations = projects
|
|
80
|
+
.filter((p) => p.name && p.path)
|
|
81
|
+
.map((p) => ({
|
|
82
|
+
name: p.name,
|
|
83
|
+
location: (0, path_1.relative)(process.cwd(), p.path) || ".",
|
|
84
|
+
}));
|
|
85
|
+
const locationByName = new Map(withLocations.map((p) => [p.name, p.location]));
|
|
86
|
+
return Promise.all(withLocations.map(async ({ name, location }) => ({
|
|
87
|
+
name,
|
|
88
|
+
location,
|
|
89
|
+
workspaceDependencies: await readWorkspaceDependencyLocations(location, locationByName),
|
|
90
|
+
mismatchedWorkspaceDependencies: [],
|
|
91
|
+
})));
|
|
92
|
+
}, { promise: true });
|
|
93
|
+
//# sourceMappingURL=pnpmUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pnpmUtils.js","sourceRoot":"","sources":["../../../../../../../../packages/pipeline/src/pipeline/pnpm/pnpmUtils.ts"],"names":[],"mappings":";;;;;;AAAA,iEAA6C;AAC7C,2BAA8C;AAC9C,0CAAuC;AACvC,+BAAsC;AACtC,wDAAgC;AAChC,+BAA6B;AAE7B,qDAAyD;AAQzD,MAAM,gCAAgC,GAAG,KAAK,EAC5C,QAAgB,EAChB,cAAmC,EAChB,EAAE;;IACrB,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CACpB,MAAM,IAAA,mBAAQ,EAAC,IAAA,WAAI,EAAC,QAAQ,EAAE,cAAc,CAAC,EAAE,OAAO,CAAC,CACxD,CAAC;QACF,MAAM,QAAQ,GAAG;YACf,GAAG,MAAM,CAAC,IAAI,CAAC,MAAA,GAAG,CAAC,YAAY,mCAAI,EAAE,CAAC;YACtC,GAAG,MAAM,CAAC,IAAI,CAAC,MAAA,GAAG,CAAC,eAAe,mCAAI,EAAE,CAAC;YACzC,GAAG,MAAM,CAAC,IAAI,CAAC,MAAA,GAAG,CAAC,oBAAoB,mCAAI,EAAE,CAAC;SAC/C,CAAC;QACF,OAAO;YACL,GAAG,IAAI,GAAG,CACR,QAAQ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KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC;QAC/C,IAAI;QACJ,QAAQ;QACR,qBAAqB,EAAE,MAAM,gCAAgC,CAC3D,QAAQ,EACR,cAAc,CACf;QACD,+BAA+B,EAAE,EAAE;KACpC,CAAC,CAAC,CACJ,CAAC;AACJ,CAAC,EACD,EAAE,OAAO,EAAE,IAAI,EAAE,CAClB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { BuildConfig } from "../build/types";
|
|
2
2
|
import type { DeployConfig } from "../deploy/types";
|
|
3
3
|
import type { CatladderJobSpec } from "./jobs";
|
|
4
|
-
import type { ComponentContext } from "./context";
|
|
4
|
+
import type { ComponentContext, PackageManagerType } from "./context";
|
|
5
5
|
import type { PartialDeep } from "./utils";
|
|
6
6
|
import type { PipelineType, WorkspaceBuildConfig } from "..";
|
|
7
7
|
import type { AgentConfig } from "./agent";
|
|
@@ -255,6 +255,13 @@ export type Config<C extends ConfigProps = never> = {
|
|
|
255
255
|
* how secrets are stored and shared (see {@link SecretsConfig})
|
|
256
256
|
*/
|
|
257
257
|
secrets?: SecretsConfig;
|
|
258
|
+
/**
|
|
259
|
+
* which package manager the project uses. Usually not needed:
|
|
260
|
+
* catladder autodetects it from the `packageManager` field in
|
|
261
|
+
* package.json or the lockfile present (pnpm-lock.yaml / yarn.lock),
|
|
262
|
+
* falling back to yarn. Set it to override the detection.
|
|
263
|
+
*/
|
|
264
|
+
packageManager?: PackageManagerType;
|
|
258
265
|
/**
|
|
259
266
|
* materialize the agent skills shipped with catladder (usage guides
|
|
260
267
|
* for AI coding agents like Claude Code) into the repository, so
|
|
@@ -45,23 +45,31 @@ export type YarnWorkspace = {
|
|
|
45
45
|
workspaceDependencies: string[];
|
|
46
46
|
mismatchedWorkspaceDependencies: string[];
|
|
47
47
|
};
|
|
48
|
+
export type PackageManagerType = "yarn" | "pnpm";
|
|
48
49
|
export type YarnPackageManagerInfoBase = {
|
|
49
50
|
type: "yarn";
|
|
50
51
|
version: string;
|
|
51
52
|
workspaces: YarnWorkspace[];
|
|
52
53
|
isClassic: boolean;
|
|
53
54
|
};
|
|
54
|
-
export type
|
|
55
|
+
export type PnpmPackageManagerInfoBase = {
|
|
56
|
+
type: "pnpm";
|
|
57
|
+
version: string;
|
|
58
|
+
workspaces: YarnWorkspace[];
|
|
59
|
+
};
|
|
60
|
+
type PackageManagerInfoComponentPart = {
|
|
55
61
|
currentWorkspace?: YarnWorkspace;
|
|
56
62
|
componentIsInWorkspace: boolean;
|
|
57
63
|
pathsToCopyInDocker: string[];
|
|
58
64
|
currentWorkspaceDependencies: string[];
|
|
59
65
|
};
|
|
60
|
-
export type
|
|
66
|
+
export type YarnPackageManagerInfoComponent = YarnPackageManagerInfoBase & PackageManagerInfoComponentPart;
|
|
67
|
+
export type PnpmPackageManagerInfoComponent = PnpmPackageManagerInfoBase & PackageManagerInfoComponentPart;
|
|
68
|
+
export type PackageManagerInfoComponent = YarnPackageManagerInfoComponent | PnpmPackageManagerInfoComponent;
|
|
61
69
|
/**
|
|
62
70
|
* not confuse with yarn workspaces
|
|
63
71
|
*/
|
|
64
|
-
export type PackageManagerInfoBase = YarnPackageManagerInfoBase;
|
|
72
|
+
export type PackageManagerInfoBase = YarnPackageManagerInfoBase | PnpmPackageManagerInfoBase;
|
|
65
73
|
export type ContextBeforeConfig = {
|
|
66
74
|
componentName: string;
|
|
67
75
|
fullConfig: Config;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../../../../../packages/pipeline/src/types/context.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../../../../../packages/pipeline/src/types/context.ts"],"names":[],"mappings":";;;AAiNO,MAAM,iCAAiC,GAAG,CAC/C,OAAgD,EACK,EAAE;IACvD,OAAO,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,YAAY,CAAC;AAC7C,CAAC,CAAC;AAJW,QAAA,iCAAiC,qCAI5C;AAEK,MAAM,iCAAiC,GAAG,CAC/C,OAAgD,EACQ,EAAE;IAC1D,OAAO,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,eAAe,CAAC;AAChD,CAAC,CAAC;AAJW,QAAA,iCAAiC,qCAI5C"}
|
|
@@ -4,7 +4,7 @@ exports.createVerifyJobs = exports.VERIFY_JOB_NAME = void 0;
|
|
|
4
4
|
const createArtifactsConfig_1 = require("../build/base/createArtifactsConfig");
|
|
5
5
|
const cache_1 = require("../build/node/cache");
|
|
6
6
|
const constants_1 = require("../build/node/constants");
|
|
7
|
-
const
|
|
7
|
+
const packageManagerInstall_1 = require("../build/node/packageManagerInstall");
|
|
8
8
|
const deploy_1 = require("../deploy");
|
|
9
9
|
const runner_1 = require("../runner");
|
|
10
10
|
const utils_1 = require("../utils");
|
|
@@ -21,9 +21,9 @@ const createVerifyJobs = async (context) => {
|
|
|
21
21
|
return [];
|
|
22
22
|
}
|
|
23
23
|
const isNodeBuild = context.build.type !== "disabled" && context.build.buildType === "node";
|
|
24
|
-
const [
|
|
24
|
+
const [packageManagerInstall, nodeCache] = isNodeBuild
|
|
25
25
|
? await Promise.all([
|
|
26
|
-
(0,
|
|
26
|
+
(0, packageManagerInstall_1.getPackageManagerInstall)(context),
|
|
27
27
|
(0, cache_1.getNodeCache)(context, "pull"),
|
|
28
28
|
])
|
|
29
29
|
: [null, null];
|
|
@@ -59,9 +59,9 @@ const createVerifyJobs = async (context) => {
|
|
|
59
59
|
},
|
|
60
60
|
script: [
|
|
61
61
|
...setupScript,
|
|
62
|
-
...(
|
|
62
|
+
...(packageManagerInstall ? (0, packageManagerInstall_1.ensureNodeVersion)(context) : []),
|
|
63
63
|
`cd ${context.build.dir}`,
|
|
64
|
-
...(
|
|
64
|
+
...(packageManagerInstall !== null && packageManagerInstall !== void 0 ? packageManagerInstall : []),
|
|
65
65
|
...(0, utils_1.ensureArray)(verifyConfig.command),
|
|
66
66
|
],
|
|
67
67
|
allow_failure: verifyConfig.allowFailure,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createVerifyJobs.js","sourceRoot":"","sources":["../../../../../../../packages/pipeline/src/verify/createVerifyJobs.ts"],"names":[],"mappings":";;;AAAA,+EAA4E;AAC5E,+CAAmD;AACnD,uDAAsE;AACtE
|
|
1
|
+
{"version":3,"file":"createVerifyJobs.js","sourceRoot":"","sources":["../../../../../../../packages/pipeline/src/verify/createVerifyJobs.ts"],"names":[],"mappings":";;;AAAA,+EAA4E;AAC5E,+CAAmD;AACnD,uDAAsE;AACtE,+EAG6C;AAC7C,sCAAyC;AACzC,sCAA2C;AAG3C,oCAAuC;AAE1B,QAAA,eAAe,GAAG,WAAW,CAAC;AAEpC,MAAM,gBAAgB,GAAG,KAAK,EACnC,OAAyB,EACA,EAAE;;IAC3B,MAAM,YAAY,GAAG,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC;IACpD,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,YAAY,GAAG,MAAA,OAAO,CAAC,MAAM,0CAAE,MAAM,CAAC;IAC5C,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,qDAAqD;QACrD,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,WAAW,GACf,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,UAAU,IAAI,OAAO,CAAC,KAAK,CAAC,SAAS,KAAK,MAAM,CAAC;IAE1E,MAAM,CAAC,qBAAqB,EAAE,SAAS,CAAC,GAAG,WAAW;QACpD,CAAC,CAAC,MAAM,OAAO,CAAC,GAAG,CAAC;YAChB,IAAA,gDAAwB,EAAC,OAAO,CAAC;YACjC,IAAA,oBAAY,EAAC,OAAO,EAAE,MAAM,CAAC;SAC9B,CAAC;QACJ,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAEjB,MAAM,WAAW,GACf,MAAA,MAAA,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AAW,EAAC,YAAY,CAAC,OAAO,CAAC;aACrC;YACD,aAAa,EAAE,YAAY,CAAC,YAAY;YACxC,GAAG,IAAA,6CAAqB,EACtB,OAAO,CAAC,KAAK,CAAC,GAAG,EACjB,YAAY,CAAC,gBAAgB,EAC7B,YAAY,CAAC,SAAS,CACvB;SACF;KACF,CAAC;AACJ,CAAC,CAAC;AAvEW,QAAA,gBAAgB,oBAuE3B"}
|
|
@@ -35,10 +35,17 @@ FROM node:$NODE_VERSION-alpine
|
|
|
35
35
|
$DOCKERFILE_ADDITIONS
|
|
36
36
|
|
|
37
37
|
RUN apk add --no-cache git curl
|
|
38
|
-
|
|
38
|
+
# package-manager setup (e.g. installing pnpm globally) and the
|
|
39
|
+
# workspace-file copy run as root: pnpm ADDs a tar whose extracted
|
|
40
|
+
# parent dirs come out root-owned (ADD --chown only covers the files),
|
|
41
|
+
# so it needs a root chown before the node user can write node_modules.
|
|
42
|
+
# The actual install below still runs as the unprivileged node user.
|
|
43
|
+
$DOCKER_SETUP_PACKAGE_MANAGER
|
|
39
44
|
|
|
40
45
|
$DOCKER_COPY_WORKSPACE_FILES
|
|
41
46
|
|
|
47
|
+
USER node
|
|
48
|
+
|
|
42
49
|
WORKDIR /app/$APP_DIR
|
|
43
50
|
|
|
44
51
|
$DOCKER_COPY_AND_INSTALL_APP
|
|
@@ -9,6 +9,10 @@ RUN rm /bin/sh && \
|
|
|
9
9
|
# set high timeout for yarn, see https://github.com/dhis2/notes/issues/29
|
|
10
10
|
RUN yarn config set network-timeout 600000 -g
|
|
11
11
|
|
|
12
|
+
# pnpm for projects using it (pnpm self-switches to the version pinned
|
|
13
|
+
# in the project's packageManager field)
|
|
14
|
+
RUN npm install -g pnpm
|
|
15
|
+
|
|
12
16
|
# install nvm && some common node versions
|
|
13
17
|
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash && \
|
|
14
18
|
source /root/.nvm/nvm.sh && \
|
|
@@ -28,11 +28,26 @@ components: {
|
|
|
28
28
|
Set `build: false` to disable building for a component (e.g. a
|
|
29
29
|
deploy-only or docker-tag component).
|
|
30
30
|
|
|
31
|
+
Node-family builds work with **yarn or pnpm**: catladder autodetects the
|
|
32
|
+
package manager (from the `packageManager` field in package.json or the
|
|
33
|
+
lockfile) and generates the matching install commands, caches and
|
|
34
|
+
default build/lint/test commands. Override with `packageManager:
|
|
35
|
+
"pnpm" | "yarn"` at the top level of `catladder.ts` if needed. The
|
|
36
|
+
`meteor` build type is yarn-only.
|
|
37
|
+
|
|
38
|
+
pnpm gotchas: dependency build scripts must be approved in
|
|
39
|
+
pnpm-workspace.yaml (`allowBuilds` map since pnpm 11,
|
|
40
|
+
`onlyBuiltDependencies` list on pnpm 10); pnpm runs the root
|
|
41
|
+
`prepare` script even during the production install in the docker
|
|
42
|
+
build — guard husky with `"prepare": "husky || true"`; `pnpm run`
|
|
43
|
+
prints a banner to stdout, so use `pnpm --silent run` in piped
|
|
44
|
+
commands.
|
|
45
|
+
|
|
31
46
|
## Build types
|
|
32
47
|
|
|
33
48
|
| Type | Use for | Notes |
|
|
34
49
|
|---|---|---|
|
|
35
|
-
| `node` | Node/JS apps (Next.js, Vite, plain node) | default
|
|
50
|
+
| `node` | Node/JS apps (Next.js, Vite, plain node) | default `<pm> build` + `<pm> start` (yarn or pnpm, autodetected); `docker` selects the runtime image |
|
|
36
51
|
| `rails` | Ruby on Rails apps | Cloud Native Buildpacks when there is no `Dockerfile`; Postgres test DB |
|
|
37
52
|
| `meteor` | Meteor apps | starts `node main.js` |
|
|
38
53
|
| `custom` | anything else | you provide the `jobImage` and `docker` config (both required) |
|
|
@@ -46,8 +61,9 @@ type: `build: { from: "web" }` (see workspace builds below).
|
|
|
46
61
|
- `buildCommand` — the build step (`string | string[] | null | false`;
|
|
47
62
|
`false`/`null` skips building).
|
|
48
63
|
- `startCommand` — how the app is started at runtime.
|
|
49
|
-
- `postInstall` — commands run after
|
|
50
|
-
e.g. for Yarn PnP where `package.json` postinstall
|
|
64
|
+
- `postInstall` — commands run after the package-manager install (node
|
|
65
|
+
family; needed e.g. for Yarn PnP where `package.json` postinstall
|
|
66
|
+
won't run).
|
|
51
67
|
- `lint` / `test` / `audit` — customize (`{ command, jobImage, … }`) or
|
|
52
68
|
set to `false` to disable that job.
|
|
53
69
|
- `artifactsPaths` / `artifactsExcludePaths` — extra build artifacts
|
|
@@ -10,7 +10,7 @@ generated pipeline files.
|
|
|
10
10
|
|---|---|---|
|
|
11
11
|
| `buildCommand` | `string \| string[] \| null \| false` | build step; `false`/`null` skips it |
|
|
12
12
|
| `startCommand` | `string` | runtime start command |
|
|
13
|
-
| `postInstall` | `string \| string[]` | runs after
|
|
13
|
+
| `postInstall` | `string \| string[]` | runs after the package-manager install (node family) |
|
|
14
14
|
| `lint` / `test` / `audit` | `false \| TestJobCustom` | customize or disable the job |
|
|
15
15
|
| `artifactsPaths` | `string[]` | extra artifacts (`dist`, `.next` always included) |
|
|
16
16
|
| `artifactsExcludePaths` | `string[]` | artifact excludes |
|
|
@@ -29,8 +29,9 @@ generated pipeline files.
|
|
|
29
29
|
## Per-type options & defaults
|
|
30
30
|
|
|
31
31
|
### `node`
|
|
32
|
-
-
|
|
33
|
-
-
|
|
32
|
+
- Works with yarn **and pnpm** — the package manager is autodetected (`packageManager` field / lockfile), overridable via top-level `packageManager: "pnpm" | "yarn"` in `catladder.ts`.
|
|
33
|
+
- `docker?` — built-in node image `{ type: "node", yarnRebuildEnabled?: boolean (default true, yarn berry only), additionsBegin?: string[], additionsEnd?: string[] }`, or a custom docker config.
|
|
34
|
+
- Defaults: `buildCommand: "<pm> build"`, `startCommand: "<pm> start"` (`yarn`/`pnpm` per detection), artifacts `["dist", ".next"]`, excludes `[".next/cache/**/*"]`.
|
|
34
35
|
|
|
35
36
|
### `rails`
|
|
36
37
|
- `test?.databaseImage?` — test DB container image (Postgres only; default `docker.io/postgres:latest`).
|
|
@@ -41,6 +42,7 @@ generated pipeline files.
|
|
|
41
42
|
- `buildVars?: Record<string, string | undefined>` — Bundler / Rails asset-precompile vars (`undefined` inherits from the component's env vars).
|
|
42
43
|
|
|
43
44
|
### `meteor`
|
|
45
|
+
- Yarn-only (meteor's bundler is yarn-based) — a pnpm project cannot use this build type.
|
|
44
46
|
- `installScripts?: boolean` — run `yarn install` inside the source folder in the image (only needed with custom image scripts).
|
|
45
47
|
- `docker?` — meteor built-in or custom. Default `startCommand: "node main.js"`.
|
|
46
48
|
|
|
@@ -68,5 +70,5 @@ defaulted `buildCommand: "yarn build-storybook --quiet -o ./dist"`.
|
|
|
68
70
|
Top-level `builds: Record<string, WorkspaceBuildConfig>`. Only
|
|
69
71
|
`type: "node"` is supported.
|
|
70
72
|
|
|
71
|
-
- Node workspace build: `dir?`, `buildCommand?` (default
|
|
73
|
+
- Node workspace build: `dir?`, `buildCommand?` (default `<pm> build`), `dockerDefaults?: { yarnRebuildEnabled }`, plus shared `lint?` (default `{ command: "<pm> lint" }`), `test?` (default `{ command: "<pm> test" }`), `audit?`, `runnerVariables?`, `artifactsReports?`, `jobImage?`, `jobTags?`, `cache?` (`<pm>` = `yarn`/`pnpm` per detection).
|
|
72
74
|
- A component references it via `build: { from: "<name>", docker?, startCommand?, artifactsPaths?, artifactsExcludePaths?, cache? }` — the per-component overrides layer on top of the shared build.
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
<!-- rendered from the command definitions by
|
|
4
4
|
apps/cli/src/scripts/generateCliSkillReference.ts — do not edit -->
|
|
5
5
|
|
|
6
|
-
All commands run non-interactively as `yarn catladder <command>
|
|
7
|
-
see SKILL.md for how to
|
|
6
|
+
All commands run non-interactively as `yarn catladder <command> ...`
|
|
7
|
+
(`pnpm catladder ...` in pnpm projects); see SKILL.md for how to
|
|
8
|
+
pass inputs.
|
|
8
9
|
|
|
9
10
|
## `catladder cloudsql restore-db`
|
|
10
11
|
|
|
@@ -64,6 +64,11 @@ Key concepts:
|
|
|
64
64
|
- **Pipelines**: `pipelines: { gitlab: true, github: true }` selects
|
|
65
65
|
which CI systems get generated files. Options objects instead of
|
|
66
66
|
`true` allow per-pipeline settings (e.g. `runnerVariables`).
|
|
67
|
+
- **Package manager**: yarn and pnpm are supported and autodetected
|
|
68
|
+
(from the `packageManager` field in package.json or the lockfile;
|
|
69
|
+
yarn is the fallback). `packageManager: "pnpm" | "yarn"` at the top
|
|
70
|
+
level overrides the detection. In pnpm projects, run the CLIs as
|
|
71
|
+
`pnpm catenv` / `pnpm catladder`.
|
|
67
72
|
|
|
68
73
|
## Common tasks
|
|
69
74
|
|
|
@@ -61,7 +61,7 @@ resources with `yarn catladder project setup`; detect drift with
|
|
|
61
61
|
- `type: "pages"` — **required**. Publishes a static site on gitlab pages (not yet supported on the github backend).
|
|
62
62
|
- `script: string[]` — **required**; produces the site.
|
|
63
63
|
- `publishDir?: string` — output directory relative to the repo root, default `"public"`.
|
|
64
|
-
- `
|
|
64
|
+
- `requiresInstall?: boolean` — run the package-manager install (yarn/pnpm) first (`requiresYarnInstall` is a deprecated alias).
|
|
65
65
|
- `jobImage?: GitlabJobImage`; also accepts `cache`.
|
|
66
66
|
- Review envs publish under an `mr-<iid>` path prefix (parallel deployments → MR previews; exposed as `$PAGES_PREFIX`); other envs publish at the root. The environment url is the published pages url.
|
|
67
67
|
- Defaults to `allowFailure: true`.
|
|
@@ -75,7 +75,7 @@ resources with `yarn catladder project setup`; detect drift with
|
|
|
75
75
|
- `type: "custom"` — **required**.
|
|
76
76
|
- `requiresDocker: boolean` — **required**; whether the deploy needs a built Docker image.
|
|
77
77
|
- `script: string[]` — **required**; the deploy script.
|
|
78
|
-
- `
|
|
78
|
+
- `requiresInstall?: boolean` — whether the script needs the package-manager install (`requiresYarnInstall` is a deprecated alias).
|
|
79
79
|
- `stopScript?: string[]` — script to stop/tear down the environment.
|
|
80
80
|
- `jobImage?: GitlabJobImage`.
|
|
81
81
|
- Also accepts `cache` (via `WithCacheConfig`).
|
|
@@ -39,7 +39,9 @@ edit.
|
|
|
39
39
|
## Caching
|
|
40
40
|
|
|
41
41
|
Cache configuration is generated per build type; node builds cache
|
|
42
|
-
`node_modules` and the
|
|
42
|
+
`node_modules` and the package manager's download cache (the `.yarn`
|
|
43
|
+
zip cache, or for pnpm projects a project-local `.pnpm-store`). GitLab
|
|
44
|
+
uses mutable caches with
|
|
43
45
|
fallback keys (review branches fall back to the dev cache); GitHub uses
|
|
44
46
|
immutable lockfile-keyed caches where only the build job writes.
|
|
45
47
|
Caching behavior is changed via the build config in `catladder.ts`,
|