@catladder/cli 0.0.0-next-d71e41ba → 0.0.0-next-dccc0a36
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 +790 -272
- package/dist/bundles/cli/index.js +790 -272
- 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 +68 -5
- package/dist/bundles/skills/catladder-builds/references/build-types.md +8 -6
- 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 +16 -4
- package/dist/packages/pipeline/src/backends/github/GithubBackend.js +4 -4
- package/dist/packages/pipeline/src/backends/github/GithubBackend.js.map +1 -1
- package/dist/packages/pipeline/src/backends/gitlab/GitlabBackend.js +4 -4
- package/dist/packages/pipeline/src/backends/gitlab/GitlabBackend.js.map +1 -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/build/types.d.ts +6 -5
- package/dist/packages/pipeline/src/build/types.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/customImages/hash.d.ts +9 -0
- package/dist/packages/pipeline/src/customImages/hash.js +41 -16
- package/dist/packages/pipeline/src/customImages/hash.js.map +1 -1
- package/dist/packages/pipeline/src/customImages/jobImagesPlan.d.ts +23 -5
- package/dist/packages/pipeline/src/customImages/jobImagesPlan.js +177 -43
- package/dist/packages/pipeline/src/customImages/jobImagesPlan.js.map +1 -1
- package/dist/packages/pipeline/src/customImages/projectImages.d.ts +67 -0
- package/dist/packages/pipeline/src/customImages/projectImages.js +9 -0
- package/dist/packages/pipeline/src/customImages/projectImages.js.map +1 -0
- 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 +9 -3
- package/dist/packages/pipeline/src/deploy/types/index.d.ts +4 -4
- package/dist/packages/pipeline/src/deploy/types/pages.d.ts +9 -3
- package/dist/packages/pipeline/src/index.d.ts +2 -0
- package/dist/packages/pipeline/src/index.js +2 -0
- package/dist/packages/pipeline/src/index.js.map +1 -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 +16 -1
- package/dist/packages/pipeline/src/types/config.js.map +1 -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/types/jobs.d.ts +2 -1
- package/dist/packages/pipeline/src/types/jobs.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 +68 -5
- package/dist/skills/catladder-builds/references/build-types.md +8 -6
- 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 +16 -4
- 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
|
@@ -14,6 +14,7 @@ const createComponentContext = async (ctx) => {
|
|
|
14
14
|
throw new Error("componentName may only contain lower case letters, numbers and -");
|
|
15
15
|
}
|
|
16
16
|
const packageManagerInfoPromise = (0, packageManager_1.getPackageManagerInfoForComponent)(ctx.config, ctx.componentName);
|
|
17
|
+
const { type: packageManagerType } = await packageManagerInfoPromise;
|
|
17
18
|
const envContext = (0, getEnvironmentContext_1.getEnvironmentContext)(ctx);
|
|
18
19
|
const componentConfigWithoutDefaults = envContext.envConfigRaw;
|
|
19
20
|
const resolvedBuildType = componentConfigWithoutDefaults.build === false
|
|
@@ -27,12 +28,12 @@ const createComponentContext = async (ctx) => {
|
|
|
27
28
|
const defaults = componentConfigWithoutDefaults.deploy
|
|
28
29
|
? {
|
|
29
30
|
build: resolvedBuildType &&
|
|
30
|
-
build_1.BUILD_TYPES[resolvedBuildType].defaults(envContext),
|
|
31
|
+
build_1.BUILD_TYPES[resolvedBuildType].defaults(envContext, packageManagerType),
|
|
31
32
|
deploy: deploy_1.DEPLOY_TYPES[componentConfigWithoutDefaults.deploy.type].defaults(envContext),
|
|
32
33
|
}
|
|
33
34
|
: {
|
|
34
35
|
build: resolvedBuildType &&
|
|
35
|
-
build_1.BUILD_TYPES[resolvedBuildType].defaults(envContext),
|
|
36
|
+
build_1.BUILD_TYPES[resolvedBuildType].defaults(envContext, packageManagerType),
|
|
36
37
|
deploy: {},
|
|
37
38
|
};
|
|
38
39
|
const componentConfig = (0, utils_1.mergeWithMergingArrays)(defaults, componentConfigWithoutDefaults);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createComponentContext.js","sourceRoot":"","sources":["../../../../../../../packages/pipeline/src/context/createComponentContext.ts"],"names":[],"mappings":";;;AAAA,yCAAuC;AACvC,oCAAgE;AAEhE,sCAAyC;AAEzC,+DAA+E;AAS/E,oCAAkD;AAClD,qDAAkD;AAClD,mEAAgE;AAUzD,MAAM,sBAAsB,GAAG,KAAK,EACzC,GAAkC,EACP,EAAE;;IAC7B,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC;QAC5C,MAAM,IAAI,KAAK,CACb,kEAAkE,CACnE,CAAC;IACJ,CAAC;IAED,MAAM,yBAAyB,GAAG,IAAA,kDAAiC,EACjE,GAAG,CAAC,MAAM,EACV,GAAG,CAAC,aAAa,CAClB,CAAC;
|
|
1
|
+
{"version":3,"file":"createComponentContext.js","sourceRoot":"","sources":["../../../../../../../packages/pipeline/src/context/createComponentContext.ts"],"names":[],"mappings":";;;AAAA,yCAAuC;AACvC,oCAAgE;AAEhE,sCAAyC;AAEzC,+DAA+E;AAS/E,oCAAkD;AAClD,qDAAkD;AAClD,mEAAgE;AAUzD,MAAM,sBAAsB,GAAG,KAAK,EACzC,GAAkC,EACP,EAAE;;IAC7B,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC;QAC5C,MAAM,IAAI,KAAK,CACb,kEAAkE,CACnE,CAAC;IACJ,CAAC;IAED,MAAM,yBAAyB,GAAG,IAAA,kDAAiC,EACjE,GAAG,CAAC,MAAM,EACV,GAAG,CAAC,aAAa,CAClB,CAAC;IACF,MAAM,EAAE,IAAI,EAAE,kBAAkB,EAAE,GAAG,MAAM,yBAAyB,CAAC;IAErE,MAAM,UAAU,GAAG,IAAA,6CAAqB,EAAC,GAAG,CAAC,CAAC;IAE9C,MAAM,8BAA8B,GAAG,UAAU,CAAC,YAAY,CAAC;IAE/D,MAAM,iBAAiB,GACrB,8BAA8B,CAAC,KAAK,KAAK,KAAK;QAC5C,CAAC,CAAC,KAAK;QACP,CAAC,CAAC,IAAA,+BAAuB,EAAC,8BAA8B,CAAC,KAAK,CAAC;YAC7D,CAAC,CAAC,8BAA8B,CAAC,KAAK,CAAC,IAAI;YAC3C,CAAC,CAAC,MAAA,GAAG,CAAC,MAAM,CAA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C,CAAC,UAAU,CAAC,OAAO,CAAC;QACrB,CAAC,CAAC,UAAU,CAAC;IACf,OAAO;QACL,GAAG,OAAO;QACV,UAAU,EAAE,kBAAkB;KAC/B,CAAC;AACJ,CAAC,CAAC;AAhIW,QAAA,sBAAsB,0BAgIjC"}
|
|
@@ -11,7 +11,8 @@ async function createWorkspaceContext({ env, components, workspaceName, config,
|
|
|
11
11
|
if (!workspaceConfigRaw) {
|
|
12
12
|
throw new Error(`Workspace ${workspaceName} not found in config`);
|
|
13
13
|
}
|
|
14
|
-
const
|
|
14
|
+
const packageManagerInfo = (0, packageManager_1.getPackageManagerInfoBase)(config);
|
|
15
|
+
const defaults = __1.WORKSPACE_BUILD_TYPES[workspaceConfigRaw.type].defaults((await packageManagerInfo).type);
|
|
15
16
|
const workspaceConfig = (0, utils_1.mergeWithMergingArrays)(defaults, workspaceConfigRaw);
|
|
16
17
|
return {
|
|
17
18
|
name: workspaceName,
|
|
@@ -22,7 +23,7 @@ async function createWorkspaceContext({ env, components, workspaceName, config,
|
|
|
22
23
|
env,
|
|
23
24
|
components,
|
|
24
25
|
fullConfig: config,
|
|
25
|
-
packageManagerInfo
|
|
26
|
+
packageManagerInfo,
|
|
26
27
|
build: {
|
|
27
28
|
type: "workspace",
|
|
28
29
|
dir: (_b = workspaceConfig.dir) !== null && _b !== void 0 ? _b : ".",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createWorkspaceContext.js","sourceRoot":"","sources":["../../../../../../../packages/pipeline/src/context/createWorkspaceContext.ts"],"names":[],"mappings":";;;AAAA,0BAMY;AACZ,+DAAuE;AACvE,oCAAkD;AAClD,yCAAiC;AAE1B,KAAK,UAAU,sBAAsB,CAAC,EAC3C,GAAG,EACH,UAAU,EACV,aAAa,EACb,MAAM,EACN,YAAY,EACZ,OAAO,GAQR;;IACC,MAAM,kBAAkB,GAAG,MAAA,MAAM,CAAC,MAAM,0CAAG,aAAa,CAAC,CAAC;IAC1D,IAAI,CAAC,kBAAkB,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,aAAa,aAAa,sBAAsB,CAAC,CAAC;IACpE,CAAC;IAED,MAAM,QAAQ,GAAG,yBAAqB,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,QAAQ,
|
|
1
|
+
{"version":3,"file":"createWorkspaceContext.js","sourceRoot":"","sources":["../../../../../../../packages/pipeline/src/context/createWorkspaceContext.ts"],"names":[],"mappings":";;;AAAA,0BAMY;AACZ,+DAAuE;AACvE,oCAAkD;AAClD,yCAAiC;AAE1B,KAAK,UAAU,sBAAsB,CAAC,EAC3C,GAAG,EACH,UAAU,EACV,aAAa,EACb,MAAM,EACN,YAAY,EACZ,OAAO,GAQR;;IACC,MAAM,kBAAkB,GAAG,MAAA,MAAM,CAAC,MAAM,0CAAG,aAAa,CAAC,CAAC;IAC1D,IAAI,CAAC,kBAAkB,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,aAAa,aAAa,sBAAsB,CAAC,CAAC;IACpE,CAAC;IAED,MAAM,kBAAkB,GAAG,IAAA,0CAAyB,EAAC,MAAM,CAAC,CAAC;IAC7D,MAAM,QAAQ,GAAG,yBAAqB,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,QAAQ,CACtE,CAAC,MAAM,kBAAkB,CAAC,CAAC,IAAI,CAChC,CAAC;IAEF,MAAM,eAAe,GAAG,IAAA,8BAAsB,EAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC;IAC7E,OAAO;QACL,IAAI,EAAE,aAAa;QACnB,YAAY;QACZ,OAAO;QACP,IAAI,EAAE,WAAW;QAEjB,eAAe;QAEf,GAAG;QACH,UAAU;QACV,UAAU,EAAE,MAAM;QAClB,kBAAkB;QAClB,KAAK,EAAE;YACL,IAAI,EAAE,WAAW;YACjB,GAAG,EAAE,MAAA,eAAe,CAAC,GAAG,mCAAI,GAAG;YAC/B,gBAAgB,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAC/B,IAAA,gBAAI,EACF,CACE,MAAM,OAAO,CAAC,GAAG,CACf,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,CACtD,CACF,CAAC,IAAI,EAAE,CACT;YACH,SAAS,EAAE,eAAe,CAAC,IAAI;YAC/B,MAAM,EAAE,eAAe;SACxB;KACF,CAAC;AACJ,CAAC;AArDD,wDAqDC"}
|
|
@@ -13,3 +13,12 @@ export type CustomImageHashResult = {
|
|
|
13
13
|
watchedPaths: string[];
|
|
14
14
|
};
|
|
15
15
|
export declare function computeCustomImageHash(config: ImageHashConfig): CustomImageHashResult;
|
|
16
|
+
/**
|
|
17
|
+
* the hash of an image defined by an inline Dockerfile: its content
|
|
18
|
+
* stands in for the definition dir. The build context is deliberately
|
|
19
|
+
* NOT hashed (it may be the whole repository) — `hashExtraPaths` is how
|
|
20
|
+
* context files opt into the hash.
|
|
21
|
+
*/
|
|
22
|
+
export declare function computeInlineImageHash(config: Pick<ImageHashConfig, "hashExtraPaths" | "buildArgs"> & {
|
|
23
|
+
dockerfileContent: string;
|
|
24
|
+
}): CustomImageHashResult;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.computeCustomImageHash = void 0;
|
|
3
|
+
exports.computeInlineImageHash = exports.computeCustomImageHash = void 0;
|
|
4
4
|
const crypto_1 = require("crypto");
|
|
5
5
|
const fs_1 = require("fs");
|
|
6
6
|
const path_1 = require("path");
|
|
@@ -21,6 +21,29 @@ function listFilesRecursive(dir) {
|
|
|
21
21
|
})
|
|
22
22
|
.sort();
|
|
23
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* the parts every image definition hashes on top of its content:
|
|
26
|
+
* files outside the definition, and the build args
|
|
27
|
+
*/
|
|
28
|
+
function hashExtras(hash, config) {
|
|
29
|
+
const watchedPaths = [];
|
|
30
|
+
// Hash extra paths (for files outside the dir)
|
|
31
|
+
if (config.hashExtraPaths) {
|
|
32
|
+
// Extra paths are literal file paths (not globs) for simplicity
|
|
33
|
+
const extraFiles = [...config.hashExtraPaths].sort();
|
|
34
|
+
for (const file of extraFiles) {
|
|
35
|
+
hash.update(file);
|
|
36
|
+
hash.update((0, fs_1.readFileSync)(file));
|
|
37
|
+
}
|
|
38
|
+
watchedPaths.push(...config.hashExtraPaths);
|
|
39
|
+
}
|
|
40
|
+
// Hash build args (sorted keys for determinism)
|
|
41
|
+
if (config.buildArgs) {
|
|
42
|
+
const sorted = Object.entries(config.buildArgs).sort(([a], [b]) => a.localeCompare(b));
|
|
43
|
+
hash.update(JSON.stringify(sorted));
|
|
44
|
+
}
|
|
45
|
+
return watchedPaths;
|
|
46
|
+
}
|
|
24
47
|
function computeCustomImageHash(config) {
|
|
25
48
|
var _a;
|
|
26
49
|
const hash = (0, crypto_1.createHash)("sha256");
|
|
@@ -41,25 +64,27 @@ function computeCustomImageHash(config) {
|
|
|
41
64
|
}
|
|
42
65
|
watchedPaths.push(`${extraDir}/**/*`);
|
|
43
66
|
}
|
|
44
|
-
|
|
45
|
-
if (config.hashExtraPaths) {
|
|
46
|
-
// Extra paths are literal file paths (not globs) for simplicity
|
|
47
|
-
const extraFiles = [...config.hashExtraPaths].sort();
|
|
48
|
-
for (const file of extraFiles) {
|
|
49
|
-
hash.update(file);
|
|
50
|
-
hash.update((0, fs_1.readFileSync)(file));
|
|
51
|
-
}
|
|
52
|
-
watchedPaths.push(...config.hashExtraPaths);
|
|
53
|
-
}
|
|
54
|
-
// Hash build args (sorted keys for determinism)
|
|
55
|
-
if (config.buildArgs) {
|
|
56
|
-
const sorted = Object.entries(config.buildArgs).sort(([a], [b]) => a.localeCompare(b));
|
|
57
|
-
hash.update(JSON.stringify(sorted));
|
|
58
|
-
}
|
|
67
|
+
watchedPaths.push(...hashExtras(hash, config));
|
|
59
68
|
return {
|
|
60
69
|
hash: hash.digest("hex").slice(0, 12),
|
|
61
70
|
watchedPaths,
|
|
62
71
|
};
|
|
63
72
|
}
|
|
64
73
|
exports.computeCustomImageHash = computeCustomImageHash;
|
|
74
|
+
/**
|
|
75
|
+
* the hash of an image defined by an inline Dockerfile: its content
|
|
76
|
+
* stands in for the definition dir. The build context is deliberately
|
|
77
|
+
* NOT hashed (it may be the whole repository) — `hashExtraPaths` is how
|
|
78
|
+
* context files opt into the hash.
|
|
79
|
+
*/
|
|
80
|
+
function computeInlineImageHash(config) {
|
|
81
|
+
const hash = (0, crypto_1.createHash)("sha256");
|
|
82
|
+
hash.update(config.dockerfileContent);
|
|
83
|
+
const watchedPaths = hashExtras(hash, config);
|
|
84
|
+
return {
|
|
85
|
+
hash: hash.digest("hex").slice(0, 12),
|
|
86
|
+
watchedPaths,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
exports.computeInlineImageHash = computeInlineImageHash;
|
|
65
90
|
//# sourceMappingURL=hash.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hash.js","sourceRoot":"","sources":["../../../../../../../packages/pipeline/src/customImages/hash.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"hash.js","sourceRoot":"","sources":["../../../../../../../packages/pipeline/src/customImages/hash.ts"],"names":[],"mappings":";;;AACA,mCAAoC;AACpC,2BAAyD;AACzD,+BAAqC;AAiBrC,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC;AAC1D,MAAM,aAAa,GAAG,CAAC,IAAY,EAAE,EAAE,WACrC,OAAA,aAAa,CAAC,GAAG,CAAC,MAAA,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,mCAAI,EAAE,CAAC,CAAA,EAAA,CAAC;AAEjD,SAAS,kBAAkB,CAAC,GAAW;IACrC,MAAM,QAAQ,GAAG,IAAA,cAAO,EAAC,GAAG,CAAC,CAAC;IAC9B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,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;IAE/C,OAAO;QACL,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;QACrC,YAAY;KACb,CAAC;AACJ,CAAC;AA/BD,wDA+BC;AAED;;;;;GAKG;AACH,SAAgB,sBAAsB,CACpC,MAEC;IAED,MAAM,IAAI,GAAG,IAAA,mBAAU,EAAC,QAAQ,CAAC,CAAC;IAClC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;IACtC,MAAM,YAAY,GAAG,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAE9C,OAAO;QACL,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;QACrC,YAAY;KACb,CAAC;AACJ,CAAC;AAbD,wDAaC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { CatladderImageRef } from "../runner";
|
|
2
2
|
import type { GitlabJobImage, PipelineType } from "../types";
|
|
3
3
|
import type { CatladderJob, CatladderJobNeed } from "../types/jobs";
|
|
4
|
+
import type { ProjectImageConfig, ProjectImageRef } from "./projectImages";
|
|
4
5
|
export declare const GENERATED_IMAGES_FOLDER = ".catladder-generated/images";
|
|
5
6
|
export type ResolvedJobImage = {
|
|
6
7
|
/** the concrete image url */
|
|
@@ -14,6 +15,11 @@ export type GeneratedImageFile = {
|
|
|
14
15
|
path: string;
|
|
15
16
|
content: string;
|
|
16
17
|
};
|
|
18
|
+
/**
|
|
19
|
+
* where inline project Dockerfiles are materialized — a subfolder, so a
|
|
20
|
+
* project image can carry the same name as a shipped one
|
|
21
|
+
*/
|
|
22
|
+
export declare const PROJECT_IMAGES_FOLDER = ".catladder-generated/images/project";
|
|
17
23
|
/**
|
|
18
24
|
* plans the catladder job images of one backend run: resolves image
|
|
19
25
|
* references, collects the image build jobs, and the image definitions
|
|
@@ -25,8 +31,10 @@ export type GeneratedImageFile = {
|
|
|
25
31
|
*/
|
|
26
32
|
export declare class JobImagesPlan {
|
|
27
33
|
private readonly pipelineType;
|
|
34
|
+
private readonly projectImages;
|
|
28
35
|
private used;
|
|
29
|
-
|
|
36
|
+
private usedProject;
|
|
37
|
+
constructor(pipelineType: PipelineType, projectImages?: Record<string, ProjectImageConfig>);
|
|
30
38
|
/**
|
|
31
39
|
* resolves a job image (marker or concrete) to a concrete image url
|
|
32
40
|
* plus the build job dependency
|
|
@@ -37,21 +45,31 @@ export declare class JobImagesPlan {
|
|
|
37
45
|
fromRepoRegistry?: boolean;
|
|
38
46
|
};
|
|
39
47
|
resolveRef(ref: CatladderImageRef): ResolvedJobImage;
|
|
48
|
+
resolveProjectRef(ref: ProjectImageRef): ResolvedJobImage;
|
|
40
49
|
/**
|
|
41
50
|
* the registry image prefix. On github, container images can't use
|
|
42
51
|
* runtime env vars — the expression form is required.
|
|
43
52
|
*/
|
|
44
53
|
private registryImageRef;
|
|
54
|
+
private useProject;
|
|
55
|
+
/**
|
|
56
|
+
* the source-dependent half of a project image: an inline Dockerfile
|
|
57
|
+
* is materialized into the generated files and hashed by its content,
|
|
58
|
+
* a directory is hashed and watched in place
|
|
59
|
+
*/
|
|
60
|
+
private planProjectSource;
|
|
45
61
|
private use;
|
|
46
62
|
/**
|
|
47
63
|
* the image build jobs for all used images
|
|
48
64
|
*/
|
|
49
65
|
getEnsureJobs(): CatladderJob[];
|
|
50
|
-
private
|
|
66
|
+
private createImageBuildJob;
|
|
51
67
|
/**
|
|
52
|
-
* the image definitions
|
|
53
|
-
*
|
|
54
|
-
*
|
|
68
|
+
* the image definitions to materialize into the generated files (so
|
|
69
|
+
* pipelines build from committed, reviewable files and gitlab's
|
|
70
|
+
* rules:changes can watch them): the definitions catladder ships and
|
|
71
|
+
* the project's inline Dockerfiles. A project image directory is
|
|
72
|
+
* already committed and contributes nothing.
|
|
55
73
|
*/
|
|
56
74
|
getGeneratedFiles(): GeneratedImageFile[];
|
|
57
75
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.JobImagesPlan = exports.GENERATED_IMAGES_FOLDER = void 0;
|
|
3
|
+
exports.JobImagesPlan = exports.PROJECT_IMAGES_FOLDER = exports.GENERATED_IMAGES_FOLDER = void 0;
|
|
4
4
|
const fs_1 = require("fs");
|
|
5
5
|
const path_1 = require("path");
|
|
6
6
|
const ciVariables_1 = require("../bash/ciVariables");
|
|
@@ -8,6 +8,7 @@ const docker_1 = require("../build/docker");
|
|
|
8
8
|
const runner_1 = require("../runner");
|
|
9
9
|
const gitlab_1 = require("../utils/gitlab");
|
|
10
10
|
const hash_1 = require("./hash");
|
|
11
|
+
const projectImages_1 = require("./projectImages");
|
|
11
12
|
const shippedImages_1 = require("./shippedImages");
|
|
12
13
|
exports.GENERATED_IMAGES_FOLDER = ".catladder-generated/images";
|
|
13
14
|
/**
|
|
@@ -15,7 +16,44 @@ exports.GENERATED_IMAGES_FOLDER = ".catladder-generated/images";
|
|
|
15
16
|
* catladder image, so building images never depends on one (bootstrap)
|
|
16
17
|
*/
|
|
17
18
|
const BUILDER_IMAGE = "docker.io/docker:29.5.1";
|
|
18
|
-
|
|
19
|
+
/**
|
|
20
|
+
* every planned image is consumed the same way: its url, plus an
|
|
21
|
+
* optional dependency on its build job
|
|
22
|
+
*/
|
|
23
|
+
const toResolvedJobImage = ({ imageRef, jobName, }) => ({
|
|
24
|
+
image: imageRef,
|
|
25
|
+
fromRepoRegistry: true,
|
|
26
|
+
need: {
|
|
27
|
+
job: jobName,
|
|
28
|
+
artifacts: false,
|
|
29
|
+
optional: true,
|
|
30
|
+
global: true,
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
/**
|
|
34
|
+
* materializes an image definition directory into the generated files
|
|
35
|
+
* (used for the definitions catladder ships)
|
|
36
|
+
*/
|
|
37
|
+
const materializeDir = (sourceDir, targetDir) => listFilesRecursive(sourceDir).map((file) => ({
|
|
38
|
+
path: (0, path_1.join)(targetDir, file),
|
|
39
|
+
content: (0, fs_1.readFileSync)((0, path_1.join)(sourceDir, file), "utf-8"),
|
|
40
|
+
}));
|
|
41
|
+
// built-in (catladder-shipped) images carry the catladder marker in
|
|
42
|
+
// their job name; project-declared images get the short plain name
|
|
43
|
+
const ensureJobName = (name) => `🐳 catladder image ${name}`;
|
|
44
|
+
const projectEnsureJobName = (name) => `🐳 image ${name}`;
|
|
45
|
+
/**
|
|
46
|
+
* the config file whose content feeds the project image hashes
|
|
47
|
+
* (`buildArgs`, `hashExtraPaths`): the gitlab change detection has to
|
|
48
|
+
* watch it, because a config-only change alters the image tag without
|
|
49
|
+
* touching the image dir
|
|
50
|
+
*/
|
|
51
|
+
const CONFIG_FILE = "catladder.ts";
|
|
52
|
+
/**
|
|
53
|
+
* where inline project Dockerfiles are materialized — a subfolder, so a
|
|
54
|
+
* project image can carry the same name as a shipped one
|
|
55
|
+
*/
|
|
56
|
+
exports.PROJECT_IMAGES_FOLDER = `${exports.GENERATED_IMAGES_FOLDER}/project`;
|
|
19
57
|
/**
|
|
20
58
|
* plans the catladder job images of one backend run: resolves image
|
|
21
59
|
* references, collects the image build jobs, and the image definitions
|
|
@@ -26,33 +64,30 @@ const ensureJobName = (name) => `🐳 job image ${name}`;
|
|
|
26
64
|
* Reference-driven: only images actually used by a job are built.
|
|
27
65
|
*/
|
|
28
66
|
class JobImagesPlan {
|
|
29
|
-
constructor(pipelineType) {
|
|
67
|
+
constructor(pipelineType, projectImages = {}) {
|
|
30
68
|
this.pipelineType = pipelineType;
|
|
69
|
+
this.projectImages = projectImages;
|
|
31
70
|
this.used = new Map();
|
|
71
|
+
this.usedProject = new Map();
|
|
32
72
|
}
|
|
33
73
|
/**
|
|
34
74
|
* resolves a job image (marker or concrete) to a concrete image url
|
|
35
75
|
* plus the build job dependency
|
|
36
76
|
*/
|
|
37
77
|
resolve(image) {
|
|
38
|
-
if (
|
|
39
|
-
return
|
|
78
|
+
if ((0, runner_1.isCatladderImageRef)(image)) {
|
|
79
|
+
return this.resolveRef(image);
|
|
80
|
+
}
|
|
81
|
+
if ((0, projectImages_1.isProjectImageRef)(image)) {
|
|
82
|
+
return this.resolveProjectRef(image);
|
|
40
83
|
}
|
|
41
|
-
return
|
|
84
|
+
return { image };
|
|
42
85
|
}
|
|
43
86
|
resolveRef(ref) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
fromRepoRegistry: true,
|
|
49
|
-
need: {
|
|
50
|
-
job: ensureJobName(name),
|
|
51
|
-
artifacts: false,
|
|
52
|
-
optional: true,
|
|
53
|
-
global: true,
|
|
54
|
-
},
|
|
55
|
-
};
|
|
87
|
+
return toResolvedJobImage(this.use(ref.catladderImage));
|
|
88
|
+
}
|
|
89
|
+
resolveProjectRef(ref) {
|
|
90
|
+
return toResolvedJobImage(this.useProject(ref.image));
|
|
56
91
|
}
|
|
57
92
|
/**
|
|
58
93
|
* the registry image prefix. On github, container images can't use
|
|
@@ -63,6 +98,85 @@ class JobImagesPlan {
|
|
|
63
98
|
? "ghcr.io/${{ github.repository }}"
|
|
64
99
|
: `${(0, ciVariables_1.getCiVariable)({ pipelineType: this.pipelineType }, "registryImage")}`;
|
|
65
100
|
}
|
|
101
|
+
useProject(name) {
|
|
102
|
+
const existing = this.usedProject.get(name);
|
|
103
|
+
if (existing) {
|
|
104
|
+
return existing;
|
|
105
|
+
}
|
|
106
|
+
const imageConfig = this.projectImages[name];
|
|
107
|
+
if (!imageConfig) {
|
|
108
|
+
const declared = Object.keys(this.projectImages);
|
|
109
|
+
throw new Error(`unknown job image "${name}" — ${declared.length > 0
|
|
110
|
+
? `images declared in config.images: ${declared.join(", ")}`
|
|
111
|
+
: "no images are declared in config.images"}`);
|
|
112
|
+
}
|
|
113
|
+
const source = this.planProjectSource(name, imageConfig);
|
|
114
|
+
const planned = {
|
|
115
|
+
...source,
|
|
116
|
+
jobName: projectEnsureJobName(name),
|
|
117
|
+
buildArgs: imageConfig.buildArgs,
|
|
118
|
+
// `job-images/` keeps the project's job images apart from its
|
|
119
|
+
// deployable component images (registry root) and build caches
|
|
120
|
+
imageRef: `${this.registryImageRef()}/job-images/${name}:${source.hash}`,
|
|
121
|
+
};
|
|
122
|
+
this.usedProject.set(name, planned);
|
|
123
|
+
return planned;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* the source-dependent half of a project image: an inline Dockerfile
|
|
127
|
+
* is materialized into the generated files and hashed by its content,
|
|
128
|
+
* a directory is hashed and watched in place
|
|
129
|
+
*/
|
|
130
|
+
planProjectSource(name, imageConfig) {
|
|
131
|
+
var _a, _b;
|
|
132
|
+
if (imageConfig.dockerfile !== undefined) {
|
|
133
|
+
const content = toDockerfileContent(imageConfig.dockerfile);
|
|
134
|
+
const dockerfilePath = `${exports.PROJECT_IMAGES_FOLDER}/${name}/Dockerfile`;
|
|
135
|
+
const { hash, watchedPaths } = (0, hash_1.computeInlineImageHash)({
|
|
136
|
+
dockerfileContent: content,
|
|
137
|
+
hashExtraPaths: imageConfig.hashExtraPaths,
|
|
138
|
+
buildArgs: imageConfig.buildArgs,
|
|
139
|
+
});
|
|
140
|
+
return {
|
|
141
|
+
hash,
|
|
142
|
+
dockerfilePath,
|
|
143
|
+
// an inline definition carries no directory of its own — the
|
|
144
|
+
// repository root is the sensible default context
|
|
145
|
+
contextDir: (_a = imageConfig.context) !== null && _a !== void 0 ? _a : ".",
|
|
146
|
+
watchedPaths: [
|
|
147
|
+
`${exports.PROJECT_IMAGES_FOLDER}/${name}/**/*`,
|
|
148
|
+
...watchedPaths,
|
|
149
|
+
CONFIG_FILE,
|
|
150
|
+
],
|
|
151
|
+
files: [{ path: dockerfilePath, content }],
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
const dir = imageConfig.dir;
|
|
155
|
+
// fail at generation time with the offending image named: an
|
|
156
|
+
// unreadable dir would otherwise surface as a bare fs ENOENT, and a
|
|
157
|
+
// missing Dockerfile only as a docker build failure in CI
|
|
158
|
+
if (!(0, fs_1.existsSync)(dir)) {
|
|
159
|
+
throw new Error(`job image "${name}": the directory "${dir}" does not exist (config.images.${name}.dir, relative to the repository root)`);
|
|
160
|
+
}
|
|
161
|
+
if (!(0, fs_1.existsSync)((0, path_1.join)(dir, "Dockerfile"))) {
|
|
162
|
+
throw new Error(`job image "${name}": no Dockerfile in "${dir}" (config.images.${name}.dir)`);
|
|
163
|
+
}
|
|
164
|
+
const { hash, watchedPaths } = (0, hash_1.computeCustomImageHash)({
|
|
165
|
+
dir,
|
|
166
|
+
hashExtraPaths: imageConfig.hashExtraPaths,
|
|
167
|
+
buildArgs: imageConfig.buildArgs,
|
|
168
|
+
});
|
|
169
|
+
return {
|
|
170
|
+
hash,
|
|
171
|
+
dockerfilePath: `${dir}/Dockerfile`,
|
|
172
|
+
contextDir: (_b = imageConfig.context) !== null && _b !== void 0 ? _b : dir,
|
|
173
|
+
// the dir is committed in the project — watched in place, nothing
|
|
174
|
+
// is materialized. The config file is watched too: buildArgs /
|
|
175
|
+
// hashExtraPaths changes alter the tag without touching the dir
|
|
176
|
+
watchedPaths: [...watchedPaths, CONFIG_FILE],
|
|
177
|
+
files: [],
|
|
178
|
+
};
|
|
179
|
+
}
|
|
66
180
|
use(name) {
|
|
67
181
|
var _a;
|
|
68
182
|
const existing = this.used.get(name);
|
|
@@ -77,27 +191,43 @@ class JobImagesPlan {
|
|
|
77
191
|
dir: (0, shippedImages_1.getShippedImageDir)(name),
|
|
78
192
|
extraDirs: dependencies.map((dependency) => (0, shippedImages_1.getShippedImageDir)(dependency)),
|
|
79
193
|
});
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
|
|
194
|
+
const targetDir = `${exports.GENERATED_IMAGES_FOLDER}/${name}`;
|
|
195
|
+
const planned = {
|
|
196
|
+
hash,
|
|
197
|
+
jobName: ensureJobName(name),
|
|
198
|
+
imageRef: `${this.registryImageRef()}/catladder/${name}:${hash}`,
|
|
199
|
+
dockerfilePath: `${targetDir}/Dockerfile`,
|
|
200
|
+
// the jobs family INCLUDEs sibling images, so it builds from the
|
|
201
|
+
// images root; the others from their own dir
|
|
202
|
+
contextDir: shippedImages_1.RUNNER_IMAGE_BUILD_CONTEXT[name] === "root"
|
|
203
|
+
? exports.GENERATED_IMAGES_FOLDER
|
|
204
|
+
: targetDir,
|
|
205
|
+
watchedPaths: [name, ...dependencies].map((dir) => `${exports.GENERATED_IMAGES_FOLDER}/${dir}/**/*`),
|
|
206
|
+
// pipelines build from committed, reviewable files (and gitlab's
|
|
207
|
+
// rules:changes can watch them)
|
|
208
|
+
files: materializeDir((0, shippedImages_1.getShippedImageDir)(name), targetDir),
|
|
209
|
+
};
|
|
210
|
+
this.used.set(name, planned);
|
|
211
|
+
return planned;
|
|
83
212
|
}
|
|
84
213
|
/**
|
|
85
214
|
* the image build jobs for all used images
|
|
86
215
|
*/
|
|
87
216
|
getEnsureJobs() {
|
|
88
|
-
return [...this.used.
|
|
217
|
+
return [...this.used.values(), ...this.usedProject.values()].map((planned) => this.createImageBuildJob(planned));
|
|
89
218
|
}
|
|
90
|
-
|
|
91
|
-
|
|
219
|
+
createImageBuildJob({ jobName, imageRef, watchedPaths, dockerfilePath, contextDir, buildArgs, }) {
|
|
220
|
+
const buildArgFlags = Object.entries(buildArgs !== null && buildArgs !== void 0 ? buildArgs : {})
|
|
221
|
+
.map(([key, value]) => ` --build-arg '${key}=${value}'`)
|
|
222
|
+
.join("");
|
|
223
|
+
const buildCommand = `DOCKER_BUILDKIT=1 docker build -t ${imageRef}${buildArgFlags} -f ${dockerfilePath} ${contextDir}`;
|
|
92
224
|
const ctx = { pipelineType: this.pipelineType };
|
|
93
225
|
const registryUser = (0, ciVariables_1.getCiVariable)(ctx, "registryUser");
|
|
94
226
|
const jobToken = (0, ciVariables_1.getCiVariable)(ctx, "jobToken");
|
|
95
227
|
const registry = (0, ciVariables_1.getCiVariable)(ctx, "registry");
|
|
96
|
-
const imageRef = `${this.registryImageRef()}/catladder/${name}:${hash}`;
|
|
97
|
-
const watchedDirs = [name, ...((_a = shippedImages_1.RUNNER_IMAGE_DEPENDENCIES[name]) !== null && _a !== void 0 ? _a : [])];
|
|
98
228
|
const { services, runnerVariables } = (0, docker_1.getDockerJobBaseProps)();
|
|
99
229
|
return {
|
|
100
|
-
name:
|
|
230
|
+
name: jobName,
|
|
101
231
|
stage: "setup",
|
|
102
232
|
image: BUILDER_IMAGE,
|
|
103
233
|
services,
|
|
@@ -107,7 +237,9 @@ class JobImagesPlan {
|
|
|
107
237
|
// no equivalent and always runs (the existence check is fast)
|
|
108
238
|
rules: [
|
|
109
239
|
{
|
|
110
|
-
|
|
240
|
+
// a fresh array per job: the yaml serializer anchors repeated
|
|
241
|
+
// objects, and a shared reference would reshuffle anchors
|
|
242
|
+
changes: [...watchedPaths],
|
|
111
243
|
},
|
|
112
244
|
],
|
|
113
245
|
variables: {},
|
|
@@ -121,31 +253,33 @@ class JobImagesPlan {
|
|
|
121
253
|
` exit 0`,
|
|
122
254
|
`fi`,
|
|
123
255
|
]),
|
|
124
|
-
...(0, gitlab_1.collapseableSection)("docker-build", "Building image")([
|
|
125
|
-
`DOCKER_BUILDKIT=1 docker build -t ${imageRef} -f ${exports.GENERATED_IMAGES_FOLDER}/${name}/Dockerfile ${shippedImages_1.RUNNER_IMAGE_BUILD_CONTEXT[name] === "root"
|
|
126
|
-
? exports.GENERATED_IMAGES_FOLDER
|
|
127
|
-
: `${exports.GENERATED_IMAGES_FOLDER}/${name}`}`,
|
|
128
|
-
]),
|
|
256
|
+
...(0, gitlab_1.collapseableSection)("docker-build", "Building image")([buildCommand]),
|
|
129
257
|
...(0, gitlab_1.collapseableSection)("docker-push", "Pushing image")([`docker push ${imageRef}`]),
|
|
130
258
|
],
|
|
131
259
|
};
|
|
132
260
|
}
|
|
133
261
|
/**
|
|
134
|
-
* the image definitions
|
|
135
|
-
*
|
|
136
|
-
*
|
|
262
|
+
* the image definitions to materialize into the generated files (so
|
|
263
|
+
* pipelines build from committed, reviewable files and gitlab's
|
|
264
|
+
* rules:changes can watch them): the definitions catladder ships and
|
|
265
|
+
* the project's inline Dockerfiles. A project image directory is
|
|
266
|
+
* already committed and contributes nothing.
|
|
137
267
|
*/
|
|
138
268
|
getGeneratedFiles() {
|
|
139
|
-
return [...this.used.
|
|
140
|
-
const dir = (0, shippedImages_1.getShippedImageDir)(name);
|
|
141
|
-
return listFilesRecursive(dir).map((file) => ({
|
|
142
|
-
path: (0, path_1.join)(exports.GENERATED_IMAGES_FOLDER, name, file),
|
|
143
|
-
content: (0, fs_1.readFileSync)((0, path_1.join)(dir, file), "utf-8"),
|
|
144
|
-
}));
|
|
145
|
-
});
|
|
269
|
+
return [...this.used.values(), ...this.usedProject.values()].flatMap(({ files }) => files);
|
|
146
270
|
}
|
|
147
271
|
}
|
|
148
272
|
exports.JobImagesPlan = JobImagesPlan;
|
|
273
|
+
/**
|
|
274
|
+
* an inline Dockerfile is written as given — as one string, or as lines
|
|
275
|
+
* joined with newlines (always newline-terminated)
|
|
276
|
+
*/
|
|
277
|
+
const toDockerfileContent = (dockerfile) => {
|
|
278
|
+
const content = Array.isArray(dockerfile)
|
|
279
|
+
? dockerfile.join("\n")
|
|
280
|
+
: dockerfile;
|
|
281
|
+
return content.endsWith("\n") ? content : `${content}\n`;
|
|
282
|
+
};
|
|
149
283
|
const IGNORED_FILES = new Set([".DS_Store", "Thumbs.db"]);
|
|
150
284
|
const listFilesRecursive = (dir) => (0, fs_1.readdirSync)(dir, { recursive: true, encoding: "utf-8" })
|
|
151
285
|
.filter((entry) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jobImagesPlan.js","sourceRoot":"","sources":["../../../../../../../packages/pipeline/src/customImages/jobImagesPlan.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"jobImagesPlan.js","sourceRoot":"","sources":["../../../../../../../packages/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