@catladder/cli 0.0.0-main-74b7952c → 0.0.0-main-ab1c788d
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 +166 -141
- package/dist/bundles/cli/index.js +164 -141
- 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/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 +15 -0
- package/dist/pipeline/src/context/createComponentContext.js +116 -0
- package/dist/pipeline/src/context/createComponentContext.js.map +1 -0
- package/dist/pipeline/src/context/index.d.ts +1 -16
- package/dist/pipeline/src/context/index.js +1 -109
- package/dist/pipeline/src/context/index.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
|
@@ -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
|
}); };
|
|
@@ -10443,7 +10454,7 @@ var cache_1 = __nccwpck_require__(72026);
|
|
|
10443
10454
|
var constants_1 = __nccwpck_require__(31765);
|
|
10444
10455
|
var yarn_1 = __nccwpck_require__(45043);
|
|
10445
10456
|
var createNodeBuildJobs = function (context) {
|
|
10446
|
-
var _a, _b, _c, _d, _e
|
|
10457
|
+
var _a, _b, _c, _d, _e;
|
|
10447
10458
|
var buildConfig = context.build.config;
|
|
10448
10459
|
if (!(0, types_1.isOfBuildType)(buildConfig, "node", "node-static", "storybook")) {
|
|
10449
10460
|
throw new Error("deploy config is not node, node-static or storybook");
|
|
@@ -10460,7 +10471,8 @@ var createNodeBuildJobs = function (context) {
|
|
|
10460
10471
|
artifacts: {
|
|
10461
10472
|
paths: __spreadArray([
|
|
10462
10473
|
context.build.dir
|
|
10463
|
-
], __read(((
|
|
10474
|
+
], __read(((_d = context.build.packageManagerInfo
|
|
10475
|
+
.currentWorkspaceDependencies) !== null && _d !== void 0 ? _d : [])), false).flatMap(function (dir) {
|
|
10464
10476
|
var _a, _b;
|
|
10465
10477
|
return __spreadArray([
|
|
10466
10478
|
(0, path_1.join)(dir, "__build_info.json"),
|
|
@@ -10484,7 +10496,8 @@ var createNodeBuildJobs = function (context) {
|
|
|
10484
10496
|
variables: {
|
|
10485
10497
|
// only required for non static
|
|
10486
10498
|
DOCKER_COPY_AND_INSTALL_APP: (0, yarn_1.getDockerAppCopyAndBuildScript)(context.build),
|
|
10487
|
-
DOCKER_COPY_WORKSPACE_FILES: (
|
|
10499
|
+
DOCKER_COPY_WORKSPACE_FILES: (_e = context.build.packageManagerInfo.pathsToCopyInDocker
|
|
10500
|
+
.map(function (dir) { return "COPY --chown=node:node ".concat(dir, " /app/").concat(dir); })) === null || _e === void 0 ? void 0 : _e.join("\n"),
|
|
10488
10501
|
},
|
|
10489
10502
|
},
|
|
10490
10503
|
});
|
|
@@ -10533,9 +10546,8 @@ var path_1 = __nccwpck_require__(71017);
|
|
|
10533
10546
|
var slugify_1 = __importDefault(__nccwpck_require__(44035));
|
|
10534
10547
|
var lodash_1 = __nccwpck_require__(23255);
|
|
10535
10548
|
var getYarnCache = function (context, policy) {
|
|
10536
|
-
var _a;
|
|
10537
10549
|
if (policy === void 0) { policy = "pull-push"; }
|
|
10538
|
-
var componentIsInWorkspace =
|
|
10550
|
+
var componentIsInWorkspace = context.packageManagerInfo.componentIsInWorkspace;
|
|
10539
10551
|
return [
|
|
10540
10552
|
componentIsInWorkspace
|
|
10541
10553
|
? {
|
|
@@ -10552,9 +10564,9 @@ var getYarnCache = function (context, policy) {
|
|
|
10552
10564
|
};
|
|
10553
10565
|
exports.getYarnCache = getYarnCache;
|
|
10554
10566
|
var getNodeModulesCache = function (context, policy) {
|
|
10555
|
-
var _a
|
|
10567
|
+
var _a;
|
|
10556
10568
|
if (policy === void 0) { policy = "pull-push"; }
|
|
10557
|
-
var componentIsInWorkspace =
|
|
10569
|
+
var componentIsInWorkspace = context.packageManagerInfo.componentIsInWorkspace;
|
|
10558
10570
|
// 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
10571
|
// It would slow down all pipelines whenever one adds a new dependency as it will need to download all node_modules again.
|
|
10560
10572
|
return [
|
|
@@ -10567,9 +10579,9 @@ var getNodeModulesCache = function (context, policy) {
|
|
|
10567
10579
|
paths: __spreadArray([], __read((componentIsInWorkspace
|
|
10568
10580
|
? (0, lodash_1.uniq)(__spreadArray([
|
|
10569
10581
|
"node_modules"
|
|
10570
|
-
], __read(((
|
|
10582
|
+
], __read(((_a = context.packageManagerInfo.workspaces.map(function (w) {
|
|
10571
10583
|
return (0, path_1.join)(w.location, "node_modules");
|
|
10572
|
-
})) !== null &&
|
|
10584
|
+
})) !== null && _a !== void 0 ? _a : [])), false))
|
|
10573
10585
|
: [(0, path_1.join)(context.dir, "node_modules")])), false),
|
|
10574
10586
|
},
|
|
10575
10587
|
];
|
|
@@ -10802,7 +10814,7 @@ var constants_1 = __nccwpck_require__(31765);
|
|
|
10802
10814
|
var yarn_1 = __nccwpck_require__(45043);
|
|
10803
10815
|
var createArtifactsConfig_1 = __nccwpck_require__(12820);
|
|
10804
10816
|
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
|
|
10817
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
10806
10818
|
// don't run tests after release
|
|
10807
10819
|
// TODO: this will be replaced by using rules
|
|
10808
10820
|
if (context.trigger === "taggedRelease") {
|
|
@@ -10822,18 +10834,18 @@ var createNodeTestJobs = function (context) {
|
|
|
10822
10834
|
? __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
10835
|
"cd ".concat(context.build.dir)
|
|
10824
10836
|
], __read(((_e = (0, utils_1.ensureArray)((_d = buildConfig.audit) === null || _d === void 0 ? void 0 : _d.command)) !== null && _e !== void 0 ? _e : [
|
|
10825
|
-
|
|
10837
|
+
context.build.packageManagerInfo.isClassic
|
|
10826
10838
|
? "yarn audit"
|
|
10827
10839
|
: "yarn npm audit --environment production", // yarn 2
|
|
10828
|
-
])), false), allow_failure: true }), (0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (
|
|
10840
|
+
])), 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
10841
|
var lintJob = buildConfig.lint !== false
|
|
10830
|
-
? __assign(__assign(__assign({ name: "👮 lint" }, base), { image: (
|
|
10842
|
+
? __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
10843
|
"cd ".concat(context.build.dir)
|
|
10832
|
-
], false), __read(yarnInstall), false), __read(((
|
|
10844
|
+
], 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
10845
|
var testJob = buildConfig.test !== false
|
|
10834
|
-
? __assign(__assign(__assign({ name: "🧪 test" }, base), { image: (
|
|
10846
|
+
? __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
10847
|
"cd ".concat(context.build.dir)
|
|
10836
|
-
], false), __read(yarnInstall), false), __read(((
|
|
10848
|
+
], 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
10849
|
return [auditJob, lintJob, testJob].filter(utils_1.notNil);
|
|
10838
10850
|
};
|
|
10839
10851
|
exports.createNodeTestJobs = createNodeTestJobs;
|
|
@@ -10880,8 +10892,7 @@ var YARN_INSTALL_CLASSIC = "yarn install --frozen-lockfile";
|
|
|
10880
10892
|
// FIXME: check why and when rebuild is needed
|
|
10881
10893
|
var YARN_BERRY_PROD_REBUILD = "yarn workspaces focus --production && yarn rebuild";
|
|
10882
10894
|
var getYarnInstallCommand = function (context) {
|
|
10883
|
-
|
|
10884
|
-
if ((_a = context.packageManagerInfo) === null || _a === void 0 ? void 0 : _a.isClassic) {
|
|
10895
|
+
if (context.packageManagerInfo.isClassic) {
|
|
10885
10896
|
return YARN_INSTALL_CLASSIC;
|
|
10886
10897
|
}
|
|
10887
10898
|
return "yarn install --immutable";
|
|
@@ -10903,13 +10914,14 @@ var getYarnInstall = function (context, options) {
|
|
|
10903
10914
|
exports.getYarnInstall = getYarnInstall;
|
|
10904
10915
|
var DOCKER_COPY_FILES = "COPY --chown=node:node $APP_DIR .";
|
|
10905
10916
|
var getDockerAppCopyAndBuildScript = function (context) {
|
|
10906
|
-
|
|
10907
|
-
if ((_a = context.packageManagerInfo) === null || _a === void 0 ? void 0 : _a.isClassic) {
|
|
10917
|
+
if (context.packageManagerInfo.isClassic) {
|
|
10908
10918
|
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
10919
|
}
|
|
10910
10920
|
// yarn >= 4 ships with build in plugins, see https://github.com/yarnpkg/berry/pull/4253
|
|
10911
10921
|
// trying to import those fail on this version
|
|
10912
|
-
var doesNotShipWithBuiltInPlugins = ["2", "3"].some(function (v) {
|
|
10922
|
+
var doesNotShipWithBuiltInPlugins = ["2", "3"].some(function (v) {
|
|
10923
|
+
return context.packageManagerInfo.version.startsWith(v);
|
|
10924
|
+
});
|
|
10913
10925
|
var maybeAddWorkspaceToolsCommand = doesNotShipWithBuiltInPlugins
|
|
10914
10926
|
? "RUN yarn plugin import workspace-tools"
|
|
10915
10927
|
: "";
|
|
@@ -11163,19 +11175,19 @@ var utils_1 = __nccwpck_require__(32497);
|
|
|
11163
11175
|
exports.SBOM_BUILD_JOB_NAME = "🧾 sbom";
|
|
11164
11176
|
exports.SBOM_FILE = "__sbom.json";
|
|
11165
11177
|
var createSbomBuildJob = function (context) {
|
|
11166
|
-
var _a, _b, _c, _d
|
|
11178
|
+
var _a, _b, _c, _d;
|
|
11167
11179
|
var buildConfig = context.build.config;
|
|
11168
11180
|
var defaultImage = "aquasec/trivy:0.38.3";
|
|
11169
11181
|
var defaultScript = [
|
|
11170
|
-
"trivy fs --quiet --format cyclonedx --output \"".concat(exports.SBOM_FILE, "\" ").concat(
|
|
11182
|
+
"trivy fs --quiet --format cyclonedx --output \"".concat(exports.SBOM_FILE, "\" ").concat(context.build.packageManagerInfo.componentIsInWorkspace
|
|
11171
11183
|
? "."
|
|
11172
11184
|
: context.build.dir),
|
|
11173
11185
|
];
|
|
11174
11186
|
var image = buildConfig.type === "custom" && buildConfig.sbom !== false
|
|
11175
|
-
? (
|
|
11187
|
+
? (_b = (_a = buildConfig.sbom) === null || _a === void 0 ? void 0 : _a.jobImage) !== null && _b !== void 0 ? _b : defaultImage
|
|
11176
11188
|
: defaultImage;
|
|
11177
11189
|
var script = buildConfig.type === "custom" && buildConfig.sbom !== false
|
|
11178
|
-
? (
|
|
11190
|
+
? (_d = (0, utils_1.ensureArray)((_c = buildConfig.sbom) === null || _c === void 0 ? void 0 : _c.command)) !== null && _d !== void 0 ? _d : defaultScript
|
|
11179
11191
|
: defaultScript;
|
|
11180
11192
|
return {
|
|
11181
11193
|
name: exports.SBOM_BUILD_JOB_NAME,
|
|
@@ -11380,6 +11392,129 @@ exports.DOCKER_REGISTRY = process.env.INLINE_DOCKER_REGISTRY ||
|
|
|
11380
11392
|
|
|
11381
11393
|
/***/ }),
|
|
11382
11394
|
|
|
11395
|
+
/***/ 92775:
|
|
11396
|
+
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
11397
|
+
|
|
11398
|
+
"use strict";
|
|
11399
|
+
|
|
11400
|
+
var __assign = (this && this.__assign) || function () {
|
|
11401
|
+
__assign = Object.assign || function(t) {
|
|
11402
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
11403
|
+
s = arguments[i];
|
|
11404
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
11405
|
+
t[p] = s[p];
|
|
11406
|
+
}
|
|
11407
|
+
return t;
|
|
11408
|
+
};
|
|
11409
|
+
return __assign.apply(this, arguments);
|
|
11410
|
+
};
|
|
11411
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
11412
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
11413
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
11414
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
11415
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
11416
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
11417
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
11418
|
+
});
|
|
11419
|
+
};
|
|
11420
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11421
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
11422
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
11423
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
11424
|
+
function step(op) {
|
|
11425
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
11426
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
11427
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
11428
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
11429
|
+
switch (op[0]) {
|
|
11430
|
+
case 0: case 1: t = op; break;
|
|
11431
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
11432
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
11433
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
11434
|
+
default:
|
|
11435
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
11436
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
11437
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
11438
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
11439
|
+
if (t[2]) _.ops.pop();
|
|
11440
|
+
_.trys.pop(); continue;
|
|
11441
|
+
}
|
|
11442
|
+
op = body.call(thisArg, _);
|
|
11443
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
11444
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
11445
|
+
}
|
|
11446
|
+
};
|
|
11447
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
11448
|
+
exports.createContext = exports.createComponentContext = void 0;
|
|
11449
|
+
var lodash_1 = __nccwpck_require__(23255);
|
|
11450
|
+
var build_1 = __nccwpck_require__(67862);
|
|
11451
|
+
var deploy_1 = __nccwpck_require__(68483);
|
|
11452
|
+
var utils_1 = __nccwpck_require__(32497);
|
|
11453
|
+
var getEnvironment_1 = __nccwpck_require__(45699);
|
|
11454
|
+
var getEnvironmentContext_1 = __nccwpck_require__(13663);
|
|
11455
|
+
var packageManager_1 = __nccwpck_require__(76451);
|
|
11456
|
+
var createComponentContext = function (ctx) { return __awaiter(void 0, void 0, void 0, function () {
|
|
11457
|
+
var packageManagerInfo, envContext, componentConfigWithoutDefaults, defaults, componentConfig, environment, deploy, build, customJobs, dir, context, resolvedCustomJobs;
|
|
11458
|
+
return __generator(this, function (_a) {
|
|
11459
|
+
switch (_a.label) {
|
|
11460
|
+
case 0:
|
|
11461
|
+
if (!/^[a-z0-9-]+$/.test(ctx.componentName)) {
|
|
11462
|
+
throw new Error("componentName may only contain lower case letters, numbers and -");
|
|
11463
|
+
}
|
|
11464
|
+
return [4 /*yield*/, (0, packageManager_1.getPackageManagerInfo)(ctx.config, ctx.componentName)];
|
|
11465
|
+
case 1:
|
|
11466
|
+
packageManagerInfo = _a.sent();
|
|
11467
|
+
envContext = (0, getEnvironmentContext_1.getEnvironmentContext)(ctx);
|
|
11468
|
+
componentConfigWithoutDefaults = envContext.envConfigRaw;
|
|
11469
|
+
defaults = componentConfigWithoutDefaults.deploy
|
|
11470
|
+
? {
|
|
11471
|
+
build: build_1.BUILD_TYPES[componentConfigWithoutDefaults.build.type].defaults(envContext),
|
|
11472
|
+
deploy: deploy_1.DEPLOY_TYPES[componentConfigWithoutDefaults.deploy.type].defaults(envContext),
|
|
11473
|
+
}
|
|
11474
|
+
: {
|
|
11475
|
+
build: {},
|
|
11476
|
+
deploy: {},
|
|
11477
|
+
};
|
|
11478
|
+
componentConfig = (0, utils_1.mergeWithMergingArrays)(defaults, componentConfigWithoutDefaults);
|
|
11479
|
+
return [4 /*yield*/, (0, getEnvironment_1.getEnvironment)(ctx)];
|
|
11480
|
+
case 2:
|
|
11481
|
+
environment = _a.sent();
|
|
11482
|
+
deploy = componentConfig.deploy, build = componentConfig.build, customJobs = componentConfig.customJobs, dir = componentConfig.dir;
|
|
11483
|
+
context = {
|
|
11484
|
+
fullConfig: ctx.config,
|
|
11485
|
+
componentConfig: componentConfig,
|
|
11486
|
+
build: {
|
|
11487
|
+
dir: dir,
|
|
11488
|
+
packageManagerInfo: packageManagerInfo,
|
|
11489
|
+
config: build,
|
|
11490
|
+
},
|
|
11491
|
+
deploy: deploy
|
|
11492
|
+
? {
|
|
11493
|
+
config: deploy,
|
|
11494
|
+
}
|
|
11495
|
+
: null,
|
|
11496
|
+
componentName: ctx.componentName,
|
|
11497
|
+
environment: environment,
|
|
11498
|
+
packageManagerInfo: packageManagerInfo,
|
|
11499
|
+
pipelineType: ctx.pipelineType,
|
|
11500
|
+
trigger: ctx.trigger,
|
|
11501
|
+
};
|
|
11502
|
+
resolvedCustomJobs = (0, lodash_1.isFunction)(customJobs)
|
|
11503
|
+
? customJobs(context)
|
|
11504
|
+
: customJobs;
|
|
11505
|
+
return [2 /*return*/, __assign(__assign({}, context), { customJobs: resolvedCustomJobs })];
|
|
11506
|
+
}
|
|
11507
|
+
});
|
|
11508
|
+
}); };
|
|
11509
|
+
exports.createComponentContext = createComponentContext;
|
|
11510
|
+
/**
|
|
11511
|
+
* @deprecated use createComponentContext instead
|
|
11512
|
+
*/
|
|
11513
|
+
exports.createContext = exports.createComponentContext;
|
|
11514
|
+
//# sourceMappingURL=createComponentContext.js.map
|
|
11515
|
+
|
|
11516
|
+
/***/ }),
|
|
11517
|
+
|
|
11383
11518
|
/***/ 17827:
|
|
11384
11519
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
11385
11520
|
|
|
@@ -11834,17 +11969,6 @@ exports.getReviewSlug = getReviewSlug;
|
|
|
11834
11969
|
|
|
11835
11970
|
"use strict";
|
|
11836
11971
|
|
|
11837
|
-
var __assign = (this && this.__assign) || function () {
|
|
11838
|
-
__assign = Object.assign || function(t) {
|
|
11839
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
11840
|
-
s = arguments[i];
|
|
11841
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
11842
|
-
t[p] = s[p];
|
|
11843
|
-
}
|
|
11844
|
-
return t;
|
|
11845
|
-
};
|
|
11846
|
-
return __assign.apply(this, arguments);
|
|
11847
|
-
};
|
|
11848
11972
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
11849
11973
|
if (k2 === undefined) k2 = k;
|
|
11850
11974
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -11859,107 +11983,10 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
11859
11983
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
11860
11984
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11861
11985
|
};
|
|
11862
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
11863
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
11864
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
11865
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
11866
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
11867
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
11868
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
11869
|
-
});
|
|
11870
|
-
};
|
|
11871
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11872
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
11873
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
11874
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
11875
|
-
function step(op) {
|
|
11876
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
11877
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
11878
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
11879
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
11880
|
-
switch (op[0]) {
|
|
11881
|
-
case 0: case 1: t = op; break;
|
|
11882
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
11883
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
11884
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
11885
|
-
default:
|
|
11886
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
11887
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
11888
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
11889
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
11890
|
-
if (t[2]) _.ops.pop();
|
|
11891
|
-
_.trys.pop(); continue;
|
|
11892
|
-
}
|
|
11893
|
-
op = body.call(thisArg, _);
|
|
11894
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
11895
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
11896
|
-
}
|
|
11897
|
-
};
|
|
11898
11986
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
11899
|
-
|
|
11900
|
-
var lodash_1 = __nccwpck_require__(23255);
|
|
11901
|
-
var build_1 = __nccwpck_require__(67862);
|
|
11902
|
-
var deploy_1 = __nccwpck_require__(68483);
|
|
11903
|
-
var utils_1 = __nccwpck_require__(32497);
|
|
11904
|
-
var getEnvironment_1 = __nccwpck_require__(45699);
|
|
11905
|
-
var getEnvironmentContext_1 = __nccwpck_require__(13663);
|
|
11987
|
+
__exportStar(__nccwpck_require__(92775), exports);
|
|
11906
11988
|
__exportStar(__nccwpck_require__(45699), exports);
|
|
11907
11989
|
__exportStar(__nccwpck_require__(45133), exports);
|
|
11908
|
-
var createComponentContext = function (ctx) { return __awaiter(void 0, void 0, void 0, function () {
|
|
11909
|
-
var envContext, componentConfigWithoutDefaults, defaults, componentConfig, environment, deploy, build, customJobs, dir, context, resolvedCustomJobs;
|
|
11910
|
-
return __generator(this, function (_a) {
|
|
11911
|
-
switch (_a.label) {
|
|
11912
|
-
case 0:
|
|
11913
|
-
if (!/^[a-z0-9-]+$/.test(ctx.componentName)) {
|
|
11914
|
-
throw new Error("componentName may only contain lower case letters, numbers and -");
|
|
11915
|
-
}
|
|
11916
|
-
envContext = (0, getEnvironmentContext_1.getEnvironmentContext)(ctx);
|
|
11917
|
-
componentConfigWithoutDefaults = envContext.envConfigRaw;
|
|
11918
|
-
defaults = componentConfigWithoutDefaults.deploy
|
|
11919
|
-
? {
|
|
11920
|
-
build: build_1.BUILD_TYPES[componentConfigWithoutDefaults.build.type].defaults(envContext),
|
|
11921
|
-
deploy: deploy_1.DEPLOY_TYPES[componentConfigWithoutDefaults.deploy.type].defaults(envContext),
|
|
11922
|
-
}
|
|
11923
|
-
: {
|
|
11924
|
-
build: {},
|
|
11925
|
-
deploy: {},
|
|
11926
|
-
};
|
|
11927
|
-
componentConfig = (0, utils_1.mergeWithMergingArrays)(defaults, componentConfigWithoutDefaults);
|
|
11928
|
-
return [4 /*yield*/, (0, getEnvironment_1.getEnvironment)(ctx)];
|
|
11929
|
-
case 1:
|
|
11930
|
-
environment = _a.sent();
|
|
11931
|
-
deploy = componentConfig.deploy, build = componentConfig.build, customJobs = componentConfig.customJobs, dir = componentConfig.dir;
|
|
11932
|
-
context = {
|
|
11933
|
-
fullConfig: ctx.config,
|
|
11934
|
-
componentConfig: componentConfig,
|
|
11935
|
-
build: {
|
|
11936
|
-
dir: dir,
|
|
11937
|
-
packageManagerInfo: ctx.packageManagerInfo,
|
|
11938
|
-
config: build,
|
|
11939
|
-
},
|
|
11940
|
-
deploy: deploy
|
|
11941
|
-
? {
|
|
11942
|
-
config: deploy,
|
|
11943
|
-
}
|
|
11944
|
-
: null,
|
|
11945
|
-
componentName: ctx.componentName,
|
|
11946
|
-
environment: environment,
|
|
11947
|
-
packageManagerInfo: ctx.packageManagerInfo,
|
|
11948
|
-
pipelineType: ctx.pipelineType,
|
|
11949
|
-
trigger: ctx.trigger,
|
|
11950
|
-
};
|
|
11951
|
-
resolvedCustomJobs = (0, lodash_1.isFunction)(customJobs)
|
|
11952
|
-
? customJobs(context)
|
|
11953
|
-
: customJobs;
|
|
11954
|
-
return [2 /*return*/, __assign(__assign({}, context), { customJobs: resolvedCustomJobs })];
|
|
11955
|
-
}
|
|
11956
|
-
});
|
|
11957
|
-
}); };
|
|
11958
|
-
exports.createComponentContext = createComponentContext;
|
|
11959
|
-
/**
|
|
11960
|
-
* @deprecated use createComponentContext instead
|
|
11961
|
-
*/
|
|
11962
|
-
exports.createContext = exports.createComponentContext;
|
|
11963
11990
|
//# sourceMappingURL=index.js.map
|
|
11964
11991
|
|
|
11965
11992
|
/***/ }),
|
|
@@ -15106,7 +15133,6 @@ exports.createJobsForComponent = void 0;
|
|
|
15106
15133
|
var build_1 = __nccwpck_require__(67862);
|
|
15107
15134
|
var context_1 = __nccwpck_require__(5875);
|
|
15108
15135
|
var deploy_1 = __nccwpck_require__(68483);
|
|
15109
|
-
var packageManager_1 = __nccwpck_require__(76451);
|
|
15110
15136
|
var injectDefaultVarsInCustomJobs = function (context, jobs) {
|
|
15111
15137
|
return jobs.map(function (_a) {
|
|
15112
15138
|
var _b;
|
|
@@ -15131,14 +15157,11 @@ var createRawJobs = function (context) {
|
|
|
15131
15157
|
return __spreadArray(__spreadArray(__spreadArray([], __read(buildJobs), false), __read(deployJobs), false), __read(customJobs), false);
|
|
15132
15158
|
};
|
|
15133
15159
|
var createJobsForComponent = function (contextContext) { return __awaiter(void 0, void 0, void 0, function () {
|
|
15134
|
-
var
|
|
15160
|
+
var context;
|
|
15135
15161
|
return __generator(this, function (_a) {
|
|
15136
15162
|
switch (_a.label) {
|
|
15137
|
-
case 0: return [4 /*yield*/, (0,
|
|
15163
|
+
case 0: return [4 /*yield*/, (0, context_1.createComponentContext)(contextContext)];
|
|
15138
15164
|
case 1:
|
|
15139
|
-
packageManagerInfo = _a.sent();
|
|
15140
|
-
return [4 /*yield*/, (0, context_1.createComponentContext)(__assign(__assign({}, contextContext), { packageManagerInfo: packageManagerInfo }))];
|
|
15141
|
-
case 2:
|
|
15142
15165
|
context = _a.sent();
|
|
15143
15166
|
return [2 /*return*/, createRawJobs(context).map(function (job) { return (__assign(__assign({}, job), { context: context })); })];
|
|
15144
15167
|
}
|
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":";;;;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CAAC,MAAM,EAAE;wBAC5B;4BACE,OAAO,EAAE,UAAU,CAAC,OAAO;4BAC3B,gBAAgB,EAAE,UAAU,CAAC,gBAAgB;yBAC9C;qBACF,CAAC,EAAC;;;gBAEH,kBAAkB;gBAClB,sBAAO,EAAE,EAAC;;;;KAEb,CAAC;AAvBW,QAAA,kBAAkB,sBAuB7B;AAEF;;;GAGG;AACI,IAAM,yBAAyB,GAAG,UACvC,MAAuB,EACvB,GAAW,EACX,aAAqB;;;;;;gBAGA,qBAAM,IAAA,sBAAc,EAAC,GAAG,EAAE,aAAa,CAAC,EAAA;;gBAArD,UAAU,GAAG,SAAwC;gBAC3D,sBAAO,cAAc,CAAC,MAAM,EAAE;wBAC5B,UAAU,CAAC,WAAW,CAAC,KAAK;wBAC5B,UAAU,CAAC,WAAW,CAAC,MAAM;qBAC9B,CAAC,EAAC;;;gBAEH,kBAAkB;gBAClB,sBAAO,EAAE,EAAC;;;;KAEb,CAAC;AAfW,QAAA,yBAAyB,6BAepC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const getGitRoot: () => Promise<string>;
|
|
1
|
+
export declare const getGitRoot: () => Promise<string | null>;
|
|
2
2
|
export declare const getRootGitlabCiFile: () => Promise<string>;
|
|
3
3
|
export declare const readRootGitlabCiFile: () => Promise<any[]>;
|
|
4
4
|
export declare const hasGitlabCiFile: () => Promise<boolean>;
|
|
@@ -58,10 +58,18 @@ var getProjectConfig_1 = require("../../config/getProjectConfig");
|
|
|
58
58
|
var files_1 = require("../files");
|
|
59
59
|
var child_process_promise_1 = require("child-process-promise");
|
|
60
60
|
var getGitRoot = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
61
|
+
var e_1;
|
|
61
62
|
return __generator(this, function (_a) {
|
|
62
63
|
switch (_a.label) {
|
|
63
|
-
case 0:
|
|
64
|
+
case 0:
|
|
65
|
+
_a.trys.push([0, 2, , 3]);
|
|
66
|
+
return [4 /*yield*/, (0, child_process_promise_1.exec)("git rev-parse --show-toplevel")];
|
|
64
67
|
case 1: return [2 /*return*/, (_a.sent()).stdout.trim()];
|
|
68
|
+
case 2:
|
|
69
|
+
e_1 = _a.sent();
|
|
70
|
+
// not a git repo
|
|
71
|
+
return [2 /*return*/, null];
|
|
72
|
+
case 3: return [2 /*return*/];
|
|
65
73
|
}
|
|
66
74
|
});
|
|
67
75
|
}); };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/utils/projects/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6BAA4B;AAC5B,kEAA8E;AAE9E,kCAA2C;AAC3C,+DAA6C;AAEtC,IAAM,UAAU,GAAG
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/utils/projects/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6BAA4B;AAC5B,kEAA8E;AAE9E,kCAA2C;AAC3C,+DAA6C;AAEtC,IAAM,UAAU,GAAG;;;;;;gBAEd,qBAAM,IAAA,4BAAI,EAAC,+BAA+B,CAAC,EAAA;oBAAnD,sBAAO,CAAC,SAA2C,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,EAAC;;;gBAEnE,iBAAiB;gBACjB,sBAAO,IAAI,EAAC;;;;KAEf,CAAC;AAPW,QAAA,UAAU,cAOrB;AAEK,IAAM,mBAAmB,GAAG;;;;oBACjB,qBAAM,IAAA,kBAAU,GAAE,EAAA;;gBAA5B,OAAO,GAAG,SAAkB;gBAClC,sBAAO,IAAA,WAAI,EAAC,OAAO,EAAE,gBAAgB,CAAC,EAAC;;;KACxC,CAAC;AAHW,QAAA,mBAAmB,uBAG9B;AAEK,IAAM,oBAAoB,GAAG;;;YAClC,KAAA,uBAAe,CAAA;YAAC,qBAAM,IAAA,2BAAmB,GAAE,EAAA;gBAA3C,sBAAA,kBAAgB,SAA2B,EAAC,EAAA;;SAAA,CAAC;AADlC,QAAA,oBAAoB,wBACc;AAExC,IAAM,eAAe,GAAG;;;;oBACP,qBAAM,IAAA,4BAAoB,GAAE,EAAA;;gBAA5C,KAAA,sBAAgB,SAA4B,KAAA,EAA3C,KAAK,QAAA,EAAE,IAAI,QAAA;gBAClB,IAAI,KAAK,EAAE,CAAC;oBACV,sBAAO,KAAK,EAAC;gBACf,CAAC;gBACD,sBAAO,IAAI,EAAC;;;KACb,CAAC;AANW,QAAA,eAAe,mBAM1B;AAEK,IAAM,mBAAmB,GAAG,UAAO,YAAoB;;;;;gBACpD,GAAG,GAAK,IAAA,8BAAW,EAAC,YAAY,CAAC,IAA9B,CAA+B;gBAC3B,qBAAM,IAAA,mCAAgB,GAAE,EAAA;;gBAAjC,MAAM,GAAG,SAAwB;gBACvC,sBAAO,UAAG,MAAM,CAAC,YAAY,cAAI,MAAM,CAAC,OAAO,cAAI,GAAG,CAAE,EAAC;;;KAC1D,CAAC;AAJW,QAAA,mBAAmB,uBAI9B"}
|
|
@@ -36,7 +36,7 @@ var cache_1 = require("./cache");
|
|
|
36
36
|
var constants_1 = require("./constants");
|
|
37
37
|
var yarn_1 = require("./yarn");
|
|
38
38
|
var createNodeBuildJobs = function (context) {
|
|
39
|
-
var _a, _b, _c, _d, _e
|
|
39
|
+
var _a, _b, _c, _d, _e;
|
|
40
40
|
var buildConfig = context.build.config;
|
|
41
41
|
if (!(0, types_1.isOfBuildType)(buildConfig, "node", "node-static", "storybook")) {
|
|
42
42
|
throw new Error("deploy config is not node, node-static or storybook");
|
|
@@ -53,7 +53,8 @@ var createNodeBuildJobs = function (context) {
|
|
|
53
53
|
artifacts: {
|
|
54
54
|
paths: __spreadArray([
|
|
55
55
|
context.build.dir
|
|
56
|
-
], __read(((
|
|
56
|
+
], __read(((_d = context.build.packageManagerInfo
|
|
57
|
+
.currentWorkspaceDependencies) !== null && _d !== void 0 ? _d : [])), false).flatMap(function (dir) {
|
|
57
58
|
var _a, _b;
|
|
58
59
|
return __spreadArray([
|
|
59
60
|
(0, path_1.join)(dir, "__build_info.json"),
|
|
@@ -77,7 +78,8 @@ var createNodeBuildJobs = function (context) {
|
|
|
77
78
|
variables: {
|
|
78
79
|
// only required for non static
|
|
79
80
|
DOCKER_COPY_AND_INSTALL_APP: (0, yarn_1.getDockerAppCopyAndBuildScript)(context.build),
|
|
80
|
-
DOCKER_COPY_WORKSPACE_FILES: (
|
|
81
|
+
DOCKER_COPY_WORKSPACE_FILES: (_e = context.build.packageManagerInfo.pathsToCopyInDocker
|
|
82
|
+
.map(function (dir) { return "COPY --chown=node:node ".concat(dir, " /app/").concat(dir); })) === null || _e === void 0 ? void 0 : _e.join("\n"),
|
|
81
83
|
},
|
|
82
84
|
},
|
|
83
85
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildJob.js","sourceRoot":"","sources":["../../../../../../pipeline/src/build/node/buildJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6BAA4B;AAC5B,uCAA8C;AAG9C,qCAA0C;AAC1C,gCAA0C;AAC1C,oCAAsE;AACtE,kCAAyC;AACzC,iCAAmE;AACnE,yCAA0D;AAC1D,+BAAwE;AAEjE,IAAM,mBAAmB,GAAG,UACjC,OAAyB;;IAEzB,IAAM,WAAW,GAAG,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC;IAEzC,IAAI,CAAC,IAAA,qBAAa,EAAC,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,WAAW,CAAC,EAAE,CAAC;QACpE,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;IACzE,CAAC;IAED,IAAM,YAAY,GAAG,IAAA,uBAAc,EAAC,cAAc,CAAC,CAAC;IACpD,IAAM,WAAW,GAAG,IAAA,qBAAc,EAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAElD,OAAO,IAAA,sBAAe,EAAC,OAAO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,aAAa,IAAI,WAAW,CAAC,IAAI,KAAK,WAAW;gBACpE,CAAC,CAAC,OAAO;gBACT,CAAC,CAAC,MAAM,CACX;YACD,KAAK,2BAAM,IAAA,oBAAY,EAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,SAAC;YAC/C,SAAS,EAAE;gBACT,+BAA+B;gBAC/B,2BAA2B,EAAE,IAAA,qCAA8B,EACzD,OAAO,CAAC,KAAK,CACd;gBACD,2BAA2B,EACzB,MAAA,OAAO,CAAC,KAAK,CAAC,kBAAkB,CAAC,mBAAmB;qBACjD,GAAG,CAAC,UAAC,GAAG,IAAK,OAAA,iCAA0B,GAAG,mBAAS,GAAG,CAAE,EAA3C,CAA2C,CAAC,0CACxD,IAAI,CAAC,IAAI,CAAC;aACjB;SACF;KACF,CAAC,CAAC;AACL,CAAC,CAAC;AApEW,QAAA,mBAAmB,uBAoE9B"}
|
|
@@ -33,9 +33,8 @@ var path_1 = require("path");
|
|
|
33
33
|
var slugify_1 = __importDefault(require("slugify"));
|
|
34
34
|
var lodash_1 = require("lodash");
|
|
35
35
|
var getYarnCache = function (context, policy) {
|
|
36
|
-
var _a;
|
|
37
36
|
if (policy === void 0) { policy = "pull-push"; }
|
|
38
|
-
var componentIsInWorkspace =
|
|
37
|
+
var componentIsInWorkspace = context.packageManagerInfo.componentIsInWorkspace;
|
|
39
38
|
return [
|
|
40
39
|
componentIsInWorkspace
|
|
41
40
|
? {
|
|
@@ -52,9 +51,9 @@ var getYarnCache = function (context, policy) {
|
|
|
52
51
|
};
|
|
53
52
|
exports.getYarnCache = getYarnCache;
|
|
54
53
|
var getNodeModulesCache = function (context, policy) {
|
|
55
|
-
var _a
|
|
54
|
+
var _a;
|
|
56
55
|
if (policy === void 0) { policy = "pull-push"; }
|
|
57
|
-
var componentIsInWorkspace =
|
|
56
|
+
var componentIsInWorkspace = context.packageManagerInfo.componentIsInWorkspace;
|
|
58
57
|
// 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.
|
|
59
58
|
// It would slow down all pipelines whenever one adds a new dependency as it will need to download all node_modules again.
|
|
60
59
|
return [
|
|
@@ -67,9 +66,9 @@ var getNodeModulesCache = function (context, policy) {
|
|
|
67
66
|
paths: __spreadArray([], __read((componentIsInWorkspace
|
|
68
67
|
? (0, lodash_1.uniq)(__spreadArray([
|
|
69
68
|
"node_modules"
|
|
70
|
-
], __read(((
|
|
69
|
+
], __read(((_a = context.packageManagerInfo.workspaces.map(function (w) {
|
|
71
70
|
return (0, path_1.join)(w.location, "node_modules");
|
|
72
|
-
})) !== null &&
|
|
71
|
+
})) !== null && _a !== void 0 ? _a : [])), false))
|
|
73
72
|
: [(0, path_1.join)(context.dir, "node_modules")])), false),
|
|
74
73
|
},
|
|
75
74
|
];
|