@storm-software/cloudflare-tools 0.55.85 → 0.55.87

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 (45) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.md +1 -1
  3. package/dist/{chunk-VTHBMY4B.js → chunk-6XDOBG77.js} +39 -28
  4. package/dist/{chunk-FUE3PSOC.mjs → chunk-CW6SXRL4.mjs} +825 -544
  5. package/dist/{chunk-VRLPVMXP.mjs → chunk-FABNT5TZ.mjs} +15 -13
  6. package/dist/{chunk-QQJ225UZ.mjs → chunk-GPAI4NHQ.mjs} +141 -87
  7. package/dist/{chunk-YNJJF3XM.mjs → chunk-H4XWGL24.mjs} +93 -56
  8. package/dist/{chunk-IVLCYFXD.js → chunk-HBASMEU5.js} +168 -114
  9. package/dist/{chunk-6B5PUF7X.js → chunk-HIUZ6UL7.js} +97 -47
  10. package/dist/{chunk-R7AIVBS7.js → chunk-I4P7DVDN.js} +19 -24
  11. package/dist/{chunk-KWHACLHR.mjs → chunk-ISGKIYF5.mjs} +92 -42
  12. package/dist/{chunk-5RE7UZTH.mjs → chunk-L4WFYC7K.mjs} +39 -28
  13. package/dist/{chunk-PWYTCJYX.js → chunk-LDHIZ5T7.js} +875 -594
  14. package/dist/{chunk-J5SB6L2L.js → chunk-MCKGQKYU.js} +2 -5
  15. package/dist/{chunk-DEJ5S46A.mjs → chunk-MV24QW26.mjs} +195 -127
  16. package/dist/{chunk-V7LBWOVV.js → chunk-PZ5CI56F.js} +196 -128
  17. package/dist/{chunk-AOEF7EWN.mjs → chunk-QPABB45G.mjs} +19 -24
  18. package/dist/{chunk-TLFPZXKG.mjs → chunk-QQ22YQSB.mjs} +3 -6
  19. package/dist/{chunk-QGRENI3O.js → chunk-RIUVF72K.js} +17 -15
  20. package/dist/{chunk-PKQBY4ZM.js → chunk-X4Y76AIM.js} +26 -20
  21. package/dist/{chunk-CNGX2WYG.js → chunk-XCEENUJB.js} +93 -58
  22. package/dist/{chunk-N4KJP2OA.mjs → chunk-YJOYATEB.mjs} +27 -21
  23. package/dist/executors.js +8 -8
  24. package/dist/executors.mjs +8 -8
  25. package/dist/generators.js +6 -6
  26. package/dist/generators.mjs +5 -5
  27. package/dist/index.js +41 -49
  28. package/dist/index.mjs +40 -48
  29. package/dist/src/executors/cloudflare-publish/executor.js +7 -7
  30. package/dist/src/executors/cloudflare-publish/executor.mjs +6 -6
  31. package/dist/src/executors/r2-upload-publish/executor.js +7 -7
  32. package/dist/src/executors/r2-upload-publish/executor.mjs +6 -6
  33. package/dist/src/executors/serve/executor.js +49 -50
  34. package/dist/src/executors/serve/executor.mjs +48 -49
  35. package/dist/src/generators/init/generator.js +3 -3
  36. package/dist/src/generators/init/generator.mjs +2 -2
  37. package/dist/src/generators/worker/generator.js +6 -6
  38. package/dist/src/generators/worker/generator.mjs +5 -5
  39. package/dist/src/utils/index.js +4 -4
  40. package/dist/src/utils/index.mjs +3 -3
  41. package/dist/src/utils/r2-bucket-helpers.js +4 -4
  42. package/dist/src/utils/r2-bucket-helpers.mjs +3 -3
  43. package/dist/tsup.config.js +3 -8
  44. package/dist/tsup.config.mjs +3 -8
  45. package/package.json +1 -1
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  ProjectTagConstants,
3
3
  addProjectTag
4
- } from "./chunk-5RE7UZTH.mjs";
4
+ } from "./chunk-L4WFYC7K.mjs";
5
5
  import {
6
6
  getConfig,
7
7
  getWorkspaceConfig
8
- } from "./chunk-QQJ225UZ.mjs";
8
+ } from "./chunk-GPAI4NHQ.mjs";
9
9
  import {
10
10
  findWorkspaceRoot,
11
11
  formatLogMessage,
@@ -19,15 +19,14 @@ import {
19
19
  writeSuccess,
20
20
  writeTrace,
21
21
  writeWarning
22
- } from "./chunk-DEJ5S46A.mjs";
22
+ } from "./chunk-MV24QW26.mjs";
23
23
  import {
24
24
  __dirname,
25
- __name,
26
25
  __require
27
- } from "./chunk-TLFPZXKG.mjs";
26
+ } from "./chunk-QQ22YQSB.mjs";
28
27
 
29
28
  // ../config-tools/src/utilities/apply-workspace-tokens.ts
30
- var applyWorkspaceBaseTokens = /* @__PURE__ */ __name(async (option, tokenParams) => {
29
+ var applyWorkspaceBaseTokens = async (option, tokenParams) => {
31
30
  let result = option;
32
31
  if (!result) {
33
32
  return result;
@@ -37,7 +36,10 @@ var applyWorkspaceBaseTokens = /* @__PURE__ */ __name(async (option, tokenParams
37
36
  if (optionKeys.some((optionKey) => result.includes(`{${optionKey}}`))) {
38
37
  for (const optionKey of optionKeys) {
39
38
  if (result.includes(`{${optionKey}}`)) {
40
- result = result.replaceAll(`{${optionKey}}`, tokenParams?.[optionKey] || "");
39
+ result = result.replaceAll(
40
+ `{${optionKey}}`,
41
+ tokenParams?.[optionKey] || ""
42
+ );
41
43
  }
42
44
  }
43
45
  }
@@ -47,47 +49,65 @@ var applyWorkspaceBaseTokens = /* @__PURE__ */ __name(async (option, tokenParams
47
49
  if (configKeys.some((configKey) => result.includes(`{${configKey}}`))) {
48
50
  for (const configKey of configKeys) {
49
51
  if (result.includes(`{${configKey}}`)) {
50
- result = result.replaceAll(`{${configKey}}`, tokenParams.config[configKey] || "");
52
+ result = result.replaceAll(
53
+ `{${configKey}}`,
54
+ tokenParams.config[configKey] || ""
55
+ );
51
56
  }
52
57
  }
53
58
  }
54
59
  }
55
60
  if (result.includes("{workspaceRoot}")) {
56
- result = result.replaceAll("{workspaceRoot}", tokenParams.workspaceRoot ?? tokenParams.config?.workspaceRoot ?? findWorkspaceRoot());
61
+ result = result.replaceAll(
62
+ "{workspaceRoot}",
63
+ tokenParams.workspaceRoot ?? tokenParams.config?.workspaceRoot ?? findWorkspaceRoot()
64
+ );
57
65
  }
58
66
  return result;
59
- }, "applyWorkspaceBaseTokens");
60
- var applyWorkspaceProjectTokens = /* @__PURE__ */ __name((option, tokenParams) => {
67
+ };
68
+ var applyWorkspaceProjectTokens = (option, tokenParams) => {
61
69
  return applyWorkspaceBaseTokens(option, tokenParams);
62
- }, "applyWorkspaceProjectTokens");
63
- var applyWorkspaceTokens = /* @__PURE__ */ __name(async (options, tokenParams, tokenizerFn) => {
70
+ };
71
+ var applyWorkspaceTokens = async (options, tokenParams, tokenizerFn) => {
64
72
  if (!options) {
65
73
  return {};
66
74
  }
67
75
  const result = {};
68
76
  for (const option of Object.keys(options)) {
69
77
  if (typeof options[option] === "string") {
70
- result[option] = await Promise.resolve(tokenizerFn(options[option], tokenParams));
78
+ result[option] = await Promise.resolve(
79
+ tokenizerFn(options[option], tokenParams)
80
+ );
71
81
  } else if (Array.isArray(options[option])) {
72
- result[option] = await Promise.all(options[option].map(async (item) => typeof item === "string" ? await Promise.resolve(tokenizerFn(item, tokenParams)) : item));
82
+ result[option] = await Promise.all(
83
+ options[option].map(
84
+ async (item) => typeof item === "string" ? await Promise.resolve(tokenizerFn(item, tokenParams)) : item
85
+ )
86
+ );
73
87
  } else if (typeof options[option] === "object") {
74
- result[option] = await applyWorkspaceTokens(options[option], tokenParams, tokenizerFn);
88
+ result[option] = await applyWorkspaceTokens(
89
+ options[option],
90
+ tokenParams,
91
+ tokenizerFn
92
+ );
75
93
  } else {
76
94
  result[option] = options[option];
77
95
  }
78
96
  }
79
97
  return result;
80
- }, "applyWorkspaceTokens");
98
+ };
81
99
 
82
100
  // ../workspace-tools/src/base/base-executor.ts
83
101
  import { defu } from "defu";
84
- var withRunExecutor = /* @__PURE__ */ __name((name, executorFn, executorOptions = {}) => async (_options, context) => {
102
+ var withRunExecutor = (name, executorFn, executorOptions = {}) => async (_options, context) => {
85
103
  const stopwatch = getStopwatch(name);
86
104
  let options = _options;
87
105
  let config = {};
88
106
  try {
89
107
  if (!context.projectsConfigurations?.projects || !context.projectName || !context.projectsConfigurations.projects[context.projectName]) {
90
- throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace.");
108
+ throw new Error(
109
+ "The Build process failed because the context is not valid. Please run this command from a workspace."
110
+ );
91
111
  }
92
112
  const workspaceRoot3 = findWorkspaceRoot();
93
113
  const projectRoot = context.projectsConfigurations.projects[context.projectName].root || workspaceRoot3;
@@ -96,35 +116,50 @@ var withRunExecutor = /* @__PURE__ */ __name((name, executorFn, executorOptions
96
116
  config.workspaceRoot = workspaceRoot3;
97
117
  writeInfo(`\u26A1 Running the ${name} executor for ${projectName} `, config);
98
118
  if (!executorOptions.skipReadingConfig) {
99
- writeTrace(`Loading the Storm Config from environment variables and storm.config.js file...
119
+ writeTrace(
120
+ `Loading the Storm Config from environment variables and storm.config.js file...
100
121
  - workspaceRoot: ${workspaceRoot3}
101
122
  - projectRoot: ${projectRoot}
102
123
  - sourceRoot: ${sourceRoot}
103
124
  - projectName: ${projectName}
104
- `, config);
125
+ `,
126
+ config
127
+ );
105
128
  config = await getConfig(workspaceRoot3);
106
129
  }
107
130
  if (executorOptions?.hooks?.applyDefaultOptions) {
108
131
  writeDebug("Running the applyDefaultOptions hook...", config);
109
- options = await Promise.resolve(executorOptions.hooks.applyDefaultOptions(options, config));
132
+ options = await Promise.resolve(
133
+ executorOptions.hooks.applyDefaultOptions(options, config)
134
+ );
110
135
  writeDebug("Completed the applyDefaultOptions hook", config);
111
136
  }
112
- writeTrace(`Executor schema options \u2699\uFE0F
137
+ writeTrace(
138
+ `Executor schema options \u2699\uFE0F
113
139
  ${formatLogMessage(options)}
114
- `, config);
115
- const tokenized = await applyWorkspaceTokens(options, defu({
116
- workspaceRoot: workspaceRoot3,
117
- projectRoot,
118
- sourceRoot,
119
- projectName,
140
+ `,
120
141
  config
121
- }, config, context.projectsConfigurations.projects[context.projectName]), applyWorkspaceProjectTokens);
122
- writeTrace(`Executor schema tokenized options \u2699\uFE0F
142
+ );
143
+ const tokenized = await applyWorkspaceTokens(
144
+ options,
145
+ defu(
146
+ { workspaceRoot: workspaceRoot3, projectRoot, sourceRoot, projectName, config },
147
+ config,
148
+ context.projectsConfigurations.projects[context.projectName]
149
+ ),
150
+ applyWorkspaceProjectTokens
151
+ );
152
+ writeTrace(
153
+ `Executor schema tokenized options \u2699\uFE0F
123
154
  ${formatLogMessage(tokenized)}
124
- `, config);
155
+ `,
156
+ config
157
+ );
125
158
  if (executorOptions?.hooks?.preProcess) {
126
159
  writeDebug("Running the preProcess hook...", config);
127
- await Promise.resolve(executorOptions.hooks.preProcess(tokenized, config));
160
+ await Promise.resolve(
161
+ executorOptions.hooks.preProcess(tokenized, config)
162
+ );
128
163
  writeDebug("Completed the preProcess hook", config);
129
164
  }
130
165
  const ret = executorFn(tokenized, context, config);
@@ -134,10 +169,15 @@ ${formatLogMessage(tokenized)}
134
169
  void iter;
135
170
  }
136
171
  }
137
- const result = await Promise.resolve(ret);
172
+ const result = await Promise.resolve(
173
+ ret
174
+ );
138
175
  if (result && (!result.success || result.error && result?.error?.message && typeof result?.error?.message === "string" && result?.error?.name && typeof result?.error?.name === "string")) {
139
- writeTrace(`Failure determined by the ${name} executor
140
- ${formatLogMessage(result)}`, config);
176
+ writeTrace(
177
+ `Failure determined by the ${name} executor
178
+ ${formatLogMessage(result)}`,
179
+ config
180
+ );
141
181
  console.error(result);
142
182
  throw new Error(`The ${name} executor failed to run`, {
143
183
  cause: result?.error
@@ -154,28 +194,37 @@ ${formatLogMessage(result)}`, config);
154
194
  success: true
155
195
  };
156
196
  } catch (error) {
157
- writeFatal("A fatal error occurred while running the executor - the process was forced to terminate", config);
158
- writeError(`An exception was thrown in the executor's process
197
+ writeFatal(
198
+ "A fatal error occurred while running the executor - the process was forced to terminate",
199
+ config
200
+ );
201
+ writeError(
202
+ `An exception was thrown in the executor's process
159
203
  - Details: ${error.message}
160
- - Stacktrace: ${error.stack}`, config);
204
+ - Stacktrace: ${error.stack}`,
205
+ config
206
+ );
161
207
  return {
162
208
  success: false
163
209
  };
164
210
  } finally {
165
211
  stopwatch();
166
212
  }
167
- }, "withRunExecutor");
168
- var _isFunction = /* @__PURE__ */ __name((value) => {
213
+ };
214
+ var _isFunction = (value) => {
169
215
  try {
170
216
  return value instanceof Function || typeof value === "function" || !!(value?.constructor && value?.call && value?.apply);
171
217
  } catch (e) {
172
218
  return false;
173
219
  }
174
- }, "_isFunction");
220
+ };
175
221
 
176
222
  // ../workspace-tools/src/utils/cargo.ts
177
223
  import { joinPathFragments, workspaceRoot } from "@nx/devkit";
178
- import { execSync, spawn } from "node:child_process";
224
+ import {
225
+ execSync,
226
+ spawn
227
+ } from "node:child_process";
179
228
  import { relative } from "node:path";
180
229
  var INVALID_CARGO_ARGS = [
181
230
  "allFeatures",
@@ -185,7 +234,7 @@ var INVALID_CARGO_ARGS = [
185
234
  "package",
186
235
  "tsConfig"
187
236
  ];
188
- var buildCargoCommand = /* @__PURE__ */ __name((baseCommand, options, context) => {
237
+ var buildCargoCommand = (baseCommand, options, context) => {
189
238
  const args = [];
190
239
  if (options.toolchain && options.toolchain !== "stable") {
191
240
  args.push(`+${options.toolchain}`);
@@ -223,13 +272,12 @@ var buildCargoCommand = /* @__PURE__ */ __name((baseCommand, options, context) =
223
272
  args.push("--target-dir", options.outputPath);
224
273
  }
225
274
  return args;
226
- }, "buildCargoCommand");
275
+ };
227
276
  async function cargoCommand(...args) {
228
277
  console.log(`> cargo ${args.join(" ")}`);
229
278
  args.push("--color", "always");
230
279
  return await Promise.resolve(runProcess("cargo", ...args));
231
280
  }
232
- __name(cargoCommand, "cargoCommand");
233
281
  function cargoCommandSync(args = "", options) {
234
282
  const normalizedOptions = {
235
283
  stdio: options?.stdio ?? "inherit",
@@ -256,7 +304,6 @@ function cargoCommandSync(args = "", options) {
256
304
  };
257
305
  }
258
306
  }
259
- __name(cargoCommandSync, "cargoCommandSync");
260
307
  function cargoMetadata() {
261
308
  const output3 = cargoCommandSync("metadata --format-version=1", {
262
309
  stdio: "pipe"
@@ -267,15 +314,12 @@ function cargoMetadata() {
267
314
  }
268
315
  return JSON.parse(output3.output);
269
316
  }
270
- __name(cargoMetadata, "cargoMetadata");
271
317
  function runProcess(processCmd, ...args) {
272
318
  const metadata = cargoMetadata();
273
319
  const targetDir = metadata?.target_directory ?? joinPathFragments(workspaceRoot, "dist", "cargo");
274
320
  return new Promise((resolve) => {
275
321
  if (process.env.VERCEL) {
276
- return resolve({
277
- success: true
278
- });
322
+ return resolve({ success: true });
279
323
  }
280
324
  execSync(`${processCmd} ${args.join(" ")}`, {
281
325
  cwd: process.cwd(),
@@ -286,113 +330,119 @@ function runProcess(processCmd, ...args) {
286
330
  CARGO_BUILD_TARGET_DIR: targetDir
287
331
  },
288
332
  windowsHide: true,
289
- stdio: [
290
- "inherit",
291
- "inherit",
292
- "inherit"
293
- ]
294
- });
295
- resolve({
296
- success: true
333
+ stdio: ["inherit", "inherit", "inherit"]
297
334
  });
335
+ resolve({ success: true });
298
336
  });
299
337
  }
300
- __name(runProcess, "runProcess");
301
338
 
302
339
  // ../workspace-tools/src/executors/cargo-build/executor.ts
303
340
  async function cargoBuildExecutor(options, context) {
304
341
  const command = buildCargoCommand("build", options, context);
305
342
  return await cargoCommand(...command);
306
343
  }
307
- __name(cargoBuildExecutor, "cargoBuildExecutor");
308
- var executor_default = withRunExecutor("Cargo Build", cargoBuildExecutor, {
309
- skipReadingConfig: false,
310
- hooks: {
311
- applyDefaultOptions: /* @__PURE__ */ __name((options) => {
312
- options.outputPath ??= "dist/target/{projectRoot}";
313
- options.toolchain ??= "stable";
314
- return options;
315
- }, "applyDefaultOptions")
344
+ var executor_default = withRunExecutor(
345
+ "Cargo Build",
346
+ cargoBuildExecutor,
347
+ {
348
+ skipReadingConfig: false,
349
+ hooks: {
350
+ applyDefaultOptions: (options) => {
351
+ options.outputPath ??= "dist/target/{projectRoot}";
352
+ options.toolchain ??= "stable";
353
+ return options;
354
+ }
355
+ }
316
356
  }
317
- });
357
+ );
318
358
 
319
359
  // ../workspace-tools/src/executors/cargo-check/executor.ts
320
360
  async function cargoCheckExecutor(options, context) {
321
361
  const command = buildCargoCommand("check", options, context);
322
362
  return await cargoCommand(...command);
323
363
  }
324
- __name(cargoCheckExecutor, "cargoCheckExecutor");
325
- var executor_default2 = withRunExecutor("Cargo Check", cargoCheckExecutor, {
326
- skipReadingConfig: false,
327
- hooks: {
328
- applyDefaultOptions: /* @__PURE__ */ __name((options) => {
329
- options.toolchain ??= "stable";
330
- return options;
331
- }, "applyDefaultOptions")
364
+ var executor_default2 = withRunExecutor(
365
+ "Cargo Check",
366
+ cargoCheckExecutor,
367
+ {
368
+ skipReadingConfig: false,
369
+ hooks: {
370
+ applyDefaultOptions: (options) => {
371
+ options.toolchain ??= "stable";
372
+ return options;
373
+ }
374
+ }
332
375
  }
333
- });
376
+ );
334
377
 
335
378
  // ../workspace-tools/src/executors/cargo-clippy/executor.ts
336
379
  async function cargoClippyExecutor(options, context) {
337
380
  const command = buildCargoCommand("clippy", options, context);
338
381
  return await cargoCommand(...command);
339
382
  }
340
- __name(cargoClippyExecutor, "cargoClippyExecutor");
341
- var executor_default3 = withRunExecutor("Cargo Clippy", cargoClippyExecutor, {
342
- skipReadingConfig: false,
343
- hooks: {
344
- applyDefaultOptions: /* @__PURE__ */ __name((options) => {
345
- options.toolchain ??= "stable";
346
- options.fix ??= false;
347
- return options;
348
- }, "applyDefaultOptions")
383
+ var executor_default3 = withRunExecutor(
384
+ "Cargo Clippy",
385
+ cargoClippyExecutor,
386
+ {
387
+ skipReadingConfig: false,
388
+ hooks: {
389
+ applyDefaultOptions: (options) => {
390
+ options.toolchain ??= "stable";
391
+ options.fix ??= false;
392
+ return options;
393
+ }
394
+ }
349
395
  }
350
- });
396
+ );
351
397
 
352
398
  // ../workspace-tools/src/executors/cargo-doc/executor.ts
353
399
  async function cargoDocExecutor(options, context) {
354
- const opts = {
355
- ...options
356
- };
400
+ const opts = { ...options };
357
401
  opts["no-deps"] = opts.noDeps;
358
402
  delete opts.noDeps;
359
403
  const command = buildCargoCommand("doc", options, context);
360
404
  return await cargoCommand(...command);
361
405
  }
362
- __name(cargoDocExecutor, "cargoDocExecutor");
363
- var executor_default4 = withRunExecutor("Cargo Doc", cargoDocExecutor, {
364
- skipReadingConfig: false,
365
- hooks: {
366
- applyDefaultOptions: /* @__PURE__ */ __name((options) => {
367
- options.outputPath ??= "dist/docs/{projectRoot}";
368
- options.toolchain ??= "stable";
369
- options.release ??= options.profile ? false : true;
370
- options.allFeatures ??= true;
371
- options.lib ??= true;
372
- options.bins ??= true;
373
- options.examples ??= true;
374
- options.noDeps ??= false;
375
- return options;
376
- }, "applyDefaultOptions")
406
+ var executor_default4 = withRunExecutor(
407
+ "Cargo Doc",
408
+ cargoDocExecutor,
409
+ {
410
+ skipReadingConfig: false,
411
+ hooks: {
412
+ applyDefaultOptions: (options) => {
413
+ options.outputPath ??= "dist/docs/{projectRoot}";
414
+ options.toolchain ??= "stable";
415
+ options.release ??= options.profile ? false : true;
416
+ options.allFeatures ??= true;
417
+ options.lib ??= true;
418
+ options.bins ??= true;
419
+ options.examples ??= true;
420
+ options.noDeps ??= false;
421
+ return options;
422
+ }
423
+ }
377
424
  }
378
- });
425
+ );
379
426
 
380
427
  // ../workspace-tools/src/executors/cargo-format/executor.ts
381
428
  async function cargoFormatExecutor(options, context) {
382
429
  const command = buildCargoCommand("fmt", options, context);
383
430
  return await cargoCommand(...command);
384
431
  }
385
- __name(cargoFormatExecutor, "cargoFormatExecutor");
386
- var executor_default5 = withRunExecutor("Cargo Format", cargoFormatExecutor, {
387
- skipReadingConfig: false,
388
- hooks: {
389
- applyDefaultOptions: /* @__PURE__ */ __name((options) => {
390
- options.outputPath ??= "dist/target/{projectRoot}";
391
- options.toolchain ??= "stable";
392
- return options;
393
- }, "applyDefaultOptions")
432
+ var executor_default5 = withRunExecutor(
433
+ "Cargo Format",
434
+ cargoFormatExecutor,
435
+ {
436
+ skipReadingConfig: false,
437
+ hooks: {
438
+ applyDefaultOptions: (options) => {
439
+ options.outputPath ??= "dist/target/{projectRoot}";
440
+ options.toolchain ??= "stable";
441
+ return options;
442
+ }
443
+ }
394
444
  }
395
- });
445
+ );
396
446
 
397
447
  // ../workspace-tools/src/executors/cargo-publish/executor.ts
398
448
  import { joinPathFragments as joinPathFragments2 } from "@nx/devkit";
@@ -432,7 +482,7 @@ import { relative as relative2 } from "path";
432
482
  import { CopyAssetsHandler } from "@nx/js/src/utils/assets/copy-assets-handler";
433
483
  import { glob } from "glob";
434
484
  import { readFile, writeFile } from "node:fs/promises";
435
- var copyAssets = /* @__PURE__ */ __name(async (config, assets, outputPath, projectRoot, sourceRoot, generatePackageJson2 = true, includeSrc = false, banner, footer) => {
485
+ var copyAssets = async (config, assets, outputPath, projectRoot, sourceRoot, generatePackageJson2 = true, includeSrc = false, banner, footer) => {
436
486
  const pendingAssets = Array.from(assets ?? []);
437
487
  pendingAssets.push({
438
488
  input: projectRoot,
@@ -458,8 +508,11 @@ var copyAssets = /* @__PURE__ */ __name(async (config, assets, outputPath, proje
458
508
  output: "src/"
459
509
  });
460
510
  }
461
- writeTrace(`\u{1F4DD} Copying the following assets to the output directory:
462
- ${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${pendingAsset} -> ${outputPath}` : ` - ${pendingAsset.input}/${pendingAsset.glob} -> ${joinPaths(outputPath, pendingAsset.output)}`).join("\n")}`, config);
511
+ writeTrace(
512
+ `\u{1F4DD} Copying the following assets to the output directory:
513
+ ${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${pendingAsset} -> ${outputPath}` : ` - ${pendingAsset.input}/${pendingAsset.glob} -> ${joinPaths(outputPath, pendingAsset.output)}`).join("\n")}`,
514
+ config
515
+ );
463
516
  const assetHandler = new CopyAssetsHandler({
464
517
  projectDir: projectRoot,
465
518
  rootDir: config.workspaceRoot,
@@ -468,28 +521,45 @@ ${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${p
468
521
  });
469
522
  await assetHandler.processAllAssetsOnce();
470
523
  if (includeSrc === true) {
471
- writeDebug(`\u{1F4DD} Adding banner and writing source files: ${joinPaths(outputPath, "src")}`, config);
524
+ writeDebug(
525
+ `\u{1F4DD} Adding banner and writing source files: ${joinPaths(
526
+ outputPath,
527
+ "src"
528
+ )}`,
529
+ config
530
+ );
472
531
  const files = await glob([
473
532
  joinPaths(config.workspaceRoot, outputPath, "src/**/*.ts"),
474
533
  joinPaths(config.workspaceRoot, outputPath, "src/**/*.tsx"),
475
534
  joinPaths(config.workspaceRoot, outputPath, "src/**/*.js"),
476
535
  joinPaths(config.workspaceRoot, outputPath, "src/**/*.jsx")
477
536
  ]);
478
- await Promise.allSettled(files.map(async (file) => writeFile(file, `${banner && typeof banner === "string" ? banner.startsWith("//") ? banner : `// ${banner}` : ""}
537
+ await Promise.allSettled(
538
+ files.map(
539
+ async (file) => writeFile(
540
+ file,
541
+ `${banner && typeof banner === "string" ? banner.startsWith("//") ? banner : `// ${banner}` : ""}
479
542
 
480
543
  ${await readFile(file, "utf8")}
481
544
 
482
- ${footer && typeof footer === "string" ? footer.startsWith("//") ? footer : `// ${footer}` : ""}`)));
545
+ ${footer && typeof footer === "string" ? footer.startsWith("//") ? footer : `// ${footer}` : ""}`
546
+ )
547
+ )
548
+ );
483
549
  }
484
- }, "copyAssets");
550
+ };
485
551
 
486
552
  // ../build-tools/src/utilities/generate-package-json.ts
487
553
  import { calculateProjectBuildableDependencies } from "@nx/js/src/utils/buildable-libs-utils";
488
554
  import { Glob } from "glob";
489
555
  import { existsSync, readFileSync as readFileSync2 } from "node:fs";
490
556
  import { readFile as readFile2 } from "node:fs/promises";
491
- import { createProjectGraphAsync, readCachedProjectGraph, readProjectsConfigurationFromProjectGraph } from "nx/src/project-graph/project-graph";
492
- var addPackageDependencies = /* @__PURE__ */ __name(async (workspaceRoot3, projectRoot, projectName, packageJson) => {
557
+ import {
558
+ createProjectGraphAsync,
559
+ readCachedProjectGraph,
560
+ readProjectsConfigurationFromProjectGraph
561
+ } from "nx/src/project-graph/project-graph";
562
+ var addPackageDependencies = async (workspaceRoot3, projectRoot, projectName, packageJson) => {
493
563
  let projectGraph;
494
564
  try {
495
565
  projectGraph = readCachedProjectGraph();
@@ -498,16 +568,35 @@ var addPackageDependencies = /* @__PURE__ */ __name(async (workspaceRoot3, proje
498
568
  projectGraph = readCachedProjectGraph();
499
569
  }
500
570
  if (!projectGraph) {
501
- throw new Error("The Build process failed because the project graph is not available. Please run the build command again.");
571
+ throw new Error(
572
+ "The Build process failed because the project graph is not available. Please run the build command again."
573
+ );
502
574
  }
503
- const projectDependencies = calculateProjectBuildableDependencies(void 0, projectGraph, workspaceRoot3, projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
575
+ const projectDependencies = calculateProjectBuildableDependencies(
576
+ void 0,
577
+ projectGraph,
578
+ workspaceRoot3,
579
+ projectName,
580
+ process.env.NX_TASK_TARGET_TARGET || "build",
581
+ process.env.NX_TASK_TARGET_CONFIGURATION || "production",
582
+ true
583
+ );
504
584
  const localPackages = [];
505
- for (const project of projectDependencies.dependencies.filter((dep) => dep.node.type === "lib" && dep.node.data?.root !== projectRoot && dep.node.data?.root !== workspaceRoot3)) {
585
+ for (const project of projectDependencies.dependencies.filter(
586
+ (dep) => dep.node.type === "lib" && dep.node.data?.root !== projectRoot && dep.node.data?.root !== workspaceRoot3
587
+ )) {
506
588
  const projectNode = project.node;
507
589
  if (projectNode.data.root) {
508
- const projectPackageJsonPath = joinPaths(workspaceRoot3, projectNode.data.root, "package.json");
590
+ const projectPackageJsonPath = joinPaths(
591
+ workspaceRoot3,
592
+ projectNode.data.root,
593
+ "package.json"
594
+ );
509
595
  if (existsSync(projectPackageJsonPath)) {
510
- const projectPackageJsonContent = await readFile2(projectPackageJsonPath, "utf8");
596
+ const projectPackageJsonContent = await readFile2(
597
+ projectPackageJsonPath,
598
+ "utf8"
599
+ );
511
600
  const projectPackageJson = JSON.parse(projectPackageJsonContent);
512
601
  if (projectPackageJson.private !== true) {
513
602
  localPackages.push(projectPackageJson);
@@ -516,19 +605,33 @@ var addPackageDependencies = /* @__PURE__ */ __name(async (workspaceRoot3, proje
516
605
  }
517
606
  }
518
607
  if (localPackages.length > 0) {
519
- writeTrace(`\u{1F4E6} Adding local packages to package.json: ${localPackages.map((p) => p.name).join(", ")}`);
520
- const projectJsonFile = await readFile2(joinPaths(projectRoot, "project.json"), "utf8");
608
+ writeTrace(
609
+ `\u{1F4E6} Adding local packages to package.json: ${localPackages.map((p) => p.name).join(", ")}`
610
+ );
611
+ const projectJsonFile = await readFile2(
612
+ joinPaths(projectRoot, "project.json"),
613
+ "utf8"
614
+ );
521
615
  const projectJson = JSON.parse(projectJsonFile);
522
616
  const projectName2 = projectJson.name;
523
617
  const projectConfigurations = readProjectsConfigurationFromProjectGraph(projectGraph);
524
618
  if (!projectConfigurations?.projects?.[projectName2]) {
525
- throw new Error("The Build process failed because the project does not have a valid configuration in the project.json file. Check if the file exists in the root of the project.");
619
+ throw new Error(
620
+ "The Build process failed because the project does not have a valid configuration in the project.json file. Check if the file exists in the root of the project."
621
+ );
526
622
  }
527
623
  const implicitDependencies = projectConfigurations.projects?.[projectName2].implicitDependencies?.reduce((ret, dep) => {
528
624
  if (projectConfigurations.projects?.[dep]) {
529
- const depPackageJsonPath = joinPaths(workspaceRoot3, projectConfigurations.projects[dep].root, "package.json");
625
+ const depPackageJsonPath = joinPaths(
626
+ workspaceRoot3,
627
+ projectConfigurations.projects[dep].root,
628
+ "package.json"
629
+ );
530
630
  if (existsSync(depPackageJsonPath)) {
531
- const depPackageJsonContent = readFileSync2(depPackageJsonPath, "utf8");
631
+ const depPackageJsonContent = readFileSync2(
632
+ depPackageJsonPath,
633
+ "utf8"
634
+ );
532
635
  const depPackageJson = JSON.parse(depPackageJsonContent);
533
636
  if (depPackageJson.private !== true && !ret.includes(depPackageJson.name)) {
534
637
  ret.push(depPackageJson.name);
@@ -553,10 +656,13 @@ var addPackageDependencies = /* @__PURE__ */ __name(async (workspaceRoot3, proje
553
656
  writeTrace("\u{1F4E6} No local packages dependencies to add to package.json");
554
657
  }
555
658
  return packageJson;
556
- }, "addPackageDependencies");
557
- var addWorkspacePackageJsonFields = /* @__PURE__ */ __name(async (workspaceConfig, projectRoot, sourceRoot, projectName, includeSrc = false, packageJson) => {
659
+ };
660
+ var addWorkspacePackageJsonFields = async (workspaceConfig, projectRoot, sourceRoot, projectName, includeSrc = false, packageJson) => {
558
661
  const workspaceRoot3 = workspaceConfig.workspaceRoot ? workspaceConfig.workspaceRoot : findWorkspaceRoot();
559
- const workspacePackageJsonContent = await readFile2(joinPaths(workspaceRoot3, "package.json"), "utf8");
662
+ const workspacePackageJsonContent = await readFile2(
663
+ joinPaths(workspaceRoot3, "package.json"),
664
+ "utf8"
665
+ );
560
666
  const workspacePackageJson = JSON.parse(workspacePackageJsonContent);
561
667
  packageJson.type ??= "module";
562
668
  packageJson.sideEffects ??= false;
@@ -567,9 +673,7 @@ var addWorkspacePackageJsonFields = /* @__PURE__ */ __name(async (workspaceConfi
567
673
  }
568
674
  packageJson.source ??= `${joinPaths(distSrc, "index.ts").replaceAll("\\", "/")}`;
569
675
  }
570
- packageJson.files ??= [
571
- "dist/**/*"
572
- ];
676
+ packageJson.files ??= ["dist/**/*"];
573
677
  if (includeSrc === true && !packageJson.files.includes("src")) {
574
678
  packageJson.files.push("src/**/*");
575
679
  }
@@ -585,26 +689,22 @@ var addWorkspacePackageJsonFields = /* @__PURE__ */ __name(async (workspaceConfi
585
689
  packageJson.author ??= workspacePackageJson.author;
586
690
  packageJson.maintainers ??= workspacePackageJson.maintainers;
587
691
  if (!packageJson.maintainers && packageJson.author) {
588
- packageJson.maintainers = [
589
- packageJson.author
590
- ];
692
+ packageJson.maintainers = [packageJson.author];
591
693
  }
592
694
  packageJson.contributors ??= workspacePackageJson.contributors;
593
695
  if (!packageJson.contributors && packageJson.author) {
594
- packageJson.contributors = [
595
- packageJson.author
596
- ];
696
+ packageJson.contributors = [packageJson.author];
597
697
  }
598
698
  packageJson.repository ??= workspacePackageJson.repository;
599
699
  packageJson.repository.directory ??= projectRoot ? projectRoot : joinPaths("packages", projectName);
600
700
  return packageJson;
601
- }, "addWorkspacePackageJsonFields");
701
+ };
602
702
 
603
703
  // ../build-tools/src/utilities/get-entry-points.ts
604
704
  import { glob as glob2 } from "glob";
605
705
 
606
706
  // ../build-tools/src/utilities/get-env.ts
607
- var getEnv = /* @__PURE__ */ __name((builder, options) => {
707
+ var getEnv = (builder, options) => {
608
708
  return {
609
709
  STORM_BUILD: builder,
610
710
  STORM_ORG: options.orgName || DEFAULT_ORGANIZATION,
@@ -615,39 +715,51 @@ var getEnv = /* @__PURE__ */ __name((builder, options) => {
615
715
  STORM_TARGET: JSON.stringify(options.target),
616
716
  ...options.env
617
717
  };
618
- }, "getEnv");
718
+ };
619
719
 
620
720
  // ../build-tools/src/utilities/read-nx-config.ts
621
721
  import { existsSync as existsSync2 } from "node:fs";
622
722
  import { readFile as readFile3 } from "node:fs/promises";
623
723
 
624
724
  // ../build-tools/src/utilities/task-graph.ts
625
- import { createTaskGraph, mapTargetDefaultsToDependencies } from "nx/src/tasks-runner/create-task-graph";
725
+ import {
726
+ createTaskGraph,
727
+ mapTargetDefaultsToDependencies
728
+ } from "nx/src/tasks-runner/create-task-graph";
626
729
 
627
730
  // ../esbuild/src/assets.ts
628
731
  async function copyBuildAssets(context) {
629
732
  if (context.result?.errors.length === 0) {
630
- writeDebug(` \u{1F4CB} Copying asset files to output directory: ${context.outputPath}`, context.workspaceConfig);
733
+ writeDebug(
734
+ ` \u{1F4CB} Copying asset files to output directory: ${context.outputPath}`,
735
+ context.workspaceConfig
736
+ );
631
737
  const stopwatch = getStopwatch(`${context.options.name} asset copy`);
632
- await copyAssets(context.workspaceConfig, context.options.assets ?? [], context.outputPath, context.options.projectRoot, context.sourceRoot, true, false);
738
+ await copyAssets(
739
+ context.workspaceConfig,
740
+ context.options.assets ?? [],
741
+ context.outputPath,
742
+ context.options.projectRoot,
743
+ context.sourceRoot,
744
+ true,
745
+ false
746
+ );
633
747
  stopwatch();
634
748
  }
635
749
  return context;
636
750
  }
637
- __name(copyBuildAssets, "copyBuildAssets");
638
751
 
639
752
  // ../esbuild/src/clean.ts
640
753
  import { rm } from "node:fs/promises";
641
754
  async function cleanDirectories(directory) {
642
- await rm(directory, {
643
- recursive: true,
644
- force: true
645
- });
755
+ await rm(directory, { recursive: true, force: true });
646
756
  }
647
- __name(cleanDirectories, "cleanDirectories");
648
757
 
649
758
  // ../esbuild/src/context.ts
650
- import { createProjectGraphAsync as createProjectGraphAsync2, readProjectsConfigurationFromProjectGraph as readProjectsConfigurationFromProjectGraph2 } from "@nx/devkit";
759
+ import {
760
+ createProjectGraphAsync as createProjectGraphAsync2,
761
+ readProjectsConfigurationFromProjectGraph as readProjectsConfigurationFromProjectGraph2
762
+ } from "@nx/devkit";
651
763
  import defu2 from "defu";
652
764
  import { existsSync as existsSync3 } from "node:fs";
653
765
  import hf from "node:fs/promises";
@@ -704,43 +816,46 @@ function resolvePathsConfig(options, cwd, projectRoot) {
704
816
  if (options?.compilerOptions?.paths) {
705
817
  const paths = Object.entries(options.compilerOptions.paths);
706
818
  const resolvedPaths = paths.map(([key, paths2]) => {
707
- return [
708
- key,
709
- paths2.map((v) => path2.resolve(cwd, v))
710
- ];
819
+ return [key, paths2.map((v) => path2.resolve(cwd, v))];
711
820
  });
712
821
  return Object.fromEntries(resolvedPaths);
713
822
  }
714
823
  if (options.extends) {
715
- const extendsPath = path2.resolve(projectRoot ? joinPaths(cwd, projectRoot, options.extends) : joinPaths(cwd, options.extends));
824
+ const extendsPath = path2.resolve(
825
+ projectRoot ? joinPaths(cwd, projectRoot, options.extends) : joinPaths(cwd, options.extends)
826
+ );
716
827
  const extendsDir = path2.dirname(extendsPath);
717
828
  const extendsConfig = __require(extendsPath);
718
829
  return resolvePathsConfig(extendsConfig, extendsDir);
719
830
  }
720
831
  return [];
721
832
  }
722
- __name(resolvePathsConfig, "resolvePathsConfig");
723
- var resolvePathsPlugin = /* @__PURE__ */ __name((context) => ({
833
+ var resolvePathsPlugin = (context) => ({
724
834
  name: "storm:resolve-paths",
725
835
  setup(build3) {
726
- const parentTsConfig = build3.initialOptions.tsconfig ? __require(joinPaths(context.workspaceConfig.workspaceRoot, build3.initialOptions.tsconfig.replace(context.workspaceConfig.workspaceRoot, ""))) : __require(joinPaths(context.workspaceConfig.workspaceRoot, "tsconfig.json"));
727
- const resolvedTsPaths = resolvePathsConfig(parentTsConfig, context.workspaceConfig.workspaceRoot, context.options.projectRoot);
728
- const packagesRegex = new RegExp(`^(${Object.keys(resolvedTsPaths).join("|")})$`);
729
- build3.onResolve({
730
- filter: packagesRegex
731
- }, (args) => {
836
+ const parentTsConfig = build3.initialOptions.tsconfig ? __require(joinPaths(
837
+ context.workspaceConfig.workspaceRoot,
838
+ build3.initialOptions.tsconfig.replace(
839
+ context.workspaceConfig.workspaceRoot,
840
+ ""
841
+ )
842
+ )) : __require(joinPaths(context.workspaceConfig.workspaceRoot, "tsconfig.json"));
843
+ const resolvedTsPaths = resolvePathsConfig(
844
+ parentTsConfig,
845
+ context.workspaceConfig.workspaceRoot,
846
+ context.options.projectRoot
847
+ );
848
+ const packagesRegex = new RegExp(
849
+ `^(${Object.keys(resolvedTsPaths).join("|")})$`
850
+ );
851
+ build3.onResolve({ filter: packagesRegex }, (args) => {
732
852
  if (build3.initialOptions.external?.includes(args.path)) {
733
- return {
734
- path: args.path,
735
- external: true
736
- };
853
+ return { path: args.path, external: true };
737
854
  }
738
- return {
739
- path: `${resolvedTsPaths[args.path][0]}/index.ts`
740
- };
855
+ return { path: `${resolvedTsPaths[args.path][0]}/index.ts` };
741
856
  });
742
857
  }
743
- }), "resolvePathsPlugin");
858
+ });
744
859
 
745
860
  // ../esbuild/src/context.ts
746
861
  async function resolveContext(userOptions) {
@@ -757,7 +872,11 @@ async function resolveContext(userOptions) {
757
872
  const projectGraph = await createProjectGraphAsync2({
758
873
  exitOnError: true
759
874
  });
760
- const projectJsonPath = joinPaths(workspaceRoot3.dir, projectRoot, "project.json");
875
+ const projectJsonPath = joinPaths(
876
+ workspaceRoot3.dir,
877
+ projectRoot,
878
+ "project.json"
879
+ );
761
880
  if (!existsSync3(projectJsonPath)) {
762
881
  throw new Error("Cannot find project.json configuration");
763
882
  }
@@ -766,11 +885,17 @@ async function resolveContext(userOptions) {
766
885
  const projectName = projectJson.name || userOptions.name;
767
886
  const projectConfigurations = readProjectsConfigurationFromProjectGraph2(projectGraph);
768
887
  if (!projectConfigurations?.projects?.[projectName]) {
769
- throw new Error("The Build process failed because the project does not have a valid configuration in the project.json file. Check if the file exists in the root of the project.");
888
+ throw new Error(
889
+ "The Build process failed because the project does not have a valid configuration in the project.json file. Check if the file exists in the root of the project."
890
+ );
770
891
  }
771
892
  const options = defu2(userOptions, DEFAULT_BUILD_OPTIONS);
772
893
  options.name ??= projectName;
773
- const packageJsonPath = joinPaths(workspaceRoot3.dir, options.projectRoot, "package.json");
894
+ const packageJsonPath = joinPaths(
895
+ workspaceRoot3.dir,
896
+ options.projectRoot,
897
+ "package.json"
898
+ );
774
899
  if (!existsSync3(packageJsonPath)) {
775
900
  throw new Error("Cannot find package.json configuration");
776
901
  }
@@ -804,7 +929,11 @@ async function resolveContext(userOptions) {
804
929
  projectName,
805
930
  projectGraph,
806
931
  sourceRoot: resolvedOptions.sourceRoot || projectJson.sourceRoot || joinPaths(resolvedOptions.projectRoot, "src"),
807
- outputPath: resolvedOptions.outputPath || joinPaths(workspaceConfig.workspaceRoot, "dist", resolvedOptions.projectRoot),
932
+ outputPath: resolvedOptions.outputPath || joinPaths(
933
+ workspaceConfig.workspaceRoot,
934
+ "dist",
935
+ resolvedOptions.projectRoot
936
+ ),
808
937
  minify: resolvedOptions.minify || resolvedOptions.mode === "production"
809
938
  };
810
939
  context.options.esbuildPlugins = [
@@ -813,7 +942,6 @@ async function resolveContext(userOptions) {
813
942
  ];
814
943
  return context;
815
944
  }
816
- __name(resolveContext, "resolveContext");
817
945
 
818
946
  // ../esbuild/src/package-json.ts
819
947
  import { writeJsonFile } from "@nx/devkit";
@@ -823,17 +951,39 @@ async function generatePackageJson(context) {
823
951
  if (context.options.generatePackageJson !== false && existsSync4(joinPaths(context.options.projectRoot, "package.json"))) {
824
952
  writeDebug(" \u270D\uFE0F Writing package.json file", context.workspaceConfig);
825
953
  const stopwatch = getStopwatch("Write package.json file");
826
- const packageJsonPath = joinPaths(context.options.projectRoot, "project.json");
954
+ const packageJsonPath = joinPaths(
955
+ context.options.projectRoot,
956
+ "project.json"
957
+ );
827
958
  if (!existsSync4(packageJsonPath)) {
828
959
  throw new Error("Cannot find package.json configuration");
829
960
  }
830
- const packageJsonFile = await hf2.readFile(joinPaths(context.workspaceConfig.workspaceRoot, context.options.projectRoot, "package.json"), "utf8");
961
+ const packageJsonFile = await hf2.readFile(
962
+ joinPaths(
963
+ context.workspaceConfig.workspaceRoot,
964
+ context.options.projectRoot,
965
+ "package.json"
966
+ ),
967
+ "utf8"
968
+ );
831
969
  let packageJson = JSON.parse(packageJsonFile);
832
970
  if (!packageJson) {
833
971
  throw new Error("Cannot find package.json configuration file");
834
972
  }
835
- packageJson = await addPackageDependencies(context.workspaceConfig.workspaceRoot, context.options.projectRoot, context.projectName, packageJson);
836
- packageJson = await addWorkspacePackageJsonFields(context.workspaceConfig, context.options.projectRoot, context.sourceRoot, context.projectName, false, packageJson);
973
+ packageJson = await addPackageDependencies(
974
+ context.workspaceConfig.workspaceRoot,
975
+ context.options.projectRoot,
976
+ context.projectName,
977
+ packageJson
978
+ );
979
+ packageJson = await addWorkspacePackageJsonFields(
980
+ context.workspaceConfig,
981
+ context.options.projectRoot,
982
+ context.sourceRoot,
983
+ context.projectName,
984
+ false,
985
+ packageJson
986
+ );
837
987
  if (context.options.entry) {
838
988
  packageJson.exports ??= {};
839
989
  packageJson.exports["./package.json"] ??= "./package.json";
@@ -903,20 +1053,25 @@ async function generatePackageJson(context) {
903
1053
  if (isDts) {
904
1054
  packageJson.types = `${defaultEntry}.d.${isEsm ? "mts" : isCjs ? "cts" : "ts"}`;
905
1055
  }
906
- packageJson.exports = Object.keys(packageJson.exports).reduce((ret, key) => {
907
- if (key.endsWith("/index") && !ret[key.replace("/index", "")]) {
908
- ret[key.replace("/index", "")] = packageJson.exports[key];
909
- }
910
- return ret;
911
- }, packageJson.exports);
1056
+ packageJson.exports = Object.keys(packageJson.exports).reduce(
1057
+ (ret, key) => {
1058
+ if (key.endsWith("/index") && !ret[key.replace("/index", "")]) {
1059
+ ret[key.replace("/index", "")] = packageJson.exports[key];
1060
+ }
1061
+ return ret;
1062
+ },
1063
+ packageJson.exports
1064
+ );
912
1065
  }
913
1066
  }
914
- await writeJsonFile(joinPaths(context.outputPath, "package.json"), packageJson);
1067
+ await writeJsonFile(
1068
+ joinPaths(context.outputPath, "package.json"),
1069
+ packageJson
1070
+ );
915
1071
  stopwatch();
916
1072
  }
917
1073
  return context;
918
1074
  }
919
- __name(generatePackageJson, "generatePackageJson");
920
1075
 
921
1076
  // ../esbuild/src/plugins/deps-check.ts
922
1077
  import { builtinModules as builtinModules2 } from "node:module";
@@ -945,12 +1100,8 @@ var unusedIgnore = [
945
1100
  // these are indirectly used by build
946
1101
  "buffer"
947
1102
  ];
948
- var missingIgnore = [
949
- ".prisma",
950
- "@prisma/client",
951
- "ts-toolbelt"
952
- ];
953
- var depsCheckPlugin = /* @__PURE__ */ __name((bundle) => ({
1103
+ var missingIgnore = [".prisma", "@prisma/client", "ts-toolbelt"];
1104
+ var depsCheckPlugin = (bundle) => ({
954
1105
  name: "storm:deps-check",
955
1106
  setup(build3) {
956
1107
  const pkgJsonPath = path3.join(process.cwd(), "package.json");
@@ -964,9 +1115,7 @@ var depsCheckPlugin = /* @__PURE__ */ __name((bundle) => ({
964
1115
  ];
965
1116
  const collectedDependencies = /* @__PURE__ */ new Set();
966
1117
  const onlyPackages = /^[^./](?!:)|^\.[^./]|^\.\.[^/]/;
967
- build3.onResolve({
968
- filter: onlyPackages
969
- }, (args) => {
1118
+ build3.onResolve({ filter: onlyPackages }, (args) => {
970
1119
  if (args.importer.includes(process.cwd())) {
971
1120
  if (args.path[0] === "@") {
972
1121
  const [org, pkg] = args.path.split("/");
@@ -976,19 +1125,13 @@ var depsCheckPlugin = /* @__PURE__ */ __name((bundle) => ({
976
1125
  collectedDependencies.add(pkg);
977
1126
  }
978
1127
  }
979
- return {
980
- external: true
981
- };
1128
+ return { external: true };
982
1129
  });
983
1130
  build3.onEnd(() => {
984
- const unusedDependencies = [
985
- ...dependencies
986
- ].filter((dep) => {
1131
+ const unusedDependencies = [...dependencies].filter((dep) => {
987
1132
  return !collectedDependencies.has(dep) || builtinModules2.includes(dep);
988
1133
  });
989
- const missingDependencies = [
990
- ...collectedDependencies
991
- ].filter((dep) => {
1134
+ const missingDependencies = [...collectedDependencies].filter((dep) => {
992
1135
  return !dependencies.includes(dep) && !builtinModules2.includes(dep);
993
1136
  });
994
1137
  const filteredUnusedDeps = unusedDependencies.filter((dep) => {
@@ -997,8 +1140,12 @@ var depsCheckPlugin = /* @__PURE__ */ __name((bundle) => ({
997
1140
  const filteredMissingDeps = missingDependencies.filter((dep) => {
998
1141
  return !missingIgnore.some((pattern) => dep.match(pattern)) && !peerDependencies.includes(dep);
999
1142
  });
1000
- writeWarning(`Unused Dependencies: ${JSON.stringify(filteredUnusedDeps)}`);
1001
- writeError(`Missing Dependencies: ${JSON.stringify(filteredMissingDeps)}`);
1143
+ writeWarning(
1144
+ `Unused Dependencies: ${JSON.stringify(filteredUnusedDeps)}`
1145
+ );
1146
+ writeError(
1147
+ `Missing Dependencies: ${JSON.stringify(filteredMissingDeps)}`
1148
+ );
1002
1149
  if (filteredMissingDeps.length > 0) {
1003
1150
  throw new Error(`Missing dependencies detected - please install them:
1004
1151
  ${JSON.stringify(filteredMissingDeps)}
@@ -1006,12 +1153,15 @@ ${JSON.stringify(filteredMissingDeps)}
1006
1153
  }
1007
1154
  });
1008
1155
  }
1009
- }), "depsCheckPlugin");
1156
+ });
1010
1157
 
1011
1158
  // ../esbuild/src/tsup.ts
1012
1159
  import { build as tsup } from "tsup";
1013
1160
  async function executeTsup(context) {
1014
- writeDebug(` \u{1F680} Running ${context.options.name} build`, context.workspaceConfig);
1161
+ writeDebug(
1162
+ ` \u{1F680} Running ${context.options.name} build`,
1163
+ context.workspaceConfig
1164
+ );
1015
1165
  const stopwatch = getStopwatch(`${context.options.name} build`);
1016
1166
  await tsup({
1017
1167
  ...context.options,
@@ -1021,21 +1171,30 @@ async function executeTsup(context) {
1021
1171
  stopwatch();
1022
1172
  return context;
1023
1173
  }
1024
- __name(executeTsup, "executeTsup");
1025
1174
 
1026
1175
  // ../esbuild/src/build.ts
1027
1176
  async function reportResults(context) {
1028
1177
  if (context.result?.errors.length === 0) {
1029
1178
  if (context.result.warnings.length > 0) {
1030
- writeWarning(` \u{1F6A7} The following warnings occurred during the build: ${context.result.warnings.map((warning) => warning.text).join("\n")}`, context.workspaceConfig);
1031
- }
1032
- writeSuccess(` \u{1F4E6} The ${context.options.name} build completed successfully`, context.workspaceConfig);
1179
+ writeWarning(
1180
+ ` \u{1F6A7} The following warnings occurred during the build: ${context.result.warnings.map((warning) => warning.text).join("\n")}`,
1181
+ context.workspaceConfig
1182
+ );
1183
+ }
1184
+ writeSuccess(
1185
+ ` \u{1F4E6} The ${context.options.name} build completed successfully`,
1186
+ context.workspaceConfig
1187
+ );
1033
1188
  } else if (context.result?.errors && context.result?.errors.length > 0) {
1034
- writeError(` \u274C The ${context.options.name} build failed with the following errors: ${context.result.errors.map((error) => error.text).join("\n")}`, context.workspaceConfig);
1035
- throw new Error(`The ${context.options.name} build failed with the following errors: ${context.result.errors.map((error) => error.text).join("\n")}`);
1189
+ writeError(
1190
+ ` \u274C The ${context.options.name} build failed with the following errors: ${context.result.errors.map((error) => error.text).join("\n")}`,
1191
+ context.workspaceConfig
1192
+ );
1193
+ throw new Error(
1194
+ `The ${context.options.name} build failed with the following errors: ${context.result.errors.map((error) => error.text).join("\n")}`
1195
+ );
1036
1196
  }
1037
1197
  }
1038
- __name(reportResults, "reportResults");
1039
1198
  async function dependencyCheck(options) {
1040
1199
  if (process.env.DEV === "true") {
1041
1200
  return void 0;
@@ -1046,43 +1205,39 @@ async function dependencyCheck(options) {
1046
1205
  const buildPromise = esbuild.build({
1047
1206
  entryPoints: globbySync("**/*.{j,t}s", {
1048
1207
  // We don't check dependencies in ecosystem tests because tests are isolated from the build.
1049
- ignore: [
1050
- "./src/__tests__/**/*",
1051
- "./tests/e2e/**/*",
1052
- "./dist/**/*"
1053
- ],
1208
+ ignore: ["./src/__tests__/**/*", "./tests/e2e/**/*", "./dist/**/*"],
1054
1209
  gitignore: true
1055
1210
  }),
1056
1211
  logLevel: "silent",
1212
+ // there will be errors
1057
1213
  bundle: true,
1214
+ // we bundle to get everything
1058
1215
  write: false,
1216
+ // no need to write for analysis
1059
1217
  outdir: "out",
1060
- plugins: [
1061
- depsCheckPlugin(options.bundle)
1062
- ]
1218
+ plugins: [depsCheckPlugin(options.bundle)]
1063
1219
  });
1064
1220
  await buildPromise.catch(() => {
1065
1221
  });
1066
1222
  return void 0;
1067
1223
  }
1068
- __name(dependencyCheck, "dependencyCheck");
1069
1224
  async function cleanOutputPath(context) {
1070
1225
  if (context.clean !== false && context.outputPath) {
1071
- writeDebug(` \u{1F9F9} Cleaning ${context.options.name} output path: ${context.outputPath}`, context.workspaceConfig);
1226
+ writeDebug(
1227
+ ` \u{1F9F9} Cleaning ${context.options.name} output path: ${context.outputPath}`,
1228
+ context.workspaceConfig
1229
+ );
1072
1230
  const stopwatch = getStopwatch(`${context.options.name} output clean`);
1073
1231
  await cleanDirectories(context.outputPath);
1074
1232
  stopwatch();
1075
1233
  }
1076
1234
  return context;
1077
1235
  }
1078
- __name(cleanOutputPath, "cleanOutputPath");
1079
1236
  async function build2(options) {
1080
1237
  writeDebug(` \u26A1 Executing Storm ESBuild pipeline`);
1081
1238
  const stopwatch = getStopwatch("ESBuild pipeline");
1082
1239
  try {
1083
- const opts = Array.isArray(options) ? options : [
1084
- options
1085
- ];
1240
+ const opts = Array.isArray(options) ? options : [options];
1086
1241
  if (opts.length === 0) {
1087
1242
  throw new Error("No build options were provided");
1088
1243
  }
@@ -1097,19 +1252,22 @@ async function build2(options) {
1097
1252
  await reportResults(context);
1098
1253
  writeSuccess(" \u{1F3C1} ESBuild pipeline build completed successfully");
1099
1254
  } catch (error) {
1100
- writeFatal("Fatal errors that the build process could not recover from have occured. The build process has been terminated.");
1255
+ writeFatal(
1256
+ "Fatal errors that the build process could not recover from have occured. The build process has been terminated."
1257
+ );
1101
1258
  throw error;
1102
1259
  } finally {
1103
1260
  stopwatch();
1104
1261
  }
1105
1262
  }
1106
- __name(build2, "build");
1107
1263
 
1108
1264
  // ../workspace-tools/src/executors/esbuild/executor.ts
1109
1265
  async function esbuildExecutorFn(options, context, config) {
1110
1266
  writeInfo("\u{1F4E6} Running Storm ESBuild executor on the workspace", config);
1111
1267
  if (!context.projectsConfigurations?.projects || !context.projectName || !context.projectsConfigurations.projects[context.projectName] || !context.projectsConfigurations.projects[context.projectName]?.root) {
1112
- throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace.");
1268
+ throw new Error(
1269
+ "The Build process failed because the context is not valid. Please run this command from a workspace."
1270
+ );
1113
1271
  }
1114
1272
  await build2({
1115
1273
  ...options,
@@ -1123,20 +1281,21 @@ async function esbuildExecutorFn(options, context, config) {
1123
1281
  success: true
1124
1282
  };
1125
1283
  }
1126
- __name(esbuildExecutorFn, "esbuildExecutorFn");
1127
- var executor_default6 = withRunExecutor("Storm ESBuild build", esbuildExecutorFn, {
1128
- skipReadingConfig: false,
1129
- hooks: {
1130
- applyDefaultOptions: /* @__PURE__ */ __name(async (options, config) => {
1131
- options.entry ??= [
1132
- "src/index.ts"
1133
- ];
1134
- options.outputPath ??= "dist/{projectRoot}";
1135
- options.tsconfig ??= "{projectRoot}/tsconfig.json";
1136
- return options;
1137
- }, "applyDefaultOptions")
1284
+ var executor_default6 = withRunExecutor(
1285
+ "Storm ESBuild build",
1286
+ esbuildExecutorFn,
1287
+ {
1288
+ skipReadingConfig: false,
1289
+ hooks: {
1290
+ applyDefaultOptions: async (options, config) => {
1291
+ options.entry ??= ["src/index.ts"];
1292
+ options.outputPath ??= "dist/{projectRoot}";
1293
+ options.tsconfig ??= "{projectRoot}/tsconfig.json";
1294
+ return options;
1295
+ }
1296
+ }
1138
1297
  }
1139
- });
1298
+ );
1140
1299
 
1141
1300
  // ../workspace-tools/src/executors/npm-publish/executor.ts
1142
1301
  import { execSync as execSync3 } from "node:child_process";
@@ -1159,31 +1318,38 @@ import filePlugin from "@size-limit/file";
1159
1318
  import sizeLimit from "size-limit";
1160
1319
  async function sizeLimitExecutorFn(options, context, config) {
1161
1320
  if (!context?.projectName || !context.projectsConfigurations?.projects || !context.projectsConfigurations.projects[context.projectName]) {
1162
- throw new Error("The Size-Limit process failed because the context is not valid. Please run this command from a workspace.");
1321
+ throw new Error(
1322
+ "The Size-Limit process failed because the context is not valid. Please run this command from a workspace."
1323
+ );
1163
1324
  }
1164
1325
  writeInfo(`\u{1F4CF} Running Size-Limit on ${context.projectName}`, config);
1165
- sizeLimit([
1166
- filePlugin,
1167
- esBuildPlugin,
1168
- esBuildWhyPlugin
1169
- ], {
1170
- checks: options.entry ?? context.projectsConfigurations.projects[context.projectName]?.sourceRoot ?? joinPathFragments3(context.projectsConfigurations.projects[context.projectName]?.root ?? "./", "src")
1326
+ sizeLimit([filePlugin, esBuildPlugin, esBuildWhyPlugin], {
1327
+ checks: options.entry ?? context.projectsConfigurations.projects[context.projectName]?.sourceRoot ?? joinPathFragments3(
1328
+ context.projectsConfigurations.projects[context.projectName]?.root ?? "./",
1329
+ "src"
1330
+ )
1171
1331
  }).then((result) => {
1172
- writeInfo(`\u{1F4CF} ${context.projectName} Size-Limit result: ${JSON.stringify(result)}`, config);
1332
+ writeInfo(
1333
+ `\u{1F4CF} ${context.projectName} Size-Limit result: ${JSON.stringify(result)}`,
1334
+ config
1335
+ );
1173
1336
  });
1174
1337
  return {
1175
1338
  success: true
1176
1339
  };
1177
1340
  }
1178
- __name(sizeLimitExecutorFn, "sizeLimitExecutorFn");
1179
- var executor_default7 = withRunExecutor("Size-Limit Performance Test Executor", sizeLimitExecutorFn, {
1180
- skipReadingConfig: false,
1181
- hooks: {
1182
- applyDefaultOptions: /* @__PURE__ */ __name((options) => {
1183
- return options;
1184
- }, "applyDefaultOptions")
1341
+ var executor_default7 = withRunExecutor(
1342
+ "Size-Limit Performance Test Executor",
1343
+ sizeLimitExecutorFn,
1344
+ {
1345
+ skipReadingConfig: false,
1346
+ hooks: {
1347
+ applyDefaultOptions: (options) => {
1348
+ return options;
1349
+ }
1350
+ }
1185
1351
  }
1186
- });
1352
+ );
1187
1353
 
1188
1354
  // ../workspace-tools/src/executors/typia/executor.ts
1189
1355
  import { removeSync } from "fs-extra";
@@ -1193,33 +1359,36 @@ async function typiaExecutorFn(options, _, config) {
1193
1359
  writeInfo(`\u{1F9F9} Cleaning output path: ${options.outputPath}`, config);
1194
1360
  removeSync(options.outputPath);
1195
1361
  }
1196
- await Promise.all(options.entry.map((entry) => {
1197
- writeInfo(`\u{1F680} Running Typia on entry: ${entry}`, config);
1198
- return TypiaProgrammer.build({
1199
- input: entry,
1200
- output: options.outputPath,
1201
- project: options.tsconfig
1202
- });
1203
- }));
1362
+ await Promise.all(
1363
+ options.entry.map((entry) => {
1364
+ writeInfo(`\u{1F680} Running Typia on entry: ${entry}`, config);
1365
+ return TypiaProgrammer.build({
1366
+ input: entry,
1367
+ output: options.outputPath,
1368
+ project: options.tsconfig
1369
+ });
1370
+ })
1371
+ );
1204
1372
  return {
1205
1373
  success: true
1206
1374
  };
1207
1375
  }
1208
- __name(typiaExecutorFn, "typiaExecutorFn");
1209
- var executor_default8 = withRunExecutor("Typia runtime validation generator", typiaExecutorFn, {
1210
- skipReadingConfig: false,
1211
- hooks: {
1212
- applyDefaultOptions: /* @__PURE__ */ __name((options) => {
1213
- options.entry ??= [
1214
- "{sourceRoot}/index.ts"
1215
- ];
1216
- options.outputPath ??= "{sourceRoot}/__generated__/typia";
1217
- options.tsconfig ??= "{projectRoot}/tsconfig.json";
1218
- options.clean ??= true;
1219
- return options;
1220
- }, "applyDefaultOptions")
1376
+ var executor_default8 = withRunExecutor(
1377
+ "Typia runtime validation generator",
1378
+ typiaExecutorFn,
1379
+ {
1380
+ skipReadingConfig: false,
1381
+ hooks: {
1382
+ applyDefaultOptions: (options) => {
1383
+ options.entry ??= ["{sourceRoot}/index.ts"];
1384
+ options.outputPath ??= "{sourceRoot}/__generated__/typia";
1385
+ options.tsconfig ??= "{projectRoot}/tsconfig.json";
1386
+ options.clean ??= true;
1387
+ return options;
1388
+ }
1389
+ }
1221
1390
  }
1222
- });
1391
+ );
1223
1392
 
1224
1393
  // ../workspace-tools/src/executors/unbuild/executor.ts
1225
1394
  import { defu as defu3 } from "defu";
@@ -1227,74 +1396,101 @@ import { createJiti } from "jiti";
1227
1396
  async function unbuildExecutorFn(options, context, config) {
1228
1397
  writeInfo("\u{1F4E6} Running Storm Unbuild executor on the workspace", config);
1229
1398
  if (!context.projectsConfigurations?.projects || !context.projectName || !context.projectsConfigurations.projects[context.projectName]) {
1230
- throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace root directory.");
1399
+ throw new Error(
1400
+ "The Build process failed because the context is not valid. Please run this command from a workspace root directory."
1401
+ );
1231
1402
  }
1232
1403
  if (!context.projectsConfigurations.projects[context.projectName].root) {
1233
- throw new Error("The Build process failed because the project root is not valid. Please run this command from a workspace root directory.");
1404
+ throw new Error(
1405
+ "The Build process failed because the project root is not valid. Please run this command from a workspace root directory."
1406
+ );
1234
1407
  }
1235
1408
  if (!context.projectsConfigurations.projects[context.projectName].sourceRoot) {
1236
- throw new Error("The Build process failed because the project's source root is not valid. Please run this command from a workspace root directory.");
1409
+ throw new Error(
1410
+ "The Build process failed because the project's source root is not valid. Please run this command from a workspace root directory."
1411
+ );
1237
1412
  }
1238
1413
  const jiti = createJiti(config.workspaceRoot, {
1239
- fsCache: config.skipCache ? false : joinPaths(config.workspaceRoot, config.directories.cache || "node_modules/.cache/storm", "jiti"),
1414
+ fsCache: config.skipCache ? false : joinPaths(
1415
+ config.workspaceRoot,
1416
+ config.directories.cache || "node_modules/.cache/storm",
1417
+ "jiti"
1418
+ ),
1240
1419
  interopDefault: true
1241
1420
  });
1242
- const stormUnbuild = await jiti.import(jiti.esmResolve("@storm-software/unbuild/build"));
1243
- await stormUnbuild.build(defu3({
1244
- ...options,
1245
- projectRoot: context.projectsConfigurations.projects[context.projectName].root,
1246
- projectName: context.projectName,
1247
- sourceRoot: context.projectsConfigurations.projects[context.projectName].sourceRoot,
1248
- platform: options.platform
1249
- }, {
1250
- stubOptions: {
1251
- jiti: {
1252
- fsCache: config.skipCache ? false : joinPaths(config.workspaceRoot, config.directories.cache || "node_modules/.cache/storm", "jiti")
1253
- }
1254
- },
1255
- rollup: {
1256
- emitCJS: true,
1257
- watch: false,
1258
- dts: {
1259
- respectExternal: true
1421
+ const stormUnbuild = await jiti.import(
1422
+ jiti.esmResolve("@storm-software/unbuild/build")
1423
+ );
1424
+ await stormUnbuild.build(
1425
+ defu3(
1426
+ {
1427
+ ...options,
1428
+ projectRoot: context.projectsConfigurations.projects[context.projectName].root,
1429
+ projectName: context.projectName,
1430
+ sourceRoot: context.projectsConfigurations.projects[context.projectName].sourceRoot,
1431
+ platform: options.platform
1260
1432
  },
1261
- esbuild: {
1262
- target: options.target,
1263
- format: "esm",
1264
- platform: options.platform,
1265
- minify: options.minify ?? !options.debug,
1266
- sourcemap: options.sourcemap ?? options.debug,
1267
- treeShaking: options.treeShaking
1433
+ {
1434
+ stubOptions: {
1435
+ jiti: {
1436
+ fsCache: config.skipCache ? false : joinPaths(
1437
+ config.workspaceRoot,
1438
+ config.directories.cache || "node_modules/.cache/storm",
1439
+ "jiti"
1440
+ )
1441
+ }
1442
+ },
1443
+ rollup: {
1444
+ emitCJS: true,
1445
+ watch: false,
1446
+ dts: {
1447
+ respectExternal: true
1448
+ },
1449
+ esbuild: {
1450
+ target: options.target,
1451
+ format: "esm",
1452
+ platform: options.platform,
1453
+ minify: options.minify ?? !options.debug,
1454
+ sourcemap: options.sourcemap ?? options.debug,
1455
+ treeShaking: options.treeShaking
1456
+ }
1457
+ }
1268
1458
  }
1269
- }
1270
- }));
1459
+ )
1460
+ );
1271
1461
  return {
1272
1462
  success: true
1273
1463
  };
1274
1464
  }
1275
- __name(unbuildExecutorFn, "unbuildExecutorFn");
1276
- var executor_default9 = withRunExecutor("TypeScript Unbuild build", unbuildExecutorFn, {
1277
- skipReadingConfig: false,
1278
- hooks: {
1279
- applyDefaultOptions: /* @__PURE__ */ __name(async (options, config) => {
1280
- options.debug ??= false;
1281
- options.treeShaking ??= true;
1282
- options.buildOnly ??= false;
1283
- options.platform ??= "neutral";
1284
- options.entry ??= [
1285
- "{sourceRoot}"
1286
- ];
1287
- options.tsconfig ??= "{projectRoot}/tsconfig.json";
1288
- return options;
1289
- }, "applyDefaultOptions")
1465
+ var executor_default9 = withRunExecutor(
1466
+ "TypeScript Unbuild build",
1467
+ unbuildExecutorFn,
1468
+ {
1469
+ skipReadingConfig: false,
1470
+ hooks: {
1471
+ applyDefaultOptions: async (options, config) => {
1472
+ options.debug ??= false;
1473
+ options.treeShaking ??= true;
1474
+ options.buildOnly ??= false;
1475
+ options.platform ??= "neutral";
1476
+ options.entry ??= ["{sourceRoot}"];
1477
+ options.tsconfig ??= "{projectRoot}/tsconfig.json";
1478
+ return options;
1479
+ }
1480
+ }
1290
1481
  }
1291
- });
1482
+ );
1292
1483
 
1293
1484
  // ../workspace-tools/src/generators/browser-library/generator.ts
1294
- import { formatFiles as formatFiles2, generateFiles, names as names2, offsetFromRoot as offsetFromRoot2 } from "@nx/devkit";
1485
+ import {
1486
+ formatFiles as formatFiles2,
1487
+ generateFiles,
1488
+ names as names2,
1489
+ offsetFromRoot as offsetFromRoot2
1490
+ } from "@nx/devkit";
1295
1491
 
1296
1492
  // ../workspace-tools/src/base/base-generator.ts
1297
- var withRunGenerator = /* @__PURE__ */ __name((name, generatorFn, generatorOptions = {
1493
+ var withRunGenerator = (name, generatorFn, generatorOptions = {
1298
1494
  skipReadingConfig: false
1299
1495
  }) => async (tree, _options) => {
1300
1496
  const stopwatch = getStopwatch(name);
@@ -1306,27 +1502,40 @@ var withRunGenerator = /* @__PURE__ */ __name((name, generatorFn, generatorOptio
1306
1502
  `, config);
1307
1503
  const workspaceRoot3 = findWorkspaceRoot();
1308
1504
  if (!generatorOptions.skipReadingConfig) {
1309
- writeDebug(`Loading the Storm Config from environment variables and storm.config.js file...
1310
- - workspaceRoot: ${workspaceRoot3}`, config);
1505
+ writeDebug(
1506
+ `Loading the Storm Config from environment variables and storm.config.js file...
1507
+ - workspaceRoot: ${workspaceRoot3}`,
1508
+ config
1509
+ );
1311
1510
  config = await getConfig(workspaceRoot3);
1312
1511
  }
1313
1512
  if (generatorOptions?.hooks?.applyDefaultOptions) {
1314
1513
  writeDebug("Running the applyDefaultOptions hook...", config);
1315
- options = await Promise.resolve(generatorOptions.hooks.applyDefaultOptions(options, config));
1514
+ options = await Promise.resolve(
1515
+ generatorOptions.hooks.applyDefaultOptions(options, config)
1516
+ );
1316
1517
  writeDebug("Completed the applyDefaultOptions hook", config);
1317
1518
  }
1318
- writeTrace(`Generator schema options \u2699\uFE0F
1319
- ${Object.keys(options ?? {}).map((key) => ` - ${key}=${JSON.stringify(options[key])}`).join("\n")}`, config);
1320
- const tokenized = await applyWorkspaceTokens(options, {
1321
- workspaceRoot: tree.root,
1519
+ writeTrace(
1520
+ `Generator schema options \u2699\uFE0F
1521
+ ${Object.keys(options ?? {}).map((key) => ` - ${key}=${JSON.stringify(options[key])}`).join("\n")}`,
1322
1522
  config
1323
- }, applyWorkspaceBaseTokens);
1523
+ );
1524
+ const tokenized = await applyWorkspaceTokens(
1525
+ options,
1526
+ { workspaceRoot: tree.root, config },
1527
+ applyWorkspaceBaseTokens
1528
+ );
1324
1529
  if (generatorOptions?.hooks?.preProcess) {
1325
1530
  writeDebug("Running the preProcess hook...", config);
1326
- await Promise.resolve(generatorOptions.hooks.preProcess(tokenized, config));
1531
+ await Promise.resolve(
1532
+ generatorOptions.hooks.preProcess(tokenized, config)
1533
+ );
1327
1534
  writeDebug("Completed the preProcess hook", config);
1328
1535
  }
1329
- const result = await Promise.resolve(generatorFn(tree, tokenized, config));
1536
+ const result = await Promise.resolve(
1537
+ generatorFn(tree, tokenized, config)
1538
+ );
1330
1539
  if (result) {
1331
1540
  if (result.success === false || result.error && result?.error?.message && typeof result?.error?.message === "string" && result?.error?.name && typeof result?.error?.name === "string") {
1332
1541
  throw new Error(`The ${name} generator failed to run`, {
@@ -1347,20 +1556,40 @@ ${Object.keys(options ?? {}).map((key) => ` - ${key}=${JSON.stringify(options[ke
1347
1556
  };
1348
1557
  } catch (error) {
1349
1558
  return () => {
1350
- writeFatal("A fatal error occurred while running the generator - the process was forced to terminate", config);
1351
- writeError(`An exception was thrown in the generator's process
1559
+ writeFatal(
1560
+ "A fatal error occurred while running the generator - the process was forced to terminate",
1561
+ config
1562
+ );
1563
+ writeError(
1564
+ `An exception was thrown in the generator's process
1352
1565
  - Details: ${error.message}
1353
- - Stacktrace: ${error.stack}`, config);
1566
+ - Stacktrace: ${error.stack}`,
1567
+ config
1568
+ );
1354
1569
  };
1355
1570
  } finally {
1356
1571
  stopwatch();
1357
1572
  }
1358
- }, "withRunGenerator");
1573
+ };
1359
1574
 
1360
1575
  // ../workspace-tools/src/base/typescript-library-generator.ts
1361
- import { addDependenciesToPackageJson, addProjectConfiguration, ensurePackage, formatFiles, names, offsetFromRoot, readJson, updateJson, writeJson } from "@nx/devkit";
1576
+ import {
1577
+ addDependenciesToPackageJson,
1578
+ addProjectConfiguration,
1579
+ ensurePackage,
1580
+ formatFiles,
1581
+ names,
1582
+ offsetFromRoot,
1583
+ readJson,
1584
+ updateJson,
1585
+ writeJson
1586
+ } from "@nx/devkit";
1362
1587
  import { determineProjectNameAndRootOptions } from "@nx/devkit/src/generators/project-name-and-root-utils";
1363
- import { addTsConfigPath, getRelativePathToRootTsConfig, tsConfigBaseOptions } from "@nx/js";
1588
+ import {
1589
+ addTsConfigPath,
1590
+ getRelativePathToRootTsConfig,
1591
+ tsConfigBaseOptions
1592
+ } from "@nx/js";
1364
1593
  import jsInitGenerator from "@nx/js/src/generators/init/init";
1365
1594
  import setupVerdaccio from "@nx/js/src/generators/setup-verdaccio/generator";
1366
1595
 
@@ -1372,24 +1601,27 @@ var pnpmVersion = "8.10.2";
1372
1601
 
1373
1602
  // ../workspace-tools/src/base/typescript-library-generator.ts
1374
1603
  async function typeScriptLibraryGeneratorFn(tree, options, config) {
1375
- const normalized = await normalizeOptions(tree, {
1376
- ...options
1377
- });
1604
+ const normalized = await normalizeOptions(tree, { ...options });
1378
1605
  const tasks = [];
1379
- tasks.push(await jsInitGenerator(tree, {
1380
- ...normalized,
1381
- tsConfigName: normalized.rootProject ? "tsconfig.json" : "tsconfig.base.json"
1382
- }));
1383
- tasks.push(addDependenciesToPackageJson(tree, {}, {
1384
- "@storm-software/workspace-tools": "latest",
1385
- "@storm-software/testing-tools": "latest",
1386
- ...options.devDependencies ?? {}
1387
- }));
1388
- if (normalized.publishable) {
1389
- tasks.push(await setupVerdaccio(tree, {
1606
+ tasks.push(
1607
+ await jsInitGenerator(tree, {
1390
1608
  ...normalized,
1391
- skipFormat: true
1392
- }));
1609
+ tsConfigName: normalized.rootProject ? "tsconfig.json" : "tsconfig.base.json"
1610
+ })
1611
+ );
1612
+ tasks.push(
1613
+ addDependenciesToPackageJson(
1614
+ tree,
1615
+ {},
1616
+ {
1617
+ "@storm-software/workspace-tools": "latest",
1618
+ "@storm-software/testing-tools": "latest",
1619
+ ...options.devDependencies ?? {}
1620
+ }
1621
+ )
1622
+ );
1623
+ if (normalized.publishable) {
1624
+ tasks.push(await setupVerdaccio(tree, { ...normalized, skipFormat: true }));
1393
1625
  }
1394
1626
  const projectConfig = {
1395
1627
  root: normalized.directory,
@@ -1398,13 +1630,9 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
1398
1630
  targets: {
1399
1631
  build: {
1400
1632
  executor: options.buildExecutor,
1401
- outputs: [
1402
- "{options.outputPath}"
1403
- ],
1633
+ outputs: ["{options.outputPath}"],
1404
1634
  options: {
1405
- entry: [
1406
- joinPaths(normalized.projectRoot, "src", "index.ts")
1407
- ],
1635
+ entry: [joinPaths(normalized.projectRoot, "src", "index.ts")],
1408
1636
  outputPath: getOutputPath(normalized),
1409
1637
  tsconfig: joinPaths(normalized.projectRoot, "tsconfig.json"),
1410
1638
  project: joinPaths(normalized.projectRoot, "package.json"),
@@ -1439,9 +1667,12 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
1439
1667
  if (options.platform) {
1440
1668
  projectConfig.targets.build.options.platform = options.platform === "worker" ? "node" : options.platform;
1441
1669
  }
1442
- addProjectTag(projectConfig, ProjectTagConstants.Platform.TAG_ID, options.platform === "node" ? ProjectTagConstants.Platform.NODE : options.platform === "worker" ? ProjectTagConstants.Platform.WORKER : options.platform === "browser" ? ProjectTagConstants.Platform.BROWSER : ProjectTagConstants.Platform.NEUTRAL, {
1443
- overwrite: false
1444
- });
1670
+ addProjectTag(
1671
+ projectConfig,
1672
+ ProjectTagConstants.Platform.TAG_ID,
1673
+ options.platform === "node" ? ProjectTagConstants.Platform.NODE : options.platform === "worker" ? ProjectTagConstants.Platform.WORKER : options.platform === "browser" ? ProjectTagConstants.Platform.BROWSER : ProjectTagConstants.Platform.NEUTRAL,
1674
+ { overwrite: false }
1675
+ );
1445
1676
  createProjectTsConfigJson(tree, normalized);
1446
1677
  addProjectConfiguration(tree, normalized.name, projectConfig);
1447
1678
  let repository = {
@@ -1518,7 +1749,11 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
1518
1749
  }));
1519
1750
  }
1520
1751
  addTsConfigPath(tree, normalized.importPath, [
1521
- joinPaths(normalized.projectRoot, "./src", `index.${normalized.js ? "js" : "ts"}`)
1752
+ joinPaths(
1753
+ normalized.projectRoot,
1754
+ "./src",
1755
+ `index.${normalized.js ? "js" : "ts"}`
1756
+ )
1522
1757
  ]);
1523
1758
  addTsConfigPath(tree, joinPaths(normalized.importPath, "/*"), [
1524
1759
  joinPaths(normalized.projectRoot, "./src", "/*")
@@ -1546,25 +1781,15 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
1546
1781
  outDir: `${offsetFromRoot(normalized.projectRoot)}dist/out-tsc`
1547
1782
  },
1548
1783
  files: [],
1549
- include: [
1550
- "src/**/*.ts",
1551
- "src/**/*.js"
1552
- ],
1553
- exclude: [
1554
- "jest.config.ts",
1555
- "src/**/*.spec.ts",
1556
- "src/**/*.test.ts"
1557
- ]
1784
+ include: ["src/**/*.ts", "src/**/*.js"],
1785
+ exclude: ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"]
1558
1786
  });
1559
1787
  }
1560
1788
  await formatFiles(tree);
1561
1789
  return null;
1562
1790
  }
1563
- __name(typeScriptLibraryGeneratorFn, "typeScriptLibraryGeneratorFn");
1564
1791
  function getOutputPath(options) {
1565
- const parts = [
1566
- "dist"
1567
- ];
1792
+ const parts = ["dist"];
1568
1793
  if (options.projectRoot === ".") {
1569
1794
  parts.push(options.name);
1570
1795
  } else {
@@ -1572,7 +1797,6 @@ function getOutputPath(options) {
1572
1797
  }
1573
1798
  return joinPaths(...parts);
1574
1799
  }
1575
- __name(getOutputPath, "getOutputPath");
1576
1800
  function createProjectTsConfigJson(tree, options) {
1577
1801
  const tsconfig = {
1578
1802
  extends: options.rootProject ? void 0 : getRelativePathToRootTsConfig(tree, options.projectRoot),
@@ -1583,9 +1807,7 @@ function createProjectTsConfigJson(tree, options) {
1583
1807
  noEmit: true,
1584
1808
  ...options?.tsconfigOptions?.compilerOptions ?? {}
1585
1809
  },
1586
- files: [
1587
- ...options?.tsconfigOptions?.files ?? []
1588
- ],
1810
+ files: [...options?.tsconfigOptions?.files ?? []],
1589
1811
  include: [
1590
1812
  ...options?.tsconfigOptions?.include ?? [],
1591
1813
  "src/**/*.ts",
@@ -1601,7 +1823,6 @@ function createProjectTsConfigJson(tree, options) {
1601
1823
  };
1602
1824
  writeJson(tree, joinPaths(options.projectRoot, "tsconfig.json"), tsconfig);
1603
1825
  }
1604
- __name(createProjectTsConfigJson, "createProjectTsConfigJson");
1605
1826
  async function normalizeOptions(tree, options, config) {
1606
1827
  let importPath = options.importPath;
1607
1828
  if (!importPath && config?.namespace) {
@@ -1609,7 +1830,9 @@ async function normalizeOptions(tree, options, config) {
1609
1830
  }
1610
1831
  if (options.publishable) {
1611
1832
  if (!importPath) {
1612
- throw new Error(`For publishable libs you have to provide a proper "--importPath" which needs to be a valid npm package name (e.g. my-awesome-lib or @myorg/my-lib)`);
1833
+ throw new Error(
1834
+ `For publishable libs you have to provide a proper "--importPath" which needs to be a valid npm package name (e.g. my-awesome-lib or @myorg/my-lib)`
1835
+ );
1613
1836
  }
1614
1837
  }
1615
1838
  let bundler = "tsc";
@@ -1618,7 +1841,12 @@ async function normalizeOptions(tree, options, config) {
1618
1841
  }
1619
1842
  const { Linter } = ensurePackage("@nx/eslint", nxVersion);
1620
1843
  const rootProject = false;
1621
- const { projectName, names: projectNames, projectRoot, importPath: normalizedImportPath } = await determineProjectNameAndRootOptions(tree, {
1844
+ const {
1845
+ projectName,
1846
+ names: projectNames,
1847
+ projectRoot,
1848
+ importPath: normalizedImportPath
1849
+ } = await determineProjectNameAndRootOptions(tree, {
1622
1850
  name: options.name,
1623
1851
  projectType: "library",
1624
1852
  directory: options.directory,
@@ -1655,11 +1883,16 @@ async function normalizeOptions(tree, options, config) {
1655
1883
  shouldUseSwcJest: false
1656
1884
  };
1657
1885
  }
1658
- __name(normalizeOptions, "normalizeOptions");
1659
1886
 
1660
1887
  // ../workspace-tools/src/generators/browser-library/generator.ts
1661
1888
  async function browserLibraryGeneratorFn(tree, schema, config) {
1662
- const filesDir = joinPaths(__dirname, "src", "generators", "browser-library", "files");
1889
+ const filesDir = joinPaths(
1890
+ __dirname,
1891
+ "src",
1892
+ "generators",
1893
+ "browser-library",
1894
+ "files"
1895
+ );
1663
1896
  const tsLibraryGeneratorOptions = {
1664
1897
  buildExecutor: "@storm-software/workspace-tools:unbuild",
1665
1898
  platform: "browser",
@@ -1685,7 +1918,9 @@ async function browserLibraryGeneratorFn(tree, schema, config) {
1685
1918
  directory: schema.directory
1686
1919
  };
1687
1920
  const options = await normalizeOptions(tree, tsLibraryGeneratorOptions);
1688
- const { className, name, propertyName } = names2(options.projectNames.projectFileName);
1921
+ const { className, name, propertyName } = names2(
1922
+ options.projectNames.projectFileName
1923
+ );
1689
1924
  generateFiles(tree, filesDir, options.projectRoot, {
1690
1925
  ...schema,
1691
1926
  dot: ".",
@@ -1716,55 +1951,88 @@ async function browserLibraryGeneratorFn(tree, schema, config) {
1716
1951
  await formatFiles2(tree);
1717
1952
  return null;
1718
1953
  }
1719
- __name(browserLibraryGeneratorFn, "browserLibraryGeneratorFn");
1720
- var generator_default = withRunGenerator("TypeScript Library Creator (Browser Platform)", browserLibraryGeneratorFn, {
1721
- hooks: {
1722
- applyDefaultOptions: /* @__PURE__ */ __name((options) => {
1723
- options.description ??= "A library used by Storm Software to support browser applications";
1724
- options.platform ??= "browser";
1725
- return options;
1726
- }, "applyDefaultOptions")
1954
+ var generator_default = withRunGenerator(
1955
+ "TypeScript Library Creator (Browser Platform)",
1956
+ browserLibraryGeneratorFn,
1957
+ {
1958
+ hooks: {
1959
+ applyDefaultOptions: (options) => {
1960
+ options.description ??= "A library used by Storm Software to support browser applications";
1961
+ options.platform ??= "browser";
1962
+ return options;
1963
+ }
1964
+ }
1727
1965
  }
1728
- });
1966
+ );
1729
1967
 
1730
1968
  // ../workspace-tools/src/generators/config-schema/generator.ts
1731
1969
  import { formatFiles as formatFiles3, writeJson as writeJson2 } from "@nx/devkit";
1732
1970
  import { zodToJsonSchema } from "zod-to-json-schema";
1733
1971
  async function configSchemaGeneratorFn(tree, options, config) {
1734
- writeInfo("\u{1F4E6} Running Storm Workspace Configuration JSON Schema generator", config);
1735
- writeTrace(`Determining the Storm Workspace Configuration JSON Schema...`, config);
1972
+ writeInfo(
1973
+ "\u{1F4E6} Running Storm Workspace Configuration JSON Schema generator",
1974
+ config
1975
+ );
1976
+ writeTrace(
1977
+ `Determining the Storm Workspace Configuration JSON Schema...`,
1978
+ config
1979
+ );
1736
1980
  const jsonSchema = zodToJsonSchema(stormWorkspaceConfigSchema, {
1737
1981
  name: "StormWorkspaceConfiguration"
1738
1982
  });
1739
1983
  writeTrace(jsonSchema, config);
1740
- const outputPath = options.outputFile.replaceAll("{workspaceRoot}", "").replaceAll(config?.workspaceRoot ?? findWorkspaceRoot(), options.outputFile?.startsWith("./") ? "" : "./");
1741
- writeTrace(`\u{1F4DD} Writing Storm Configuration JSON Schema to "${outputPath}"`, config);
1742
- writeJson2(tree, outputPath, jsonSchema, {
1743
- spaces: 2
1744
- });
1984
+ const outputPath = options.outputFile.replaceAll("{workspaceRoot}", "").replaceAll(
1985
+ config?.workspaceRoot ?? findWorkspaceRoot(),
1986
+ options.outputFile?.startsWith("./") ? "" : "./"
1987
+ );
1988
+ writeTrace(
1989
+ `\u{1F4DD} Writing Storm Configuration JSON Schema to "${outputPath}"`,
1990
+ config
1991
+ );
1992
+ writeJson2(tree, outputPath, jsonSchema, { spaces: 2 });
1745
1993
  await formatFiles3(tree);
1746
- writeSuccess("\u{1F680} Storm Configuration JSON Schema creation has completed successfully!", config);
1994
+ writeSuccess(
1995
+ "\u{1F680} Storm Configuration JSON Schema creation has completed successfully!",
1996
+ config
1997
+ );
1747
1998
  return {
1748
1999
  success: true
1749
2000
  };
1750
2001
  }
1751
- __name(configSchemaGeneratorFn, "configSchemaGeneratorFn");
1752
- var generator_default2 = withRunGenerator("Configuration Schema Creator", configSchemaGeneratorFn, {
1753
- hooks: {
1754
- applyDefaultOptions: /* @__PURE__ */ __name((options) => {
1755
- options.outputFile ??= "{workspaceRoot}/storm-workspace.schema.json";
1756
- return options;
1757
- }, "applyDefaultOptions")
2002
+ var generator_default2 = withRunGenerator(
2003
+ "Configuration Schema Creator",
2004
+ configSchemaGeneratorFn,
2005
+ {
2006
+ hooks: {
2007
+ applyDefaultOptions: (options) => {
2008
+ options.outputFile ??= "{workspaceRoot}/storm-workspace.schema.json";
2009
+ return options;
2010
+ }
2011
+ }
1758
2012
  }
1759
- });
2013
+ );
1760
2014
 
1761
2015
  // ../workspace-tools/src/generators/init/init.ts
1762
- import { addDependenciesToPackageJson as addDependenciesToPackageJson2, formatFiles as formatFiles4 } from "@nx/devkit";
2016
+ import {
2017
+ addDependenciesToPackageJson as addDependenciesToPackageJson2,
2018
+ formatFiles as formatFiles4
2019
+ } from "@nx/devkit";
1763
2020
 
1764
2021
  // ../workspace-tools/src/generators/neutral-library/generator.ts
1765
- import { formatFiles as formatFiles5, generateFiles as generateFiles2, names as names3, offsetFromRoot as offsetFromRoot3 } from "@nx/devkit";
2022
+ import {
2023
+ formatFiles as formatFiles5,
2024
+ generateFiles as generateFiles2,
2025
+ names as names3,
2026
+ offsetFromRoot as offsetFromRoot3
2027
+ } from "@nx/devkit";
1766
2028
  async function neutralLibraryGeneratorFn(tree, schema, config) {
1767
- const filesDir = joinPaths(__dirname, "src", "generators", "neutral-library", "files");
2029
+ const filesDir = joinPaths(
2030
+ __dirname,
2031
+ "src",
2032
+ "generators",
2033
+ "neutral-library",
2034
+ "files"
2035
+ );
1768
2036
  const tsLibraryGeneratorOptions = {
1769
2037
  ...schema,
1770
2038
  platform: "neutral",
@@ -1772,7 +2040,9 @@ async function neutralLibraryGeneratorFn(tree, schema, config) {
1772
2040
  buildExecutor: "@storm-software/workspace-tools:unbuild"
1773
2041
  };
1774
2042
  const options = await normalizeOptions(tree, tsLibraryGeneratorOptions);
1775
- const { className, name, propertyName } = names3(options.projectNames.projectFileName);
2043
+ const { className, name, propertyName } = names3(
2044
+ options.projectNames.projectFileName
2045
+ );
1776
2046
  generateFiles2(tree, filesDir, options.projectRoot, {
1777
2047
  ...schema,
1778
2048
  dot: ".",
@@ -1793,21 +2063,35 @@ async function neutralLibraryGeneratorFn(tree, schema, config) {
1793
2063
  await formatFiles5(tree);
1794
2064
  return null;
1795
2065
  }
1796
- __name(neutralLibraryGeneratorFn, "neutralLibraryGeneratorFn");
1797
- var generator_default3 = withRunGenerator("TypeScript Library Creator (Neutral Platform)", neutralLibraryGeneratorFn, {
1798
- hooks: {
1799
- applyDefaultOptions: /* @__PURE__ */ __name((options) => {
1800
- options.description ??= "A library used by Storm Software to support either browser or NodeJs applications";
1801
- options.platform = "neutral";
1802
- return options;
1803
- }, "applyDefaultOptions")
2066
+ var generator_default3 = withRunGenerator(
2067
+ "TypeScript Library Creator (Neutral Platform)",
2068
+ neutralLibraryGeneratorFn,
2069
+ {
2070
+ hooks: {
2071
+ applyDefaultOptions: (options) => {
2072
+ options.description ??= "A library used by Storm Software to support either browser or NodeJs applications";
2073
+ options.platform = "neutral";
2074
+ return options;
2075
+ }
2076
+ }
1804
2077
  }
1805
- });
2078
+ );
1806
2079
 
1807
2080
  // ../workspace-tools/src/generators/node-library/generator.ts
1808
- import { formatFiles as formatFiles6, generateFiles as generateFiles3, names as names4, offsetFromRoot as offsetFromRoot4 } from "@nx/devkit";
2081
+ import {
2082
+ formatFiles as formatFiles6,
2083
+ generateFiles as generateFiles3,
2084
+ names as names4,
2085
+ offsetFromRoot as offsetFromRoot4
2086
+ } from "@nx/devkit";
1809
2087
  async function nodeLibraryGeneratorFn(tree, schema, config) {
1810
- const filesDir = joinPaths(__dirname, "src", "generators", "node-library", "files");
2088
+ const filesDir = joinPaths(
2089
+ __dirname,
2090
+ "src",
2091
+ "generators",
2092
+ "node-library",
2093
+ "files"
2094
+ );
1811
2095
  const tsLibraryGeneratorOptions = {
1812
2096
  platform: "node",
1813
2097
  devDependencies: {
@@ -1840,19 +2124,29 @@ async function nodeLibraryGeneratorFn(tree, schema, config) {
1840
2124
  await formatFiles6(tree);
1841
2125
  return null;
1842
2126
  }
1843
- __name(nodeLibraryGeneratorFn, "nodeLibraryGeneratorFn");
1844
- var generator_default4 = withRunGenerator("TypeScript Library Creator (NodeJs Platform)", nodeLibraryGeneratorFn, {
1845
- hooks: {
1846
- applyDefaultOptions: /* @__PURE__ */ __name((options) => {
1847
- options.description ??= "A library used by Storm Software to support NodeJs applications";
1848
- options.platform ??= "node";
1849
- return options;
1850
- }, "applyDefaultOptions")
2127
+ var generator_default4 = withRunGenerator(
2128
+ "TypeScript Library Creator (NodeJs Platform)",
2129
+ nodeLibraryGeneratorFn,
2130
+ {
2131
+ hooks: {
2132
+ applyDefaultOptions: (options) => {
2133
+ options.description ??= "A library used by Storm Software to support NodeJs applications";
2134
+ options.platform ??= "node";
2135
+ return options;
2136
+ }
2137
+ }
1851
2138
  }
1852
- });
2139
+ );
1853
2140
 
1854
2141
  // ../workspace-tools/src/generators/preset/generator.ts
1855
- import { addDependenciesToPackageJson as addDependenciesToPackageJson3, addProjectConfiguration as addProjectConfiguration2, formatFiles as formatFiles7, generateFiles as generateFiles4, joinPathFragments as joinPathFragments4, updateJson as updateJson2 } from "@nx/devkit";
2142
+ import {
2143
+ addDependenciesToPackageJson as addDependenciesToPackageJson3,
2144
+ addProjectConfiguration as addProjectConfiguration2,
2145
+ formatFiles as formatFiles7,
2146
+ generateFiles as generateFiles4,
2147
+ joinPathFragments as joinPathFragments4,
2148
+ updateJson as updateJson2
2149
+ } from "@nx/devkit";
1856
2150
  import * as path4 from "node:path";
1857
2151
  async function presetGeneratorFn(tree, options) {
1858
2152
  const projectRoot = ".";
@@ -2067,14 +2361,30 @@ async function presetGeneratorFn(tree, options) {
2067
2361
  "nx-cloud": "latest"
2068
2362
  };
2069
2363
  }
2070
- await Promise.resolve(addDependenciesToPackageJson3(tree, dependencies, {}, joinPathFragments4(projectRoot, "package.json")));
2364
+ await Promise.resolve(
2365
+ addDependenciesToPackageJson3(
2366
+ tree,
2367
+ dependencies,
2368
+ {},
2369
+ joinPathFragments4(projectRoot, "package.json")
2370
+ )
2371
+ );
2071
2372
  return null;
2072
2373
  }
2073
- __name(presetGeneratorFn, "presetGeneratorFn");
2074
- var generator_default5 = withRunGenerator("Storm Workspace Preset Generator", presetGeneratorFn);
2374
+ var generator_default5 = withRunGenerator(
2375
+ "Storm Workspace Preset Generator",
2376
+ presetGeneratorFn
2377
+ );
2075
2378
 
2076
2379
  // ../workspace-tools/src/generators/release-version/generator.ts
2077
- import { formatFiles as formatFiles8, joinPathFragments as joinPathFragments5, output, readJson as readJson2, updateJson as updateJson3, writeJson as writeJson3 } from "@nx/devkit";
2380
+ import {
2381
+ formatFiles as formatFiles8,
2382
+ joinPathFragments as joinPathFragments5,
2383
+ output,
2384
+ readJson as readJson2,
2385
+ updateJson as updateJson3,
2386
+ writeJson as writeJson3
2387
+ } from "@nx/devkit";
2078
2388
  import { resolveLocalPackageDependencies as resolveLocalPackageJsonDependencies } from "@nx/js/src/generators/release-version/utils/resolve-local-package-dependencies";
2079
2389
  import { updateLockFile } from "@nx/js/src/release/utils/update-lock-file";
2080
2390
 
@@ -2213,7 +2523,9 @@ var DEFAULT_COMMIT_QUESTIONS = {
2213
2523
  type: "select",
2214
2524
  title: "Commit Type",
2215
2525
  description: "Select the commit type that best describes your changes",
2216
- enum: Object.keys(DEFAULT_COMMIT_TYPES).filter((type) => DEFAULT_COMMIT_TYPES[type].hidden !== true).reduce((ret, type) => {
2526
+ enum: Object.keys(DEFAULT_COMMIT_TYPES).filter(
2527
+ (type) => DEFAULT_COMMIT_TYPES[type].hidden !== true
2528
+ ).reduce((ret, type) => {
2217
2529
  ret[type] = DEFAULT_COMMIT_TYPES[type];
2218
2530
  return ret;
2219
2531
  }, {}),
@@ -2253,7 +2565,7 @@ var DEFAULT_COMMIT_QUESTIONS = {
2253
2565
  type: "input",
2254
2566
  title: "Breaking Changes (Details)",
2255
2567
  description: "A BREAKING CHANGE commit requires a body. Please enter a longer description of the commit itself",
2256
- when: /* @__PURE__ */ __name((answers) => answers.isBreaking === true, "when"),
2568
+ when: (answers) => answers.isBreaking === true,
2257
2569
  maxLength: 600,
2258
2570
  minLength: 3
2259
2571
  },
@@ -2267,26 +2579,29 @@ var DEFAULT_COMMIT_QUESTIONS = {
2267
2579
  type: "input",
2268
2580
  title: "Open Issue Affected (Details)",
2269
2581
  description: "If issues are closed, the commit requires a body. Please enter a longer description of the commit itself",
2270
- when: /* @__PURE__ */ __name((answers) => answers.isIssueAffected === true, "when"),
2582
+ when: (answers) => answers.isIssueAffected === true,
2271
2583
  maxLength: 600,
2272
2584
  minLength: 3
2273
2585
  }
2274
2586
  };
2275
- var RuleConfigSeverity;
2276
- (function(RuleConfigSeverity2) {
2277
- RuleConfigSeverity2[RuleConfigSeverity2["Disabled"] = 0] = "Disabled";
2278
- RuleConfigSeverity2[RuleConfigSeverity2["Warning"] = 1] = "Warning";
2279
- RuleConfigSeverity2[RuleConfigSeverity2["Error"] = 2] = "Error";
2280
- })(RuleConfigSeverity || (RuleConfigSeverity = {}));
2281
2587
 
2282
2588
  // ../workspace-tools/src/generators/release-version/generator.ts
2283
2589
  import { exec, execSync as execSync4 } from "node:child_process";
2284
2590
  import { relative as relative3 } from "node:path";
2285
2591
  import { IMPLICIT_DEFAULT_RELEASE_GROUP } from "nx/src/command-line/release/config/config";
2286
- import { getFirstGitCommit, getLatestGitTagForPattern } from "nx/src/command-line/release/utils/git";
2287
- import { resolveSemverSpecifierFromConventionalCommits, resolveSemverSpecifierFromPrompt } from "nx/src/command-line/release/utils/resolve-semver-specifier";
2592
+ import {
2593
+ getFirstGitCommit,
2594
+ getLatestGitTagForPattern
2595
+ } from "nx/src/command-line/release/utils/git";
2596
+ import {
2597
+ resolveSemverSpecifierFromConventionalCommits,
2598
+ resolveSemverSpecifierFromPrompt
2599
+ } from "nx/src/command-line/release/utils/resolve-semver-specifier";
2288
2600
  import { isValidSemverSpecifier } from "nx/src/command-line/release/utils/semver";
2289
- import { deriveNewSemverVersion, validReleaseVersionPrefixes } from "nx/src/command-line/release/version-legacy";
2601
+ import {
2602
+ deriveNewSemverVersion,
2603
+ validReleaseVersionPrefixes
2604
+ } from "nx/src/command-line/release/version-legacy";
2290
2605
  import { interpolate } from "nx/src/tasks-runner/utils";
2291
2606
  import { prerelease } from "semver";
2292
2607
 
@@ -2348,11 +2663,7 @@ var cargo_base_executor_untyped_default = defineUntypedSchema3({
2348
2663
  $schema: {
2349
2664
  title: "Toolchain",
2350
2665
  description: "The type of toolchain to use for the build",
2351
- enum: [
2352
- "stable",
2353
- "beta",
2354
- "nightly"
2355
- ],
2666
+ enum: ["stable", "beta", "nightly"],
2356
2667
  default: "stable"
2357
2668
  },
2358
2669
  $default: "stable"
@@ -2390,17 +2701,7 @@ var cargo_base_executor_untyped_default = defineUntypedSchema3({
2390
2701
  title: "Features",
2391
2702
  type: "string",
2392
2703
  description: "The features to build",
2393
- oneOf: [
2394
- {
2395
- type: "string"
2396
- },
2397
- {
2398
- type: "array",
2399
- items: {
2400
- type: "string"
2401
- }
2402
- }
2403
- ]
2704
+ oneOf: [{ type: "string" }, { type: "array", items: { type: "string" } }]
2404
2705
  }
2405
2706
  },
2406
2707
  allFeatures: {
@@ -2420,10 +2721,7 @@ var typescript_build_executor_untyped_default = defineUntypedSchema4({
2420
2721
  id: "TypeScriptBuildExecutorSchema",
2421
2722
  title: "TypeScript Build Executor",
2422
2723
  description: "A type definition for the base TypeScript build executor schema",
2423
- required: [
2424
- "entry",
2425
- "tsconfig"
2426
- ]
2724
+ required: ["entry", "tsconfig"]
2427
2725
  },
2428
2726
  entry: {
2429
2727
  $schema: {
@@ -2431,13 +2729,9 @@ var typescript_build_executor_untyped_default = defineUntypedSchema4({
2431
2729
  format: "path",
2432
2730
  type: "array",
2433
2731
  description: "The entry file or files to build",
2434
- items: {
2435
- type: "string"
2436
- }
2732
+ items: { type: "string" }
2437
2733
  },
2438
- $default: [
2439
- "{sourceRoot}/index.ts"
2440
- ]
2734
+ $default: ["{sourceRoot}/index.ts"]
2441
2735
  },
2442
2736
  tsconfig: {
2443
2737
  $schema: {
@@ -2517,7 +2811,7 @@ var typescript_build_executor_untyped_default = defineUntypedSchema4({
2517
2811
  ]
2518
2812
  },
2519
2813
  $default: "esnext",
2520
- $resolve: /* @__PURE__ */ __name((val = "esnext") => val.toLowerCase(), "$resolve")
2814
+ $resolve: (val = "esnext") => val.toLowerCase()
2521
2815
  },
2522
2816
  format: {
2523
2817
  $schema: {
@@ -2526,28 +2820,17 @@ var typescript_build_executor_untyped_default = defineUntypedSchema4({
2526
2820
  description: "The format to build",
2527
2821
  items: {
2528
2822
  type: "string",
2529
- enum: [
2530
- "cjs",
2531
- "esm",
2532
- "iife"
2533
- ]
2823
+ enum: ["cjs", "esm", "iife"]
2534
2824
  }
2535
2825
  },
2536
- $resolve: /* @__PURE__ */ __name((val = [
2537
- "cjs",
2538
- "esm"
2539
- ]) => [].concat(val), "$resolve")
2826
+ $resolve: (val = ["cjs", "esm"]) => [].concat(val)
2540
2827
  },
2541
2828
  platform: {
2542
2829
  $schema: {
2543
2830
  title: "Platform",
2544
2831
  type: "string",
2545
2832
  description: "The platform to build",
2546
- enum: [
2547
- "neutral",
2548
- "node",
2549
- "browser"
2550
- ]
2833
+ enum: ["neutral", "node", "browser"]
2551
2834
  },
2552
2835
  $default: "neutral"
2553
2836
  },
@@ -2557,7 +2840,7 @@ var typescript_build_executor_untyped_default = defineUntypedSchema4({
2557
2840
  type: "array",
2558
2841
  description: "The external dependencies"
2559
2842
  },
2560
- $resolve: /* @__PURE__ */ __name((val = []) => [].concat(val), "$resolve")
2843
+ $resolve: (val = []) => [].concat(val)
2561
2844
  },
2562
2845
  define: {
2563
2846
  $schema: {
@@ -2566,7 +2849,7 @@ var typescript_build_executor_untyped_default = defineUntypedSchema4({
2566
2849
  tsType: "Record<string, string>",
2567
2850
  description: "The define values"
2568
2851
  },
2569
- $resolve: /* @__PURE__ */ __name((val = {}) => val, "$resolve"),
2852
+ $resolve: (val = {}) => val,
2570
2853
  $default: {}
2571
2854
  },
2572
2855
  env: {
@@ -2576,7 +2859,7 @@ var typescript_build_executor_untyped_default = defineUntypedSchema4({
2576
2859
  tsType: "Record<string, string>",
2577
2860
  description: "The environment variable values"
2578
2861
  },
2579
- $resolve: /* @__PURE__ */ __name((val = {}) => val, "$resolve"),
2862
+ $resolve: (val = {}) => val,
2580
2863
  $default: {}
2581
2864
  }
2582
2865
  });
@@ -2589,10 +2872,7 @@ var typescript_library_generator_untyped_default = defineUntypedSchema5({
2589
2872
  id: "TypeScriptLibraryGeneratorSchema",
2590
2873
  title: "TypeScript Library Generator",
2591
2874
  description: "A type definition for the base TypeScript Library Generator schema",
2592
- required: [
2593
- "directory",
2594
- "name"
2595
- ]
2875
+ required: ["directory", "name"]
2596
2876
  },
2597
2877
  name: {
2598
2878
  $schema: {
@@ -2621,12 +2901,7 @@ var typescript_library_generator_untyped_default = defineUntypedSchema5({
2621
2901
  title: "Platform",
2622
2902
  type: "string",
2623
2903
  description: "The platform to target with the library",
2624
- enum: [
2625
- "neutral",
2626
- "node",
2627
- "worker",
2628
- "browser"
2629
- ]
2904
+ enum: ["neutral", "node", "worker", "browser"]
2630
2905
  },
2631
2906
  $default: "neutral"
2632
2907
  },
@@ -2648,11 +2923,7 @@ var typescript_library_generator_untyped_default = defineUntypedSchema5({
2648
2923
  $schema: {
2649
2924
  title: "Unit Test Runner",
2650
2925
  type: "string",
2651
- enum: [
2652
- "jest",
2653
- "vitest",
2654
- "none"
2655
- ],
2926
+ enum: ["jest", "vitest", "none"],
2656
2927
  description: "The unit test runner to use"
2657
2928
  }
2658
2929
  },
@@ -2660,10 +2931,7 @@ var typescript_library_generator_untyped_default = defineUntypedSchema5({
2660
2931
  $schema: {
2661
2932
  title: "Test Environment",
2662
2933
  type: "string",
2663
- enum: [
2664
- "jsdom",
2665
- "node"
2666
- ],
2934
+ enum: ["jsdom", "node"],
2667
2935
  description: "The test environment to use"
2668
2936
  }
2669
2937
  },
@@ -2705,12 +2973,25 @@ var typescript_library_generator_untyped_default = defineUntypedSchema5({
2705
2973
  import { retrieveProjectConfigurationsWithoutPluginInference } from "nx/src/project-graph/utils/retrieve-workspace-files";
2706
2974
 
2707
2975
  // ../workspace-tools/src/utils/lock-file.ts
2708
- import { output as output2, readJsonFile, workspaceRoot as workspaceRoot2 } from "@nx/devkit";
2976
+ import {
2977
+ output as output2,
2978
+ readJsonFile,
2979
+ workspaceRoot as workspaceRoot2
2980
+ } from "@nx/devkit";
2709
2981
  import { existsSync as existsSync6 } from "node:fs";
2710
2982
  import { join as join2 } from "node:path";
2711
- import { getNpmLockfileDependencies, getNpmLockfileNodes } from "nx/src/plugins/js/lock-file/npm-parser";
2712
- import { getPnpmLockfileDependencies, getPnpmLockfileNodes } from "nx/src/plugins/js/lock-file/pnpm-parser";
2713
- import { getYarnLockfileDependencies, getYarnLockfileNodes } from "nx/src/plugins/js/lock-file/yarn-parser";
2983
+ import {
2984
+ getNpmLockfileDependencies,
2985
+ getNpmLockfileNodes
2986
+ } from "nx/src/plugins/js/lock-file/npm-parser";
2987
+ import {
2988
+ getPnpmLockfileDependencies,
2989
+ getPnpmLockfileNodes
2990
+ } from "nx/src/plugins/js/lock-file/pnpm-parser";
2991
+ import {
2992
+ getYarnLockfileDependencies,
2993
+ getYarnLockfileNodes
2994
+ } from "nx/src/plugins/js/lock-file/yarn-parser";
2714
2995
  var YARN_LOCK_FILE = "yarn.lock";
2715
2996
  var NPM_LOCK_FILE = "package-lock.json";
2716
2997
  var PNPM_LOCK_FILE = "pnpm-lock.yaml";