@catladder/cli 1.149.1 → 1.149.3
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 +1 -1
- package/dist/bundles/cli/index.js +1 -1
- 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 +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
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
3
|
if (k2 === undefined) k2 = k;
|
|
15
4
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -24,105 +13,8 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
24
13
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
25
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
26
15
|
};
|
|
27
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
28
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
29
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
30
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
31
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
32
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
33
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
37
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
38
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
39
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
40
|
-
function step(op) {
|
|
41
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
42
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
43
|
-
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;
|
|
44
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
45
|
-
switch (op[0]) {
|
|
46
|
-
case 0: case 1: t = op; break;
|
|
47
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
48
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
49
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
50
|
-
default:
|
|
51
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
52
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
53
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
54
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
55
|
-
if (t[2]) _.ops.pop();
|
|
56
|
-
_.trys.pop(); continue;
|
|
57
|
-
}
|
|
58
|
-
op = body.call(thisArg, _);
|
|
59
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
60
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
64
|
-
|
|
65
|
-
var lodash_1 = require("lodash");
|
|
66
|
-
var build_1 = require("../build");
|
|
67
|
-
var deploy_1 = require("../deploy");
|
|
68
|
-
var utils_1 = require("../utils");
|
|
69
|
-
var getEnvironment_1 = require("./getEnvironment");
|
|
70
|
-
var getEnvironmentContext_1 = require("./getEnvironmentContext");
|
|
17
|
+
__exportStar(require("./createComponentContext"), exports);
|
|
71
18
|
__exportStar(require("./getEnvironment"), exports);
|
|
72
19
|
__exportStar(require("./getEnvironmentVariables"), exports);
|
|
73
|
-
var createComponentContext = function (ctx) { return __awaiter(void 0, void 0, void 0, function () {
|
|
74
|
-
var envContext, componentConfigWithoutDefaults, defaults, componentConfig, environment, deploy, build, customJobs, dir, context, resolvedCustomJobs;
|
|
75
|
-
return __generator(this, function (_a) {
|
|
76
|
-
switch (_a.label) {
|
|
77
|
-
case 0:
|
|
78
|
-
if (!/^[a-z0-9-]+$/.test(ctx.componentName)) {
|
|
79
|
-
throw new Error("componentName may only contain lower case letters, numbers and -");
|
|
80
|
-
}
|
|
81
|
-
envContext = (0, getEnvironmentContext_1.getEnvironmentContext)(ctx);
|
|
82
|
-
componentConfigWithoutDefaults = envContext.envConfigRaw;
|
|
83
|
-
defaults = componentConfigWithoutDefaults.deploy
|
|
84
|
-
? {
|
|
85
|
-
build: build_1.BUILD_TYPES[componentConfigWithoutDefaults.build.type].defaults(envContext),
|
|
86
|
-
deploy: deploy_1.DEPLOY_TYPES[componentConfigWithoutDefaults.deploy.type].defaults(envContext),
|
|
87
|
-
}
|
|
88
|
-
: {
|
|
89
|
-
build: {},
|
|
90
|
-
deploy: {},
|
|
91
|
-
};
|
|
92
|
-
componentConfig = (0, utils_1.mergeWithMergingArrays)(defaults, componentConfigWithoutDefaults);
|
|
93
|
-
return [4 /*yield*/, (0, getEnvironment_1.getEnvironment)(ctx)];
|
|
94
|
-
case 1:
|
|
95
|
-
environment = _a.sent();
|
|
96
|
-
deploy = componentConfig.deploy, build = componentConfig.build, customJobs = componentConfig.customJobs, dir = componentConfig.dir;
|
|
97
|
-
context = {
|
|
98
|
-
fullConfig: ctx.config,
|
|
99
|
-
componentConfig: componentConfig,
|
|
100
|
-
build: {
|
|
101
|
-
dir: dir,
|
|
102
|
-
packageManagerInfo: ctx.packageManagerInfo,
|
|
103
|
-
config: build,
|
|
104
|
-
},
|
|
105
|
-
deploy: deploy
|
|
106
|
-
? {
|
|
107
|
-
config: deploy,
|
|
108
|
-
}
|
|
109
|
-
: null,
|
|
110
|
-
componentName: ctx.componentName,
|
|
111
|
-
environment: environment,
|
|
112
|
-
packageManagerInfo: ctx.packageManagerInfo,
|
|
113
|
-
pipelineType: ctx.pipelineType,
|
|
114
|
-
trigger: ctx.trigger,
|
|
115
|
-
};
|
|
116
|
-
resolvedCustomJobs = (0, lodash_1.isFunction)(customJobs)
|
|
117
|
-
? customJobs(context)
|
|
118
|
-
: customJobs;
|
|
119
|
-
return [2 /*return*/, __assign(__assign({}, context), { customJobs: resolvedCustomJobs })];
|
|
120
|
-
}
|
|
121
|
-
});
|
|
122
|
-
}); };
|
|
123
|
-
exports.createComponentContext = createComponentContext;
|
|
124
|
-
/**
|
|
125
|
-
* @deprecated use createComponentContext instead
|
|
126
|
-
*/
|
|
127
|
-
exports.createContext = exports.createComponentContext;
|
|
128
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../pipeline/src/context/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../pipeline/src/context/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2DAAyC;AACzC,mDAAiC;AACjC,4DAA0C"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { CreateComponentContextContext } from "../context";
|
|
2
2
|
import type { CatladderJobWithContext } from "../types/context";
|
|
3
|
-
export declare const createJobsForComponent: (contextContext:
|
|
3
|
+
export declare const createJobsForComponent: (contextContext: CreateComponentContextContext) => Promise<Array<CatladderJobWithContext>>;
|
|
@@ -87,7 +87,6 @@ exports.createJobsForComponent = void 0;
|
|
|
87
87
|
var build_1 = require("../build");
|
|
88
88
|
var context_1 = require("../context");
|
|
89
89
|
var deploy_1 = require("../deploy");
|
|
90
|
-
var packageManager_1 = require("./packageManager");
|
|
91
90
|
var injectDefaultVarsInCustomJobs = function (context, jobs) {
|
|
92
91
|
return jobs.map(function (_a) {
|
|
93
92
|
var _b;
|
|
@@ -112,14 +111,11 @@ var createRawJobs = function (context) {
|
|
|
112
111
|
return __spreadArray(__spreadArray(__spreadArray([], __read(buildJobs), false), __read(deployJobs), false), __read(customJobs), false);
|
|
113
112
|
};
|
|
114
113
|
var createJobsForComponent = function (contextContext) { return __awaiter(void 0, void 0, void 0, function () {
|
|
115
|
-
var
|
|
114
|
+
var context;
|
|
116
115
|
return __generator(this, function (_a) {
|
|
117
116
|
switch (_a.label) {
|
|
118
|
-
case 0: return [4 /*yield*/, (0,
|
|
117
|
+
case 0: return [4 /*yield*/, (0, context_1.createComponentContext)(contextContext)];
|
|
119
118
|
case 1:
|
|
120
|
-
packageManagerInfo = _a.sent();
|
|
121
|
-
return [4 /*yield*/, (0, context_1.createComponentContext)(__assign(__assign({}, contextContext), { packageManagerInfo: packageManagerInfo }))];
|
|
122
|
-
case 2:
|
|
123
119
|
context = _a.sent();
|
|
124
120
|
return [2 /*return*/, createRawJobs(context).map(function (job) { return (__assign(__assign({}, job), { context: context })); })];
|
|
125
121
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createJobsForComponent.js","sourceRoot":"","sources":["../../../../../pipeline/src/pipeline/createJobsForComponent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"createJobsForComponent.js","sourceRoot":"","sources":["../../../../../pipeline/src/pipeline/createJobsForComponent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kCAAuC;AAEvC,sCAAoD;AACpD,oCAAyC;AAQzC,IAAM,6BAA6B,GAAG,UACpC,OAAyB,EACzB,IAAoB;IAEpB,OAAA,IAAI,CAAC,GAAG,CAAC,UAAC,EAAqB;;QAAnB,IAAA,SAAS,eAAA,EAAK,GAAG,cAAnB,aAAqB,CAAF;QAAO,OAAA,YAClC,SAAS,wBACJ,CAAC,MAAA,OAAO,CAAC,WAAW,CAAC,OAAO,mCAAI,EAAE,CAAC,GACnC,CAAC,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,EAAE,CAAC,KAEnB,GAAG,EACN,CAAA;KAAA,CAAC;AANH,CAMG,CAAC;AACN,IAAM,aAAa,GAAG,UAAC,OAAyB;IAC9C,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;QACxB,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,IAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC;IACnC,OAAO,6BAA6B,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AACzD,CAAC,CAAC;AACF,IAAM,aAAa,GAAG,UAAC,OAAgB;;IACrC,IAAM,SAAS,GAAG,mBAAW,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACvE,IAAM,UAAU,GAAG,CAAA,MAAA,OAAO,CAAC,MAAM,0CAAE,MAAM;QACvC,CAAC,CAAC,qBAAY,CAAC,MAAA,OAAO,CAAC,MAAM,0CAAE,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC;QACzD,CAAC,CAAC,EAAE,CAAC;IAEP,IAAM,UAAU,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;IAC1C,4DAAW,SAAS,kBAAK,UAAU,kBAAK,UAAU,UAAE;AACtD,CAAC,CAAC;AAEK,IAAM,sBAAsB,GAAG,UACpC,cAA6C;;;;oBAE7B,qBAAM,IAAA,gCAAsB,EAAC,cAAc,CAAC,EAAA;;gBAAtD,OAAO,GAAG,SAA4C;gBAC5D,sBAAO,aAAa,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,UAAC,GAAG,IAAK,OAAA,uBAAM,GAAG,KAAE,OAAO,SAAA,IAAG,EAArB,CAAqB,CAAC,EAAC;;;KACnE,CAAC;AALW,QAAA,sBAAsB,0BAKjC"}
|
|
@@ -67,7 +67,7 @@ export type ContextBeforeConfig = {
|
|
|
67
67
|
};
|
|
68
68
|
export type BuildContext = {
|
|
69
69
|
dir: string;
|
|
70
|
-
packageManagerInfo
|
|
70
|
+
packageManagerInfo: PackageManagerInfo;
|
|
71
71
|
config: BuildConfig;
|
|
72
72
|
};
|
|
73
73
|
export type DeployContext = {
|
|
@@ -91,7 +91,7 @@ export type ComponentContext = {
|
|
|
91
91
|
/**
|
|
92
92
|
* @deprecated use buildContext.packageManagerInfo instead
|
|
93
93
|
*/
|
|
94
|
-
packageManagerInfo
|
|
94
|
+
packageManagerInfo: PackageManagerInfo;
|
|
95
95
|
customJobs?: CatladderJob[];
|
|
96
96
|
};
|
|
97
97
|
/**
|