@storm-software/k8s-tools 0.18.0 → 0.19.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 +11 -0
- package/dist/chunk-2GAU2GHG.js +203 -0
- package/dist/chunk-2QNNUD5M.js +86 -0
- package/dist/chunk-3GQAWCBQ.js +13 -0
- package/dist/chunk-3J7KBHMJ.mjs +0 -0
- package/dist/chunk-6V45YKVB.mjs +203 -0
- package/dist/chunk-7AV2CVBT.mjs +169 -0
- package/dist/chunk-7BCSLKT3.js +98 -0
- package/dist/chunk-7IJP4RLN.mjs +63 -0
- package/dist/chunk-AFPEYAYK.js +61 -0
- package/dist/chunk-DHBG5ASJ.js +1 -0
- package/dist/chunk-DZ5UCMNL.mjs +1063 -0
- package/dist/chunk-EAQFLLRB.js +23 -0
- package/dist/chunk-EISL3C34.js +169 -0
- package/dist/chunk-GDXB64KG.js +1063 -0
- package/dist/chunk-GOVHOOTS.js +184 -0
- package/dist/chunk-IOT45LXV.js +134 -0
- package/dist/chunk-LFNGKV6F.js +18 -0
- package/dist/chunk-LSBSNYPQ.mjs +86 -0
- package/dist/chunk-O7U3AH6A.mjs +58 -0
- package/dist/chunk-OA63SGD6.mjs +23 -0
- package/dist/chunk-OBT35QXS.mjs +59 -0
- package/dist/chunk-OXY6AHKS.js +57 -0
- package/dist/chunk-Q6DDBFXE.mjs +147 -0
- package/dist/chunk-RVFKH45R.mjs +134 -0
- package/dist/chunk-T5WNZJOD.js +63 -0
- package/dist/chunk-TUDMFJIT.mjs +98 -0
- package/dist/chunk-U76ID4TS.js +1 -0
- package/dist/chunk-UDLI3L7V.mjs +18 -0
- package/dist/chunk-UWJTAL4W.js +59 -0
- package/dist/chunk-W7DPLC4K.mjs +184 -0
- package/dist/chunk-WWU25UQ4.mjs +0 -0
- package/dist/chunk-XMPMWMWQ.js +147 -0
- package/dist/chunk-XO66D74Z.js +1 -0
- package/dist/chunk-XUV4U54K.mjs +21 -0
- package/dist/chunk-YSCEY447.mjs +0 -0
- package/dist/chunk-ZO7MGNKJ.mjs +61 -0
- package/dist/executor-DY-z8MOl.d.mts +53 -0
- package/dist/executor-Dr6UXfvX.d.ts +53 -0
- package/dist/executors.d.mts +6 -0
- package/dist/executors.d.ts +6 -0
- package/dist/executors.js +19 -0
- package/dist/executors.mjs +19 -0
- package/dist/generator-B5bCfIUV.d.ts +24 -0
- package/dist/generator-BIe65kKR.d.mts +28 -0
- package/dist/generator-Cad7bXVB.d.mts +24 -0
- package/dist/generator-D7M45zOU.d.ts +28 -0
- package/dist/generators.d.mts +6 -0
- package/dist/generators.d.ts +6 -0
- package/dist/generators.js +15 -0
- package/dist/generators.mjs +15 -0
- package/dist/index.d.mts +15 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +57 -0
- package/dist/index.mjs +57 -0
- package/dist/schema.d-Cx_3iG9A.d.mts +150 -0
- package/dist/schema.d-Cx_3iG9A.d.ts +150 -0
- package/dist/src/executors/container-publish/executor.d.mts +11 -0
- package/dist/src/executors/container-publish/executor.d.ts +11 -0
- package/dist/src/executors/container-publish/executor.js +13 -0
- package/dist/src/executors/container-publish/executor.mjs +13 -0
- package/dist/src/executors/helm-package/executor.d.mts +4 -0
- package/dist/src/executors/helm-package/executor.d.ts +4 -0
- package/dist/src/executors/helm-package/executor.js +15 -0
- package/dist/src/executors/helm-package/executor.mjs +15 -0
- package/dist/src/executors/helm-package/schema.d.ts +1 -1
- package/dist/src/generators/helm-chart/files/chart/templates/NOTES.txt +22 -0
- package/dist/src/generators/helm-chart/files/chart/templates/_helpers.yaml +62 -0
- package/dist/src/generators/helm-chart/files/chart/templates/deployment.yaml +68 -0
- package/dist/src/generators/helm-chart/files/chart/templates/hpa.yaml +32 -0
- package/dist/src/generators/helm-chart/files/chart/templates/ingress.yaml +61 -0
- package/dist/src/generators/helm-chart/files/chart/templates/service.yaml +13 -0
- package/dist/src/generators/helm-chart/files/chart/templates/serviceaccount.yaml +13 -0
- package/dist/src/generators/helm-chart/files/chart/templates/test/test-connection.yaml +15 -0
- package/dist/src/generators/helm-chart/generator.d.mts +5 -0
- package/dist/src/generators/helm-chart/generator.d.ts +5 -0
- package/dist/src/generators/helm-chart/generator.js +12 -0
- package/dist/src/generators/helm-chart/generator.mjs +12 -0
- package/dist/src/generators/helm-chart/schema.d.ts +1 -1
- package/dist/src/generators/helm-dependency/generator.d.mts +5 -0
- package/dist/src/generators/helm-dependency/generator.d.ts +5 -0
- package/dist/src/generators/helm-dependency/generator.js +12 -0
- package/dist/src/generators/helm-dependency/generator.mjs +12 -0
- package/dist/src/generators/helm-dependency/schema.d.ts +1 -1
- package/dist/src/plugins/docker/index.d.mts +12 -0
- package/dist/src/plugins/docker/index.d.ts +12 -0
- package/dist/src/plugins/docker/index.js +15 -0
- package/dist/src/plugins/docker/index.mjs +15 -0
- package/dist/src/utils/client.d.mts +35 -0
- package/dist/src/utils/client.d.ts +35 -0
- package/dist/src/utils/client.js +11 -0
- package/dist/src/utils/client.mjs +11 -0
- package/dist/src/utils/ensure-init.d.mts +11 -0
- package/dist/src/utils/ensure-init.d.ts +11 -0
- package/dist/src/utils/ensure-init.js +7 -0
- package/dist/src/utils/ensure-init.mjs +7 -0
- package/dist/src/utils/index.d.mts +6 -0
- package/dist/src/utils/index.d.ts +6 -0
- package/dist/src/utils/index.js +21 -0
- package/dist/src/utils/index.mjs +21 -0
- package/dist/src/utils/prettier.d.mts +13 -0
- package/dist/src/utils/prettier.d.ts +13 -0
- package/dist/src/utils/prettier.js +9 -0
- package/dist/src/utils/prettier.mjs +9 -0
- package/dist/tsup.config.d.mts +5 -0
- package/dist/tsup.config.d.ts +5 -0
- package/dist/tsup.config.js +36 -0
- package/dist/tsup.config.mjs +36 -0
- package/dist/types-BCBFBwnJ.d.mts +20 -0
- package/dist/types-BCBFBwnJ.d.ts +20 -0
- package/dist/types-CIJRaFHD.d.mts +1185 -0
- package/dist/types-CIJRaFHD.d.ts +1185 -0
- package/package.json +1 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunk3GQAWCBQjs = require('./chunk-3GQAWCBQ.js');
|
|
4
|
+
|
|
5
|
+
// src/utils/ensure-init.ts
|
|
6
|
+
var ensureInitialized = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (target, propertyKey, descriptor) => {
|
|
7
|
+
const originalMethod = descriptor.value;
|
|
8
|
+
descriptor.value = async function(...arguments_) {
|
|
9
|
+
const self = this;
|
|
10
|
+
if (self.initialized === void 0 || typeof self.initialize !== "function") {
|
|
11
|
+
throw new TypeError(`The ensureInitialized decorator can only be applied in classes with an 'initialized' property and 'initialize' method.`);
|
|
12
|
+
}
|
|
13
|
+
if (!self.initialized) {
|
|
14
|
+
await self.initialize();
|
|
15
|
+
}
|
|
16
|
+
return originalMethod.apply(this, arguments_);
|
|
17
|
+
};
|
|
18
|
+
return descriptor;
|
|
19
|
+
}, "ensureInitialized");
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
exports.ensureInitialized = ensureInitialized;
|
|
@@ -0,0 +1,169 @@
|
|
|
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
|
+
|
|
3
|
+
var _chunkUWJTAL4Wjs = require('./chunk-UWJTAL4W.js');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunkAFPEYAYKjs = require('./chunk-AFPEYAYK.js');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
var _chunkGDXB64KGjs = require('./chunk-GDXB64KG.js');
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
var _chunk2GAU2GHGjs = require('./chunk-2GAU2GHG.js');
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
var _chunk3GQAWCBQjs = require('./chunk-3GQAWCBQ.js');
|
|
26
|
+
|
|
27
|
+
// ../workspace-tools/src/base/base-executor.ts
|
|
28
|
+
var withRunExecutor = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (name, executorFn, executorOptions = {}) => async (_options, context) => {
|
|
29
|
+
const stopwatch = _chunkGDXB64KGjs.getStopwatch.call(void 0, name);
|
|
30
|
+
let options = _options;
|
|
31
|
+
let config = {};
|
|
32
|
+
try {
|
|
33
|
+
_chunkGDXB64KGjs.writeInfo.call(void 0, `\u26A1 Running the ${name} executor...
|
|
34
|
+
`, config);
|
|
35
|
+
if (!_optionalChain([context, 'access', _ => _.projectsConfigurations, 'optionalAccess', _2 => _2.projects]) || !context.projectName || !context.projectsConfigurations.projects[context.projectName]) {
|
|
36
|
+
throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace.");
|
|
37
|
+
}
|
|
38
|
+
const workspaceRoot = _chunkGDXB64KGjs.findWorkspaceRoot.call(void 0, );
|
|
39
|
+
const projectRoot = _nullishCoalesce(_optionalChain([context, 'access', _3 => _3.projectsConfigurations, 'access', _4 => _4.projects, 'access', _5 => _5[context.projectName], 'optionalAccess', _6 => _6.root]), () => ( workspaceRoot));
|
|
40
|
+
const sourceRoot = _nullishCoalesce(_optionalChain([context, 'access', _7 => _7.projectsConfigurations, 'access', _8 => _8.projects, 'access', _9 => _9[context.projectName], 'optionalAccess', _10 => _10.sourceRoot]), () => ( workspaceRoot));
|
|
41
|
+
const projectName = _nullishCoalesce(_optionalChain([context, 'access', _11 => _11.projectsConfigurations, 'access', _12 => _12.projects, 'access', _13 => _13[context.projectName], 'optionalAccess', _14 => _14.name]), () => ( context.projectName));
|
|
42
|
+
config.workspaceRoot = workspaceRoot;
|
|
43
|
+
if (!executorOptions.skipReadingConfig) {
|
|
44
|
+
_chunkGDXB64KGjs.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 _chunkGDXB64KGjs.loadStormConfig.call(void 0, workspaceRoot);
|
|
51
|
+
}
|
|
52
|
+
if (_optionalChain([executorOptions, 'optionalAccess', _15 => _15.hooks, 'optionalAccess', _16 => _16.applyDefaultOptions])) {
|
|
53
|
+
_chunkGDXB64KGjs.writeDebug.call(void 0, "Running the applyDefaultOptions hook...", config);
|
|
54
|
+
options = await Promise.resolve(executorOptions.hooks.applyDefaultOptions(options, config));
|
|
55
|
+
_chunkGDXB64KGjs.writeDebug.call(void 0, "Completed the applyDefaultOptions hook", config);
|
|
56
|
+
}
|
|
57
|
+
_chunkGDXB64KGjs.writeTrace.call(void 0, `Executor schema options \u2699\uFE0F
|
|
58
|
+
${Object.keys(options).map((key) => ` - ${key}=${_isFunction(options[key]) ? "<function>" : JSON.stringify(options[key])}`).join("\n")}`, config);
|
|
59
|
+
const tokenized = await _chunkAFPEYAYKjs.applyWorkspaceTokens.call(void 0, options, {
|
|
60
|
+
config,
|
|
61
|
+
workspaceRoot,
|
|
62
|
+
projectRoot,
|
|
63
|
+
sourceRoot,
|
|
64
|
+
projectName,
|
|
65
|
+
...context.projectsConfigurations.projects[context.projectName],
|
|
66
|
+
...executorOptions
|
|
67
|
+
}, _chunkUWJTAL4Wjs.applyWorkspaceExecutorTokens);
|
|
68
|
+
if (_optionalChain([executorOptions, 'optionalAccess', _17 => _17.hooks, 'optionalAccess', _18 => _18.preProcess])) {
|
|
69
|
+
_chunkGDXB64KGjs.writeDebug.call(void 0, "Running the preProcess hook...", config);
|
|
70
|
+
await Promise.resolve(executorOptions.hooks.preProcess(tokenized, config));
|
|
71
|
+
_chunkGDXB64KGjs.writeDebug.call(void 0, "Completed the preProcess hook", config);
|
|
72
|
+
}
|
|
73
|
+
const ret = executorFn(tokenized, context, config);
|
|
74
|
+
if (_isFunction(_optionalChain([ret, 'optionalAccess', _19 => _19.next]))) {
|
|
75
|
+
const asyncGen = ret;
|
|
76
|
+
for await (const iter of asyncGen) {
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
const result = await Promise.resolve(ret);
|
|
80
|
+
if (result && (!result.success || result.error && _optionalChain([result, 'optionalAccess', _20 => _20.error, 'optionalAccess', _21 => _21.message]) && typeof _optionalChain([result, 'optionalAccess', _22 => _22.error, 'optionalAccess', _23 => _23.message]) === "string" && _optionalChain([result, 'optionalAccess', _24 => _24.error, 'optionalAccess', _25 => _25.name]) && typeof _optionalChain([result, 'optionalAccess', _26 => _26.error, 'optionalAccess', _27 => _27.name]) === "string")) {
|
|
81
|
+
_chunkGDXB64KGjs.writeTrace.call(void 0, `Failure determined by the ${name} executor
|
|
82
|
+
${_chunkGDXB64KGjs.formatLogMessage.call(void 0, result)}`, config);
|
|
83
|
+
console.error(result);
|
|
84
|
+
throw new Error(`The ${name} executor failed to run`, {
|
|
85
|
+
cause: _optionalChain([result, 'optionalAccess', _28 => _28.error])
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
if (_optionalChain([executorOptions, 'optionalAccess', _29 => _29.hooks, 'optionalAccess', _30 => _30.postProcess])) {
|
|
89
|
+
_chunkGDXB64KGjs.writeDebug.call(void 0, "Running the postProcess hook...", config);
|
|
90
|
+
await Promise.resolve(executorOptions.hooks.postProcess(config));
|
|
91
|
+
_chunkGDXB64KGjs.writeDebug.call(void 0, "Completed the postProcess hook", config);
|
|
92
|
+
}
|
|
93
|
+
_chunkGDXB64KGjs.writeSuccess.call(void 0, `Completed running the ${name} task executor!
|
|
94
|
+
`, config);
|
|
95
|
+
return {
|
|
96
|
+
success: true
|
|
97
|
+
};
|
|
98
|
+
} catch (error) {
|
|
99
|
+
_chunkGDXB64KGjs.writeFatal.call(void 0, "A fatal error occurred while running the executor - the process was forced to terminate", config);
|
|
100
|
+
_chunkGDXB64KGjs.writeError.call(void 0, `An exception was thrown in the executor's process
|
|
101
|
+
- Details: ${error.message}
|
|
102
|
+
- Stacktrace: ${error.stack}`, config);
|
|
103
|
+
return {
|
|
104
|
+
success: false
|
|
105
|
+
};
|
|
106
|
+
} finally {
|
|
107
|
+
stopwatch();
|
|
108
|
+
}
|
|
109
|
+
}, "withRunExecutor");
|
|
110
|
+
var _isFunction = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (value) => {
|
|
111
|
+
try {
|
|
112
|
+
return value instanceof Function || typeof value === "function" || !!(_optionalChain([value, 'optionalAccess', _31 => _31.constructor]) && _optionalChain([value, 'optionalAccess', _32 => _32.call]) && _optionalChain([value, 'optionalAccess', _33 => _33.apply]));
|
|
113
|
+
} catch (e) {
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
}, "_isFunction");
|
|
117
|
+
|
|
118
|
+
// src/executors/helm-package/executor.ts
|
|
119
|
+
async function serveExecutor(options, context, config) {
|
|
120
|
+
if (!_optionalChain([context, 'optionalAccess', _34 => _34.projectName]) || !_optionalChain([context, 'optionalAccess', _35 => _35.projectsConfigurations, 'optionalAccess', _36 => _36.projects, 'optionalAccess', _37 => _37[context.projectName], 'optionalAccess', _38 => _38.root])) {
|
|
121
|
+
throw new Error("Nx executor context was invalid");
|
|
122
|
+
}
|
|
123
|
+
const helm = _chunk2GAU2GHGjs.createHelmClient.call(void 0, );
|
|
124
|
+
if (_optionalChain([options, 'access', _39 => _39.dependencies, 'optionalAccess', _40 => _40.repositories])) {
|
|
125
|
+
for (const repository of options.dependencies.repositories) {
|
|
126
|
+
if (repository.name && repository.url) {
|
|
127
|
+
helm.addRepository(repository.name, repository.url);
|
|
128
|
+
} else {
|
|
129
|
+
throw new Error("Repository name and url are required");
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
if (_optionalChain([options, 'access', _41 => _41.dependencies, 'optionalAccess', _42 => _42.update])) {
|
|
134
|
+
helm.dependencyUpdate(options.chartFolder);
|
|
135
|
+
}
|
|
136
|
+
if (_optionalChain([options, 'access', _43 => _43.dependencies, 'optionalAccess', _44 => _44.build])) {
|
|
137
|
+
helm.dependencyBuild(options.chartFolder);
|
|
138
|
+
}
|
|
139
|
+
const chartPath = await helm.package({
|
|
140
|
+
chartFolder: options.chartFolder,
|
|
141
|
+
outputFolder: options.outputFolder
|
|
142
|
+
});
|
|
143
|
+
if (options.push && chartPath && options.remote) {
|
|
144
|
+
helm.push({
|
|
145
|
+
chartPath,
|
|
146
|
+
remote: options.remote
|
|
147
|
+
});
|
|
148
|
+
} else {
|
|
149
|
+
_chunkGDXB64KGjs.writeWarning.call(void 0, `Chart packaged at: ${chartPath}`, config);
|
|
150
|
+
}
|
|
151
|
+
return {
|
|
152
|
+
success: true
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
_chunk3GQAWCBQjs.__name.call(void 0, serveExecutor, "serveExecutor");
|
|
156
|
+
var executor_default = withRunExecutor("Helm Chart Package executor", serveExecutor, {
|
|
157
|
+
skipReadingConfig: false,
|
|
158
|
+
hooks: {
|
|
159
|
+
applyDefaultOptions: /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (options) => {
|
|
160
|
+
options.port ??= 4500;
|
|
161
|
+
return options;
|
|
162
|
+
}, "applyDefaultOptions")
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
exports.serveExecutor = serveExecutor; exports.executor_default = executor_default;
|