@catladder/cli 0.0.0-main-e8632d85 → 0.0.0-main-bdf1fe37
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/bundles/catenv/index.js +56 -38
- package/dist/bundles/cli/index.js +54 -38
- package/dist/cli/src/catenv.js +2 -0
- package/dist/cli/src/catenv.js.map +1 -1
- package/dist/cli/src/config/getProjectConfig.js +3 -0
- package/dist/cli/src/config/getProjectConfig.js.map +1 -1
- package/dist/cli/src/utils/projects/index.d.ts +1 -1
- package/dist/cli/src/utils/projects/index.js +9 -1
- package/dist/cli/src/utils/projects/index.js.map +1 -1
- package/dist/pipeline/src/build/base/createAppBuildJob.js +1 -1
- package/dist/pipeline/src/build/base/createAppBuildJob.js.map +1 -1
- package/dist/pipeline/src/build/base/writeDotEnv.d.ts +1 -0
- package/dist/pipeline/src/build/base/writeDotEnv.js +5 -1
- package/dist/pipeline/src/build/base/writeDotEnv.js.map +1 -1
- package/dist/pipeline/src/build/node/buildJob.js +5 -3
- package/dist/pipeline/src/build/node/buildJob.js.map +1 -1
- package/dist/pipeline/src/build/node/cache.js +5 -6
- package/dist/pipeline/src/build/node/cache.js.map +1 -1
- package/dist/pipeline/src/build/node/testJob.js +7 -7
- package/dist/pipeline/src/build/node/testJob.js.map +1 -1
- package/dist/pipeline/src/build/node/yarn.js +5 -5
- package/dist/pipeline/src/build/node/yarn.js.map +1 -1
- package/dist/pipeline/src/build/sbom.js +4 -4
- package/dist/pipeline/src/build/sbom.js.map +1 -1
- package/dist/pipeline/src/context/createComponentContext.d.ts +1 -2
- package/dist/pipeline/src/context/createComponentContext.js +8 -4
- package/dist/pipeline/src/context/createComponentContext.js.map +1 -1
- package/dist/pipeline/src/pipeline/createJobsForComponent.d.ts +1 -1
- package/dist/pipeline/src/pipeline/createJobsForComponent.js +2 -6
- package/dist/pipeline/src/pipeline/createJobsForComponent.js.map +1 -1
- package/dist/pipeline/src/types/context.d.ts +2 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/catenv.ts +2 -0
- package/src/config/getProjectConfig.ts +3 -0
- package/src/utils/projects/index.ts +7 -2
|
@@ -666,7 +666,9 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
666
666
|
var catenv_1 = __importDefault(__nccwpck_require__(6965));
|
|
667
667
|
var parseChoice_1 = __nccwpck_require__(3941);
|
|
668
668
|
var choice = process.argv[2] ? (0, parseChoice_1.parseChoice)(process.argv[2]) : null;
|
|
669
|
+
var now = performance.now();
|
|
669
670
|
(0, catenv_1.default)(choice).then(function () {
|
|
671
|
+
console.log("catenv", performance.now() - now);
|
|
670
672
|
// we have to exit manually, because we have some file watches
|
|
671
673
|
process.exit();
|
|
672
674
|
});
|
|
@@ -759,6 +761,9 @@ var reloadConfigAndObserve = function () { return __awaiter(void 0, void 0, void
|
|
|
759
761
|
case 0: return [4 /*yield*/, (0, projects_1.getGitRoot)()];
|
|
760
762
|
case 1:
|
|
761
763
|
gitRoot = _a.sent();
|
|
764
|
+
if (!gitRoot) {
|
|
765
|
+
return [2 /*return*/];
|
|
766
|
+
}
|
|
762
767
|
result = (0, pipeline_1.readConfigSync)(gitRoot);
|
|
763
768
|
if (!result) {
|
|
764
769
|
// can't do anything, there is no config
|
|
@@ -1793,10 +1798,18 @@ var getProjectConfig_1 = __nccwpck_require__(5264);
|
|
|
1793
1798
|
var files_1 = __nccwpck_require__(9863);
|
|
1794
1799
|
var child_process_promise_1 = __nccwpck_require__(5763);
|
|
1795
1800
|
var getGitRoot = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
1801
|
+
var e_1;
|
|
1796
1802
|
return __generator(this, function (_a) {
|
|
1797
1803
|
switch (_a.label) {
|
|
1798
|
-
case 0:
|
|
1804
|
+
case 0:
|
|
1805
|
+
_a.trys.push([0, 2, , 3]);
|
|
1806
|
+
return [4 /*yield*/, (0, child_process_promise_1.exec)("git rev-parse --show-toplevel")];
|
|
1799
1807
|
case 1: return [2 /*return*/, (_a.sent()).stdout.trim()];
|
|
1808
|
+
case 2:
|
|
1809
|
+
e_1 = _a.sent();
|
|
1810
|
+
// not a git repo
|
|
1811
|
+
return [2 /*return*/, null];
|
|
1812
|
+
case 3: return [2 /*return*/];
|
|
1800
1813
|
}
|
|
1801
1814
|
});
|
|
1802
1815
|
}); };
|
|
@@ -2269,7 +2282,7 @@ var createAppBuildJob = function (context, _a) {
|
|
|
2269
2282
|
cache: [],
|
|
2270
2283
|
variables: __assign(__assign(__assign(__assign({}, (variables !== null && variables !== void 0 ? variables : {})), context.environment.envVars), context.environment.jobOnlyVars.build.envVars), ((_b = context.build.config.extraVars) !== null && _b !== void 0 ? _b : {})),
|
|
2271
2284
|
runnerVariables: __assign(__assign(__assign({}, constants_1.RUNNER_BUILD_RESOURCE_VARIABLES), (runnerVariables !== null && runnerVariables !== void 0 ? runnerVariables : {})), ((_c = context.build.config.runnerVariables) !== null && _c !== void 0 ? _c : {})),
|
|
2272
|
-
script: __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((context
|
|
2285
|
+
script: __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(((0, writeDotEnv_1.componentContextNeedsBuildTimeDotEnv)(context)
|
|
2273
2286
|
? (0, writeDotEnv_1.writeDotEnv)(context)
|
|
2274
2287
|
: [])), false), __read((0, writeBuildInfo_1.writeBuildInfo)(context)), false), __read((0, yarn_1.ensureNodeVersion)(context.build)), false), [
|
|
2275
2288
|
"cd ".concat(context.build.dir)
|
|
@@ -2457,7 +2470,7 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
2457
2470
|
return ar;
|
|
2458
2471
|
};
|
|
2459
2472
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2460
|
-
exports.writeDotEnv = void 0;
|
|
2473
|
+
exports.componentContextNeedsBuildTimeDotEnv = exports.writeDotEnv = void 0;
|
|
2461
2474
|
var lodash_1 = __nccwpck_require__(3255);
|
|
2462
2475
|
/**
|
|
2463
2476
|
* writes a .env file in the components folder
|
|
@@ -2483,6 +2496,10 @@ var writeDotEnv = function (context) {
|
|
|
2483
2496
|
];
|
|
2484
2497
|
};
|
|
2485
2498
|
exports.writeDotEnv = writeDotEnv;
|
|
2499
|
+
var componentContextNeedsBuildTimeDotEnv = function (context) {
|
|
2500
|
+
return context.componentConfig.dotEnv === true; // don't build when set to `local`
|
|
2501
|
+
};
|
|
2502
|
+
exports.componentContextNeedsBuildTimeDotEnv = componentContextNeedsBuildTimeDotEnv;
|
|
2486
2503
|
//# sourceMappingURL=writeDotEnv.js.map
|
|
2487
2504
|
|
|
2488
2505
|
/***/ }),
|
|
@@ -2997,7 +3014,7 @@ var cache_1 = __nccwpck_require__(2026);
|
|
|
2997
3014
|
var constants_1 = __nccwpck_require__(1765);
|
|
2998
3015
|
var yarn_1 = __nccwpck_require__(5043);
|
|
2999
3016
|
var createNodeBuildJobs = function (context) {
|
|
3000
|
-
var _a, _b, _c, _d, _e
|
|
3017
|
+
var _a, _b, _c, _d, _e;
|
|
3001
3018
|
var buildConfig = context.build.config;
|
|
3002
3019
|
if (!(0, types_1.isOfBuildType)(buildConfig, "node", "node-static", "storybook")) {
|
|
3003
3020
|
throw new Error("deploy config is not node, node-static or storybook");
|
|
@@ -3014,7 +3031,8 @@ var createNodeBuildJobs = function (context) {
|
|
|
3014
3031
|
artifacts: {
|
|
3015
3032
|
paths: __spreadArray([
|
|
3016
3033
|
context.build.dir
|
|
3017
|
-
], __read(((
|
|
3034
|
+
], __read(((_d = context.build.packageManagerInfo
|
|
3035
|
+
.currentWorkspaceDependencies) !== null && _d !== void 0 ? _d : [])), false).flatMap(function (dir) {
|
|
3018
3036
|
var _a, _b;
|
|
3019
3037
|
return __spreadArray([
|
|
3020
3038
|
(0, path_1.join)(dir, "__build_info.json"),
|
|
@@ -3038,7 +3056,8 @@ var createNodeBuildJobs = function (context) {
|
|
|
3038
3056
|
variables: {
|
|
3039
3057
|
// only required for non static
|
|
3040
3058
|
DOCKER_COPY_AND_INSTALL_APP: (0, yarn_1.getDockerAppCopyAndBuildScript)(context.build),
|
|
3041
|
-
DOCKER_COPY_WORKSPACE_FILES: (
|
|
3059
|
+
DOCKER_COPY_WORKSPACE_FILES: (_e = context.build.packageManagerInfo.pathsToCopyInDocker
|
|
3060
|
+
.map(function (dir) { return "COPY --chown=node:node ".concat(dir, " /app/").concat(dir); })) === null || _e === void 0 ? void 0 : _e.join("\n"),
|
|
3042
3061
|
},
|
|
3043
3062
|
},
|
|
3044
3063
|
});
|
|
@@ -3087,9 +3106,8 @@ var path_1 = __nccwpck_require__(1017);
|
|
|
3087
3106
|
var slugify_1 = __importDefault(__nccwpck_require__(4035));
|
|
3088
3107
|
var lodash_1 = __nccwpck_require__(3255);
|
|
3089
3108
|
var getYarnCache = function (context, policy) {
|
|
3090
|
-
var _a;
|
|
3091
3109
|
if (policy === void 0) { policy = "pull-push"; }
|
|
3092
|
-
var componentIsInWorkspace =
|
|
3110
|
+
var componentIsInWorkspace = context.packageManagerInfo.componentIsInWorkspace;
|
|
3093
3111
|
return [
|
|
3094
3112
|
componentIsInWorkspace
|
|
3095
3113
|
? {
|
|
@@ -3106,9 +3124,9 @@ var getYarnCache = function (context, policy) {
|
|
|
3106
3124
|
};
|
|
3107
3125
|
exports.getYarnCache = getYarnCache;
|
|
3108
3126
|
var getNodeModulesCache = function (context, policy) {
|
|
3109
|
-
var _a
|
|
3127
|
+
var _a;
|
|
3110
3128
|
if (policy === void 0) { policy = "pull-push"; }
|
|
3111
|
-
var componentIsInWorkspace =
|
|
3129
|
+
var componentIsInWorkspace = context.packageManagerInfo.componentIsInWorkspace;
|
|
3112
3130
|
// We intentionally do not use the contents of yarn.lock as a cache key, as yarn 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.
|
|
3113
3131
|
// It would slow down all pipelines whenever one adds a new dependency as it will need to download all node_modules again.
|
|
3114
3132
|
return [
|
|
@@ -3121,9 +3139,9 @@ var getNodeModulesCache = function (context, policy) {
|
|
|
3121
3139
|
paths: __spreadArray([], __read((componentIsInWorkspace
|
|
3122
3140
|
? (0, lodash_1.uniq)(__spreadArray([
|
|
3123
3141
|
"node_modules"
|
|
3124
|
-
], __read(((
|
|
3142
|
+
], __read(((_a = context.packageManagerInfo.workspaces.map(function (w) {
|
|
3125
3143
|
return (0, path_1.join)(w.location, "node_modules");
|
|
3126
|
-
})) !== null &&
|
|
3144
|
+
})) !== null && _a !== void 0 ? _a : [])), false))
|
|
3127
3145
|
: [(0, path_1.join)(context.dir, "node_modules")])), false),
|
|
3128
3146
|
},
|
|
3129
3147
|
];
|
|
@@ -3356,7 +3374,7 @@ var constants_1 = __nccwpck_require__(1765);
|
|
|
3356
3374
|
var yarn_1 = __nccwpck_require__(5043);
|
|
3357
3375
|
var createArtifactsConfig_1 = __nccwpck_require__(2820);
|
|
3358
3376
|
var createNodeTestJobs = function (context) {
|
|
3359
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u
|
|
3377
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
3360
3378
|
// don't run tests after release
|
|
3361
3379
|
// TODO: this will be replaced by using rules
|
|
3362
3380
|
if (context.trigger === "taggedRelease") {
|
|
@@ -3376,18 +3394,18 @@ var createNodeTestJobs = function (context) {
|
|
|
3376
3394
|
? __assign(__assign(__assign({ name: "🛡 audit" }, base), { image: (_c = (_b = buildConfig.audit) === null || _b === void 0 ? void 0 : _b.jobImage) !== null && _c !== void 0 ? _c : defaultImage, cache: undefined, script: __spreadArray([
|
|
3377
3395
|
"cd ".concat(context.build.dir)
|
|
3378
3396
|
], __read(((_e = (0, utils_1.ensureArray)((_d = buildConfig.audit) === null || _d === void 0 ? void 0 : _d.command)) !== null && _e !== void 0 ? _e : [
|
|
3379
|
-
|
|
3397
|
+
context.build.packageManagerInfo.isClassic
|
|
3380
3398
|
? "yarn audit"
|
|
3381
3399
|
: "yarn npm audit --environment production", // yarn 2
|
|
3382
|
-
])), false), allow_failure: true }), (0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (
|
|
3400
|
+
])), false), allow_failure: true }), (0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (_f = buildConfig.audit) === null || _f === void 0 ? void 0 : _f.artifactsReports, (_g = buildConfig.audit) === null || _g === void 0 ? void 0 : _g.artifacts)) : null;
|
|
3383
3401
|
var lintJob = buildConfig.lint !== false
|
|
3384
|
-
? __assign(__assign(__assign({ name: "👮 lint" }, base), { image: (
|
|
3402
|
+
? __assign(__assign(__assign({ name: "👮 lint" }, base), { image: (_j = (_h = buildConfig.lint) === null || _h === void 0 ? void 0 : _h.jobImage) !== null && _j !== void 0 ? _j : defaultImage, cache: (0, cache_1.getNodeCache)(context.build), script: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, yarn_1.ensureNodeVersion)(context.build)), false), [
|
|
3385
3403
|
"cd ".concat(context.build.dir)
|
|
3386
|
-
], false), __read(yarnInstall), false), __read(((
|
|
3404
|
+
], false), __read(yarnInstall), false), __read(((_l = (0, utils_1.ensureArray)((_k = buildConfig.lint) === null || _k === void 0 ? void 0 : _k.command)) !== null && _l !== void 0 ? _l : ["yarn lint"])), false) }), (0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (_m = buildConfig.lint) === null || _m === void 0 ? void 0 : _m.artifactsReports, (_o = buildConfig.lint) === null || _o === void 0 ? void 0 : _o.artifacts)) : null;
|
|
3387
3405
|
var testJob = buildConfig.test !== false
|
|
3388
|
-
? __assign(__assign(__assign({ name: "🧪 test" }, base), { image: (
|
|
3406
|
+
? __assign(__assign(__assign({ name: "🧪 test" }, base), { image: (_q = (_p = buildConfig.test) === null || _p === void 0 ? void 0 : _p.jobImage) !== null && _q !== void 0 ? _q : (0, runner_1.getRunnerImage)("jobs-testing-chrome"), cache: (0, cache_1.getNodeCache)(context.build), script: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, yarn_1.ensureNodeVersion)(context.build)), false), [
|
|
3389
3407
|
"cd ".concat(context.build.dir)
|
|
3390
|
-
], false), __read(yarnInstall), false), __read(((
|
|
3408
|
+
], false), __read(yarnInstall), false), __read(((_s = (0, utils_1.ensureArray)((_r = buildConfig.test) === null || _r === void 0 ? void 0 : _r.command)) !== null && _s !== void 0 ? _s : ["yarn test"])), false) }), (0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (_t = buildConfig.test) === null || _t === void 0 ? void 0 : _t.artifactsReports, (_u = buildConfig.test) === null || _u === void 0 ? void 0 : _u.artifacts)) : null;
|
|
3391
3409
|
return [auditJob, lintJob, testJob].filter(utils_1.notNil);
|
|
3392
3410
|
};
|
|
3393
3411
|
exports.createNodeTestJobs = createNodeTestJobs;
|
|
@@ -3434,8 +3452,7 @@ var YARN_INSTALL_CLASSIC = "yarn install --frozen-lockfile";
|
|
|
3434
3452
|
// FIXME: check why and when rebuild is needed
|
|
3435
3453
|
var YARN_BERRY_PROD_REBUILD = "yarn workspaces focus --production && yarn rebuild";
|
|
3436
3454
|
var getYarnInstallCommand = function (context) {
|
|
3437
|
-
|
|
3438
|
-
if ((_a = context.packageManagerInfo) === null || _a === void 0 ? void 0 : _a.isClassic) {
|
|
3455
|
+
if (context.packageManagerInfo.isClassic) {
|
|
3439
3456
|
return YARN_INSTALL_CLASSIC;
|
|
3440
3457
|
}
|
|
3441
3458
|
return "yarn install --immutable";
|
|
@@ -3457,13 +3474,14 @@ var getYarnInstall = function (context, options) {
|
|
|
3457
3474
|
exports.getYarnInstall = getYarnInstall;
|
|
3458
3475
|
var DOCKER_COPY_FILES = "COPY --chown=node:node $APP_DIR .";
|
|
3459
3476
|
var getDockerAppCopyAndBuildScript = function (context) {
|
|
3460
|
-
|
|
3461
|
-
if ((_a = context.packageManagerInfo) === null || _a === void 0 ? void 0 : _a.isClassic) {
|
|
3477
|
+
if (context.packageManagerInfo.isClassic) {
|
|
3462
3478
|
return new BashExpression_1.BashExpression("\nRUN ".concat(YARN_INSTALL_CLASSIC, " --production --ignore-scripts\n").concat(DOCKER_COPY_FILES, "\nRUN ").concat(YARN_INSTALL_CLASSIC, " --production \n ").trim());
|
|
3463
3479
|
}
|
|
3464
3480
|
// yarn >= 4 ships with build in plugins, see https://github.com/yarnpkg/berry/pull/4253
|
|
3465
3481
|
// trying to import those fail on this version
|
|
3466
|
-
var doesNotShipWithBuiltInPlugins = ["2", "3"].some(function (v) {
|
|
3482
|
+
var doesNotShipWithBuiltInPlugins = ["2", "3"].some(function (v) {
|
|
3483
|
+
return context.packageManagerInfo.version.startsWith(v);
|
|
3484
|
+
});
|
|
3467
3485
|
var maybeAddWorkspaceToolsCommand = doesNotShipWithBuiltInPlugins
|
|
3468
3486
|
? "RUN yarn plugin import workspace-tools"
|
|
3469
3487
|
: "";
|
|
@@ -3717,19 +3735,19 @@ var utils_1 = __nccwpck_require__(2497);
|
|
|
3717
3735
|
exports.SBOM_BUILD_JOB_NAME = "🧾 sbom";
|
|
3718
3736
|
exports.SBOM_FILE = "__sbom.json";
|
|
3719
3737
|
var createSbomBuildJob = function (context) {
|
|
3720
|
-
var _a, _b, _c, _d
|
|
3738
|
+
var _a, _b, _c, _d;
|
|
3721
3739
|
var buildConfig = context.build.config;
|
|
3722
3740
|
var defaultImage = "aquasec/trivy:0.38.3";
|
|
3723
3741
|
var defaultScript = [
|
|
3724
|
-
"trivy fs --quiet --format cyclonedx --output \"".concat(exports.SBOM_FILE, "\" ").concat(
|
|
3742
|
+
"trivy fs --quiet --format cyclonedx --output \"".concat(exports.SBOM_FILE, "\" ").concat(context.build.packageManagerInfo.componentIsInWorkspace
|
|
3725
3743
|
? "."
|
|
3726
3744
|
: context.build.dir),
|
|
3727
3745
|
];
|
|
3728
3746
|
var image = buildConfig.type === "custom" && buildConfig.sbom !== false
|
|
3729
|
-
? (
|
|
3747
|
+
? (_b = (_a = buildConfig.sbom) === null || _a === void 0 ? void 0 : _a.jobImage) !== null && _b !== void 0 ? _b : defaultImage
|
|
3730
3748
|
: defaultImage;
|
|
3731
3749
|
var script = buildConfig.type === "custom" && buildConfig.sbom !== false
|
|
3732
|
-
? (
|
|
3750
|
+
? (_d = (0, utils_1.ensureArray)((_c = buildConfig.sbom) === null || _c === void 0 ? void 0 : _c.command)) !== null && _d !== void 0 ? _d : defaultScript
|
|
3733
3751
|
: defaultScript;
|
|
3734
3752
|
return {
|
|
3735
3753
|
name: exports.SBOM_BUILD_JOB_NAME,
|
|
@@ -3994,14 +4012,18 @@ var deploy_1 = __nccwpck_require__(8483);
|
|
|
3994
4012
|
var utils_1 = __nccwpck_require__(2497);
|
|
3995
4013
|
var getEnvironment_1 = __nccwpck_require__(5699);
|
|
3996
4014
|
var getEnvironmentContext_1 = __nccwpck_require__(3663);
|
|
4015
|
+
var packageManager_1 = __nccwpck_require__(6451);
|
|
3997
4016
|
var createComponentContext = function (ctx) { return __awaiter(void 0, void 0, void 0, function () {
|
|
3998
|
-
var envContext, componentConfigWithoutDefaults, defaults, componentConfig, environment, deploy, build, customJobs, dir, context, resolvedCustomJobs;
|
|
4017
|
+
var packageManagerInfo, envContext, componentConfigWithoutDefaults, defaults, componentConfig, environment, deploy, build, customJobs, dir, context, resolvedCustomJobs;
|
|
3999
4018
|
return __generator(this, function (_a) {
|
|
4000
4019
|
switch (_a.label) {
|
|
4001
4020
|
case 0:
|
|
4002
4021
|
if (!/^[a-z0-9-]+$/.test(ctx.componentName)) {
|
|
4003
4022
|
throw new Error("componentName may only contain lower case letters, numbers and -");
|
|
4004
4023
|
}
|
|
4024
|
+
return [4 /*yield*/, (0, packageManager_1.getPackageManagerInfo)(ctx.config, ctx.componentName)];
|
|
4025
|
+
case 1:
|
|
4026
|
+
packageManagerInfo = _a.sent();
|
|
4005
4027
|
envContext = (0, getEnvironmentContext_1.getEnvironmentContext)(ctx);
|
|
4006
4028
|
componentConfigWithoutDefaults = envContext.envConfigRaw;
|
|
4007
4029
|
defaults = componentConfigWithoutDefaults.deploy
|
|
@@ -4015,7 +4037,7 @@ var createComponentContext = function (ctx) { return __awaiter(void 0, void 0, v
|
|
|
4015
4037
|
};
|
|
4016
4038
|
componentConfig = (0, utils_1.mergeWithMergingArrays)(defaults, componentConfigWithoutDefaults);
|
|
4017
4039
|
return [4 /*yield*/, (0, getEnvironment_1.getEnvironment)(ctx)];
|
|
4018
|
-
case
|
|
4040
|
+
case 2:
|
|
4019
4041
|
environment = _a.sent();
|
|
4020
4042
|
deploy = componentConfig.deploy, build = componentConfig.build, customJobs = componentConfig.customJobs, dir = componentConfig.dir;
|
|
4021
4043
|
context = {
|
|
@@ -4023,7 +4045,7 @@ var createComponentContext = function (ctx) { return __awaiter(void 0, void 0, v
|
|
|
4023
4045
|
componentConfig: componentConfig,
|
|
4024
4046
|
build: {
|
|
4025
4047
|
dir: dir,
|
|
4026
|
-
packageManagerInfo:
|
|
4048
|
+
packageManagerInfo: packageManagerInfo,
|
|
4027
4049
|
config: build,
|
|
4028
4050
|
},
|
|
4029
4051
|
deploy: deploy
|
|
@@ -4033,7 +4055,7 @@ var createComponentContext = function (ctx) { return __awaiter(void 0, void 0, v
|
|
|
4033
4055
|
: null,
|
|
4034
4056
|
componentName: ctx.componentName,
|
|
4035
4057
|
environment: environment,
|
|
4036
|
-
packageManagerInfo:
|
|
4058
|
+
packageManagerInfo: packageManagerInfo,
|
|
4037
4059
|
pipelineType: ctx.pipelineType,
|
|
4038
4060
|
trigger: ctx.trigger,
|
|
4039
4061
|
};
|
|
@@ -7671,7 +7693,6 @@ exports.createJobsForComponent = void 0;
|
|
|
7671
7693
|
var build_1 = __nccwpck_require__(7862);
|
|
7672
7694
|
var context_1 = __nccwpck_require__(5875);
|
|
7673
7695
|
var deploy_1 = __nccwpck_require__(8483);
|
|
7674
|
-
var packageManager_1 = __nccwpck_require__(6451);
|
|
7675
7696
|
var injectDefaultVarsInCustomJobs = function (context, jobs) {
|
|
7676
7697
|
return jobs.map(function (_a) {
|
|
7677
7698
|
var _b;
|
|
@@ -7696,14 +7717,11 @@ var createRawJobs = function (context) {
|
|
|
7696
7717
|
return __spreadArray(__spreadArray(__spreadArray([], __read(buildJobs), false), __read(deployJobs), false), __read(customJobs), false);
|
|
7697
7718
|
};
|
|
7698
7719
|
var createJobsForComponent = function (contextContext) { return __awaiter(void 0, void 0, void 0, function () {
|
|
7699
|
-
var
|
|
7720
|
+
var context;
|
|
7700
7721
|
return __generator(this, function (_a) {
|
|
7701
7722
|
switch (_a.label) {
|
|
7702
|
-
case 0: return [4 /*yield*/, (0,
|
|
7723
|
+
case 0: return [4 /*yield*/, (0, context_1.createComponentContext)(contextContext)];
|
|
7703
7724
|
case 1:
|
|
7704
|
-
packageManagerInfo = _a.sent();
|
|
7705
|
-
return [4 /*yield*/, (0, context_1.createComponentContext)(__assign(__assign({}, contextContext), { packageManagerInfo: packageManagerInfo }))];
|
|
7706
|
-
case 2:
|
|
7707
7725
|
context = _a.sent();
|
|
7708
7726
|
return [2 /*return*/, createRawJobs(context).map(function (job) { return (__assign(__assign({}, job), { context: context })); })];
|
|
7709
7727
|
}
|
|
@@ -6471,6 +6471,9 @@ var reloadConfigAndObserve = function () { return __awaiter(void 0, void 0, void
|
|
|
6471
6471
|
case 0: return [4 /*yield*/, (0, projects_1.getGitRoot)()];
|
|
6472
6472
|
case 1:
|
|
6473
6473
|
gitRoot = _a.sent();
|
|
6474
|
+
if (!gitRoot) {
|
|
6475
|
+
return [2 /*return*/];
|
|
6476
|
+
}
|
|
6474
6477
|
result = (0, pipeline_1.readConfigSync)(gitRoot);
|
|
6475
6478
|
if (!result) {
|
|
6476
6479
|
// can't do anything, there is no config
|
|
@@ -9082,10 +9085,18 @@ var getProjectConfig_1 = __nccwpck_require__(12145);
|
|
|
9082
9085
|
var files_1 = __nccwpck_require__(9863);
|
|
9083
9086
|
var child_process_promise_1 = __nccwpck_require__(75763);
|
|
9084
9087
|
var getGitRoot = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
9088
|
+
var e_1;
|
|
9085
9089
|
return __generator(this, function (_a) {
|
|
9086
9090
|
switch (_a.label) {
|
|
9087
|
-
case 0:
|
|
9091
|
+
case 0:
|
|
9092
|
+
_a.trys.push([0, 2, , 3]);
|
|
9093
|
+
return [4 /*yield*/, (0, child_process_promise_1.exec)("git rev-parse --show-toplevel")];
|
|
9088
9094
|
case 1: return [2 /*return*/, (_a.sent()).stdout.trim()];
|
|
9095
|
+
case 2:
|
|
9096
|
+
e_1 = _a.sent();
|
|
9097
|
+
// not a git repo
|
|
9098
|
+
return [2 /*return*/, null];
|
|
9099
|
+
case 3: return [2 /*return*/];
|
|
9089
9100
|
}
|
|
9090
9101
|
});
|
|
9091
9102
|
}); };
|
|
@@ -9715,7 +9726,7 @@ var createAppBuildJob = function (context, _a) {
|
|
|
9715
9726
|
cache: [],
|
|
9716
9727
|
variables: __assign(__assign(__assign(__assign({}, (variables !== null && variables !== void 0 ? variables : {})), context.environment.envVars), context.environment.jobOnlyVars.build.envVars), ((_b = context.build.config.extraVars) !== null && _b !== void 0 ? _b : {})),
|
|
9717
9728
|
runnerVariables: __assign(__assign(__assign({}, constants_1.RUNNER_BUILD_RESOURCE_VARIABLES), (runnerVariables !== null && runnerVariables !== void 0 ? runnerVariables : {})), ((_c = context.build.config.runnerVariables) !== null && _c !== void 0 ? _c : {})),
|
|
9718
|
-
script: __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((context
|
|
9729
|
+
script: __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(((0, writeDotEnv_1.componentContextNeedsBuildTimeDotEnv)(context)
|
|
9719
9730
|
? (0, writeDotEnv_1.writeDotEnv)(context)
|
|
9720
9731
|
: [])), false), __read((0, writeBuildInfo_1.writeBuildInfo)(context)), false), __read((0, yarn_1.ensureNodeVersion)(context.build)), false), [
|
|
9721
9732
|
"cd ".concat(context.build.dir)
|
|
@@ -9903,7 +9914,7 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
9903
9914
|
return ar;
|
|
9904
9915
|
};
|
|
9905
9916
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
9906
|
-
exports.writeDotEnv = void 0;
|
|
9917
|
+
exports.componentContextNeedsBuildTimeDotEnv = exports.writeDotEnv = void 0;
|
|
9907
9918
|
var lodash_1 = __nccwpck_require__(23255);
|
|
9908
9919
|
/**
|
|
9909
9920
|
* writes a .env file in the components folder
|
|
@@ -9929,6 +9940,10 @@ var writeDotEnv = function (context) {
|
|
|
9929
9940
|
];
|
|
9930
9941
|
};
|
|
9931
9942
|
exports.writeDotEnv = writeDotEnv;
|
|
9943
|
+
var componentContextNeedsBuildTimeDotEnv = function (context) {
|
|
9944
|
+
return context.componentConfig.dotEnv === true; // don't build when set to `local`
|
|
9945
|
+
};
|
|
9946
|
+
exports.componentContextNeedsBuildTimeDotEnv = componentContextNeedsBuildTimeDotEnv;
|
|
9932
9947
|
//# sourceMappingURL=writeDotEnv.js.map
|
|
9933
9948
|
|
|
9934
9949
|
/***/ }),
|
|
@@ -10443,7 +10458,7 @@ var cache_1 = __nccwpck_require__(72026);
|
|
|
10443
10458
|
var constants_1 = __nccwpck_require__(31765);
|
|
10444
10459
|
var yarn_1 = __nccwpck_require__(45043);
|
|
10445
10460
|
var createNodeBuildJobs = function (context) {
|
|
10446
|
-
var _a, _b, _c, _d, _e
|
|
10461
|
+
var _a, _b, _c, _d, _e;
|
|
10447
10462
|
var buildConfig = context.build.config;
|
|
10448
10463
|
if (!(0, types_1.isOfBuildType)(buildConfig, "node", "node-static", "storybook")) {
|
|
10449
10464
|
throw new Error("deploy config is not node, node-static or storybook");
|
|
@@ -10460,7 +10475,8 @@ var createNodeBuildJobs = function (context) {
|
|
|
10460
10475
|
artifacts: {
|
|
10461
10476
|
paths: __spreadArray([
|
|
10462
10477
|
context.build.dir
|
|
10463
|
-
], __read(((
|
|
10478
|
+
], __read(((_d = context.build.packageManagerInfo
|
|
10479
|
+
.currentWorkspaceDependencies) !== null && _d !== void 0 ? _d : [])), false).flatMap(function (dir) {
|
|
10464
10480
|
var _a, _b;
|
|
10465
10481
|
return __spreadArray([
|
|
10466
10482
|
(0, path_1.join)(dir, "__build_info.json"),
|
|
@@ -10484,7 +10500,8 @@ var createNodeBuildJobs = function (context) {
|
|
|
10484
10500
|
variables: {
|
|
10485
10501
|
// only required for non static
|
|
10486
10502
|
DOCKER_COPY_AND_INSTALL_APP: (0, yarn_1.getDockerAppCopyAndBuildScript)(context.build),
|
|
10487
|
-
DOCKER_COPY_WORKSPACE_FILES: (
|
|
10503
|
+
DOCKER_COPY_WORKSPACE_FILES: (_e = context.build.packageManagerInfo.pathsToCopyInDocker
|
|
10504
|
+
.map(function (dir) { return "COPY --chown=node:node ".concat(dir, " /app/").concat(dir); })) === null || _e === void 0 ? void 0 : _e.join("\n"),
|
|
10488
10505
|
},
|
|
10489
10506
|
},
|
|
10490
10507
|
});
|
|
@@ -10533,9 +10550,8 @@ var path_1 = __nccwpck_require__(71017);
|
|
|
10533
10550
|
var slugify_1 = __importDefault(__nccwpck_require__(44035));
|
|
10534
10551
|
var lodash_1 = __nccwpck_require__(23255);
|
|
10535
10552
|
var getYarnCache = function (context, policy) {
|
|
10536
|
-
var _a;
|
|
10537
10553
|
if (policy === void 0) { policy = "pull-push"; }
|
|
10538
|
-
var componentIsInWorkspace =
|
|
10554
|
+
var componentIsInWorkspace = context.packageManagerInfo.componentIsInWorkspace;
|
|
10539
10555
|
return [
|
|
10540
10556
|
componentIsInWorkspace
|
|
10541
10557
|
? {
|
|
@@ -10552,9 +10568,9 @@ var getYarnCache = function (context, policy) {
|
|
|
10552
10568
|
};
|
|
10553
10569
|
exports.getYarnCache = getYarnCache;
|
|
10554
10570
|
var getNodeModulesCache = function (context, policy) {
|
|
10555
|
-
var _a
|
|
10571
|
+
var _a;
|
|
10556
10572
|
if (policy === void 0) { policy = "pull-push"; }
|
|
10557
|
-
var componentIsInWorkspace =
|
|
10573
|
+
var componentIsInWorkspace = context.packageManagerInfo.componentIsInWorkspace;
|
|
10558
10574
|
// We intentionally do not use the contents of yarn.lock as a cache key, as yarn 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.
|
|
10559
10575
|
// It would slow down all pipelines whenever one adds a new dependency as it will need to download all node_modules again.
|
|
10560
10576
|
return [
|
|
@@ -10567,9 +10583,9 @@ var getNodeModulesCache = function (context, policy) {
|
|
|
10567
10583
|
paths: __spreadArray([], __read((componentIsInWorkspace
|
|
10568
10584
|
? (0, lodash_1.uniq)(__spreadArray([
|
|
10569
10585
|
"node_modules"
|
|
10570
|
-
], __read(((
|
|
10586
|
+
], __read(((_a = context.packageManagerInfo.workspaces.map(function (w) {
|
|
10571
10587
|
return (0, path_1.join)(w.location, "node_modules");
|
|
10572
|
-
})) !== null &&
|
|
10588
|
+
})) !== null && _a !== void 0 ? _a : [])), false))
|
|
10573
10589
|
: [(0, path_1.join)(context.dir, "node_modules")])), false),
|
|
10574
10590
|
},
|
|
10575
10591
|
];
|
|
@@ -10802,7 +10818,7 @@ var constants_1 = __nccwpck_require__(31765);
|
|
|
10802
10818
|
var yarn_1 = __nccwpck_require__(45043);
|
|
10803
10819
|
var createArtifactsConfig_1 = __nccwpck_require__(12820);
|
|
10804
10820
|
var createNodeTestJobs = function (context) {
|
|
10805
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u
|
|
10821
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
10806
10822
|
// don't run tests after release
|
|
10807
10823
|
// TODO: this will be replaced by using rules
|
|
10808
10824
|
if (context.trigger === "taggedRelease") {
|
|
@@ -10822,18 +10838,18 @@ var createNodeTestJobs = function (context) {
|
|
|
10822
10838
|
? __assign(__assign(__assign({ name: "🛡 audit" }, base), { image: (_c = (_b = buildConfig.audit) === null || _b === void 0 ? void 0 : _b.jobImage) !== null && _c !== void 0 ? _c : defaultImage, cache: undefined, script: __spreadArray([
|
|
10823
10839
|
"cd ".concat(context.build.dir)
|
|
10824
10840
|
], __read(((_e = (0, utils_1.ensureArray)((_d = buildConfig.audit) === null || _d === void 0 ? void 0 : _d.command)) !== null && _e !== void 0 ? _e : [
|
|
10825
|
-
|
|
10841
|
+
context.build.packageManagerInfo.isClassic
|
|
10826
10842
|
? "yarn audit"
|
|
10827
10843
|
: "yarn npm audit --environment production", // yarn 2
|
|
10828
|
-
])), false), allow_failure: true }), (0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (
|
|
10844
|
+
])), false), allow_failure: true }), (0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (_f = buildConfig.audit) === null || _f === void 0 ? void 0 : _f.artifactsReports, (_g = buildConfig.audit) === null || _g === void 0 ? void 0 : _g.artifacts)) : null;
|
|
10829
10845
|
var lintJob = buildConfig.lint !== false
|
|
10830
|
-
? __assign(__assign(__assign({ name: "👮 lint" }, base), { image: (
|
|
10846
|
+
? __assign(__assign(__assign({ name: "👮 lint" }, base), { image: (_j = (_h = buildConfig.lint) === null || _h === void 0 ? void 0 : _h.jobImage) !== null && _j !== void 0 ? _j : defaultImage, cache: (0, cache_1.getNodeCache)(context.build), script: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, yarn_1.ensureNodeVersion)(context.build)), false), [
|
|
10831
10847
|
"cd ".concat(context.build.dir)
|
|
10832
|
-
], false), __read(yarnInstall), false), __read(((
|
|
10848
|
+
], false), __read(yarnInstall), false), __read(((_l = (0, utils_1.ensureArray)((_k = buildConfig.lint) === null || _k === void 0 ? void 0 : _k.command)) !== null && _l !== void 0 ? _l : ["yarn lint"])), false) }), (0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (_m = buildConfig.lint) === null || _m === void 0 ? void 0 : _m.artifactsReports, (_o = buildConfig.lint) === null || _o === void 0 ? void 0 : _o.artifacts)) : null;
|
|
10833
10849
|
var testJob = buildConfig.test !== false
|
|
10834
|
-
? __assign(__assign(__assign({ name: "🧪 test" }, base), { image: (
|
|
10850
|
+
? __assign(__assign(__assign({ name: "🧪 test" }, base), { image: (_q = (_p = buildConfig.test) === null || _p === void 0 ? void 0 : _p.jobImage) !== null && _q !== void 0 ? _q : (0, runner_1.getRunnerImage)("jobs-testing-chrome"), cache: (0, cache_1.getNodeCache)(context.build), script: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, yarn_1.ensureNodeVersion)(context.build)), false), [
|
|
10835
10851
|
"cd ".concat(context.build.dir)
|
|
10836
|
-
], false), __read(yarnInstall), false), __read(((
|
|
10852
|
+
], false), __read(yarnInstall), false), __read(((_s = (0, utils_1.ensureArray)((_r = buildConfig.test) === null || _r === void 0 ? void 0 : _r.command)) !== null && _s !== void 0 ? _s : ["yarn test"])), false) }), (0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (_t = buildConfig.test) === null || _t === void 0 ? void 0 : _t.artifactsReports, (_u = buildConfig.test) === null || _u === void 0 ? void 0 : _u.artifacts)) : null;
|
|
10837
10853
|
return [auditJob, lintJob, testJob].filter(utils_1.notNil);
|
|
10838
10854
|
};
|
|
10839
10855
|
exports.createNodeTestJobs = createNodeTestJobs;
|
|
@@ -10880,8 +10896,7 @@ var YARN_INSTALL_CLASSIC = "yarn install --frozen-lockfile";
|
|
|
10880
10896
|
// FIXME: check why and when rebuild is needed
|
|
10881
10897
|
var YARN_BERRY_PROD_REBUILD = "yarn workspaces focus --production && yarn rebuild";
|
|
10882
10898
|
var getYarnInstallCommand = function (context) {
|
|
10883
|
-
|
|
10884
|
-
if ((_a = context.packageManagerInfo) === null || _a === void 0 ? void 0 : _a.isClassic) {
|
|
10899
|
+
if (context.packageManagerInfo.isClassic) {
|
|
10885
10900
|
return YARN_INSTALL_CLASSIC;
|
|
10886
10901
|
}
|
|
10887
10902
|
return "yarn install --immutable";
|
|
@@ -10903,13 +10918,14 @@ var getYarnInstall = function (context, options) {
|
|
|
10903
10918
|
exports.getYarnInstall = getYarnInstall;
|
|
10904
10919
|
var DOCKER_COPY_FILES = "COPY --chown=node:node $APP_DIR .";
|
|
10905
10920
|
var getDockerAppCopyAndBuildScript = function (context) {
|
|
10906
|
-
|
|
10907
|
-
if ((_a = context.packageManagerInfo) === null || _a === void 0 ? void 0 : _a.isClassic) {
|
|
10921
|
+
if (context.packageManagerInfo.isClassic) {
|
|
10908
10922
|
return new BashExpression_1.BashExpression("\nRUN ".concat(YARN_INSTALL_CLASSIC, " --production --ignore-scripts\n").concat(DOCKER_COPY_FILES, "\nRUN ").concat(YARN_INSTALL_CLASSIC, " --production \n ").trim());
|
|
10909
10923
|
}
|
|
10910
10924
|
// yarn >= 4 ships with build in plugins, see https://github.com/yarnpkg/berry/pull/4253
|
|
10911
10925
|
// trying to import those fail on this version
|
|
10912
|
-
var doesNotShipWithBuiltInPlugins = ["2", "3"].some(function (v) {
|
|
10926
|
+
var doesNotShipWithBuiltInPlugins = ["2", "3"].some(function (v) {
|
|
10927
|
+
return context.packageManagerInfo.version.startsWith(v);
|
|
10928
|
+
});
|
|
10913
10929
|
var maybeAddWorkspaceToolsCommand = doesNotShipWithBuiltInPlugins
|
|
10914
10930
|
? "RUN yarn plugin import workspace-tools"
|
|
10915
10931
|
: "";
|
|
@@ -11163,19 +11179,19 @@ var utils_1 = __nccwpck_require__(32497);
|
|
|
11163
11179
|
exports.SBOM_BUILD_JOB_NAME = "🧾 sbom";
|
|
11164
11180
|
exports.SBOM_FILE = "__sbom.json";
|
|
11165
11181
|
var createSbomBuildJob = function (context) {
|
|
11166
|
-
var _a, _b, _c, _d
|
|
11182
|
+
var _a, _b, _c, _d;
|
|
11167
11183
|
var buildConfig = context.build.config;
|
|
11168
11184
|
var defaultImage = "aquasec/trivy:0.38.3";
|
|
11169
11185
|
var defaultScript = [
|
|
11170
|
-
"trivy fs --quiet --format cyclonedx --output \"".concat(exports.SBOM_FILE, "\" ").concat(
|
|
11186
|
+
"trivy fs --quiet --format cyclonedx --output \"".concat(exports.SBOM_FILE, "\" ").concat(context.build.packageManagerInfo.componentIsInWorkspace
|
|
11171
11187
|
? "."
|
|
11172
11188
|
: context.build.dir),
|
|
11173
11189
|
];
|
|
11174
11190
|
var image = buildConfig.type === "custom" && buildConfig.sbom !== false
|
|
11175
|
-
? (
|
|
11191
|
+
? (_b = (_a = buildConfig.sbom) === null || _a === void 0 ? void 0 : _a.jobImage) !== null && _b !== void 0 ? _b : defaultImage
|
|
11176
11192
|
: defaultImage;
|
|
11177
11193
|
var script = buildConfig.type === "custom" && buildConfig.sbom !== false
|
|
11178
|
-
? (
|
|
11194
|
+
? (_d = (0, utils_1.ensureArray)((_c = buildConfig.sbom) === null || _c === void 0 ? void 0 : _c.command)) !== null && _d !== void 0 ? _d : defaultScript
|
|
11179
11195
|
: defaultScript;
|
|
11180
11196
|
return {
|
|
11181
11197
|
name: exports.SBOM_BUILD_JOB_NAME,
|
|
@@ -11440,14 +11456,18 @@ var deploy_1 = __nccwpck_require__(68483);
|
|
|
11440
11456
|
var utils_1 = __nccwpck_require__(32497);
|
|
11441
11457
|
var getEnvironment_1 = __nccwpck_require__(45699);
|
|
11442
11458
|
var getEnvironmentContext_1 = __nccwpck_require__(13663);
|
|
11459
|
+
var packageManager_1 = __nccwpck_require__(76451);
|
|
11443
11460
|
var createComponentContext = function (ctx) { return __awaiter(void 0, void 0, void 0, function () {
|
|
11444
|
-
var envContext, componentConfigWithoutDefaults, defaults, componentConfig, environment, deploy, build, customJobs, dir, context, resolvedCustomJobs;
|
|
11461
|
+
var packageManagerInfo, envContext, componentConfigWithoutDefaults, defaults, componentConfig, environment, deploy, build, customJobs, dir, context, resolvedCustomJobs;
|
|
11445
11462
|
return __generator(this, function (_a) {
|
|
11446
11463
|
switch (_a.label) {
|
|
11447
11464
|
case 0:
|
|
11448
11465
|
if (!/^[a-z0-9-]+$/.test(ctx.componentName)) {
|
|
11449
11466
|
throw new Error("componentName may only contain lower case letters, numbers and -");
|
|
11450
11467
|
}
|
|
11468
|
+
return [4 /*yield*/, (0, packageManager_1.getPackageManagerInfo)(ctx.config, ctx.componentName)];
|
|
11469
|
+
case 1:
|
|
11470
|
+
packageManagerInfo = _a.sent();
|
|
11451
11471
|
envContext = (0, getEnvironmentContext_1.getEnvironmentContext)(ctx);
|
|
11452
11472
|
componentConfigWithoutDefaults = envContext.envConfigRaw;
|
|
11453
11473
|
defaults = componentConfigWithoutDefaults.deploy
|
|
@@ -11461,7 +11481,7 @@ var createComponentContext = function (ctx) { return __awaiter(void 0, void 0, v
|
|
|
11461
11481
|
};
|
|
11462
11482
|
componentConfig = (0, utils_1.mergeWithMergingArrays)(defaults, componentConfigWithoutDefaults);
|
|
11463
11483
|
return [4 /*yield*/, (0, getEnvironment_1.getEnvironment)(ctx)];
|
|
11464
|
-
case
|
|
11484
|
+
case 2:
|
|
11465
11485
|
environment = _a.sent();
|
|
11466
11486
|
deploy = componentConfig.deploy, build = componentConfig.build, customJobs = componentConfig.customJobs, dir = componentConfig.dir;
|
|
11467
11487
|
context = {
|
|
@@ -11469,7 +11489,7 @@ var createComponentContext = function (ctx) { return __awaiter(void 0, void 0, v
|
|
|
11469
11489
|
componentConfig: componentConfig,
|
|
11470
11490
|
build: {
|
|
11471
11491
|
dir: dir,
|
|
11472
|
-
packageManagerInfo:
|
|
11492
|
+
packageManagerInfo: packageManagerInfo,
|
|
11473
11493
|
config: build,
|
|
11474
11494
|
},
|
|
11475
11495
|
deploy: deploy
|
|
@@ -11479,7 +11499,7 @@ var createComponentContext = function (ctx) { return __awaiter(void 0, void 0, v
|
|
|
11479
11499
|
: null,
|
|
11480
11500
|
componentName: ctx.componentName,
|
|
11481
11501
|
environment: environment,
|
|
11482
|
-
packageManagerInfo:
|
|
11502
|
+
packageManagerInfo: packageManagerInfo,
|
|
11483
11503
|
pipelineType: ctx.pipelineType,
|
|
11484
11504
|
trigger: ctx.trigger,
|
|
11485
11505
|
};
|
|
@@ -15117,7 +15137,6 @@ exports.createJobsForComponent = void 0;
|
|
|
15117
15137
|
var build_1 = __nccwpck_require__(67862);
|
|
15118
15138
|
var context_1 = __nccwpck_require__(5875);
|
|
15119
15139
|
var deploy_1 = __nccwpck_require__(68483);
|
|
15120
|
-
var packageManager_1 = __nccwpck_require__(76451);
|
|
15121
15140
|
var injectDefaultVarsInCustomJobs = function (context, jobs) {
|
|
15122
15141
|
return jobs.map(function (_a) {
|
|
15123
15142
|
var _b;
|
|
@@ -15142,14 +15161,11 @@ var createRawJobs = function (context) {
|
|
|
15142
15161
|
return __spreadArray(__spreadArray(__spreadArray([], __read(buildJobs), false), __read(deployJobs), false), __read(customJobs), false);
|
|
15143
15162
|
};
|
|
15144
15163
|
var createJobsForComponent = function (contextContext) { return __awaiter(void 0, void 0, void 0, function () {
|
|
15145
|
-
var
|
|
15164
|
+
var context;
|
|
15146
15165
|
return __generator(this, function (_a) {
|
|
15147
15166
|
switch (_a.label) {
|
|
15148
|
-
case 0: return [4 /*yield*/, (0,
|
|
15167
|
+
case 0: return [4 /*yield*/, (0, context_1.createComponentContext)(contextContext)];
|
|
15149
15168
|
case 1:
|
|
15150
|
-
packageManagerInfo = _a.sent();
|
|
15151
|
-
return [4 /*yield*/, (0, context_1.createComponentContext)(__assign(__assign({}, contextContext), { packageManagerInfo: packageManagerInfo }))];
|
|
15152
|
-
case 2:
|
|
15153
15169
|
context = _a.sent();
|
|
15154
15170
|
return [2 /*return*/, createRawJobs(context).map(function (job) { return (__assign(__assign({}, job), { context: context })); })];
|
|
15155
15171
|
}
|
package/dist/cli/src/catenv.js
CHANGED
|
@@ -6,7 +6,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
var catenv_1 = __importDefault(require("./apps/catenv/catenv"));
|
|
7
7
|
var parseChoice_1 = require("./config/parseChoice");
|
|
8
8
|
var choice = process.argv[2] ? (0, parseChoice_1.parseChoice)(process.argv[2]) : null;
|
|
9
|
+
var now = performance.now();
|
|
9
10
|
(0, catenv_1.default)(choice).then(function () {
|
|
11
|
+
console.log("catenv", performance.now() - now);
|
|
10
12
|
// we have to exit manually, because we have some file watches
|
|
11
13
|
process.exit();
|
|
12
14
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catenv.js","sourceRoot":"","sources":["../../../src/catenv.ts"],"names":[],"mappings":";;;;;AAAA,gEAA0C;AAE1C,oDAAmD;AAEnD,IAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAA,yBAAW,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAErE,IAAA,gBAAM,EAAC,MAAM,CAAC,CAAC,IAAI,CAAC;IAClB,8DAA8D;IAC9D,OAAO,CAAC,IAAI,EAAE,CAAC;AACjB,CAAC,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"catenv.js","sourceRoot":"","sources":["../../../src/catenv.ts"],"names":[],"mappings":";;;;;AAAA,gEAA0C;AAE1C,oDAAmD;AAEnD,IAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAA,yBAAW,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAErE,IAAM,GAAG,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;AAC9B,IAAA,gBAAM,EAAC,MAAM,CAAC,CAAC,IAAI,CAAC;IAClB,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,EAAE,GAAG,GAAG,CAAC,CAAC;IAC/C,8DAA8D;IAC9D,OAAO,CAAC,IAAI,EAAE,CAAC;AACjB,CAAC,CAAC,CAAC"}
|
|
@@ -79,6 +79,9 @@ var reloadConfigAndObserve = function () { return __awaiter(void 0, void 0, void
|
|
|
79
79
|
case 0: return [4 /*yield*/, (0, projects_1.getGitRoot)()];
|
|
80
80
|
case 1:
|
|
81
81
|
gitRoot = _a.sent();
|
|
82
|
+
if (!gitRoot) {
|
|
83
|
+
return [2 /*return*/];
|
|
84
|
+
}
|
|
82
85
|
result = (0, pipeline_1.readConfigSync)(gitRoot);
|
|
83
86
|
if (!result) {
|
|
84
87
|
// can't do anything, there is no config
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getProjectConfig.js","sourceRoot":"","sources":["../../../../src/config/getProjectConfig.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,gDAM6B;AAG7B,0CAA6E;AAE7E,8CAA+C;AAE/C,yBAA2B;AAE3B,6CAA4C;AAAnC,0GAAA,WAAW,OAAA;AAEpB,IAAI,aAAa,GAAkB,IAAI,CAAC;AAExC,8BAA8B;AAC9B,IAAM,sBAAsB,GAAG;;;;oBACb,qBAAM,IAAA,qBAAU,GAAE,EAAA;;gBAA5B,OAAO,GAAG,SAAkB;
|
|
1
|
+
{"version":3,"file":"getProjectConfig.js","sourceRoot":"","sources":["../../../../src/config/getProjectConfig.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,gDAM6B;AAG7B,0CAA6E;AAE7E,8CAA+C;AAE/C,yBAA2B;AAE3B,6CAA4C;AAAnC,0GAAA,WAAW,OAAA;AAEpB,IAAI,aAAa,GAAkB,IAAI,CAAC;AAExC,8BAA8B;AAC9B,IAAM,sBAAsB,GAAG;;;;oBACb,qBAAM,IAAA,qBAAU,GAAE,EAAA;;gBAA5B,OAAO,GAAG,SAAkB;gBAClC,IAAI,CAAC,OAAO,EAAE,CAAC;oBACb,sBAAO;gBACT,CAAC;gBACK,MAAM,GAAG,IAAA,yBAAc,EAAC,OAAO,CAAC,CAAC;gBACvC,IAAI,CAAC,MAAM,EAAE,CAAC;oBACZ,wCAAwC;oBACxC,sBAAO;gBACT,CAAC;gBACO,MAAM,GAAW,MAAM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