@storm-software/k8s-tools 0.22.0 → 0.23.0
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/CHANGELOG.md +12 -0
- package/README.md +1 -1
- package/dist/{chunk-TRB7S5T3.js → chunk-2V2RWM6P.js} +7 -3
- package/dist/{chunk-7LSOO7EL.mjs → chunk-3GTPNX3H.mjs} +2 -2
- package/dist/{chunk-5XKQQWUJ.js → chunk-3XOZFSEV.js} +19 -19
- package/dist/{chunk-6SBUEJ5U.js → chunk-4QH2MTXK.js} +15 -8
- package/dist/chunk-4RCWAFYM.js +171 -0
- package/dist/{chunk-VT53PVGM.mjs → chunk-DGFLUWWO.mjs} +1 -1
- package/dist/{chunk-YXDTTQAK.mjs → chunk-EW7TITVO.mjs} +15 -8
- package/dist/{chunk-U2IUNS7C.js → chunk-IAELL2FJ.js} +4 -4
- package/dist/{chunk-ZVIFWURI.js → chunk-ILJQ7PUY.js} +3 -3
- package/dist/{chunk-U6NXQRO5.js → chunk-MAU7XRWZ.js} +61 -13
- package/dist/{chunk-4CEOK53A.mjs → chunk-NZX4RKGN.mjs} +2 -2
- package/dist/{chunk-U2RYLP2F.mjs → chunk-QQING6XX.mjs} +5 -1
- package/dist/{chunk-V7DG6YHH.js → chunk-QZPOXP3F.js} +4 -4
- package/dist/{chunk-WMEDG765.mjs → chunk-T7WMSUEH.mjs} +2 -2
- package/dist/{chunk-J5BM3XLI.mjs → chunk-WXP6JT2B.mjs} +53 -5
- package/dist/{chunk-QON4VGYU.mjs → chunk-XR3B537S.mjs} +19 -17
- package/dist/executors.js +5 -6
- package/dist/executors.mjs +4 -5
- package/dist/generators.js +6 -6
- package/dist/generators.mjs +5 -5
- package/dist/index.js +9 -10
- package/dist/index.mjs +8 -9
- package/dist/src/executors/container-publish/executor.js +4 -5
- package/dist/src/executors/container-publish/executor.mjs +3 -4
- package/dist/src/executors/helm-package/executor.js +4 -5
- package/dist/src/executors/helm-package/executor.mjs +3 -4
- package/dist/src/generators/helm-chart/generator.js +5 -5
- package/dist/src/generators/helm-chart/generator.mjs +4 -4
- package/dist/src/generators/helm-dependency/generator.js +5 -5
- package/dist/src/generators/helm-dependency/generator.mjs +4 -4
- package/dist/src/plugins/docker/index.js +3 -3
- package/dist/src/plugins/docker/index.mjs +2 -2
- package/package.json +1 -1
- package/dist/chunk-67XBWQRC.js +0 -169
- package/dist/chunk-KHUZ2XYL.js +0 -59
- package/dist/chunk-T5REP3DE.mjs +0 -59
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## 0.23.0 (2025-01-22)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
- **workspace-tools:** Enhanced option tokenization logic for executors ([14ed93d7](https://github.com/storm-software/storm-ops/commit/14ed93d7))
|
|
6
|
+
|
|
7
|
+
## 0.22.1 (2025-01-21)
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
- **unbuild:** Ensure we always use directory as input instead of a file ([13d4a133](https://github.com/storm-software/storm-ops/commit/13d4a133))
|
|
12
|
+
|
|
1
13
|
## 0.22.0 (2025-01-21)
|
|
2
14
|
|
|
3
15
|
### Features
|
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ This package is part of the <b>⚡Storm-Ops</b> monorepo. The Storm-Ops packages
|
|
|
21
21
|
|
|
22
22
|
<h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
|
|
23
23
|
|
|
24
|
-
[](https://prettier.io/) [](http://nx.dev/) [](https://nextjs.org/) [](http://commitizen.github.io/cz-cli/)  [](https://fumadocs.vercel.app/) 
|
|
25
25
|
|
|
26
26
|
<!-- prettier-ignore-start -->
|
|
27
27
|
<!-- markdownlint-disable -->
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk4QH2MTXKjs = require('./chunk-4QH2MTXK.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunk3GQAWCBQjs = require('./chunk-3GQAWCBQ.js');
|
|
@@ -32,10 +32,13 @@ var applyWorkspaceBaseTokens = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
if (result.includes("{workspaceRoot}")) {
|
|
35
|
-
result = result.replaceAll("{workspaceRoot}", _nullishCoalesce(_nullishCoalesce(tokenizerOptions.workspaceRoot, () => ( _optionalChain([tokenizerOptions, 'access', _3 => _3.config, 'optionalAccess', _4 => _4.workspaceRoot]))), () => (
|
|
35
|
+
result = result.replaceAll("{workspaceRoot}", _nullishCoalesce(_nullishCoalesce(tokenizerOptions.workspaceRoot, () => ( _optionalChain([tokenizerOptions, 'access', _3 => _3.config, 'optionalAccess', _4 => _4.workspaceRoot]))), () => ( _chunk4QH2MTXKjs.findWorkspaceRoot.call(void 0, ))));
|
|
36
36
|
}
|
|
37
37
|
return result;
|
|
38
38
|
}, "applyWorkspaceBaseTokens");
|
|
39
|
+
var applyWorkspaceProjectTokens = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (option, tokenizerOptions) => {
|
|
40
|
+
return applyWorkspaceBaseTokens(option, tokenizerOptions);
|
|
41
|
+
}, "applyWorkspaceProjectTokens");
|
|
39
42
|
var applyWorkspaceTokens = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (options, config, tokenizerFn) => {
|
|
40
43
|
if (!options) {
|
|
41
44
|
return {};
|
|
@@ -58,4 +61,5 @@ var applyWorkspaceTokens = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0,
|
|
|
58
61
|
|
|
59
62
|
|
|
60
63
|
|
|
61
|
-
|
|
64
|
+
|
|
65
|
+
exports.applyWorkspaceBaseTokens = applyWorkspaceBaseTokens; exports.applyWorkspaceProjectTokens = applyWorkspaceProjectTokens; exports.applyWorkspaceTokens = applyWorkspaceTokens;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunk2V2RWM6Pjs = require('./chunk-2V2RWM6P.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
@@ -12,7 +12,7 @@ var _chunkTRB7S5T3js = require('./chunk-TRB7S5T3.js');
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunk4QH2MTXKjs = require('./chunk-4QH2MTXK.js');
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
var _chunk3GQAWCBQjs = require('./chunk-3GQAWCBQ.js');
|
|
@@ -21,34 +21,34 @@ var _chunk3GQAWCBQjs = require('./chunk-3GQAWCBQ.js');
|
|
|
21
21
|
var withRunGenerator = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (name, generatorFn, generatorOptions = {
|
|
22
22
|
skipReadingConfig: false
|
|
23
23
|
}) => async (tree, _options) => {
|
|
24
|
-
const stopwatch =
|
|
24
|
+
const stopwatch = _chunk4QH2MTXKjs.getStopwatch.call(void 0, name);
|
|
25
25
|
let options = _options;
|
|
26
26
|
let config;
|
|
27
27
|
try {
|
|
28
|
-
|
|
28
|
+
_chunk4QH2MTXKjs.writeInfo.call(void 0, `\u26A1 Running the ${name} generator...
|
|
29
29
|
|
|
30
30
|
`, config);
|
|
31
|
-
const workspaceRoot =
|
|
31
|
+
const workspaceRoot = _chunk4QH2MTXKjs.findWorkspaceRoot.call(void 0, );
|
|
32
32
|
if (!generatorOptions.skipReadingConfig) {
|
|
33
|
-
|
|
33
|
+
_chunk4QH2MTXKjs.writeDebug.call(void 0, `Loading the Storm Config from environment variables and storm.config.js file...
|
|
34
34
|
- workspaceRoot: ${workspaceRoot}`, config);
|
|
35
|
-
config = await
|
|
35
|
+
config = await _chunk4QH2MTXKjs.loadStormConfig.call(void 0, workspaceRoot);
|
|
36
36
|
}
|
|
37
37
|
if (_optionalChain([generatorOptions, 'optionalAccess', _ => _.hooks, 'optionalAccess', _2 => _2.applyDefaultOptions])) {
|
|
38
|
-
|
|
38
|
+
_chunk4QH2MTXKjs.writeDebug.call(void 0, "Running the applyDefaultOptions hook...", config);
|
|
39
39
|
options = await Promise.resolve(generatorOptions.hooks.applyDefaultOptions(options, config));
|
|
40
|
-
|
|
40
|
+
_chunk4QH2MTXKjs.writeDebug.call(void 0, "Completed the applyDefaultOptions hook", config);
|
|
41
41
|
}
|
|
42
|
-
|
|
42
|
+
_chunk4QH2MTXKjs.writeTrace.call(void 0, `Generator schema options \u2699\uFE0F
|
|
43
43
|
${Object.keys(_nullishCoalesce(options, () => ( {}))).map((key) => ` - ${key}=${JSON.stringify(options[key])}`).join("\n")}`, config);
|
|
44
|
-
const tokenized = await
|
|
44
|
+
const tokenized = await _chunk2V2RWM6Pjs.applyWorkspaceTokens.call(void 0, options, {
|
|
45
45
|
workspaceRoot: tree.root,
|
|
46
46
|
config
|
|
47
|
-
},
|
|
47
|
+
}, _chunk2V2RWM6Pjs.applyWorkspaceBaseTokens);
|
|
48
48
|
if (_optionalChain([generatorOptions, 'optionalAccess', _3 => _3.hooks, 'optionalAccess', _4 => _4.preProcess])) {
|
|
49
|
-
|
|
49
|
+
_chunk4QH2MTXKjs.writeDebug.call(void 0, "Running the preProcess hook...", config);
|
|
50
50
|
await Promise.resolve(generatorOptions.hooks.preProcess(tokenized, config));
|
|
51
|
-
|
|
51
|
+
_chunk4QH2MTXKjs.writeDebug.call(void 0, "Completed the preProcess hook", config);
|
|
52
52
|
}
|
|
53
53
|
const result = await Promise.resolve(generatorFn(tree, tokenized, config));
|
|
54
54
|
if (result) {
|
|
@@ -61,18 +61,18 @@ ${Object.keys(_nullishCoalesce(options, () => ( {}))).map((key) => ` - ${key}=${
|
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
if (_optionalChain([generatorOptions, 'optionalAccess', _14 => _14.hooks, 'optionalAccess', _15 => _15.postProcess])) {
|
|
64
|
-
|
|
64
|
+
_chunk4QH2MTXKjs.writeDebug.call(void 0, "Running the postProcess hook...", config);
|
|
65
65
|
await Promise.resolve(generatorOptions.hooks.postProcess(config));
|
|
66
|
-
|
|
66
|
+
_chunk4QH2MTXKjs.writeDebug.call(void 0, "Completed the postProcess hook", config);
|
|
67
67
|
}
|
|
68
68
|
return () => {
|
|
69
|
-
|
|
69
|
+
_chunk4QH2MTXKjs.writeSuccess.call(void 0, `Completed running the ${name} generator!
|
|
70
70
|
`, config);
|
|
71
71
|
};
|
|
72
72
|
} catch (error) {
|
|
73
73
|
return () => {
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
_chunk4QH2MTXKjs.writeFatal.call(void 0, "A fatal error occurred while running the generator - the process was forced to terminate", config);
|
|
75
|
+
_chunk4QH2MTXKjs.writeError.call(void 0, `An exception was thrown in the generator's process
|
|
76
76
|
- Details: ${error.message}
|
|
77
77
|
- Stacktrace: ${error.stack}`, config);
|
|
78
78
|
};
|
|
@@ -475,49 +475,56 @@ var getLogLevelLabel = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (log
|
|
|
475
475
|
var getLogFn = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (logLevel = LogLevel.INFO, config = {}, _chalk = getChalk()) => {
|
|
476
476
|
const colors = !_optionalChain([config, 'access', _11 => _11.colors, 'optionalAccess', _12 => _12.dark]) && !_optionalChain([config, 'access', _13 => _13.colors, 'optionalAccess', _14 => _14["base"]]) && !_optionalChain([config, 'access', _15 => _15.colors, 'optionalAccess', _16 => _16["base"], 'optionalAccess', _17 => _17.dark]) ? DEFAULT_COLOR_CONFIG : _optionalChain([config, 'access', _18 => _18.colors, 'optionalAccess', _19 => _19.dark]) && typeof config.colors.dark === "string" ? config.colors : _optionalChain([config, 'access', _20 => _20.colors, 'optionalAccess', _21 => _21["base"], 'optionalAccess', _22 => _22.dark]) && typeof config.colors["base"].dark === "string" ? config.colors["base"].dark : _optionalChain([config, 'access', _23 => _23.colors, 'optionalAccess', _24 => _24["base"]]) ? _optionalChain([config, 'access', _25 => _25.colors, 'optionalAccess', _26 => _26["base"]]) : DEFAULT_COLOR_CONFIG;
|
|
477
477
|
const configLogLevel = config.logLevel || process.env.STORM_LOG_LEVEL || LogLevelLabel.INFO;
|
|
478
|
-
if (
|
|
478
|
+
if (logLevel > getLogLevel(configLogLevel) || logLevel <= LogLevel.SILENT || getLogLevel(configLogLevel) <= LogLevel.SILENT) {
|
|
479
479
|
return (_) => {
|
|
480
480
|
};
|
|
481
481
|
}
|
|
482
|
-
if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel
|
|
482
|
+
if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel) {
|
|
483
483
|
return (message) => {
|
|
484
484
|
console.error(`
|
|
485
485
|
${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.fatal, () => ( "#7d1a1a")))(`[${CONSOLE_ICONS[LogLevelLabel.FATAL]} Fatal]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
486
486
|
`);
|
|
487
487
|
};
|
|
488
488
|
}
|
|
489
|
-
if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel
|
|
489
|
+
if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel) {
|
|
490
490
|
return (message) => {
|
|
491
491
|
console.error(`
|
|
492
492
|
${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.danger, () => ( "#f85149")))(`[${CONSOLE_ICONS[LogLevelLabel.ERROR]} Error]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
493
493
|
`);
|
|
494
494
|
};
|
|
495
495
|
}
|
|
496
|
-
if (typeof logLevel === "number" && LogLevel.WARN >= logLevel
|
|
496
|
+
if (typeof logLevel === "number" && LogLevel.WARN >= logLevel) {
|
|
497
497
|
return (message) => {
|
|
498
498
|
console.warn(`
|
|
499
499
|
${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.warning, () => ( "#e3b341")))(`[${CONSOLE_ICONS[LogLevelLabel.WARN]} Warn]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
500
500
|
`);
|
|
501
501
|
};
|
|
502
502
|
}
|
|
503
|
-
if (typeof logLevel === "number" && LogLevel.SUCCESS >= logLevel
|
|
503
|
+
if (typeof logLevel === "number" && LogLevel.SUCCESS >= logLevel) {
|
|
504
504
|
return (message) => {
|
|
505
505
|
console.info(`
|
|
506
506
|
${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.success, () => ( "#56d364")))(`[${CONSOLE_ICONS[LogLevelLabel.SUCCESS]} Success]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
507
507
|
`);
|
|
508
508
|
};
|
|
509
509
|
}
|
|
510
|
-
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel
|
|
510
|
+
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel) {
|
|
511
511
|
return (message) => {
|
|
512
512
|
console.info(`
|
|
513
513
|
${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.info, () => ( "#58a6ff")))(`[${CONSOLE_ICONS[LogLevelLabel.INFO]} Info]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
514
514
|
`);
|
|
515
515
|
};
|
|
516
516
|
}
|
|
517
|
-
if (typeof logLevel === "number" && LogLevel.
|
|
517
|
+
if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel) {
|
|
518
518
|
return (message) => {
|
|
519
519
|
console.debug(`
|
|
520
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.brand, () => ( "#1fb2a6")))(`[${CONSOLE_ICONS[LogLevelLabel.DEBUG]}
|
|
520
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.brand, () => ( "#1fb2a6")))(`[${CONSOLE_ICONS[LogLevelLabel.DEBUG]} Debug]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
521
|
+
`);
|
|
522
|
+
};
|
|
523
|
+
}
|
|
524
|
+
if (typeof logLevel === "number" && LogLevel.TRACE >= logLevel) {
|
|
525
|
+
return (message) => {
|
|
526
|
+
console.debug(`
|
|
527
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.brand, () => ( "#1fb2a6")))(`[${CONSOLE_ICONS[LogLevelLabel.TRACE]} Trace]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
521
528
|
`);
|
|
522
529
|
};
|
|
523
530
|
}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunk2V2RWM6Pjs = require('./chunk-2V2RWM6P.js');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
var _chunk4QH2MTXKjs = require('./chunk-4QH2MTXK.js');
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
var _chunk2GAU2GHGjs = require('./chunk-2GAU2GHG.js');
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
var _chunk3GQAWCBQjs = require('./chunk-3GQAWCBQ.js');
|
|
24
|
+
|
|
25
|
+
// ../workspace-tools/src/base/base-executor.ts
|
|
26
|
+
var _defu = require('defu');
|
|
27
|
+
var withRunExecutor = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (name, executorFn, executorOptions = {}) => async (_options, context) => {
|
|
28
|
+
const stopwatch = _chunk4QH2MTXKjs.getStopwatch.call(void 0, name);
|
|
29
|
+
let options = _options;
|
|
30
|
+
let config = {};
|
|
31
|
+
try {
|
|
32
|
+
if (!_optionalChain([context, 'access', _ => _.projectsConfigurations, 'optionalAccess', _2 => _2.projects]) || !context.projectName || !context.projectsConfigurations.projects[context.projectName]) {
|
|
33
|
+
throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace.");
|
|
34
|
+
}
|
|
35
|
+
const workspaceRoot = _chunk4QH2MTXKjs.findWorkspaceRoot.call(void 0, );
|
|
36
|
+
const projectRoot = context.projectsConfigurations.projects[context.projectName].root || workspaceRoot;
|
|
37
|
+
const sourceRoot = context.projectsConfigurations.projects[context.projectName].sourceRoot || workspaceRoot;
|
|
38
|
+
const projectName = context.projectsConfigurations.projects[context.projectName].name || context.projectName;
|
|
39
|
+
config.workspaceRoot = workspaceRoot;
|
|
40
|
+
_chunk4QH2MTXKjs.writeInfo.call(void 0, `
|
|
41
|
+
\u26A1 Running the ${name} executor for ${projectName}
|
|
42
|
+
`, config);
|
|
43
|
+
if (!executorOptions.skipReadingConfig) {
|
|
44
|
+
_chunk4QH2MTXKjs.writeTrace.call(void 0, `Loading the Storm Config from environment variables and storm.config.js file...
|
|
45
|
+
- workspaceRoot: ${workspaceRoot}
|
|
46
|
+
- projectRoot: ${projectRoot}
|
|
47
|
+
- sourceRoot: ${sourceRoot}
|
|
48
|
+
- projectName: ${projectName}
|
|
49
|
+
`, config);
|
|
50
|
+
config = await _chunk4QH2MTXKjs.loadStormConfig.call(void 0, workspaceRoot);
|
|
51
|
+
}
|
|
52
|
+
if (_optionalChain([executorOptions, 'optionalAccess', _3 => _3.hooks, 'optionalAccess', _4 => _4.applyDefaultOptions])) {
|
|
53
|
+
_chunk4QH2MTXKjs.writeDebug.call(void 0, "Running the applyDefaultOptions hook...", config);
|
|
54
|
+
options = await Promise.resolve(executorOptions.hooks.applyDefaultOptions(options, config));
|
|
55
|
+
_chunk4QH2MTXKjs.writeDebug.call(void 0, "Completed the applyDefaultOptions hook", config);
|
|
56
|
+
}
|
|
57
|
+
_chunk4QH2MTXKjs.writeTrace.call(void 0, `Executor schema options \u2699\uFE0F
|
|
58
|
+
${_chunk4QH2MTXKjs.formatLogMessage.call(void 0, options)}
|
|
59
|
+
`, config);
|
|
60
|
+
const tokenized = await _chunk2V2RWM6Pjs.applyWorkspaceTokens.call(void 0, options, _defu.defu.call(void 0, {
|
|
61
|
+
workspaceRoot,
|
|
62
|
+
projectRoot,
|
|
63
|
+
sourceRoot,
|
|
64
|
+
projectName,
|
|
65
|
+
config
|
|
66
|
+
}, executorOptions, context.projectsConfigurations.projects[context.projectName], config), _chunk2V2RWM6Pjs.applyWorkspaceProjectTokens);
|
|
67
|
+
_chunk4QH2MTXKjs.writeTrace.call(void 0, `Executor schema tokenized options \u2699\uFE0F
|
|
68
|
+
${_chunk4QH2MTXKjs.formatLogMessage.call(void 0, tokenized)}
|
|
69
|
+
`, config);
|
|
70
|
+
if (_optionalChain([executorOptions, 'optionalAccess', _5 => _5.hooks, 'optionalAccess', _6 => _6.preProcess])) {
|
|
71
|
+
_chunk4QH2MTXKjs.writeDebug.call(void 0, "Running the preProcess hook...", config);
|
|
72
|
+
await Promise.resolve(executorOptions.hooks.preProcess(tokenized, config));
|
|
73
|
+
_chunk4QH2MTXKjs.writeDebug.call(void 0, "Completed the preProcess hook", config);
|
|
74
|
+
}
|
|
75
|
+
const ret = executorFn(tokenized, context, config);
|
|
76
|
+
if (_isFunction(_optionalChain([ret, 'optionalAccess', _7 => _7.next]))) {
|
|
77
|
+
const asyncGen = ret;
|
|
78
|
+
for await (const iter of asyncGen) {
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
const result = await Promise.resolve(ret);
|
|
82
|
+
if (result && (!result.success || result.error && _optionalChain([result, 'optionalAccess', _8 => _8.error, 'optionalAccess', _9 => _9.message]) && typeof _optionalChain([result, 'optionalAccess', _10 => _10.error, 'optionalAccess', _11 => _11.message]) === "string" && _optionalChain([result, 'optionalAccess', _12 => _12.error, 'optionalAccess', _13 => _13.name]) && typeof _optionalChain([result, 'optionalAccess', _14 => _14.error, 'optionalAccess', _15 => _15.name]) === "string")) {
|
|
83
|
+
_chunk4QH2MTXKjs.writeTrace.call(void 0, `Failure determined by the ${name} executor
|
|
84
|
+
${_chunk4QH2MTXKjs.formatLogMessage.call(void 0, result)}`, config);
|
|
85
|
+
console.error(result);
|
|
86
|
+
throw new Error(`The ${name} executor failed to run`, {
|
|
87
|
+
cause: _optionalChain([result, 'optionalAccess', _16 => _16.error])
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
if (_optionalChain([executorOptions, 'optionalAccess', _17 => _17.hooks, 'optionalAccess', _18 => _18.postProcess])) {
|
|
91
|
+
_chunk4QH2MTXKjs.writeDebug.call(void 0, "Running the postProcess hook...", config);
|
|
92
|
+
await Promise.resolve(executorOptions.hooks.postProcess(config));
|
|
93
|
+
_chunk4QH2MTXKjs.writeDebug.call(void 0, "Completed the postProcess hook", config);
|
|
94
|
+
}
|
|
95
|
+
_chunk4QH2MTXKjs.writeSuccess.call(void 0, `Completed running the ${name} task executor!
|
|
96
|
+
`, config);
|
|
97
|
+
return {
|
|
98
|
+
success: true
|
|
99
|
+
};
|
|
100
|
+
} catch (error) {
|
|
101
|
+
_chunk4QH2MTXKjs.writeFatal.call(void 0, "A fatal error occurred while running the executor - the process was forced to terminate", config);
|
|
102
|
+
_chunk4QH2MTXKjs.writeError.call(void 0, `An exception was thrown in the executor's process
|
|
103
|
+
- Details: ${error.message}
|
|
104
|
+
- Stacktrace: ${error.stack}`, config);
|
|
105
|
+
return {
|
|
106
|
+
success: false
|
|
107
|
+
};
|
|
108
|
+
} finally {
|
|
109
|
+
stopwatch();
|
|
110
|
+
}
|
|
111
|
+
}, "withRunExecutor");
|
|
112
|
+
var _isFunction = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (value) => {
|
|
113
|
+
try {
|
|
114
|
+
return value instanceof Function || typeof value === "function" || !!(_optionalChain([value, 'optionalAccess', _19 => _19.constructor]) && _optionalChain([value, 'optionalAccess', _20 => _20.call]) && _optionalChain([value, 'optionalAccess', _21 => _21.apply]));
|
|
115
|
+
} catch (e) {
|
|
116
|
+
return false;
|
|
117
|
+
}
|
|
118
|
+
}, "_isFunction");
|
|
119
|
+
|
|
120
|
+
// src/executors/helm-package/executor.ts
|
|
121
|
+
async function serveExecutor(options, context, config) {
|
|
122
|
+
if (!_optionalChain([context, 'optionalAccess', _22 => _22.projectName]) || !_optionalChain([context, 'optionalAccess', _23 => _23.projectsConfigurations, 'optionalAccess', _24 => _24.projects, 'optionalAccess', _25 => _25[context.projectName], 'optionalAccess', _26 => _26.root])) {
|
|
123
|
+
throw new Error("Nx executor context was invalid");
|
|
124
|
+
}
|
|
125
|
+
const helm = _chunk2GAU2GHGjs.createHelmClient.call(void 0, );
|
|
126
|
+
if (_optionalChain([options, 'access', _27 => _27.dependencies, 'optionalAccess', _28 => _28.repositories])) {
|
|
127
|
+
for (const repository of options.dependencies.repositories) {
|
|
128
|
+
if (repository.name && repository.url) {
|
|
129
|
+
helm.addRepository(repository.name, repository.url);
|
|
130
|
+
} else {
|
|
131
|
+
throw new Error("Repository name and url are required");
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
if (_optionalChain([options, 'access', _29 => _29.dependencies, 'optionalAccess', _30 => _30.update])) {
|
|
136
|
+
helm.dependencyUpdate(options.chartFolder);
|
|
137
|
+
}
|
|
138
|
+
if (_optionalChain([options, 'access', _31 => _31.dependencies, 'optionalAccess', _32 => _32.build])) {
|
|
139
|
+
helm.dependencyBuild(options.chartFolder);
|
|
140
|
+
}
|
|
141
|
+
const chartPath = await helm.package({
|
|
142
|
+
chartFolder: options.chartFolder,
|
|
143
|
+
outputFolder: options.outputFolder
|
|
144
|
+
});
|
|
145
|
+
if (options.push && chartPath && options.remote) {
|
|
146
|
+
helm.push({
|
|
147
|
+
chartPath,
|
|
148
|
+
remote: options.remote
|
|
149
|
+
});
|
|
150
|
+
} else {
|
|
151
|
+
_chunk4QH2MTXKjs.writeWarning.call(void 0, `Chart packaged at: ${chartPath}`, config);
|
|
152
|
+
}
|
|
153
|
+
return {
|
|
154
|
+
success: true
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
_chunk3GQAWCBQjs.__name.call(void 0, serveExecutor, "serveExecutor");
|
|
158
|
+
var executor_default = withRunExecutor("Helm Chart Package executor", serveExecutor, {
|
|
159
|
+
skipReadingConfig: false,
|
|
160
|
+
hooks: {
|
|
161
|
+
applyDefaultOptions: /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (options) => {
|
|
162
|
+
options.port ??= 4500;
|
|
163
|
+
return options;
|
|
164
|
+
}, "applyDefaultOptions")
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
exports.serveExecutor = serveExecutor; exports.executor_default = executor_default;
|
|
@@ -475,49 +475,56 @@ var getLogLevelLabel = /* @__PURE__ */ __name((logLevel = LogLevel.INFO) => {
|
|
|
475
475
|
var getLogFn = /* @__PURE__ */ __name((logLevel = LogLevel.INFO, config = {}, _chalk = getChalk()) => {
|
|
476
476
|
const colors = !config.colors?.dark && !config.colors?.["base"] && !config.colors?.["base"]?.dark ? DEFAULT_COLOR_CONFIG : config.colors?.dark && typeof config.colors.dark === "string" ? config.colors : config.colors?.["base"]?.dark && typeof config.colors["base"].dark === "string" ? config.colors["base"].dark : config.colors?.["base"] ? config.colors?.["base"] : DEFAULT_COLOR_CONFIG;
|
|
477
477
|
const configLogLevel = config.logLevel || process.env.STORM_LOG_LEVEL || LogLevelLabel.INFO;
|
|
478
|
-
if (
|
|
478
|
+
if (logLevel > getLogLevel(configLogLevel) || logLevel <= LogLevel.SILENT || getLogLevel(configLogLevel) <= LogLevel.SILENT) {
|
|
479
479
|
return (_) => {
|
|
480
480
|
};
|
|
481
481
|
}
|
|
482
|
-
if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel
|
|
482
|
+
if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel) {
|
|
483
483
|
return (message) => {
|
|
484
484
|
console.error(`
|
|
485
485
|
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.fatal ?? "#7d1a1a")(`[${CONSOLE_ICONS[LogLevelLabel.FATAL]} Fatal]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
486
486
|
`);
|
|
487
487
|
};
|
|
488
488
|
}
|
|
489
|
-
if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel
|
|
489
|
+
if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel) {
|
|
490
490
|
return (message) => {
|
|
491
491
|
console.error(`
|
|
492
492
|
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.danger ?? "#f85149")(`[${CONSOLE_ICONS[LogLevelLabel.ERROR]} Error]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
493
493
|
`);
|
|
494
494
|
};
|
|
495
495
|
}
|
|
496
|
-
if (typeof logLevel === "number" && LogLevel.WARN >= logLevel
|
|
496
|
+
if (typeof logLevel === "number" && LogLevel.WARN >= logLevel) {
|
|
497
497
|
return (message) => {
|
|
498
498
|
console.warn(`
|
|
499
499
|
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.warning ?? "#e3b341")(`[${CONSOLE_ICONS[LogLevelLabel.WARN]} Warn]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
500
500
|
`);
|
|
501
501
|
};
|
|
502
502
|
}
|
|
503
|
-
if (typeof logLevel === "number" && LogLevel.SUCCESS >= logLevel
|
|
503
|
+
if (typeof logLevel === "number" && LogLevel.SUCCESS >= logLevel) {
|
|
504
504
|
return (message) => {
|
|
505
505
|
console.info(`
|
|
506
506
|
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.success ?? "#56d364")(`[${CONSOLE_ICONS[LogLevelLabel.SUCCESS]} Success]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
507
507
|
`);
|
|
508
508
|
};
|
|
509
509
|
}
|
|
510
|
-
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel
|
|
510
|
+
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel) {
|
|
511
511
|
return (message) => {
|
|
512
512
|
console.info(`
|
|
513
513
|
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.info ?? "#58a6ff")(`[${CONSOLE_ICONS[LogLevelLabel.INFO]} Info]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
514
514
|
`);
|
|
515
515
|
};
|
|
516
516
|
}
|
|
517
|
-
if (typeof logLevel === "number" && LogLevel.
|
|
517
|
+
if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel) {
|
|
518
518
|
return (message) => {
|
|
519
519
|
console.debug(`
|
|
520
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.brand ?? "#1fb2a6")(`[${CONSOLE_ICONS[LogLevelLabel.DEBUG]}
|
|
520
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.brand ?? "#1fb2a6")(`[${CONSOLE_ICONS[LogLevelLabel.DEBUG]} Debug]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
521
|
+
`);
|
|
522
|
+
};
|
|
523
|
+
}
|
|
524
|
+
if (typeof logLevel === "number" && LogLevel.TRACE >= logLevel) {
|
|
525
|
+
return (message) => {
|
|
526
|
+
console.debug(`
|
|
527
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.brand ?? "#1fb2a6")(`[${CONSOLE_ICONS[LogLevelLabel.TRACE]} Trace]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
521
528
|
`);
|
|
522
529
|
};
|
|
523
530
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk3XOZFSEVjs = require('./chunk-3XOZFSEV.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunk4QH2MTXKjs = require('./chunk-4QH2MTXK.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _chunk3GQAWCBQjs = require('./chunk-3GQAWCBQ.js');
|
|
@@ -12,7 +12,7 @@ var _chunk3GQAWCBQjs = require('./chunk-3GQAWCBQ.js');
|
|
|
12
12
|
var _devkit = require('@nx/devkit');
|
|
13
13
|
var _jsyaml = require('js-yaml'); var _jsyaml2 = _interopRequireDefault(_jsyaml);
|
|
14
14
|
async function helmDependencyGeneratorFn(tree, options, config) {
|
|
15
|
-
|
|
15
|
+
_chunk4QH2MTXKjs.writeDebug.call(void 0, "\u{1F4DD} Preparing to add Helm Dependency", config);
|
|
16
16
|
const project = _devkit.readProjectConfiguration.call(void 0, tree, options.project);
|
|
17
17
|
if (!_optionalChain([project, 'access', _ => _.targets, 'optionalAccess', _2 => _2["helm-package"]])) {
|
|
18
18
|
throw new Error(`Project ${options.project} does not have a helm target. Please run the chart generator first.`);
|
|
@@ -27,7 +27,7 @@ async function helmDependencyGeneratorFn(tree, options, config) {
|
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
_chunk3GQAWCBQjs.__name.call(void 0, helmDependencyGeneratorFn, "helmDependencyGeneratorFn");
|
|
30
|
-
var generator_default =
|
|
30
|
+
var generator_default = _chunk3XOZFSEVjs.withRunGenerator.call(void 0, "Helm Dependency", helmDependencyGeneratorFn);
|
|
31
31
|
function addDependencyToConfig(project, name, url) {
|
|
32
32
|
return {
|
|
33
33
|
...project,
|
|
@@ -8,7 +8,7 @@ var _chunkIOT45LXVjs = require('./chunk-IOT45LXV.js');
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunk4QH2MTXKjs = require('./chunk-4QH2MTXK.js');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
var _chunk3GQAWCBQjs = require('./chunk-3GQAWCBQ.js');
|
|
@@ -35,8 +35,8 @@ var createNodes = [
|
|
|
35
35
|
if (_optionalChain([projectJson, 'optionalAccess', _2 => _2.name])) {
|
|
36
36
|
return {};
|
|
37
37
|
}
|
|
38
|
-
const workspaceRoot =
|
|
39
|
-
const config = await
|
|
38
|
+
const workspaceRoot = _chunk4QH2MTXKjs.findWorkspaceRoot.call(void 0, );
|
|
39
|
+
const config = await _chunk4QH2MTXKjs.loadStormConfig.call(void 0, workspaceRoot);
|
|
40
40
|
Object.keys(projectJson).forEach((key) => {
|
|
41
41
|
if (!project[key]) {
|
|
42
42
|
project[key] = projectJson[key];
|