@catladder/cli 0.0.0-main-e8632d85 → 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 +50 -36
- package/dist/bundles/cli/index.js +48 -36
- 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 +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
|
}); };
|
|
@@ -2997,7 +3010,7 @@ var cache_1 = __nccwpck_require__(2026);
|
|
|
2997
3010
|
var constants_1 = __nccwpck_require__(1765);
|
|
2998
3011
|
var yarn_1 = __nccwpck_require__(5043);
|
|
2999
3012
|
var createNodeBuildJobs = function (context) {
|
|
3000
|
-
var _a, _b, _c, _d, _e
|
|
3013
|
+
var _a, _b, _c, _d, _e;
|
|
3001
3014
|
var buildConfig = context.build.config;
|
|
3002
3015
|
if (!(0, types_1.isOfBuildType)(buildConfig, "node", "node-static", "storybook")) {
|
|
3003
3016
|
throw new Error("deploy config is not node, node-static or storybook");
|
|
@@ -3014,7 +3027,8 @@ var createNodeBuildJobs = function (context) {
|
|
|
3014
3027
|
artifacts: {
|
|
3015
3028
|
paths: __spreadArray([
|
|
3016
3029
|
context.build.dir
|
|
3017
|
-
], __read(((
|
|
3030
|
+
], __read(((_d = context.build.packageManagerInfo
|
|
3031
|
+
.currentWorkspaceDependencies) !== null && _d !== void 0 ? _d : [])), false).flatMap(function (dir) {
|
|
3018
3032
|
var _a, _b;
|
|
3019
3033
|
return __spreadArray([
|
|
3020
3034
|
(0, path_1.join)(dir, "__build_info.json"),
|
|
@@ -3038,7 +3052,8 @@ var createNodeBuildJobs = function (context) {
|
|
|
3038
3052
|
variables: {
|
|
3039
3053
|
// only required for non static
|
|
3040
3054
|
DOCKER_COPY_AND_INSTALL_APP: (0, yarn_1.getDockerAppCopyAndBuildScript)(context.build),
|
|
3041
|
-
DOCKER_COPY_WORKSPACE_FILES: (
|
|
3055
|
+
DOCKER_COPY_WORKSPACE_FILES: (_e = context.build.packageManagerInfo.pathsToCopyInDocker
|
|
3056
|
+
.map(function (dir) { return "COPY --chown=node:node ".concat(dir, " /app/").concat(dir); })) === null || _e === void 0 ? void 0 : _e.join("\n"),
|
|
3042
3057
|
},
|
|
3043
3058
|
},
|
|
3044
3059
|
});
|
|
@@ -3087,9 +3102,8 @@ var path_1 = __nccwpck_require__(1017);
|
|
|
3087
3102
|
var slugify_1 = __importDefault(__nccwpck_require__(4035));
|
|
3088
3103
|
var lodash_1 = __nccwpck_require__(3255);
|
|
3089
3104
|
var getYarnCache = function (context, policy) {
|
|
3090
|
-
var _a;
|
|
3091
3105
|
if (policy === void 0) { policy = "pull-push"; }
|
|
3092
|
-
var componentIsInWorkspace =
|
|
3106
|
+
var componentIsInWorkspace = context.packageManagerInfo.componentIsInWorkspace;
|
|
3093
3107
|
return [
|
|
3094
3108
|
componentIsInWorkspace
|
|
3095
3109
|
? {
|
|
@@ -3106,9 +3120,9 @@ var getYarnCache = function (context, policy) {
|
|
|
3106
3120
|
};
|
|
3107
3121
|
exports.getYarnCache = getYarnCache;
|
|
3108
3122
|
var getNodeModulesCache = function (context, policy) {
|
|
3109
|
-
var _a
|
|
3123
|
+
var _a;
|
|
3110
3124
|
if (policy === void 0) { policy = "pull-push"; }
|
|
3111
|
-
var componentIsInWorkspace =
|
|
3125
|
+
var componentIsInWorkspace = context.packageManagerInfo.componentIsInWorkspace;
|
|
3112
3126
|
// 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
3127
|
// It would slow down all pipelines whenever one adds a new dependency as it will need to download all node_modules again.
|
|
3114
3128
|
return [
|
|
@@ -3121,9 +3135,9 @@ var getNodeModulesCache = function (context, policy) {
|
|
|
3121
3135
|
paths: __spreadArray([], __read((componentIsInWorkspace
|
|
3122
3136
|
? (0, lodash_1.uniq)(__spreadArray([
|
|
3123
3137
|
"node_modules"
|
|
3124
|
-
], __read(((
|
|
3138
|
+
], __read(((_a = context.packageManagerInfo.workspaces.map(function (w) {
|
|
3125
3139
|
return (0, path_1.join)(w.location, "node_modules");
|
|
3126
|
-
})) !== null &&
|
|
3140
|
+
})) !== null && _a !== void 0 ? _a : [])), false))
|
|
3127
3141
|
: [(0, path_1.join)(context.dir, "node_modules")])), false),
|
|
3128
3142
|
},
|
|
3129
3143
|
];
|
|
@@ -3356,7 +3370,7 @@ var constants_1 = __nccwpck_require__(1765);
|
|
|
3356
3370
|
var yarn_1 = __nccwpck_require__(5043);
|
|
3357
3371
|
var createArtifactsConfig_1 = __nccwpck_require__(2820);
|
|
3358
3372
|
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
|
|
3373
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
3360
3374
|
// don't run tests after release
|
|
3361
3375
|
// TODO: this will be replaced by using rules
|
|
3362
3376
|
if (context.trigger === "taggedRelease") {
|
|
@@ -3376,18 +3390,18 @@ var createNodeTestJobs = function (context) {
|
|
|
3376
3390
|
? __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
3391
|
"cd ".concat(context.build.dir)
|
|
3378
3392
|
], __read(((_e = (0, utils_1.ensureArray)((_d = buildConfig.audit) === null || _d === void 0 ? void 0 : _d.command)) !== null && _e !== void 0 ? _e : [
|
|
3379
|
-
|
|
3393
|
+
context.build.packageManagerInfo.isClassic
|
|
3380
3394
|
? "yarn audit"
|
|
3381
3395
|
: "yarn npm audit --environment production", // yarn 2
|
|
3382
|
-
])), false), allow_failure: true }), (0, createArtifactsConfig_1.createArtifactsConfig)(context.build.dir, (
|
|
3396
|
+
])), 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
3397
|
var lintJob = buildConfig.lint !== false
|
|
3384
|
-
? __assign(__assign(__assign({ name: "👮 lint" }, base), { image: (
|
|
3398
|
+
? __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
3399
|
"cd ".concat(context.build.dir)
|
|
3386
|
-
], false), __read(yarnInstall), false), __read(((
|
|
3400
|
+
], 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
3401
|
var testJob = buildConfig.test !== false
|
|
3388
|
-
? __assign(__assign(__assign({ name: "🧪 test" }, base), { image: (
|
|
3402
|
+
? __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
3403
|
"cd ".concat(context.build.dir)
|
|
3390
|
-
], false), __read(yarnInstall), false), __read(((
|
|
3404
|
+
], 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
3405
|
return [auditJob, lintJob, testJob].filter(utils_1.notNil);
|
|
3392
3406
|
};
|
|
3393
3407
|
exports.createNodeTestJobs = createNodeTestJobs;
|
|
@@ -3434,8 +3448,7 @@ var YARN_INSTALL_CLASSIC = "yarn install --frozen-lockfile";
|
|
|
3434
3448
|
// FIXME: check why and when rebuild is needed
|
|
3435
3449
|
var YARN_BERRY_PROD_REBUILD = "yarn workspaces focus --production && yarn rebuild";
|
|
3436
3450
|
var getYarnInstallCommand = function (context) {
|
|
3437
|
-
|
|
3438
|
-
if ((_a = context.packageManagerInfo) === null || _a === void 0 ? void 0 : _a.isClassic) {
|
|
3451
|
+
if (context.packageManagerInfo.isClassic) {
|
|
3439
3452
|
return YARN_INSTALL_CLASSIC;
|
|
3440
3453
|
}
|
|
3441
3454
|
return "yarn install --immutable";
|
|
@@ -3457,13 +3470,14 @@ var getYarnInstall = function (context, options) {
|
|
|
3457
3470
|
exports.getYarnInstall = getYarnInstall;
|
|
3458
3471
|
var DOCKER_COPY_FILES = "COPY --chown=node:node $APP_DIR .";
|
|
3459
3472
|
var getDockerAppCopyAndBuildScript = function (context) {
|
|
3460
|
-
|
|
3461
|
-
if ((_a = context.packageManagerInfo) === null || _a === void 0 ? void 0 : _a.isClassic) {
|
|
3473
|
+
if (context.packageManagerInfo.isClassic) {
|
|
3462
3474
|
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
3475
|
}
|
|
3464
3476
|
// yarn >= 4 ships with build in plugins, see https://github.com/yarnpkg/berry/pull/4253
|
|
3465
3477
|
// trying to import those fail on this version
|
|
3466
|
-
var doesNotShipWithBuiltInPlugins = ["2", "3"].some(function (v) {
|
|
3478
|
+
var doesNotShipWithBuiltInPlugins = ["2", "3"].some(function (v) {
|
|
3479
|
+
return context.packageManagerInfo.version.startsWith(v);
|
|
3480
|
+
});
|
|
3467
3481
|
var maybeAddWorkspaceToolsCommand = doesNotShipWithBuiltInPlugins
|
|
3468
3482
|
? "RUN yarn plugin import workspace-tools"
|
|
3469
3483
|
: "";
|
|
@@ -3717,19 +3731,19 @@ var utils_1 = __nccwpck_require__(2497);
|
|
|
3717
3731
|
exports.SBOM_BUILD_JOB_NAME = "🧾 sbom";
|
|
3718
3732
|
exports.SBOM_FILE = "__sbom.json";
|
|
3719
3733
|
var createSbomBuildJob = function (context) {
|
|
3720
|
-
var _a, _b, _c, _d
|
|
3734
|
+
var _a, _b, _c, _d;
|
|
3721
3735
|
var buildConfig = context.build.config;
|
|
3722
3736
|
var defaultImage = "aquasec/trivy:0.38.3";
|
|
3723
3737
|
var defaultScript = [
|
|
3724
|
-
"trivy fs --quiet --format cyclonedx --output \"".concat(exports.SBOM_FILE, "\" ").concat(
|
|
3738
|
+
"trivy fs --quiet --format cyclonedx --output \"".concat(exports.SBOM_FILE, "\" ").concat(context.build.packageManagerInfo.componentIsInWorkspace
|
|
3725
3739
|
? "."
|
|
3726
3740
|
: context.build.dir),
|
|
3727
3741
|
];
|
|
3728
3742
|
var image = buildConfig.type === "custom" && buildConfig.sbom !== false
|
|
3729
|
-
? (
|
|
3743
|
+
? (_b = (_a = buildConfig.sbom) === null || _a === void 0 ? void 0 : _a.jobImage) !== null && _b !== void 0 ? _b : defaultImage
|
|
3730
3744
|
: defaultImage;
|
|
3731
3745
|
var script = buildConfig.type === "custom" && buildConfig.sbom !== false
|
|
3732
|
-
? (
|
|
3746
|
+
? (_d = (0, utils_1.ensureArray)((_c = buildConfig.sbom) === null || _c === void 0 ? void 0 : _c.command)) !== null && _d !== void 0 ? _d : defaultScript
|
|
3733
3747
|
: defaultScript;
|
|
3734
3748
|
return {
|
|
3735
3749
|
name: exports.SBOM_BUILD_JOB_NAME,
|
|
@@ -3994,14 +4008,18 @@ var deploy_1 = __nccwpck_require__(8483);
|
|
|
3994
4008
|
var utils_1 = __nccwpck_require__(2497);
|
|
3995
4009
|
var getEnvironment_1 = __nccwpck_require__(5699);
|
|
3996
4010
|
var getEnvironmentContext_1 = __nccwpck_require__(3663);
|
|
4011
|
+
var packageManager_1 = __nccwpck_require__(6451);
|
|
3997
4012
|
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;
|
|
4013
|
+
var packageManagerInfo, envContext, componentConfigWithoutDefaults, defaults, componentConfig, environment, deploy, build, customJobs, dir, context, resolvedCustomJobs;
|
|
3999
4014
|
return __generator(this, function (_a) {
|
|
4000
4015
|
switch (_a.label) {
|
|
4001
4016
|
case 0:
|
|
4002
4017
|
if (!/^[a-z0-9-]+$/.test(ctx.componentName)) {
|
|
4003
4018
|
throw new Error("componentName may only contain lower case letters, numbers and -");
|
|
4004
4019
|
}
|
|
4020
|
+
return [4 /*yield*/, (0, packageManager_1.getPackageManagerInfo)(ctx.config, ctx.componentName)];
|
|
4021
|
+
case 1:
|
|
4022
|
+
packageManagerInfo = _a.sent();
|
|
4005
4023
|
envContext = (0, getEnvironmentContext_1.getEnvironmentContext)(ctx);
|
|
4006
4024
|
componentConfigWithoutDefaults = envContext.envConfigRaw;
|
|
4007
4025
|
defaults = componentConfigWithoutDefaults.deploy
|
|
@@ -4015,7 +4033,7 @@ var createComponentContext = function (ctx) { return __awaiter(void 0, void 0, v
|
|
|
4015
4033
|
};
|
|
4016
4034
|
componentConfig = (0, utils_1.mergeWithMergingArrays)(defaults, componentConfigWithoutDefaults);
|
|
4017
4035
|
return [4 /*yield*/, (0, getEnvironment_1.getEnvironment)(ctx)];
|
|
4018
|
-
case
|
|
4036
|
+
case 2:
|
|
4019
4037
|
environment = _a.sent();
|
|
4020
4038
|
deploy = componentConfig.deploy, build = componentConfig.build, customJobs = componentConfig.customJobs, dir = componentConfig.dir;
|
|
4021
4039
|
context = {
|
|
@@ -4023,7 +4041,7 @@ var createComponentContext = function (ctx) { return __awaiter(void 0, void 0, v
|
|
|
4023
4041
|
componentConfig: componentConfig,
|
|
4024
4042
|
build: {
|
|
4025
4043
|
dir: dir,
|
|
4026
|
-
packageManagerInfo:
|
|
4044
|
+
packageManagerInfo: packageManagerInfo,
|
|
4027
4045
|
config: build,
|
|
4028
4046
|
},
|
|
4029
4047
|
deploy: deploy
|
|
@@ -4033,7 +4051,7 @@ var createComponentContext = function (ctx) { return __awaiter(void 0, void 0, v
|
|
|
4033
4051
|
: null,
|
|
4034
4052
|
componentName: ctx.componentName,
|
|
4035
4053
|
environment: environment,
|
|
4036
|
-
packageManagerInfo:
|
|
4054
|
+
packageManagerInfo: packageManagerInfo,
|
|
4037
4055
|
pipelineType: ctx.pipelineType,
|
|
4038
4056
|
trigger: ctx.trigger,
|
|
4039
4057
|
};
|
|
@@ -7671,7 +7689,6 @@ exports.createJobsForComponent = void 0;
|
|
|
7671
7689
|
var build_1 = __nccwpck_require__(7862);
|
|
7672
7690
|
var context_1 = __nccwpck_require__(5875);
|
|
7673
7691
|
var deploy_1 = __nccwpck_require__(8483);
|
|
7674
|
-
var packageManager_1 = __nccwpck_require__(6451);
|
|
7675
7692
|
var injectDefaultVarsInCustomJobs = function (context, jobs) {
|
|
7676
7693
|
return jobs.map(function (_a) {
|
|
7677
7694
|
var _b;
|
|
@@ -7696,14 +7713,11 @@ var createRawJobs = function (context) {
|
|
|
7696
7713
|
return __spreadArray(__spreadArray(__spreadArray([], __read(buildJobs), false), __read(deployJobs), false), __read(customJobs), false);
|
|
7697
7714
|
};
|
|
7698
7715
|
var createJobsForComponent = function (contextContext) { return __awaiter(void 0, void 0, void 0, function () {
|
|
7699
|
-
var
|
|
7716
|
+
var context;
|
|
7700
7717
|
return __generator(this, function (_a) {
|
|
7701
7718
|
switch (_a.label) {
|
|
7702
|
-
case 0: return [4 /*yield*/, (0,
|
|
7719
|
+
case 0: return [4 /*yield*/, (0, context_1.createComponentContext)(contextContext)];
|
|
7703
7720
|
case 1:
|
|
7704
|
-
packageManagerInfo = _a.sent();
|
|
7705
|
-
return [4 /*yield*/, (0, context_1.createComponentContext)(__assign(__assign({}, contextContext), { packageManagerInfo: packageManagerInfo }))];
|
|
7706
|
-
case 2:
|
|
7707
7721
|
context = _a.sent();
|
|
7708
7722
|
return [2 /*return*/, createRawJobs(context).map(function (job) { return (__assign(__assign({}, job), { context: context })); })];
|
|
7709
7723
|
}
|
|
@@ -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,
|
|
@@ -11440,14 +11452,18 @@ var deploy_1 = __nccwpck_require__(68483);
|
|
|
11440
11452
|
var utils_1 = __nccwpck_require__(32497);
|
|
11441
11453
|
var getEnvironment_1 = __nccwpck_require__(45699);
|
|
11442
11454
|
var getEnvironmentContext_1 = __nccwpck_require__(13663);
|
|
11455
|
+
var packageManager_1 = __nccwpck_require__(76451);
|
|
11443
11456
|
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;
|
|
11457
|
+
var packageManagerInfo, envContext, componentConfigWithoutDefaults, defaults, componentConfig, environment, deploy, build, customJobs, dir, context, resolvedCustomJobs;
|
|
11445
11458
|
return __generator(this, function (_a) {
|
|
11446
11459
|
switch (_a.label) {
|
|
11447
11460
|
case 0:
|
|
11448
11461
|
if (!/^[a-z0-9-]+$/.test(ctx.componentName)) {
|
|
11449
11462
|
throw new Error("componentName may only contain lower case letters, numbers and -");
|
|
11450
11463
|
}
|
|
11464
|
+
return [4 /*yield*/, (0, packageManager_1.getPackageManagerInfo)(ctx.config, ctx.componentName)];
|
|
11465
|
+
case 1:
|
|
11466
|
+
packageManagerInfo = _a.sent();
|
|
11451
11467
|
envContext = (0, getEnvironmentContext_1.getEnvironmentContext)(ctx);
|
|
11452
11468
|
componentConfigWithoutDefaults = envContext.envConfigRaw;
|
|
11453
11469
|
defaults = componentConfigWithoutDefaults.deploy
|
|
@@ -11461,7 +11477,7 @@ var createComponentContext = function (ctx) { return __awaiter(void 0, void 0, v
|
|
|
11461
11477
|
};
|
|
11462
11478
|
componentConfig = (0, utils_1.mergeWithMergingArrays)(defaults, componentConfigWithoutDefaults);
|
|
11463
11479
|
return [4 /*yield*/, (0, getEnvironment_1.getEnvironment)(ctx)];
|
|
11464
|
-
case
|
|
11480
|
+
case 2:
|
|
11465
11481
|
environment = _a.sent();
|
|
11466
11482
|
deploy = componentConfig.deploy, build = componentConfig.build, customJobs = componentConfig.customJobs, dir = componentConfig.dir;
|
|
11467
11483
|
context = {
|
|
@@ -11469,7 +11485,7 @@ var createComponentContext = function (ctx) { return __awaiter(void 0, void 0, v
|
|
|
11469
11485
|
componentConfig: componentConfig,
|
|
11470
11486
|
build: {
|
|
11471
11487
|
dir: dir,
|
|
11472
|
-
packageManagerInfo:
|
|
11488
|
+
packageManagerInfo: packageManagerInfo,
|
|
11473
11489
|
config: build,
|
|
11474
11490
|
},
|
|
11475
11491
|
deploy: deploy
|
|
@@ -11479,7 +11495,7 @@ var createComponentContext = function (ctx) { return __awaiter(void 0, void 0, v
|
|
|
11479
11495
|
: null,
|
|
11480
11496
|
componentName: ctx.componentName,
|
|
11481
11497
|
environment: environment,
|
|
11482
|
-
packageManagerInfo:
|
|
11498
|
+
packageManagerInfo: packageManagerInfo,
|
|
11483
11499
|
pipelineType: ctx.pipelineType,
|
|
11484
11500
|
trigger: ctx.trigger,
|
|
11485
11501
|
};
|
|
@@ -15117,7 +15133,6 @@ exports.createJobsForComponent = void 0;
|
|
|
15117
15133
|
var build_1 = __nccwpck_require__(67862);
|
|
15118
15134
|
var context_1 = __nccwpck_require__(5875);
|
|
15119
15135
|
var deploy_1 = __nccwpck_require__(68483);
|
|
15120
|
-
var packageManager_1 = __nccwpck_require__(76451);
|
|
15121
15136
|
var injectDefaultVarsInCustomJobs = function (context, jobs) {
|
|
15122
15137
|
return jobs.map(function (_a) {
|
|
15123
15138
|
var _b;
|
|
@@ -15142,14 +15157,11 @@ var createRawJobs = function (context) {
|
|
|
15142
15157
|
return __spreadArray(__spreadArray(__spreadArray([], __read(buildJobs), false), __read(deployJobs), false), __read(customJobs), false);
|
|
15143
15158
|
};
|
|
15144
15159
|
var createJobsForComponent = function (contextContext) { return __awaiter(void 0, void 0, void 0, function () {
|
|
15145
|
-
var
|
|
15160
|
+
var context;
|
|
15146
15161
|
return __generator(this, function (_a) {
|
|
15147
15162
|
switch (_a.label) {
|
|
15148
|
-
case 0: return [4 /*yield*/, (0,
|
|
15163
|
+
case 0: return [4 /*yield*/, (0, context_1.createComponentContext)(contextContext)];
|
|
15149
15164
|
case 1:
|
|
15150
|
-
packageManagerInfo = _a.sent();
|
|
15151
|
-
return [4 /*yield*/, (0, context_1.createComponentContext)(__assign(__assign({}, contextContext), { packageManagerInfo: packageManagerInfo }))];
|
|
15152
|
-
case 2:
|
|
15153
15165
|
context = _a.sent();
|
|
15154
15166
|
return [2 /*return*/, createRawJobs(context).map(function (job) { return (__assign(__assign({}, job), { context: context })); })];
|
|
15155
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;
|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AAC,EAAA;;gBAArD,UAAU,GAAG,SAAwC;gBAE3D,yEAAyE;gBACzE,yCAAyC;gBACzC,sBAAO,cAAc,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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