@storm-software/k8s-tools 0.17.1 → 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.
Files changed (145) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/chunk-2GAU2GHG.js +203 -0
  3. package/dist/chunk-2QNNUD5M.js +86 -0
  4. package/dist/chunk-3GQAWCBQ.js +13 -0
  5. package/dist/chunk-3J7KBHMJ.mjs +0 -0
  6. package/dist/chunk-6V45YKVB.mjs +203 -0
  7. package/dist/chunk-7AV2CVBT.mjs +169 -0
  8. package/dist/chunk-7BCSLKT3.js +98 -0
  9. package/dist/chunk-7IJP4RLN.mjs +63 -0
  10. package/dist/chunk-AFPEYAYK.js +61 -0
  11. package/dist/chunk-DHBG5ASJ.js +1 -0
  12. package/dist/chunk-DZ5UCMNL.mjs +1063 -0
  13. package/dist/chunk-EAQFLLRB.js +23 -0
  14. package/dist/chunk-EISL3C34.js +169 -0
  15. package/dist/chunk-GDXB64KG.js +1063 -0
  16. package/dist/chunk-GOVHOOTS.js +184 -0
  17. package/dist/chunk-IOT45LXV.js +134 -0
  18. package/dist/chunk-LFNGKV6F.js +18 -0
  19. package/dist/chunk-LSBSNYPQ.mjs +86 -0
  20. package/dist/chunk-O7U3AH6A.mjs +58 -0
  21. package/dist/chunk-OA63SGD6.mjs +23 -0
  22. package/dist/chunk-OBT35QXS.mjs +59 -0
  23. package/dist/chunk-OXY6AHKS.js +57 -0
  24. package/dist/chunk-Q6DDBFXE.mjs +147 -0
  25. package/dist/chunk-RVFKH45R.mjs +134 -0
  26. package/dist/chunk-T5WNZJOD.js +63 -0
  27. package/dist/chunk-TUDMFJIT.mjs +98 -0
  28. package/dist/chunk-U76ID4TS.js +1 -0
  29. package/dist/chunk-UDLI3L7V.mjs +18 -0
  30. package/dist/chunk-UWJTAL4W.js +59 -0
  31. package/{src/plugins/docker/index.js → dist/chunk-W7DPLC4K.mjs} +46 -68
  32. package/dist/chunk-WWU25UQ4.mjs +0 -0
  33. package/dist/chunk-XMPMWMWQ.js +147 -0
  34. package/dist/chunk-XO66D74Z.js +1 -0
  35. package/dist/chunk-XUV4U54K.mjs +21 -0
  36. package/dist/chunk-YSCEY447.mjs +0 -0
  37. package/dist/chunk-ZO7MGNKJ.mjs +61 -0
  38. package/dist/executor-DY-z8MOl.d.mts +53 -0
  39. package/dist/executor-Dr6UXfvX.d.ts +53 -0
  40. package/dist/executors.d.mts +6 -0
  41. package/dist/executors.d.ts +6 -0
  42. package/dist/executors.js +19 -0
  43. package/dist/executors.mjs +19 -0
  44. package/dist/generator-B5bCfIUV.d.ts +24 -0
  45. package/dist/generator-BIe65kKR.d.mts +28 -0
  46. package/dist/generator-Cad7bXVB.d.mts +24 -0
  47. package/dist/generator-D7M45zOU.d.ts +28 -0
  48. package/dist/generators.d.mts +6 -0
  49. package/dist/generators.d.ts +6 -0
  50. package/dist/generators.js +15 -0
  51. package/dist/generators.mjs +15 -0
  52. package/dist/index.d.mts +15 -0
  53. package/dist/index.d.ts +15 -0
  54. package/dist/index.js +57 -0
  55. package/dist/index.mjs +57 -0
  56. package/dist/schema.d-Cx_3iG9A.d.mts +150 -0
  57. package/dist/schema.d-Cx_3iG9A.d.ts +150 -0
  58. package/dist/src/executors/container-publish/executor.d.mts +11 -0
  59. package/dist/src/executors/container-publish/executor.d.ts +11 -0
  60. package/dist/src/executors/container-publish/executor.js +13 -0
  61. package/dist/src/executors/container-publish/executor.mjs +13 -0
  62. package/dist/src/executors/helm-package/executor.d.mts +4 -0
  63. package/dist/src/executors/helm-package/executor.d.ts +4 -0
  64. package/dist/src/executors/helm-package/executor.js +15 -0
  65. package/dist/src/executors/helm-package/executor.mjs +15 -0
  66. package/{src → dist/src}/executors/helm-package/schema.d.ts +1 -1
  67. package/dist/src/generators/helm-chart/generator.d.mts +5 -0
  68. package/dist/src/generators/helm-chart/generator.d.ts +5 -0
  69. package/dist/src/generators/helm-chart/generator.js +12 -0
  70. package/dist/src/generators/helm-chart/generator.mjs +12 -0
  71. package/{src → dist/src}/generators/helm-chart/schema.d.ts +4 -1
  72. package/dist/src/generators/helm-dependency/generator.d.mts +5 -0
  73. package/dist/src/generators/helm-dependency/generator.d.ts +5 -0
  74. package/dist/src/generators/helm-dependency/generator.js +12 -0
  75. package/dist/src/generators/helm-dependency/generator.mjs +12 -0
  76. package/{src → dist/src}/generators/helm-dependency/schema.d.ts +4 -1
  77. package/dist/src/plugins/docker/index.d.mts +12 -0
  78. package/dist/src/plugins/docker/index.d.ts +12 -0
  79. package/dist/src/plugins/docker/index.js +15 -0
  80. package/dist/src/plugins/docker/index.mjs +15 -0
  81. package/dist/src/types.d.mts +31 -0
  82. package/{src → dist/src}/types.d.ts +9 -6
  83. package/dist/src/types.js +7 -0
  84. package/dist/src/types.mjs +7 -0
  85. package/dist/src/utils/client.d.mts +35 -0
  86. package/{src → dist/src}/utils/client.d.ts +7 -3
  87. package/dist/src/utils/client.js +11 -0
  88. package/dist/src/utils/client.mjs +11 -0
  89. package/dist/src/utils/ensure-init.d.mts +11 -0
  90. package/{src → dist/src}/utils/ensure-init.d.ts +3 -1
  91. package/dist/src/utils/ensure-init.js +7 -0
  92. package/dist/src/utils/ensure-init.mjs +7 -0
  93. package/dist/src/utils/index.d.mts +6 -0
  94. package/dist/src/utils/index.d.ts +6 -0
  95. package/dist/src/utils/index.js +21 -0
  96. package/dist/src/utils/index.mjs +21 -0
  97. package/dist/src/utils/prettier.d.mts +13 -0
  98. package/dist/src/utils/prettier.d.ts +13 -0
  99. package/dist/src/utils/prettier.js +9 -0
  100. package/dist/src/utils/prettier.mjs +9 -0
  101. package/dist/tsup.config.d.mts +5 -0
  102. package/dist/tsup.config.d.ts +5 -0
  103. package/dist/tsup.config.js +36 -0
  104. package/dist/tsup.config.mjs +36 -0
  105. package/dist/types-BCBFBwnJ.d.mts +20 -0
  106. package/dist/types-BCBFBwnJ.d.ts +20 -0
  107. package/dist/types-CIJRaFHD.d.mts +1185 -0
  108. package/dist/types-CIJRaFHD.d.ts +1185 -0
  109. package/executors.json +4 -4
  110. package/generators.json +4 -4
  111. package/package.json +1 -1
  112. package/index.d.ts +0 -1
  113. package/index.js +0 -3269
  114. package/meta.json +0 -654
  115. package/src/executors/container-publish/executor.d.ts +0 -7
  116. package/src/executors/container-publish/executor.js +0 -199
  117. package/src/executors/helm-package/executor.d.ts +0 -8
  118. package/src/executors/helm-package/executor.js +0 -242
  119. package/src/executors/index.d.ts +0 -2
  120. package/src/generators/helm-chart/files/chart/.helmignore +0 -23
  121. package/src/generators/helm-chart/generator.d.ts +0 -8
  122. package/src/generators/helm-chart/generator.js +0 -79
  123. package/src/generators/helm-dependency/generator.d.ts +0 -8
  124. package/src/generators/helm-dependency/generator.js +0 -2747
  125. package/src/generators/index.d.ts +0 -2
  126. package/src/index.d.ts +0 -3
  127. package/src/plugins/docker/_dockerfile.d.ts +0 -9
  128. package/src/plugins/docker/index.d.ts +0 -1
  129. package/src/plugins/index.d.ts +0 -1
  130. package/src/utils/prettier.d.ts +0 -9
  131. /package/{src → dist/src}/executors/container-publish/schema.d.ts +0 -0
  132. /package/{src → dist/src}/executors/container-publish/schema.json +0 -0
  133. /package/{src → dist/src}/executors/helm-package/schema.json +0 -0
  134. /package/{src → dist/src}/generators/helm-chart/files/chart/Chart.yaml.template +0 -0
  135. /package/{src → dist/src}/generators/helm-chart/files/chart/templates/NOTES.txt +0 -0
  136. /package/{src → dist/src}/generators/helm-chart/files/chart/templates/_helpers.yaml +0 -0
  137. /package/{src → dist/src}/generators/helm-chart/files/chart/templates/deployment.yaml +0 -0
  138. /package/{src → dist/src}/generators/helm-chart/files/chart/templates/hpa.yaml +0 -0
  139. /package/{src → dist/src}/generators/helm-chart/files/chart/templates/ingress.yaml +0 -0
  140. /package/{src → dist/src}/generators/helm-chart/files/chart/templates/service.yaml +0 -0
  141. /package/{src → dist/src}/generators/helm-chart/files/chart/templates/serviceaccount.yaml +0 -0
  142. /package/{src → dist/src}/generators/helm-chart/files/chart/templates/test/test-connection.yaml +0 -0
  143. /package/{src → dist/src}/generators/helm-chart/files/chart/values.yaml +0 -0
  144. /package/{src → dist/src}/generators/helm-chart/schema.json +0 -0
  145. /package/{src → dist/src}/generators/helm-dependency/schema.json +0 -0
package/CHANGELOG.md CHANGED
@@ -1,3 +1,21 @@
1
+ ## 0.19.0 (2025-01-20)
2
+
3
+ ### Features
4
+
5
+ - **untyped:** Standard file name changes to avoid collisions ([71acf100](https://github.com/storm-software/storm-ops/commit/71acf100))
6
+
7
+ ### Bug Fixes
8
+
9
+ - **pulumi-tools:** Resolved issue with invalid import paths ([af7e7c5e](https://github.com/storm-software/storm-ops/commit/af7e7c5e))
10
+ - **workspace-tools:** Resolved issues with import paths ([9eeb1f73](https://github.com/storm-software/storm-ops/commit/9eeb1f73))
11
+
12
+ ## 0.18.0 (2025-01-20)
13
+
14
+ ### Features
15
+
16
+ - **workspace-tools:** Added new scripts and configuration to Nx preset ([a912e765](https://github.com/storm-software/storm-ops/commit/a912e765))
17
+ - **workspace-tools:** Update Nx plugin packages to use new build/dist infrastructure ([67cd3df2](https://github.com/storm-software/storm-ops/commit/67cd3df2))
18
+
1
19
  ## 0.17.1 (2025-01-09)
2
20
 
3
21
  ### Bug Fixes
@@ -0,0 +1,203 @@
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
+ var _chunkLFNGKV6Fjs = require('./chunk-LFNGKV6F.js');
4
+
5
+
6
+ var _chunkEAQFLLRBjs = require('./chunk-EAQFLLRB.js');
7
+
8
+
9
+ var _chunk3GQAWCBQjs = require('./chunk-3GQAWCBQ.js');
10
+
11
+ // src/utils/client.ts
12
+ var _child_process = require('child_process');
13
+ function _ts_decorate(decorators, target, key, desc) {
14
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
15
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
16
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
17
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
18
+ }
19
+ _chunk3GQAWCBQjs.__name.call(void 0, _ts_decorate, "_ts_decorate");
20
+ function _ts_metadata(k, v) {
21
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
22
+ }
23
+ _chunk3GQAWCBQjs.__name.call(void 0, _ts_metadata, "_ts_metadata");
24
+ var HelmClient = class extends _chunkLFNGKV6Fjs.AbstractHelmClient {
25
+ static {
26
+ _chunk3GQAWCBQjs.__name.call(void 0, this, "HelmClient");
27
+ }
28
+ /**
29
+ * Creates an instance of HelmClient
30
+ */
31
+ constructor() {
32
+ super();
33
+ }
34
+ /**
35
+ * Package a chart directory into a chart archive
36
+ *
37
+ * @param {PackageOptions} [options]
38
+ */
39
+ package(options) {
40
+ let chartPath = void 0;
41
+ let output = {};
42
+ try {
43
+ output = this.runCommand([
44
+ "helm",
45
+ "package",
46
+ options.chartFolder,
47
+ "-d",
48
+ options.outputFolder
49
+ ]);
50
+ } catch (err) {
51
+ if (_optionalChain([err, 'optionalAccess', _ => _.stderr, 'access', _2 => _2.length]) > 0 && _optionalChain([err, 'optionalAccess', _3 => _3.exitCode]) !== 0) {
52
+ throw new Error(`Failed to package chart: ${err.stderr}`);
53
+ }
54
+ }
55
+ if (_optionalChain([output, 'optionalAccess', _4 => _4.stderr, 'access', _5 => _5.length]) > 0 && _optionalChain([output, 'optionalAccess', _6 => _6.exitCode]) !== 0) {
56
+ throw new Error(`Failed to package chart: ${output.stderr}`);
57
+ }
58
+ const match = _optionalChain([output, 'access', _7 => _7.stdout, 'optionalAccess', _8 => _8.match, 'call', _9 => _9(/Successfully packaged chart and saved it to: (.+)/)]);
59
+ if (!match || match.length < 2) {
60
+ throw new Error("Failed to parse chart path from helm output");
61
+ }
62
+ chartPath = _optionalChain([match, 'access', _10 => _10[1], 'optionalAccess', _11 => _11.trim, 'call', _12 => _12()]);
63
+ return new Promise((resolve) => resolve(chartPath));
64
+ }
65
+ push(options) {
66
+ try {
67
+ this.runCommand([
68
+ "helm",
69
+ "push",
70
+ options.chartPath,
71
+ options.remote
72
+ ]);
73
+ } catch (err) {
74
+ if (_optionalChain([err, 'optionalAccess', _13 => _13.stderr, 'access', _14 => _14.length]) > 0 && _optionalChain([err, 'optionalAccess', _15 => _15.exitCode]) !== 0) {
75
+ throw new Error(`Failed to push chart: ${err.stderr}`);
76
+ }
77
+ }
78
+ }
79
+ dependencyUpdate(chartFolder) {
80
+ try {
81
+ this.runCommand([
82
+ "helm",
83
+ "dependency",
84
+ "update",
85
+ chartFolder
86
+ ]);
87
+ } catch (err) {
88
+ if (_optionalChain([err, 'optionalAccess', _16 => _16.stderr, 'access', _17 => _17.length]) > 0 && _optionalChain([err, 'optionalAccess', _18 => _18.exitCode]) !== 0) {
89
+ throw new Error(`Failed to update chart dependencies: ${err.stderr}`);
90
+ }
91
+ }
92
+ }
93
+ dependencyBuild(chartFolder) {
94
+ try {
95
+ this.runCommand([
96
+ "helm",
97
+ "dependency",
98
+ "build",
99
+ chartFolder
100
+ ]);
101
+ } catch (err) {
102
+ if (_optionalChain([err, 'optionalAccess', _19 => _19.stderr, 'access', _20 => _20.length]) > 0 && _optionalChain([err, 'optionalAccess', _21 => _21.exitCode]) !== 0) {
103
+ throw new Error(`Failed to build chart dependencies: ${err.stderr}`);
104
+ }
105
+ }
106
+ }
107
+ addRepository(name, url) {
108
+ try {
109
+ this.runCommand([
110
+ "helm",
111
+ "repo",
112
+ "add",
113
+ name,
114
+ url
115
+ ]);
116
+ } catch (err) {
117
+ if (_optionalChain([err, 'optionalAccess', _22 => _22.stderr, 'access', _23 => _23.length]) > 0 && _optionalChain([err, 'optionalAccess', _24 => _24.exitCode]) !== 0) {
118
+ throw new Error(`Failed to add repository: ${err.stderr}`);
119
+ }
120
+ }
121
+ }
122
+ /**
123
+ * Initialize Helm
124
+ *
125
+ * @returns A promise
126
+ */
127
+ async initialize() {
128
+ if (this.initialized) {
129
+ return;
130
+ }
131
+ try {
132
+ this.runCommand([
133
+ "helm",
134
+ "version"
135
+ ]);
136
+ } catch (err) {
137
+ if (_optionalChain([err, 'optionalAccess', _25 => _25.stderr, 'access', _26 => _26.length]) > 0 && _optionalChain([err, 'optionalAccess', _27 => _27.exitCode]) !== 0) {
138
+ throw new Error(`Helm is not installed: ${err.stderr}`);
139
+ }
140
+ }
141
+ return new Promise((resolve) => {
142
+ this.initialized = true;
143
+ resolve();
144
+ });
145
+ }
146
+ runCommand(commands) {
147
+ return _child_process.execSync.call(void 0, commands.filter(Boolean).join(" "), {
148
+ encoding: "utf8",
149
+ windowsHide: true,
150
+ maxBuffer: 1024 * 1e6,
151
+ stdio: "pipe"
152
+ });
153
+ }
154
+ };
155
+ _ts_decorate([
156
+ _chunkEAQFLLRBjs.ensureInitialized,
157
+ _ts_metadata("design:type", Function),
158
+ _ts_metadata("design:paramtypes", [
159
+ typeof PackageOptions === "undefined" ? Object : PackageOptions
160
+ ]),
161
+ _ts_metadata("design:returntype", typeof Promise === "undefined" ? Object : Promise)
162
+ ], HelmClient.prototype, "package", null);
163
+ _ts_decorate([
164
+ _chunkEAQFLLRBjs.ensureInitialized,
165
+ _ts_metadata("design:type", Function),
166
+ _ts_metadata("design:paramtypes", [
167
+ typeof PushOptions === "undefined" ? Object : PushOptions
168
+ ]),
169
+ _ts_metadata("design:returntype", void 0)
170
+ ], HelmClient.prototype, "push", null);
171
+ _ts_decorate([
172
+ _chunkEAQFLLRBjs.ensureInitialized,
173
+ _ts_metadata("design:type", Function),
174
+ _ts_metadata("design:paramtypes", [
175
+ String
176
+ ]),
177
+ _ts_metadata("design:returntype", void 0)
178
+ ], HelmClient.prototype, "dependencyUpdate", null);
179
+ _ts_decorate([
180
+ _chunkEAQFLLRBjs.ensureInitialized,
181
+ _ts_metadata("design:type", Function),
182
+ _ts_metadata("design:paramtypes", [
183
+ String
184
+ ]),
185
+ _ts_metadata("design:returntype", void 0)
186
+ ], HelmClient.prototype, "dependencyBuild", null);
187
+ _ts_decorate([
188
+ _chunkEAQFLLRBjs.ensureInitialized,
189
+ _ts_metadata("design:type", Function),
190
+ _ts_metadata("design:paramtypes", [
191
+ String,
192
+ String
193
+ ]),
194
+ _ts_metadata("design:returntype", void 0)
195
+ ], HelmClient.prototype, "addRepository", null);
196
+ var createHelmClient = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, () => {
197
+ return new HelmClient();
198
+ }, "createHelmClient");
199
+
200
+
201
+
202
+
203
+ exports.HelmClient = HelmClient; exports.createHelmClient = createHelmClient;
@@ -0,0 +1,86 @@
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
+
4
+ var _chunkAFPEYAYKjs = require('./chunk-AFPEYAYK.js');
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+ var _chunkGDXB64KGjs = require('./chunk-GDXB64KG.js');
16
+
17
+
18
+ var _chunk3GQAWCBQjs = require('./chunk-3GQAWCBQ.js');
19
+
20
+ // ../workspace-tools/src/base/base-generator.ts
21
+ var withRunGenerator = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (name, generatorFn, generatorOptions = {
22
+ skipReadingConfig: false
23
+ }) => async (tree, _options) => {
24
+ const stopwatch = _chunkGDXB64KGjs.getStopwatch.call(void 0, name);
25
+ let options = _options;
26
+ let config;
27
+ try {
28
+ _chunkGDXB64KGjs.writeInfo.call(void 0, `\u26A1 Running the ${name} generator...
29
+
30
+ `, config);
31
+ const workspaceRoot = _chunkGDXB64KGjs.findWorkspaceRoot.call(void 0, );
32
+ if (!generatorOptions.skipReadingConfig) {
33
+ _chunkGDXB64KGjs.writeDebug.call(void 0, `Loading the Storm Config from environment variables and storm.config.js file...
34
+ - workspaceRoot: ${workspaceRoot}`, config);
35
+ config = await _chunkGDXB64KGjs.loadStormConfig.call(void 0, workspaceRoot);
36
+ }
37
+ if (_optionalChain([generatorOptions, 'optionalAccess', _ => _.hooks, 'optionalAccess', _2 => _2.applyDefaultOptions])) {
38
+ _chunkGDXB64KGjs.writeDebug.call(void 0, "Running the applyDefaultOptions hook...", config);
39
+ options = await Promise.resolve(generatorOptions.hooks.applyDefaultOptions(options, config));
40
+ _chunkGDXB64KGjs.writeDebug.call(void 0, "Completed the applyDefaultOptions hook", config);
41
+ }
42
+ _chunkGDXB64KGjs.writeTrace.call(void 0, `Generator schema options \u2699\uFE0F
43
+ ${Object.keys(_nullishCoalesce(options, () => ( {}))).map((key) => ` - ${key}=${JSON.stringify(options[key])}`).join("\n")}`, config);
44
+ const tokenized = await _chunkAFPEYAYKjs.applyWorkspaceTokens.call(void 0, options, {
45
+ workspaceRoot: tree.root,
46
+ config
47
+ }, _chunkAFPEYAYKjs.applyWorkspaceBaseTokens);
48
+ if (_optionalChain([generatorOptions, 'optionalAccess', _3 => _3.hooks, 'optionalAccess', _4 => _4.preProcess])) {
49
+ _chunkGDXB64KGjs.writeDebug.call(void 0, "Running the preProcess hook...", config);
50
+ await Promise.resolve(generatorOptions.hooks.preProcess(tokenized, config));
51
+ _chunkGDXB64KGjs.writeDebug.call(void 0, "Completed the preProcess hook", config);
52
+ }
53
+ const result = await Promise.resolve(generatorFn(tree, tokenized, config));
54
+ if (result) {
55
+ if (result.success === false || result.error && _optionalChain([result, 'optionalAccess', _5 => _5.error, 'optionalAccess', _6 => _6.message]) && typeof _optionalChain([result, 'optionalAccess', _7 => _7.error, 'optionalAccess', _8 => _8.message]) === "string" && _optionalChain([result, 'optionalAccess', _9 => _9.error, 'optionalAccess', _10 => _10.name]) && typeof _optionalChain([result, 'optionalAccess', _11 => _11.error, 'optionalAccess', _12 => _12.name]) === "string") {
56
+ throw new Error(`The ${name} generator failed to run`, {
57
+ cause: _optionalChain([result, 'optionalAccess', _13 => _13.error])
58
+ });
59
+ } else if (result.success && result.data) {
60
+ return result;
61
+ }
62
+ }
63
+ if (_optionalChain([generatorOptions, 'optionalAccess', _14 => _14.hooks, 'optionalAccess', _15 => _15.postProcess])) {
64
+ _chunkGDXB64KGjs.writeDebug.call(void 0, "Running the postProcess hook...", config);
65
+ await Promise.resolve(generatorOptions.hooks.postProcess(config));
66
+ _chunkGDXB64KGjs.writeDebug.call(void 0, "Completed the postProcess hook", config);
67
+ }
68
+ return () => {
69
+ _chunkGDXB64KGjs.writeSuccess.call(void 0, `Completed running the ${name} generator!
70
+ `, config);
71
+ };
72
+ } catch (error) {
73
+ return () => {
74
+ _chunkGDXB64KGjs.writeFatal.call(void 0, "A fatal error occurred while running the generator - the process was forced to terminate", config);
75
+ _chunkGDXB64KGjs.writeError.call(void 0, `An exception was thrown in the generator's process
76
+ - Details: ${error.message}
77
+ - Stacktrace: ${error.stack}`, config);
78
+ };
79
+ } finally {
80
+ stopwatch();
81
+ }
82
+ }, "withRunGenerator");
83
+
84
+
85
+
86
+ exports.withRunGenerator = withRunGenerator;
@@ -0,0 +1,13 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
4
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
5
+ }) : x)(function(x) {
6
+ if (typeof require !== "undefined") return require.apply(this, arguments);
7
+ throw Error('Dynamic require of "' + x + '" is not supported');
8
+ });
9
+
10
+
11
+
12
+
13
+ exports.__name = __name; exports.__require = __require;
File without changes
@@ -0,0 +1,203 @@
1
+ import {
2
+ AbstractHelmClient
3
+ } from "./chunk-UDLI3L7V.mjs";
4
+ import {
5
+ ensureInitialized
6
+ } from "./chunk-OA63SGD6.mjs";
7
+ import {
8
+ __name
9
+ } from "./chunk-XUV4U54K.mjs";
10
+
11
+ // src/utils/client.ts
12
+ import { execSync } from "node:child_process";
13
+ function _ts_decorate(decorators, target, key, desc) {
14
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
15
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
16
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
17
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
18
+ }
19
+ __name(_ts_decorate, "_ts_decorate");
20
+ function _ts_metadata(k, v) {
21
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
22
+ }
23
+ __name(_ts_metadata, "_ts_metadata");
24
+ var HelmClient = class extends AbstractHelmClient {
25
+ static {
26
+ __name(this, "HelmClient");
27
+ }
28
+ /**
29
+ * Creates an instance of HelmClient
30
+ */
31
+ constructor() {
32
+ super();
33
+ }
34
+ /**
35
+ * Package a chart directory into a chart archive
36
+ *
37
+ * @param {PackageOptions} [options]
38
+ */
39
+ package(options) {
40
+ let chartPath = void 0;
41
+ let output = {};
42
+ try {
43
+ output = this.runCommand([
44
+ "helm",
45
+ "package",
46
+ options.chartFolder,
47
+ "-d",
48
+ options.outputFolder
49
+ ]);
50
+ } catch (err) {
51
+ if (err?.stderr.length > 0 && err?.exitCode !== 0) {
52
+ throw new Error(`Failed to package chart: ${err.stderr}`);
53
+ }
54
+ }
55
+ if (output?.stderr.length > 0 && output?.exitCode !== 0) {
56
+ throw new Error(`Failed to package chart: ${output.stderr}`);
57
+ }
58
+ const match = output.stdout?.match(/Successfully packaged chart and saved it to: (.+)/);
59
+ if (!match || match.length < 2) {
60
+ throw new Error("Failed to parse chart path from helm output");
61
+ }
62
+ chartPath = match[1]?.trim();
63
+ return new Promise((resolve) => resolve(chartPath));
64
+ }
65
+ push(options) {
66
+ try {
67
+ this.runCommand([
68
+ "helm",
69
+ "push",
70
+ options.chartPath,
71
+ options.remote
72
+ ]);
73
+ } catch (err) {
74
+ if (err?.stderr.length > 0 && err?.exitCode !== 0) {
75
+ throw new Error(`Failed to push chart: ${err.stderr}`);
76
+ }
77
+ }
78
+ }
79
+ dependencyUpdate(chartFolder) {
80
+ try {
81
+ this.runCommand([
82
+ "helm",
83
+ "dependency",
84
+ "update",
85
+ chartFolder
86
+ ]);
87
+ } catch (err) {
88
+ if (err?.stderr.length > 0 && err?.exitCode !== 0) {
89
+ throw new Error(`Failed to update chart dependencies: ${err.stderr}`);
90
+ }
91
+ }
92
+ }
93
+ dependencyBuild(chartFolder) {
94
+ try {
95
+ this.runCommand([
96
+ "helm",
97
+ "dependency",
98
+ "build",
99
+ chartFolder
100
+ ]);
101
+ } catch (err) {
102
+ if (err?.stderr.length > 0 && err?.exitCode !== 0) {
103
+ throw new Error(`Failed to build chart dependencies: ${err.stderr}`);
104
+ }
105
+ }
106
+ }
107
+ addRepository(name, url) {
108
+ try {
109
+ this.runCommand([
110
+ "helm",
111
+ "repo",
112
+ "add",
113
+ name,
114
+ url
115
+ ]);
116
+ } catch (err) {
117
+ if (err?.stderr.length > 0 && err?.exitCode !== 0) {
118
+ throw new Error(`Failed to add repository: ${err.stderr}`);
119
+ }
120
+ }
121
+ }
122
+ /**
123
+ * Initialize Helm
124
+ *
125
+ * @returns A promise
126
+ */
127
+ async initialize() {
128
+ if (this.initialized) {
129
+ return;
130
+ }
131
+ try {
132
+ this.runCommand([
133
+ "helm",
134
+ "version"
135
+ ]);
136
+ } catch (err) {
137
+ if (err?.stderr.length > 0 && err?.exitCode !== 0) {
138
+ throw new Error(`Helm is not installed: ${err.stderr}`);
139
+ }
140
+ }
141
+ return new Promise((resolve) => {
142
+ this.initialized = true;
143
+ resolve();
144
+ });
145
+ }
146
+ runCommand(commands) {
147
+ return execSync(commands.filter(Boolean).join(" "), {
148
+ encoding: "utf8",
149
+ windowsHide: true,
150
+ maxBuffer: 1024 * 1e6,
151
+ stdio: "pipe"
152
+ });
153
+ }
154
+ };
155
+ _ts_decorate([
156
+ ensureInitialized,
157
+ _ts_metadata("design:type", Function),
158
+ _ts_metadata("design:paramtypes", [
159
+ typeof PackageOptions === "undefined" ? Object : PackageOptions
160
+ ]),
161
+ _ts_metadata("design:returntype", typeof Promise === "undefined" ? Object : Promise)
162
+ ], HelmClient.prototype, "package", null);
163
+ _ts_decorate([
164
+ ensureInitialized,
165
+ _ts_metadata("design:type", Function),
166
+ _ts_metadata("design:paramtypes", [
167
+ typeof PushOptions === "undefined" ? Object : PushOptions
168
+ ]),
169
+ _ts_metadata("design:returntype", void 0)
170
+ ], HelmClient.prototype, "push", null);
171
+ _ts_decorate([
172
+ ensureInitialized,
173
+ _ts_metadata("design:type", Function),
174
+ _ts_metadata("design:paramtypes", [
175
+ String
176
+ ]),
177
+ _ts_metadata("design:returntype", void 0)
178
+ ], HelmClient.prototype, "dependencyUpdate", null);
179
+ _ts_decorate([
180
+ ensureInitialized,
181
+ _ts_metadata("design:type", Function),
182
+ _ts_metadata("design:paramtypes", [
183
+ String
184
+ ]),
185
+ _ts_metadata("design:returntype", void 0)
186
+ ], HelmClient.prototype, "dependencyBuild", null);
187
+ _ts_decorate([
188
+ ensureInitialized,
189
+ _ts_metadata("design:type", Function),
190
+ _ts_metadata("design:paramtypes", [
191
+ String,
192
+ String
193
+ ]),
194
+ _ts_metadata("design:returntype", void 0)
195
+ ], HelmClient.prototype, "addRepository", null);
196
+ var createHelmClient = /* @__PURE__ */ __name(() => {
197
+ return new HelmClient();
198
+ }, "createHelmClient");
199
+
200
+ export {
201
+ HelmClient,
202
+ createHelmClient
203
+ };