@storm-software/cloudflare-tools 0.55.64 → 0.55.66

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 (46) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +1 -1
  3. package/dist/{chunk-HBBHWDJS.mjs → chunk-2FAHL7XD.mjs} +11 -3
  4. package/dist/{chunk-CI3G746G.mjs → chunk-3RLBM7SP.mjs} +1 -1
  5. package/dist/{chunk-H3FNUUB5.js → chunk-4O3YATGZ.js} +289 -1157
  6. package/dist/{chunk-4FV3KOBI.mjs → chunk-4XAH2R5U.mjs} +9 -7
  7. package/dist/{chunk-RGBGVGWZ.mjs → chunk-5VCVZQT4.mjs} +2 -2
  8. package/dist/{chunk-MLJ3OSJX.js → chunk-6B5PUF7X.js} +24 -18
  9. package/dist/{chunk-PG2M24AG.mjs → chunk-AMOQ2QRI.mjs} +210 -1078
  10. package/dist/{chunk-ZYEYSCDM.js → chunk-ENYRBMQC.js} +12 -12
  11. package/dist/{chunk-VQLLSEHB.mjs → chunk-IEYD3WT2.mjs} +1 -1
  12. package/dist/{chunk-ITJMNVMG.mjs → chunk-IGW2CIUT.mjs} +2 -2
  13. package/dist/{chunk-XFPT4O23.js → chunk-IVLCYFXD.js} +50 -42
  14. package/dist/{chunk-SSSAGTTW.mjs → chunk-LEJPLULT.mjs} +1 -6
  15. package/dist/{chunk-UBEHQVYS.js → chunk-QGRENI3O.js} +3 -3
  16. package/dist/{chunk-6RVDU4NC.mjs → chunk-QWFEAV3X.mjs} +4 -4
  17. package/dist/{chunk-EGSNPA63.js → chunk-U4CFTRNN.js} +8 -6
  18. package/dist/{chunk-TEEOPHLZ.js → chunk-V7LBWOVV.js} +1 -6
  19. package/dist/{chunk-C3CWFFYT.mjs → chunk-W2PVKWMH.mjs} +14 -8
  20. package/dist/executors.js +5 -5
  21. package/dist/executors.mjs +8 -8
  22. package/dist/generators.js +5 -5
  23. package/dist/generators.mjs +5 -5
  24. package/dist/index.js +8 -8
  25. package/dist/index.mjs +10 -10
  26. package/dist/src/executors/cloudflare-publish/executor.js +3 -3
  27. package/dist/src/executors/cloudflare-publish/executor.mjs +6 -6
  28. package/dist/src/executors/r2-upload-publish/executor.js +5 -5
  29. package/dist/src/executors/r2-upload-publish/executor.mjs +6 -6
  30. package/dist/src/executors/serve/executor.d.mts +2 -1300
  31. package/dist/src/executors/serve/executor.d.ts +2 -1300
  32. package/dist/src/executors/serve/executor.js +4 -4
  33. package/dist/src/executors/serve/executor.mjs +5 -5
  34. package/dist/src/generators/init/generator.js +2 -2
  35. package/dist/src/generators/init/generator.mjs +2 -2
  36. package/dist/src/generators/worker/generator.js +5 -5
  37. package/dist/src/generators/worker/generator.mjs +5 -5
  38. package/dist/src/utils/index.js +3 -3
  39. package/dist/src/utils/index.mjs +3 -3
  40. package/dist/src/utils/r2-bucket-helpers.js +3 -3
  41. package/dist/src/utils/r2-bucket-helpers.mjs +3 -3
  42. package/dist/tsup.config.d.mts +3 -3
  43. package/dist/tsup.config.d.ts +3 -3
  44. package/dist/tsup.config.js +2 -1
  45. package/dist/tsup.config.mjs +3 -2
  46. package/package.json +8 -9
@@ -1,11 +1,11 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
3
 
4
4
  var _chunkVTHBMY4Bjs = require('./chunk-VTHBMY4B.js');
5
5
 
6
6
 
7
- var _chunkXFPT4O23js = require('./chunk-XFPT4O23.js');
8
7
 
8
+ var _chunkIVLCYFXDjs = require('./chunk-IVLCYFXD.js');
9
9
 
10
10
 
11
11
 
@@ -19,8 +19,7 @@ var _chunkXFPT4O23js = require('./chunk-XFPT4O23.js');
19
19
 
20
20
 
21
21
 
22
-
23
- var _chunkTEEOPHLZjs = require('./chunk-TEEOPHLZ.js');
22
+ var _chunkV7LBWOVVjs = require('./chunk-V7LBWOVV.js');
24
23
 
25
24
 
26
25
 
@@ -53,7 +52,7 @@ var applyWorkspaceBaseTokens = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void
53
52
  }
54
53
  }
55
54
  if (result.includes("{workspaceRoot}")) {
56
- result = result.replaceAll("{workspaceRoot}", _nullishCoalesce(_nullishCoalesce(tokenParams.workspaceRoot, () => ( _optionalChain([tokenParams, 'access', _3 => _3.config, 'optionalAccess', _4 => _4.workspaceRoot]))), () => ( _chunkTEEOPHLZjs.findWorkspaceRoot.call(void 0, ))));
55
+ result = result.replaceAll("{workspaceRoot}", _nullishCoalesce(_nullishCoalesce(tokenParams.workspaceRoot, () => ( _optionalChain([tokenParams, 'access', _3 => _3.config, 'optionalAccess', _4 => _4.workspaceRoot]))), () => ( _chunkV7LBWOVVjs.findWorkspaceRoot.call(void 0, ))));
57
56
  }
58
57
  return result;
59
58
  }, "applyWorkspaceBaseTokens");
@@ -79,57 +78,38 @@ var applyWorkspaceTokens = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0,
79
78
  return result;
80
79
  }, "applyWorkspaceTokens");
81
80
 
82
- // ../config-tools/src/utilities/run.ts
83
- var _child_process = require('child_process');
84
- var LARGE_BUFFER = 1024 * 1e6;
85
- var run = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (config, command, cwd = _nullishCoalesce(config.workspaceRoot, () => ( process.cwd())), stdio = "inherit", env = process.env) => {
86
- return _child_process.execSync.call(void 0, command, {
87
- cwd,
88
- env: {
89
- ...process.env,
90
- ...env,
91
- CLICOLOR: "true",
92
- FORCE_COLOR: "true"
93
- },
94
- windowsHide: true,
95
- stdio,
96
- maxBuffer: LARGE_BUFFER,
97
- killSignal: "SIGTERM"
98
- });
99
- }, "run");
100
-
101
81
  // ../workspace-tools/src/base/base-executor.ts
102
82
  var _defu = require('defu'); var _defu2 = _interopRequireDefault(_defu);
103
- var withRunExecutor = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (name, executorFn, executorOptions = {}) => async (_options, context2) => {
104
- const stopwatch = _chunkTEEOPHLZjs.getStopwatch.call(void 0, name);
83
+ var withRunExecutor = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (name, executorFn, executorOptions = {}) => async (_options, context) => {
84
+ const stopwatch = _chunkV7LBWOVVjs.getStopwatch.call(void 0, name);
105
85
  let options = _options;
106
86
  let config = {};
107
87
  try {
108
- if (!_optionalChain([context2, 'access', _5 => _5.projectsConfigurations, 'optionalAccess', _6 => _6.projects]) || !context2.projectName || !context2.projectsConfigurations.projects[context2.projectName]) {
88
+ if (!_optionalChain([context, 'access', _5 => _5.projectsConfigurations, 'optionalAccess', _6 => _6.projects]) || !context.projectName || !context.projectsConfigurations.projects[context.projectName]) {
109
89
  throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace.");
110
90
  }
111
- const workspaceRoot3 = _chunkTEEOPHLZjs.findWorkspaceRoot.call(void 0, );
112
- const projectRoot = context2.projectsConfigurations.projects[context2.projectName].root || workspaceRoot3;
113
- const sourceRoot = context2.projectsConfigurations.projects[context2.projectName].sourceRoot || projectRoot || workspaceRoot3;
114
- const projectName = context2.projectName;
91
+ const workspaceRoot3 = _chunkV7LBWOVVjs.findWorkspaceRoot.call(void 0, );
92
+ const projectRoot = context.projectsConfigurations.projects[context.projectName].root || workspaceRoot3;
93
+ const sourceRoot = context.projectsConfigurations.projects[context.projectName].sourceRoot || projectRoot || workspaceRoot3;
94
+ const projectName = context.projectName;
115
95
  config.workspaceRoot = workspaceRoot3;
116
- _chunkTEEOPHLZjs.writeInfo.call(void 0, `\u26A1 Running the ${name} executor for ${projectName} `, config);
96
+ _chunkV7LBWOVVjs.writeInfo.call(void 0, `\u26A1 Running the ${name} executor for ${projectName} `, config);
117
97
  if (!executorOptions.skipReadingConfig) {
118
- _chunkTEEOPHLZjs.writeTrace.call(void 0, `Loading the Storm Config from environment variables and storm.config.js file...
98
+ _chunkV7LBWOVVjs.writeTrace.call(void 0, `Loading the Storm Config from environment variables and storm.config.js file...
119
99
  - workspaceRoot: ${workspaceRoot3}
120
100
  - projectRoot: ${projectRoot}
121
101
  - sourceRoot: ${sourceRoot}
122
102
  - projectName: ${projectName}
123
103
  `, config);
124
- config = await _chunkXFPT4O23js.getConfig.call(void 0, workspaceRoot3);
104
+ config = await _chunkIVLCYFXDjs.getConfig.call(void 0, workspaceRoot3);
125
105
  }
126
106
  if (_optionalChain([executorOptions, 'optionalAccess', _7 => _7.hooks, 'optionalAccess', _8 => _8.applyDefaultOptions])) {
127
- _chunkTEEOPHLZjs.writeDebug.call(void 0, "Running the applyDefaultOptions hook...", config);
107
+ _chunkV7LBWOVVjs.writeDebug.call(void 0, "Running the applyDefaultOptions hook...", config);
128
108
  options = await Promise.resolve(executorOptions.hooks.applyDefaultOptions(options, config));
129
- _chunkTEEOPHLZjs.writeDebug.call(void 0, "Completed the applyDefaultOptions hook", config);
109
+ _chunkV7LBWOVVjs.writeDebug.call(void 0, "Completed the applyDefaultOptions hook", config);
130
110
  }
131
- _chunkTEEOPHLZjs.writeTrace.call(void 0, `Executor schema options \u2699\uFE0F
132
- ${_chunkTEEOPHLZjs.formatLogMessage.call(void 0, options)}
111
+ _chunkV7LBWOVVjs.writeTrace.call(void 0, `Executor schema options \u2699\uFE0F
112
+ ${_chunkV7LBWOVVjs.formatLogMessage.call(void 0, options)}
133
113
  `, config);
134
114
  const tokenized = await applyWorkspaceTokens(options, _defu.defu.call(void 0, {
135
115
  workspaceRoot: workspaceRoot3,
@@ -137,16 +117,16 @@ ${_chunkTEEOPHLZjs.formatLogMessage.call(void 0, options)}
137
117
  sourceRoot,
138
118
  projectName,
139
119
  config
140
- }, config, context2.projectsConfigurations.projects[context2.projectName]), applyWorkspaceProjectTokens);
141
- _chunkTEEOPHLZjs.writeTrace.call(void 0, `Executor schema tokenized options \u2699\uFE0F
142
- ${_chunkTEEOPHLZjs.formatLogMessage.call(void 0, tokenized)}
120
+ }, config, context.projectsConfigurations.projects[context.projectName]), applyWorkspaceProjectTokens);
121
+ _chunkV7LBWOVVjs.writeTrace.call(void 0, `Executor schema tokenized options \u2699\uFE0F
122
+ ${_chunkV7LBWOVVjs.formatLogMessage.call(void 0, tokenized)}
143
123
  `, config);
144
124
  if (_optionalChain([executorOptions, 'optionalAccess', _9 => _9.hooks, 'optionalAccess', _10 => _10.preProcess])) {
145
- _chunkTEEOPHLZjs.writeDebug.call(void 0, "Running the preProcess hook...", config);
125
+ _chunkV7LBWOVVjs.writeDebug.call(void 0, "Running the preProcess hook...", config);
146
126
  await Promise.resolve(executorOptions.hooks.preProcess(tokenized, config));
147
- _chunkTEEOPHLZjs.writeDebug.call(void 0, "Completed the preProcess hook", config);
127
+ _chunkV7LBWOVVjs.writeDebug.call(void 0, "Completed the preProcess hook", config);
148
128
  }
149
- const ret = executorFn(tokenized, context2, config);
129
+ const ret = executorFn(tokenized, context, config);
150
130
  if (_isFunction(_optionalChain([ret, 'optionalAccess', _11 => _11.next]))) {
151
131
  const asyncGen = ret;
152
132
  for await (const iter of asyncGen) {
@@ -155,26 +135,26 @@ ${_chunkTEEOPHLZjs.formatLogMessage.call(void 0, tokenized)}
155
135
  }
156
136
  const result = await Promise.resolve(ret);
157
137
  if (result && (!result.success || result.error && _optionalChain([result, 'optionalAccess', _12 => _12.error, 'optionalAccess', _13 => _13.message]) && typeof _optionalChain([result, 'optionalAccess', _14 => _14.error, 'optionalAccess', _15 => _15.message]) === "string" && _optionalChain([result, 'optionalAccess', _16 => _16.error, 'optionalAccess', _17 => _17.name]) && typeof _optionalChain([result, 'optionalAccess', _18 => _18.error, 'optionalAccess', _19 => _19.name]) === "string")) {
158
- _chunkTEEOPHLZjs.writeTrace.call(void 0, `Failure determined by the ${name} executor
159
- ${_chunkTEEOPHLZjs.formatLogMessage.call(void 0, result)}`, config);
138
+ _chunkV7LBWOVVjs.writeTrace.call(void 0, `Failure determined by the ${name} executor
139
+ ${_chunkV7LBWOVVjs.formatLogMessage.call(void 0, result)}`, config);
160
140
  console.error(result);
161
141
  throw new Error(`The ${name} executor failed to run`, {
162
142
  cause: _optionalChain([result, 'optionalAccess', _20 => _20.error])
163
143
  });
164
144
  }
165
145
  if (_optionalChain([executorOptions, 'optionalAccess', _21 => _21.hooks, 'optionalAccess', _22 => _22.postProcess])) {
166
- _chunkTEEOPHLZjs.writeDebug.call(void 0, "Running the postProcess hook...", config);
146
+ _chunkV7LBWOVVjs.writeDebug.call(void 0, "Running the postProcess hook...", config);
167
147
  await Promise.resolve(executorOptions.hooks.postProcess(config));
168
- _chunkTEEOPHLZjs.writeDebug.call(void 0, "Completed the postProcess hook", config);
148
+ _chunkV7LBWOVVjs.writeDebug.call(void 0, "Completed the postProcess hook", config);
169
149
  }
170
- _chunkTEEOPHLZjs.writeSuccess.call(void 0, `Completed running the ${name} task executor!
150
+ _chunkV7LBWOVVjs.writeSuccess.call(void 0, `Completed running the ${name} task executor!
171
151
  `, config);
172
152
  return {
173
153
  success: true
174
154
  };
175
155
  } catch (error) {
176
- _chunkTEEOPHLZjs.writeFatal.call(void 0, "A fatal error occurred while running the executor - the process was forced to terminate", config);
177
- _chunkTEEOPHLZjs.writeError.call(void 0, `An exception was thrown in the executor's process
156
+ _chunkV7LBWOVVjs.writeFatal.call(void 0, "A fatal error occurred while running the executor - the process was forced to terminate", config);
157
+ _chunkV7LBWOVVjs.writeError.call(void 0, `An exception was thrown in the executor's process
178
158
  - Details: ${error.message}
179
159
  - Stacktrace: ${error.stack}`, config);
180
160
  return {
@@ -194,8 +174,8 @@ var _isFunction = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (value) =
194
174
 
195
175
  // ../workspace-tools/src/utils/cargo.ts
196
176
  var _devkit = require('@nx/devkit');
197
-
198
- var _path = require('path'); var path6 = _interopRequireWildcard(_path);
177
+ var _child_process = require('child_process');
178
+ var _path = require('path'); var path3 = _interopRequireWildcard(_path);
199
179
  var INVALID_CARGO_ARGS = [
200
180
  "allFeatures",
201
181
  "allTargets",
@@ -204,7 +184,7 @@ var INVALID_CARGO_ARGS = [
204
184
  "package",
205
185
  "tsConfig"
206
186
  ];
207
- var buildCargoCommand = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (baseCommand, options, context2) => {
187
+ var buildCargoCommand = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (baseCommand, options, context) => {
208
188
  const args = [];
209
189
  if (options.toolchain && options.toolchain !== "stable") {
210
190
  args.push(`+${options.toolchain}`);
@@ -226,8 +206,8 @@ var buildCargoCommand = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (ba
226
206
  args.push(`--${key}`, String(value));
227
207
  }
228
208
  }
229
- if (context2.projectName) {
230
- args.push("-p", context2.projectName);
209
+ if (context.projectName) {
210
+ args.push("-p", context.projectName);
231
211
  }
232
212
  if (options.allFeatures && !args.includes("--all-features")) {
233
213
  args.push("--all-features");
@@ -319,8 +299,8 @@ function runProcess(processCmd, ...args) {
319
299
  _chunkJ5SB6L2Ljs.__name.call(void 0, runProcess, "runProcess");
320
300
 
321
301
  // ../workspace-tools/src/executors/cargo-build/executor.ts
322
- async function cargoBuildExecutor(options, context2) {
323
- const command = buildCargoCommand("build", options, context2);
302
+ async function cargoBuildExecutor(options, context) {
303
+ const command = buildCargoCommand("build", options, context);
324
304
  return await cargoCommand(...command);
325
305
  }
326
306
  _chunkJ5SB6L2Ljs.__name.call(void 0, cargoBuildExecutor, "cargoBuildExecutor");
@@ -336,8 +316,8 @@ var executor_default = withRunExecutor("Cargo Build", cargoBuildExecutor, {
336
316
  });
337
317
 
338
318
  // ../workspace-tools/src/executors/cargo-check/executor.ts
339
- async function cargoCheckExecutor(options, context2) {
340
- const command = buildCargoCommand("check", options, context2);
319
+ async function cargoCheckExecutor(options, context) {
320
+ const command = buildCargoCommand("check", options, context);
341
321
  return await cargoCommand(...command);
342
322
  }
343
323
  _chunkJ5SB6L2Ljs.__name.call(void 0, cargoCheckExecutor, "cargoCheckExecutor");
@@ -352,8 +332,8 @@ var executor_default2 = withRunExecutor("Cargo Check", cargoCheckExecutor, {
352
332
  });
353
333
 
354
334
  // ../workspace-tools/src/executors/cargo-clippy/executor.ts
355
- async function cargoClippyExecutor(options, context2) {
356
- const command = buildCargoCommand("clippy", options, context2);
335
+ async function cargoClippyExecutor(options, context) {
336
+ const command = buildCargoCommand("clippy", options, context);
357
337
  return await cargoCommand(...command);
358
338
  }
359
339
  _chunkJ5SB6L2Ljs.__name.call(void 0, cargoClippyExecutor, "cargoClippyExecutor");
@@ -369,13 +349,13 @@ var executor_default3 = withRunExecutor("Cargo Clippy", cargoClippyExecutor, {
369
349
  });
370
350
 
371
351
  // ../workspace-tools/src/executors/cargo-doc/executor.ts
372
- async function cargoDocExecutor(options, context2) {
352
+ async function cargoDocExecutor(options, context) {
373
353
  const opts = {
374
354
  ...options
375
355
  };
376
356
  opts["no-deps"] = opts.noDeps;
377
357
  delete opts.noDeps;
378
- const command = buildCargoCommand("doc", options, context2);
358
+ const command = buildCargoCommand("doc", options, context);
379
359
  return await cargoCommand(...command);
380
360
  }
381
361
  _chunkJ5SB6L2Ljs.__name.call(void 0, cargoDocExecutor, "cargoDocExecutor");
@@ -397,8 +377,8 @@ var executor_default4 = withRunExecutor("Cargo Doc", cargoDocExecutor, {
397
377
  });
398
378
 
399
379
  // ../workspace-tools/src/executors/cargo-format/executor.ts
400
- async function cargoFormatExecutor(options, context2) {
401
- const command = buildCargoCommand("fmt", options, context2);
380
+ async function cargoFormatExecutor(options, context) {
381
+ const command = buildCargoCommand("fmt", options, context);
402
382
  return await cargoCommand(...command);
403
383
  }
404
384
  _chunkJ5SB6L2Ljs.__name.call(void 0, cargoFormatExecutor, "cargoFormatExecutor");
@@ -418,7 +398,7 @@ var executor_default5 = withRunExecutor("Cargo Format", cargoFormatExecutor, {
418
398
 
419
399
  var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
420
400
  var _https = require('https'); var _https2 = _interopRequireDefault(_https);
421
- var LARGE_BUFFER2 = 1024 * 1e6;
401
+ var LARGE_BUFFER = 1024 * 1e6;
422
402
 
423
403
  // ../esbuild/src/build.ts
424
404
 
@@ -477,8 +457,8 @@ var copyAssets = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (con
477
457
  output: "src/"
478
458
  });
479
459
  }
480
- _chunkTEEOPHLZjs.writeTrace.call(void 0, `\u{1F4DD} Copying the following assets to the output directory:
481
- ${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${pendingAsset} -> ${outputPath}` : ` - ${pendingAsset.input}/${pendingAsset.glob} -> ${_chunkTEEOPHLZjs.joinPaths.call(void 0, outputPath, pendingAsset.output)}`).join("\n")}`, config);
460
+ _chunkV7LBWOVVjs.writeTrace.call(void 0, `\u{1F4DD} Copying the following assets to the output directory:
461
+ ${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${pendingAsset} -> ${outputPath}` : ` - ${pendingAsset.input}/${pendingAsset.glob} -> ${_chunkV7LBWOVVjs.joinPaths.call(void 0, outputPath, pendingAsset.output)}`).join("\n")}`, config);
482
462
  const assetHandler = new (0, _copyassetshandler.CopyAssetsHandler)({
483
463
  projectDir: projectRoot,
484
464
  rootDir: config.workspaceRoot,
@@ -487,12 +467,12 @@ ${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${p
487
467
  });
488
468
  await assetHandler.processAllAssetsOnce();
489
469
  if (includeSrc === true) {
490
- _chunkTEEOPHLZjs.writeDebug.call(void 0, `\u{1F4DD} Adding banner and writing source files: ${_chunkTEEOPHLZjs.joinPaths.call(void 0, outputPath, "src")}`, config);
470
+ _chunkV7LBWOVVjs.writeDebug.call(void 0, `\u{1F4DD} Adding banner and writing source files: ${_chunkV7LBWOVVjs.joinPaths.call(void 0, outputPath, "src")}`, config);
491
471
  const files = await _glob.glob.call(void 0, [
492
- _chunkTEEOPHLZjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.ts"),
493
- _chunkTEEOPHLZjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.tsx"),
494
- _chunkTEEOPHLZjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.js"),
495
- _chunkTEEOPHLZjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.jsx")
472
+ _chunkV7LBWOVVjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.ts"),
473
+ _chunkV7LBWOVVjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.tsx"),
474
+ _chunkV7LBWOVVjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.js"),
475
+ _chunkV7LBWOVVjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.jsx")
496
476
  ]);
497
477
  await Promise.allSettled(files.map(async (file) => _promises.writeFile.call(void 0, file, `${banner && typeof banner === "string" ? banner.startsWith("//") ? banner : `// ${banner}` : ""}
498
478
 
@@ -509,13 +489,22 @@ var _buildablelibsutils = require('@nx/js/src/utils/buildable-libs-utils');
509
489
 
510
490
  var _projectgraph = require('nx/src/project-graph/project-graph');
511
491
  var addPackageDependencies = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (workspaceRoot3, projectRoot, projectName, packageJson) => {
512
- const projectGraph = _projectgraph.readCachedProjectGraph.call(void 0, );
492
+ let projectGraph;
493
+ try {
494
+ projectGraph = _projectgraph.readCachedProjectGraph.call(void 0, );
495
+ } catch (e2) {
496
+ await _projectgraph.createProjectGraphAsync.call(void 0, );
497
+ projectGraph = _projectgraph.readCachedProjectGraph.call(void 0, );
498
+ }
499
+ if (!projectGraph) {
500
+ throw new Error("The Build process failed because the project graph is not available. Please run the build command again.");
501
+ }
513
502
  const projectDependencies = _buildablelibsutils.calculateProjectBuildableDependencies.call(void 0, void 0, projectGraph, workspaceRoot3, projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
514
503
  const localPackages = [];
515
504
  for (const project of projectDependencies.dependencies.filter((dep) => dep.node.type === "lib" && _optionalChain([dep, 'access', _29 => _29.node, 'access', _30 => _30.data, 'optionalAccess', _31 => _31.root]) !== projectRoot && _optionalChain([dep, 'access', _32 => _32.node, 'access', _33 => _33.data, 'optionalAccess', _34 => _34.root]) !== workspaceRoot3)) {
516
505
  const projectNode = project.node;
517
506
  if (projectNode.data.root) {
518
- const projectPackageJsonPath = _chunkTEEOPHLZjs.joinPaths.call(void 0, workspaceRoot3, projectNode.data.root, "package.json");
507
+ const projectPackageJsonPath = _chunkV7LBWOVVjs.joinPaths.call(void 0, workspaceRoot3, projectNode.data.root, "package.json");
519
508
  if (_fs.existsSync.call(void 0, projectPackageJsonPath)) {
520
509
  const projectPackageJsonContent = await _promises.readFile.call(void 0, projectPackageJsonPath, "utf8");
521
510
  const projectPackageJson = JSON.parse(projectPackageJsonContent);
@@ -526,8 +515,8 @@ var addPackageDependencies = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0
526
515
  }
527
516
  }
528
517
  if (localPackages.length > 0) {
529
- _chunkTEEOPHLZjs.writeTrace.call(void 0, `\u{1F4E6} Adding local packages to package.json: ${localPackages.map((p) => p.name).join(", ")}`);
530
- const projectJsonFile = await _promises.readFile.call(void 0, _chunkTEEOPHLZjs.joinPaths.call(void 0, projectRoot, "project.json"), "utf8");
518
+ _chunkV7LBWOVVjs.writeTrace.call(void 0, `\u{1F4E6} Adding local packages to package.json: ${localPackages.map((p) => p.name).join(", ")}`);
519
+ const projectJsonFile = await _promises.readFile.call(void 0, _chunkV7LBWOVVjs.joinPaths.call(void 0, projectRoot, "project.json"), "utf8");
531
520
  const projectJson = JSON.parse(projectJsonFile);
532
521
  const projectName2 = projectJson.name;
533
522
  const projectConfigurations = _projectgraph.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
@@ -536,7 +525,7 @@ var addPackageDependencies = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0
536
525
  }
537
526
  const implicitDependencies = _optionalChain([projectConfigurations, 'access', _37 => _37.projects, 'optionalAccess', _38 => _38[projectName2], 'access', _39 => _39.implicitDependencies, 'optionalAccess', _40 => _40.reduce, 'call', _41 => _41((ret, dep) => {
538
527
  if (_optionalChain([projectConfigurations, 'access', _42 => _42.projects, 'optionalAccess', _43 => _43[dep]])) {
539
- const depPackageJsonPath = _chunkTEEOPHLZjs.joinPaths.call(void 0, workspaceRoot3, projectConfigurations.projects[dep].root, "package.json");
528
+ const depPackageJsonPath = _chunkV7LBWOVVjs.joinPaths.call(void 0, workspaceRoot3, projectConfigurations.projects[dep].root, "package.json");
540
529
  if (_fs.existsSync.call(void 0, depPackageJsonPath)) {
541
530
  const depPackageJsonContent = _fs.readFileSync.call(void 0, depPackageJsonPath, "utf8");
542
531
  const depPackageJson = JSON.parse(depPackageJsonContent);
@@ -560,13 +549,13 @@ var addPackageDependencies = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0
560
549
  return ret;
561
550
  }, _nullishCoalesce(packageJson.devDependencies, () => ( {})));
562
551
  } else {
563
- _chunkTEEOPHLZjs.writeTrace.call(void 0, "\u{1F4E6} No local packages dependencies to add to package.json");
552
+ _chunkV7LBWOVVjs.writeTrace.call(void 0, "\u{1F4E6} No local packages dependencies to add to package.json");
564
553
  }
565
554
  return packageJson;
566
555
  }, "addPackageDependencies");
567
- var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (config, projectRoot, sourceRoot, projectName, includeSrc = false, packageJson) => {
568
- const workspaceRoot3 = config.workspaceRoot ? config.workspaceRoot : _chunkTEEOPHLZjs.findWorkspaceRoot.call(void 0, );
569
- const workspacePackageJsonContent = await _promises.readFile.call(void 0, _chunkTEEOPHLZjs.joinPaths.call(void 0, workspaceRoot3, "package.json"), "utf8");
556
+ var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (workspaceConfig, projectRoot, sourceRoot, projectName, includeSrc = false, packageJson) => {
557
+ const workspaceRoot3 = workspaceConfig.workspaceRoot ? workspaceConfig.workspaceRoot : _chunkV7LBWOVVjs.findWorkspaceRoot.call(void 0, );
558
+ const workspacePackageJsonContent = await _promises.readFile.call(void 0, _chunkV7LBWOVVjs.joinPaths.call(void 0, workspaceRoot3, "package.json"), "utf8");
570
559
  const workspacePackageJson = JSON.parse(workspacePackageJsonContent);
571
560
  packageJson.type ??= "module";
572
561
  packageJson.sideEffects ??= false;
@@ -575,7 +564,7 @@ var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call
575
564
  if (distSrc.startsWith("/")) {
576
565
  distSrc = distSrc.substring(1);
577
566
  }
578
- packageJson.source ??= `${_chunkTEEOPHLZjs.joinPaths.call(void 0, distSrc, "index.ts").replaceAll("\\", "/")}`;
567
+ packageJson.source ??= `${_chunkV7LBWOVVjs.joinPaths.call(void 0, distSrc, "index.ts").replaceAll("\\", "/")}`;
579
568
  }
580
569
  packageJson.files ??= [
581
570
  "dist/**/*"
@@ -606,7 +595,7 @@ var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call
606
595
  ];
607
596
  }
608
597
  packageJson.repository ??= workspacePackageJson.repository;
609
- packageJson.repository.directory ??= projectRoot ? projectRoot : _chunkTEEOPHLZjs.joinPaths.call(void 0, "packages", projectName);
598
+ packageJson.repository.directory ??= projectRoot ? projectRoot : _chunkV7LBWOVVjs.joinPaths.call(void 0, "packages", projectName);
610
599
  return packageJson;
611
600
  }, "addWorkspacePackageJsonFields");
612
601
 
@@ -638,157 +627,16 @@ var _createtaskgraph = require('nx/src/tasks-runner/create-task-graph');
638
627
  var _chokidar = require('chokidar');
639
628
 
640
629
  var _estoolkit = require('es-toolkit');
641
- var _compat = require('es-toolkit/compat');
642
- var _esbuild = require('esbuild'); var esbuild2 = _interopRequireWildcard(_esbuild); var esbuild = _interopRequireWildcard(_esbuild);
630
+ var _esbuild = require('esbuild'); var esbuild = _interopRequireWildcard(_esbuild);
643
631
  var _globby = require('globby');
644
632
 
645
633
 
646
634
  var _findworkspaceroot = require('nx/src/utils/find-workspace-root');
647
-
648
- // ../esbuild/src/base/renderer-engine.ts
649
-
650
- var _sourcemap = require('source-map');
651
-
652
- // ../esbuild/src/utilities/output-file.ts
653
-
654
-
655
- var outputFile = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (filepath, data, options) => {
656
- await _fs2.default.promises.mkdir(path6.default.dirname(filepath), {
657
- recursive: true
658
- });
659
- await _fs2.default.promises.writeFile(filepath, data, options);
660
- }, "outputFile");
661
-
662
- // ../esbuild/src/base/renderer-engine.ts
663
- var parseSourceMap = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (map2) => {
664
- return typeof map2 === "string" ? JSON.parse(map2) : map2;
665
- }, "parseSourceMap");
666
- var isJS = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (path7) => /\.(js|mjs|cjs)$/.test(path7), "isJS");
667
- var isCSS = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (path7) => /\.css$/.test(path7), "isCSS");
668
- var getSourcemapComment = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (inline, map2, filepath, isCssFile) => {
669
- if (!map2) return "";
670
- const prefix = isCssFile ? "/*" : "//";
671
- const suffix = isCssFile ? " */" : "";
672
- const url = inline ? `data:application/json;base64,${Buffer.from(typeof map2 === "string" ? map2 : JSON.stringify(map2)).toString("base64")}` : `${path6.default.basename(filepath)}.map`;
673
- return `${prefix}# sourceMappingURL=${url}${suffix}`;
674
- }, "getSourcemapComment");
675
- var RendererEngine = class {
676
- static {
677
- _chunkJ5SB6L2Ljs.__name.call(void 0, this, "RendererEngine");
678
- }
679
- #renderers;
680
- #options;
681
- constructor(renderers) {
682
- this.#renderers = renderers;
683
- }
684
- setOptions(options) {
685
- this.#options = options;
686
- }
687
- getOptions() {
688
- if (!this.#options) {
689
- throw new Error(`Renderer options is not set`);
690
- }
691
- return this.#options;
692
- }
693
- modifyEsbuildOptions(options) {
694
- for (const renderer of this.#renderers) {
695
- if (renderer.esbuildOptions) {
696
- renderer.esbuildOptions.call(this.getOptions(), options);
697
- }
698
- }
699
- }
700
- async buildStarted() {
701
- for (const renderer of this.#renderers) {
702
- if (renderer.buildStart) {
703
- await renderer.buildStart.call(this.getOptions());
704
- }
705
- }
706
- }
707
- async buildFinished({ outputFiles, metafile }) {
708
- const files = outputFiles.filter((file) => !file.path.endsWith(".map")).map((file) => {
709
- if (isJS(file.path) || isCSS(file.path)) {
710
- let relativePath = path6.default.relative(this.getOptions().config.workspaceRoot, file.path);
711
- if (!relativePath.startsWith("\\\\?\\")) {
712
- relativePath = relativePath.replace(/\\/g, "/");
713
- }
714
- const meta = _optionalChain([metafile, 'optionalAccess', _52 => _52.outputs, 'access', _53 => _53[relativePath]]);
715
- return {
716
- type: "chunk",
717
- path: file.path,
718
- code: file.text,
719
- map: _optionalChain([outputFiles, 'access', _54 => _54.find, 'call', _55 => _55((f) => f.path === `${file.path}.map`), 'optionalAccess', _56 => _56.text]),
720
- entryPoint: _optionalChain([meta, 'optionalAccess', _57 => _57.entryPoint]),
721
- exports: _optionalChain([meta, 'optionalAccess', _58 => _58.exports]),
722
- imports: _optionalChain([meta, 'optionalAccess', _59 => _59.imports])
723
- };
724
- } else {
725
- return {
726
- type: "asset",
727
- path: file.path,
728
- contents: file.contents
729
- };
730
- }
731
- });
732
- const writtenFiles = [];
733
- await Promise.all(files.map(async (info) => {
734
- for (const renderer of this.#renderers) {
735
- if (info.type === "chunk" && renderer.renderChunk) {
736
- const result = await renderer.renderChunk.call(this.getOptions(), info.code, info);
737
- if (result) {
738
- info.code = result.code;
739
- if (result.map) {
740
- const originalConsumer = await new (0, _sourcemap.SourceMapConsumer)(parseSourceMap(info.map));
741
- const newConsumer = await new (0, _sourcemap.SourceMapConsumer)(parseSourceMap(result.map));
742
- const generator = _sourcemap.SourceMapGenerator.fromSourceMap(newConsumer);
743
- generator.applySourceMap(originalConsumer, info.path);
744
- info.map = generator.toJSON();
745
- originalConsumer.destroy();
746
- newConsumer.destroy();
747
- }
748
- }
749
- }
750
- }
751
- const inlineSourceMap = this.#options.sourcemap === "inline";
752
- const contents = info.type === "chunk" ? info.code + getSourcemapComment(inlineSourceMap, info.map, info.path, isCSS(info.path)) : info.contents;
753
- await outputFile(info.path, contents, {
754
- mode: info.type === "chunk" ? info.mode : void 0
755
- });
756
- writtenFiles.push({
757
- get name() {
758
- return path6.default.relative(process.cwd(), info.path);
759
- },
760
- get size() {
761
- return contents.length;
762
- }
763
- });
764
- if (info.type === "chunk" && info.map && !inlineSourceMap) {
765
- const map2 = typeof info.map === "string" ? JSON.parse(info.map) : info.map;
766
- const outPath = `${info.path}.map`;
767
- const contents2 = JSON.stringify(map2);
768
- await outputFile(outPath, contents2);
769
- writtenFiles.push({
770
- get name() {
771
- return path6.default.relative(process.cwd(), outPath);
772
- },
773
- get size() {
774
- return contents2.length;
775
- }
776
- });
777
- }
778
- }));
779
- for (const renderer of this.#renderers) {
780
- if (renderer.buildEnd) {
781
- await renderer.buildEnd.call(this.getOptions(), {
782
- writtenFiles
783
- });
784
- }
785
- }
786
- }
787
- };
635
+ var _tsup = require('tsup');
788
636
 
789
637
  // ../esbuild/src/clean.ts
790
638
 
791
- async function cleanDirectories(name = "ESBuild", directory, config) {
639
+ async function cleanDirectories(directory) {
792
640
  await _promises.rm.call(void 0, directory, {
793
641
  recursive: true,
794
642
  force: true
@@ -796,315 +644,24 @@ async function cleanDirectories(name = "ESBuild", directory, config) {
796
644
  }
797
645
  _chunkJ5SB6L2Ljs.__name.call(void 0, cleanDirectories, "cleanDirectories");
798
646
 
799
- // ../esbuild/src/plugins/esm-split-code-to-cjs.ts
800
-
801
- var esmSplitCodeToCjsPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (options, resolvedOptions) => ({
802
- name: "storm:esm-split-code-to-cjs",
803
- setup(build4) {
804
- build4.onEnd(async (result) => {
805
- const outFiles = Object.keys(_nullishCoalesce(_optionalChain([result, 'access', _60 => _60.metafile, 'optionalAccess', _61 => _61.outputs]), () => ( {})));
806
- const jsFiles = outFiles.filter((f) => f.endsWith("js"));
807
- await esbuild.build({
808
- outdir: resolvedOptions.outdir,
809
- entryPoints: jsFiles,
810
- allowOverwrite: true,
811
- format: "cjs",
812
- logLevel: "error",
813
- packages: "external"
814
- });
815
- });
816
- }
817
- }), "esmSplitCodeToCjsPlugin");
818
-
819
- // ../esbuild/src/plugins/fix-imports.ts
820
- var fixImportsPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (options, resolvedOptions) => ({
821
- name: "storm:fix-imports",
822
- setup(build4) {
823
- build4.onResolve({
824
- filter: /^spdx-exceptions/
825
- }, () => {
826
- return {
827
- path: _chunkJ5SB6L2Ljs.__require.resolve("spdx-exceptions")
828
- };
829
- });
830
- build4.onResolve({
831
- filter: /^spdx-license-ids/
832
- }, () => {
833
- return {
834
- path: _chunkJ5SB6L2Ljs.__require.resolve("spdx-license-ids")
835
- };
836
- });
837
- }
838
- }), "fixImportsPlugin");
839
-
840
- // ../esbuild/src/plugins/native-node-module.ts
841
-
842
- var nativeNodeModulesPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (options, resolvedOptions) => {
843
- return {
844
- name: "native-node-modules",
845
- setup(build4) {
846
- build4.onResolve({
847
- filter: /\.node$/,
848
- namespace: "file"
849
- }, (args) => {
850
- const resolvedId = _chunkJ5SB6L2Ljs.__require.resolve(args.path, {
851
- paths: [
852
- args.resolveDir
853
- ]
854
- });
855
- if (resolvedId.endsWith(".node")) {
856
- return {
857
- path: resolvedId,
858
- namespace: "node-file"
859
- };
860
- }
861
- return {
862
- path: resolvedId
863
- };
864
- });
865
- build4.onLoad({
866
- filter: /.*/,
867
- namespace: "node-file"
868
- }, (args) => {
869
- return {
870
- contents: `
871
- import path from ${JSON.stringify(args.path)}
872
- try { module.exports = require(path) }
873
- catch {}
874
- `,
875
- resolveDir: _path.dirname.call(void 0, args.path)
876
- };
877
- });
878
- build4.onResolve({
879
- filter: /\.node$/,
880
- namespace: "node-file"
881
- }, (args) => ({
882
- path: args.path,
883
- namespace: "file"
884
- }));
885
- const opts = build4.initialOptions;
886
- opts.loader = opts.loader || {};
887
- opts.loader[".node"] = "file";
888
- }
889
- };
890
- }, "nativeNodeModulesPlugin");
891
-
892
- // ../esbuild/src/plugins/node-protocol.ts
893
- var nodeProtocolPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (options, resolvedOptions) => {
894
- const nodeProtocol = "node:";
895
- return {
896
- name: "node-protocol-plugin",
897
- setup({ onResolve }) {
898
- onResolve({
899
- filter: /^node:/
900
- }, ({ path: path7 }) => ({
901
- path: path7.slice(nodeProtocol.length),
902
- external: true
903
- }));
904
- }
905
- };
906
- }, "nodeProtocolPlugin");
907
-
908
- // ../esbuild/src/plugins/on-error.ts
909
- var onErrorPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (options, resolvedOptions) => ({
910
- name: "storm:on-error",
911
- setup(build4) {
912
- build4.onEnd((result) => {
913
- if (result.errors.length > 0 && process.env.WATCH !== "true") {
914
- _chunkTEEOPHLZjs.writeError.call(void 0, `The following errors occurred during the build:
915
- ${result.errors.map((error) => error.text).join("\n")}
916
-
917
- `, resolvedOptions.config);
918
- throw new Error("Storm esbuild process failed with errors.");
919
- }
920
- });
921
- }
922
- }), "onErrorPlugin");
923
-
924
- // ../esbuild/src/plugins/resolve-paths.ts
925
-
926
- function resolvePathsConfig(options, cwd) {
927
- if (_optionalChain([options, 'optionalAccess', _62 => _62.compilerOptions, 'optionalAccess', _63 => _63.paths])) {
928
- const paths = Object.entries(options.compilerOptions.paths);
929
- const resolvedPaths = paths.map(([key, paths2]) => {
930
- return [
931
- key,
932
- paths2.map((v) => path6.default.resolve(cwd, v))
933
- ];
934
- });
935
- return Object.fromEntries(resolvedPaths);
936
- }
937
- if (options.extends) {
938
- const extendsPath = path6.default.resolve(cwd, options.extends);
939
- const extendsDir = path6.default.dirname(extendsPath);
940
- const extendsConfig = _chunkJ5SB6L2Ljs.__require.call(void 0, extendsPath);
941
- return resolvePathsConfig(extendsConfig, extendsDir);
942
- }
943
- return [];
944
- }
945
- _chunkJ5SB6L2Ljs.__name.call(void 0, resolvePathsConfig, "resolvePathsConfig");
946
- var resolvePathsPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (options, resolvedOptions) => ({
947
- name: "storm:resolve-paths",
948
- setup(build4) {
949
- const parentTsConfig = build4.initialOptions.tsconfig ? _chunkJ5SB6L2Ljs.__require.call(void 0, _chunkTEEOPHLZjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, build4.initialOptions.tsconfig)) : _chunkJ5SB6L2Ljs.__require.call(void 0, _chunkTEEOPHLZjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, "tsconfig.json"));
950
- const resolvedTsPaths = resolvePathsConfig(parentTsConfig, options.projectRoot);
951
- const packagesRegex = new RegExp(`^(${Object.keys(resolvedTsPaths).join("|")})$`);
952
- build4.onResolve({
953
- filter: packagesRegex
954
- }, (args) => {
955
- if (_optionalChain([build4, 'access', _64 => _64.initialOptions, 'access', _65 => _65.external, 'optionalAccess', _66 => _66.includes, 'call', _67 => _67(args.path)])) {
956
- return {
957
- path: args.path,
958
- external: true
959
- };
960
- }
961
- return {
962
- path: `${resolvedTsPaths[args.path][0]}/index.ts`
963
- };
964
- });
965
- }
966
- }), "resolvePathsPlugin");
967
-
968
- // ../esbuild/src/plugins/tsc.ts
969
- var _apiextractor = require('@microsoft/api-extractor');
970
-
971
-
972
- function bundleTypeDefinitions(filename, outfile, externals, options) {
973
- const { dependencies, peerDependencies, devDependencies } = _chunkJ5SB6L2Ljs.__require.call(void 0, _chunkTEEOPHLZjs.joinPaths.call(void 0, options.projectRoot, "package.json"));
974
- const dependenciesKeys = Object.keys(_nullishCoalesce(dependencies, () => ( {}))).flatMap((p) => [
975
- p,
976
- getTypeDependencyPackageName(p)
977
- ]);
978
- const peerDependenciesKeys = Object.keys(_nullishCoalesce(peerDependencies, () => ( {}))).flatMap((p) => [
979
- p,
980
- getTypeDependencyPackageName(p)
981
- ]);
982
- const devDependenciesKeys = Object.keys(_nullishCoalesce(devDependencies, () => ( {}))).flatMap((p) => [
983
- p,
984
- getTypeDependencyPackageName(p)
985
- ]);
986
- const includeDeps = devDependenciesKeys;
987
- const excludeDeps = /* @__PURE__ */ new Set([
988
- ...dependenciesKeys,
989
- ...peerDependenciesKeys,
990
- ...externals
991
- ]);
992
- const bundledPackages = includeDeps.filter((dep) => !excludeDeps.has(dep));
993
- const extractorConfig = _apiextractor.ExtractorConfig.prepare({
994
- configObject: {
995
- projectFolder: options.projectRoot,
996
- mainEntryPointFilePath: filename,
997
- bundledPackages,
998
- compiler: {
999
- tsconfigFilePath: options.tsconfig,
1000
- overrideTsconfig: {
1001
- compilerOptions: {
1002
- paths: {}
1003
- // bug with api extract + paths
1004
- }
1005
- }
1006
- },
1007
- dtsRollup: {
1008
- enabled: true,
1009
- untrimmedFilePath: _chunkTEEOPHLZjs.joinPaths.call(void 0, options.outdir, `${outfile}.d.ts`)
1010
- },
1011
- tsdocMetadata: {
1012
- enabled: false
1013
- }
1014
- },
1015
- packageJsonFullPath: _chunkTEEOPHLZjs.joinPaths.call(void 0, options.projectRoot, "package.json"),
1016
- configObjectFullPath: void 0
1017
- });
1018
- const extractorResult = _apiextractor.Extractor.invoke(extractorConfig, {
1019
- showVerboseMessages: true,
1020
- localBuild: true
1021
- });
1022
- if (extractorResult.succeeded === false) {
1023
- _chunkTEEOPHLZjs.writeError.call(void 0, `API Extractor completed with ${extractorResult.errorCount} ${extractorResult.errorCount === 1 ? "error" : "errors"}`);
1024
- throw new Error("API Extractor completed with errors");
1025
- }
1026
- }
1027
- _chunkJ5SB6L2Ljs.__name.call(void 0, bundleTypeDefinitions, "bundleTypeDefinitions");
1028
- var tscPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (options, resolvedOptions) => ({
1029
- name: "storm:tsc",
1030
- setup(build4) {
1031
- if (options.dts === false) {
1032
- return;
1033
- }
1034
- build4.onStart(async () => {
1035
- if (process.env.WATCH !== "true" && process.env.DEV !== "true") {
1036
- await run(resolvedOptions.config, `pnpm exec tsc --project ${resolvedOptions.tsconfig}`, resolvedOptions.config.workspaceRoot);
1037
- }
1038
- if (resolvedOptions.bundle && resolvedOptions.entryPoints && resolvedOptions.entryPoints.length > 0 && _optionalChain([resolvedOptions, 'access', _68 => _68.entryPoints, 'access', _69 => _69[0], 'optionalAccess', _70 => _70.in]) && resolvedOptions.entryPoints[0].in.endsWith(".ts")) {
1039
- const sourceRoot = resolvedOptions.sourceRoot.replaceAll(resolvedOptions.projectRoot, "");
1040
- const typeOutDir = resolvedOptions.outdir;
1041
- const entryPoint = resolvedOptions.entryPoints[0].in.replace(sourceRoot, "").replace(/\.ts$/, "");
1042
- const bundlePath = _chunkTEEOPHLZjs.joinPaths.call(void 0, resolvedOptions.outdir, entryPoint);
1043
- let dtsPath;
1044
- if (_fs.existsSync.call(void 0, _chunkTEEOPHLZjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint}.d.ts`))) {
1045
- dtsPath = _chunkTEEOPHLZjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint}.d.ts`);
1046
- } else if (_fs.existsSync.call(void 0, _chunkTEEOPHLZjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint.replace(/^src\//, "")}.d.ts`))) {
1047
- dtsPath = _chunkTEEOPHLZjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint.replace(/^src\//, "")}.d.ts`);
1048
- }
1049
- const ext = resolvedOptions.format === "esm" ? "d.mts" : "d.ts";
1050
- if (process.env.WATCH !== "true" && process.env.DEV !== "true") {
1051
- bundleTypeDefinitions(dtsPath, bundlePath, _nullishCoalesce(resolvedOptions.external, () => ( [])), resolvedOptions);
1052
- const dtsContents = await _promises2.default.readFile(`${bundlePath}.d.ts`, "utf8");
1053
- await _promises2.default.writeFile(`${bundlePath}.${ext}`, dtsContents);
1054
- } else {
1055
- await _promises2.default.writeFile(`${bundlePath}.${ext}`, `export * from './${entryPoint}'`);
1056
- }
1057
- }
1058
- });
1059
- }
1060
- }), "tscPlugin");
1061
- function getTypeDependencyPackageName(npmPackage) {
1062
- if (npmPackage.startsWith("@")) {
1063
- const [scope, name] = npmPackage.split("/");
1064
- return `@types/${_optionalChain([scope, 'optionalAccess', _71 => _71.slice, 'call', _72 => _72(1)])}__${name}`;
1065
- }
1066
- return `@types/${npmPackage}`;
1067
- }
1068
- _chunkJ5SB6L2Ljs.__name.call(void 0, getTypeDependencyPackageName, "getTypeDependencyPackageName");
1069
-
1070
647
  // ../esbuild/src/config.ts
1071
- var getDefaultBuildPlugins = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (options, resolvedOptions) => [
1072
- nodeProtocolPlugin(options, resolvedOptions),
1073
- resolvePathsPlugin(options, resolvedOptions),
1074
- fixImportsPlugin(options, resolvedOptions),
1075
- nativeNodeModulesPlugin(options, resolvedOptions),
1076
- esmSplitCodeToCjsPlugin(options, resolvedOptions),
1077
- tscPlugin(options, resolvedOptions),
1078
- onErrorPlugin(options, resolvedOptions)
1079
- ], "getDefaultBuildPlugins");
1080
648
  var DEFAULT_BUILD_OPTIONS = {
649
+ assets: [],
1081
650
  platform: "node",
1082
- target: "node22",
651
+ target: [
652
+ "esnext"
653
+ ],
1083
654
  format: "esm",
1084
- external: [],
1085
- logLevel: "error",
1086
655
  tsconfig: "tsconfig.json",
1087
656
  mode: "production",
657
+ generatePackageJson: true,
658
+ includeSrc: false,
1088
659
  keepNames: true,
1089
- metafile: true,
1090
- injectShims: true,
1091
- color: true,
660
+ metafile: false,
661
+ treeshake: true,
662
+ shims: false,
1092
663
  watch: false,
1093
664
  bundle: true,
1094
- clean: true,
1095
- debug: false,
1096
- resolveExtensions: [
1097
- ".tsx",
1098
- ".ts",
1099
- ".cts",
1100
- ".mts",
1101
- ".jsx",
1102
- ".js",
1103
- ".cjs",
1104
- ".mjs",
1105
- ".css",
1106
- ".json"
1107
- ],
1108
665
  loader: {
1109
666
  ".aac": "file",
1110
667
  ".css": "file",
@@ -1126,7 +683,10 @@ var DEFAULT_BUILD_OPTIONS = {
1126
683
  ".woff": "file",
1127
684
  ".woff2": "file"
1128
685
  },
1129
- banner: DEFAULT_COMPILED_BANNER
686
+ banner: {
687
+ js: DEFAULT_COMPILED_BANNER,
688
+ css: DEFAULT_COMPILED_BANNER
689
+ }
1130
690
  };
1131
691
 
1132
692
  // ../esbuild/src/plugins/deps-check.ts
@@ -1163,8 +723,8 @@ var missingIgnore = [
1163
723
  ];
1164
724
  var depsCheckPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (bundle) => ({
1165
725
  name: "storm:deps-check",
1166
- setup(build4) {
1167
- const pkgJsonPath = path6.default.join(process.cwd(), "package.json");
726
+ setup(build3) {
727
+ const pkgJsonPath = path3.default.join(process.cwd(), "package.json");
1168
728
  const pkgContents = _chunkJ5SB6L2Ljs.__require.call(void 0, pkgJsonPath);
1169
729
  const regDependencies = Object.keys(_nullishCoalesce(pkgContents["dependencies"], () => ( {})));
1170
730
  const devDependencies = Object.keys(_nullishCoalesce(pkgContents["devDependencies"], () => ( {})));
@@ -1175,7 +735,7 @@ var depsCheckPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (bund
1175
735
  ];
1176
736
  const collectedDependencies = /* @__PURE__ */ new Set();
1177
737
  const onlyPackages = /^[^./](?!:)|^\.[^./]|^\.\.[^/]/;
1178
- build4.onResolve({
738
+ build3.onResolve({
1179
739
  filter: onlyPackages
1180
740
  }, (args) => {
1181
741
  if (args.importer.includes(process.cwd())) {
@@ -1191,7 +751,7 @@ var depsCheckPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (bund
1191
751
  external: true
1192
752
  };
1193
753
  });
1194
- build4.onEnd(() => {
754
+ build3.onEnd(() => {
1195
755
  const unusedDependencies = [
1196
756
  ...dependencies
1197
757
  ].filter((dep) => {
@@ -1208,8 +768,8 @@ var depsCheckPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (bund
1208
768
  const filteredMissingDeps = missingDependencies.filter((dep) => {
1209
769
  return !missingIgnore.some((pattern) => dep.match(pattern)) && !peerDependencies.includes(dep);
1210
770
  });
1211
- _chunkTEEOPHLZjs.writeWarning.call(void 0, `Unused Dependencies: ${JSON.stringify(filteredUnusedDeps)}`);
1212
- _chunkTEEOPHLZjs.writeError.call(void 0, `Missing Dependencies: ${JSON.stringify(filteredMissingDeps)}`);
771
+ _chunkV7LBWOVVjs.writeWarning.call(void 0, `Unused Dependencies: ${JSON.stringify(filteredUnusedDeps)}`);
772
+ _chunkV7LBWOVVjs.writeError.call(void 0, `Missing Dependencies: ${JSON.stringify(filteredMissingDeps)}`);
1213
773
  if (filteredMissingDeps.length > 0) {
1214
774
  throw new Error(`Missing dependencies detected - please install them:
1215
775
  ${JSON.stringify(filteredMissingDeps)}
@@ -1219,391 +779,53 @@ ${JSON.stringify(filteredMissingDeps)}
1219
779
  }
1220
780
  }), "depsCheckPlugin");
1221
781
 
1222
- // ../esbuild/src/renderers/shebang.ts
1223
- var shebangRenderer = {
1224
- name: "shebang",
1225
- renderChunk(_, __, info) {
1226
- if (info.type === "chunk" && /\.(cjs|js|mjs)$/.test(info.path) && info.code.startsWith("#!")) {
1227
- info.mode = 493;
1228
- }
1229
- }
1230
- };
1231
-
1232
- // ../esbuild/src/tsc.ts
1233
- var _bundlerequire = require('bundle-require');
1234
-
1235
-
1236
-
1237
- var _typescript = require('typescript'); var _typescript2 = _interopRequireDefault(_typescript);
1238
- function ensureTempDeclarationDir(workspaceConfig) {
1239
- const root = workspaceConfig.directories.temp || _path.join.call(void 0, workspaceConfig.workspaceRoot, "tmp");
1240
- const dirPath = _path.join.call(void 0, root, ".tsc", "declaration");
1241
- if (_fs.existsSync.call(void 0, dirPath)) {
1242
- return dirPath;
1243
- }
1244
- _fs.mkdirSync.call(void 0, dirPath, {
1245
- recursive: true
1246
- });
1247
- const gitIgnorePath = _path.join.call(void 0, root, ".tsc", ".gitignore");
1248
- _fs.writeFileSync.call(void 0, gitIgnorePath, "**/*\n");
1249
- return dirPath;
1250
- }
1251
- _chunkJ5SB6L2Ljs.__name.call(void 0, ensureTempDeclarationDir, "ensureTempDeclarationDir");
1252
- function slash(path7) {
1253
- const isExtendedLengthPath = path7.startsWith("\\\\?\\");
1254
- if (isExtendedLengthPath) {
1255
- return path7;
1256
- }
1257
- return path7.replace(/\\/g, "/");
1258
- }
1259
- _chunkJ5SB6L2Ljs.__name.call(void 0, slash, "slash");
1260
- function toAbsolutePath(workspaceConfig, p, cwd) {
1261
- if (_path.isAbsolute.call(void 0, p)) {
1262
- return p;
1263
- }
1264
- return slash(_path.normalize.call(void 0, _path.join.call(void 0, cwd || workspaceConfig.workspaceRoot, p)));
1265
- }
1266
- _chunkJ5SB6L2Ljs.__name.call(void 0, toAbsolutePath, "toAbsolutePath");
1267
- var AliasPool = (_class = class AliasPool2 {constructor() { _class.prototype.__init.call(this); }
1268
- static {
1269
- _chunkJ5SB6L2Ljs.__name.call(void 0, this, "AliasPool");
1270
- }
1271
- __init() {this.seen = /* @__PURE__ */ new Set()}
1272
- assign(name) {
1273
- let suffix = 0;
1274
- let alias = name === "default" ? "default_alias" : name;
1275
- while (this.seen.has(alias)) {
1276
- alias = `${name}_alias_${++suffix}`;
1277
- if (suffix >= 1e3) {
1278
- throw new Error("Alias generation exceeded limit. Possible infinite loop detected.");
1279
- }
1280
- }
1281
- this.seen.add(alias);
1282
- return alias;
1283
- }
1284
- }, _class);
1285
- function getExports(workspaceConfig, program, fileMapping) {
1286
- const checker = program.getTypeChecker();
1287
- const aliasPool = new AliasPool();
1288
- const assignAlias = aliasPool.assign.bind(aliasPool);
1289
- function extractExports(sourceFileName) {
1290
- const cwd = program.getCurrentDirectory();
1291
- sourceFileName = toAbsolutePath(workspaceConfig, sourceFileName, cwd);
1292
- const sourceFile = program.getSourceFile(sourceFileName);
1293
- if (!sourceFile) {
1294
- return [];
1295
- }
1296
- const destFileName = fileMapping.get(sourceFileName);
1297
- if (!destFileName) {
1298
- return [];
1299
- }
1300
- const moduleSymbol = checker.getSymbolAtLocation(sourceFile);
1301
- if (!moduleSymbol) {
1302
- return [];
1303
- }
1304
- const exports = [];
1305
- const exportSymbols = checker.getExportsOfModule(moduleSymbol);
1306
- exportSymbols.forEach((symbol) => {
1307
- const name = symbol.getName();
1308
- exports.push({
1309
- kind: "named",
1310
- sourceFileName,
1311
- destFileName,
1312
- name,
1313
- alias: assignAlias(name),
1314
- isTypeOnly: false
1315
- });
1316
- });
1317
- return exports;
1318
- }
1319
- _chunkJ5SB6L2Ljs.__name.call(void 0, extractExports, "extractExports");
1320
- return program.getRootFileNames().flatMap(extractExports);
1321
- }
1322
- _chunkJ5SB6L2Ljs.__name.call(void 0, getExports, "getExports");
1323
- function emitDtsFiles(workspaceConfig, program, host, emitOnlyDtsFiles = true, customTransformers) {
1324
- const fileMapping = /* @__PURE__ */ new Map();
1325
- const writeFile3 = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (fileName, text, writeByteOrderMark, onError, sourceFiles, data) => {
1326
- const sourceFile = _optionalChain([sourceFiles, 'optionalAccess', _73 => _73[0]]);
1327
- const sourceFileName = _optionalChain([sourceFile, 'optionalAccess', _74 => _74.fileName]);
1328
- if (sourceFileName && !fileName.endsWith(".map")) {
1329
- const cwd = program.getCurrentDirectory();
1330
- fileMapping.set(toAbsolutePath(workspaceConfig, sourceFileName, cwd), toAbsolutePath(workspaceConfig, fileName, cwd));
1331
- }
1332
- return host.writeFile(fileName, text, writeByteOrderMark, onError, sourceFiles, data);
1333
- }, "writeFile");
1334
- const emitResult = program.emit(void 0, writeFile3, void 0, emitOnlyDtsFiles, customTransformers);
1335
- const diagnostics = _typescript2.default.getPreEmitDiagnostics(program).concat(emitResult.diagnostics);
1336
- const diagnosticMessages = [];
1337
- diagnostics.forEach((diagnostic) => {
1338
- if (diagnostic.file) {
1339
- const { line, character } = _typescript2.default.getLineAndCharacterOfPosition(diagnostic.file, diagnostic.start);
1340
- const message = _typescript2.default.flattenDiagnosticMessageText(diagnostic.messageText, "\n");
1341
- diagnosticMessages.push(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`);
1342
- } else {
1343
- const message = _typescript2.default.flattenDiagnosticMessageText(diagnostic.messageText, "\n");
1344
- diagnosticMessages.push(message);
1345
- }
1346
- });
1347
- const diagnosticMessage = diagnosticMessages.join("\n");
1348
- if (diagnosticMessage) {
1349
- _chunkTEEOPHLZjs.writeError.call(void 0, `Failed to emit declaration files.
1350
-
1351
- ${diagnosticMessage}`, workspaceConfig);
1352
- throw new Error("TypeScript compilation failed");
1353
- }
1354
- return fileMapping;
1355
- }
1356
- _chunkJ5SB6L2Ljs.__name.call(void 0, emitDtsFiles, "emitDtsFiles");
1357
- function emitDts(workspaceConfig, tsconfig, tsconfigRaw, emitOnlyDtsFiles = true, customTransformers) {
1358
- const rawTsconfig = _bundlerequire.loadTsConfig.call(void 0, workspaceConfig.workspaceRoot, tsconfig);
1359
- if (!rawTsconfig) {
1360
- throw new Error(`Unable to find ${tsconfig || "tsconfig.json"} in ${workspaceConfig.workspaceRoot}`);
1361
- }
1362
- const declarationDir = ensureTempDeclarationDir(workspaceConfig);
1363
- const parsedTsconfig = _typescript2.default.parseJsonConfigFileContent(_defu2.default.call(void 0, {
1364
- compilerOptions: {
1365
- // Enable declaration emit and disable javascript emit
1366
- noEmit: false,
1367
- declaration: true,
1368
- declarationMap: true,
1369
- declarationDir,
1370
- emitDeclarationOnly: true
1371
- }
1372
- }, _nullishCoalesce(_optionalChain([tsconfigRaw, 'optionalAccess', _75 => _75.compilerOptions]), () => ( {})), _nullishCoalesce(rawTsconfig.data, () => ( {}))), _typescript2.default.sys, tsconfig ? _path.dirname.call(void 0, tsconfig) : "./");
1373
- const options = parsedTsconfig.options;
1374
- const host = _typescript2.default.createCompilerHost(options);
1375
- const program = _typescript2.default.createProgram(parsedTsconfig.fileNames, options, host);
1376
- const fileMapping = emitDtsFiles(workspaceConfig, program, host, emitOnlyDtsFiles, customTransformers);
1377
- return getExports(workspaceConfig, program, fileMapping);
1378
- }
1379
- _chunkJ5SB6L2Ljs.__name.call(void 0, emitDts, "emitDts");
1380
-
1381
- // ../esbuild/src/utilities/get-entry-points.ts
1382
-
1383
- var getEntryPoints = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (config, projectRoot, sourceRoot, entry, emitOnAll = false) => {
1384
- const workspaceRoot3 = config.workspaceRoot || _chunkTEEOPHLZjs.findWorkspaceRoot.call(void 0, );
1385
- const entryPoints = [];
1386
- if (entry) {
1387
- if (typeof entry === "string") {
1388
- entryPoints.push({
1389
- in: entry,
1390
- out: entry
1391
- });
1392
- } else if (Array.isArray(entry)) {
1393
- entryPoints.push(...entry.map((entry2) => ({
1394
- in: entry2,
1395
- out: entry2
1396
- })));
1397
- } else {
1398
- entryPoints.push(...Object.entries(entry).map(([key, value]) => {
1399
- if (typeof value === "string") {
1400
- return {
1401
- in: value,
1402
- out: key
1403
- };
1404
- } else {
1405
- return {
1406
- in: key,
1407
- out: key
1408
- };
1409
- }
1410
- }));
1411
- }
1412
- }
1413
- if (emitOnAll) {
1414
- entryPoints.push({
1415
- in: _chunkTEEOPHLZjs.joinPaths.call(void 0, workspaceRoot3, sourceRoot || projectRoot, "**/*.{ts,tsx}"),
1416
- out: _chunkTEEOPHLZjs.joinPaths.call(void 0, workspaceRoot3, sourceRoot || projectRoot, "**/*.{ts,tsx}")
1417
- });
1418
- }
1419
- const results = await Promise.all(entryPoints.map(async (entryPoint) => {
1420
- const paths = [];
1421
- if (entryPoint.in.includes("*")) {
1422
- const files = await _glob.glob.call(void 0, entryPoint.in, {
1423
- withFileTypes: true,
1424
- ignore: [
1425
- "**/node_modules/**"
1426
- ]
1427
- });
1428
- paths.push(...files.reduce((ret, filePath) => {
1429
- const result = _chunkTEEOPHLZjs.correctPaths.call(void 0, _chunkTEEOPHLZjs.joinPaths.call(void 0, filePath.path, filePath.name).replaceAll(_chunkTEEOPHLZjs.correctPaths.call(void 0, workspaceRoot3), "").replaceAll(_chunkTEEOPHLZjs.correctPaths.call(void 0, projectRoot), ""));
1430
- if (result) {
1431
- _chunkTEEOPHLZjs.writeDebug.call(void 0, `Trying to add entry point ${result} at "${_chunkTEEOPHLZjs.joinPaths.call(void 0, filePath.path, filePath.name)}"`, config);
1432
- if (!paths.some((p) => p.in === result)) {
1433
- paths.push({
1434
- in: result,
1435
- out: entryPoint.out.replace(entryPoint.in, result)
1436
- });
1437
- }
1438
- }
1439
- return ret;
1440
- }, []));
1441
- } else {
1442
- _chunkTEEOPHLZjs.writeDebug.call(void 0, `Adding ESBuild entry point
1443
- - Input: ${entryPoint.in}
1444
- - Output: ${entryPoint.out}`, config);
1445
- if (!paths.some((p) => p.out === entryPoint.out)) {
1446
- paths.push(entryPoint);
1447
- }
1448
- }
1449
- return paths;
1450
- }));
1451
- return results.filter(Boolean).reduce((ret, result) => {
1452
- result.forEach((res) => {
1453
- if (res && !ret.some((p) => p.in === res.in)) {
1454
- ret.push(res);
1455
- }
1456
- });
1457
- return ret;
1458
- }, []);
1459
- }, "getEntryPoints");
1460
-
1461
- // ../esbuild/src/utilities/helpers.ts
1462
- function handleSync(fn) {
1463
- try {
1464
- return fn();
1465
- } catch (error_) {
1466
- return error_;
1467
- }
1468
- }
1469
- _chunkJ5SB6L2Ljs.__name.call(void 0, handleSync, "handleSync");
1470
- async function handleAsync(fn) {
1471
- try {
1472
- return await fn();
1473
- } catch (error_) {
1474
- return error_;
1475
- }
1476
- }
1477
- _chunkJ5SB6L2Ljs.__name.call(void 0, handleAsync, "handleAsync");
1478
- var handle = handleSync;
1479
- handle.async = handleAsync;
1480
- var skip = Symbol("skip");
1481
- function transduceSync(list, transformer) {
1482
- const transduced = [];
1483
- for (const [i, element_] of list.entries()) {
1484
- const transformed = transformer(element_, i);
1485
- if (transformed !== skip) {
1486
- transduced[transduced.length] = transformed;
1487
- }
1488
- }
1489
- return transduced;
1490
- }
1491
- _chunkJ5SB6L2Ljs.__name.call(void 0, transduceSync, "transduceSync");
1492
- async function transduceAsync(list, transformer) {
1493
- const transduced = [];
1494
- await Promise.all(list.entries().map(async ([i, element_]) => {
1495
- const transformed = await transformer(element_, i);
1496
- if (transformed !== skip) {
1497
- transduced[transduced.length] = transformed;
1498
- }
1499
- }));
1500
- return transduced;
1501
- }
1502
- _chunkJ5SB6L2Ljs.__name.call(void 0, transduceAsync, "transduceAsync");
1503
- var transduce = transduceSync;
1504
- transduce.async = transduceAsync;
1505
- function pipeSync(fn, ...fns) {
1506
- return (...args) => {
1507
- let result = fn(...args);
1508
- for (let i = 0; result !== skip && i < fns.length; ++i) {
1509
- result = _optionalChain([fns, 'access', _76 => _76[i], 'optionalCall', _77 => _77(result)]);
1510
- }
1511
- return result;
1512
- };
1513
- }
1514
- _chunkJ5SB6L2Ljs.__name.call(void 0, pipeSync, "pipeSync");
1515
- function pipeAsync(fn, ...fns) {
1516
- return async (...args) => {
1517
- let result = await fn(...args);
1518
- for (let i = 0; result !== skip && i < fns.length; ++i) {
1519
- result = await _optionalChain([fns, 'access', _78 => _78[i], 'optionalCall', _79 => _79(result)]);
1520
- }
1521
- return result;
1522
- };
1523
- }
1524
- _chunkJ5SB6L2Ljs.__name.call(void 0, pipeAsync, "pipeAsync");
1525
- var pipe = pipeSync;
1526
- pipe.async = pipeAsync;
1527
-
1528
782
  // ../esbuild/src/build.ts
1529
- var resolveOptions = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (userOptions) => {
783
+ async function resolveContext(userOptions) {
1530
784
  const projectRoot = userOptions.projectRoot;
1531
785
  const workspaceRoot3 = _findworkspaceroot.findWorkspaceRoot.call(void 0, projectRoot);
1532
786
  if (!workspaceRoot3) {
1533
787
  throw new Error("Cannot find Nx workspace root");
1534
788
  }
1535
- const config = await _chunkXFPT4O23js.getConfig.call(void 0, workspaceRoot3.dir);
1536
- _chunkTEEOPHLZjs.writeDebug.call(void 0, " \u2699\uFE0F Resolving build options", config);
1537
- const stopwatch = _chunkTEEOPHLZjs.getStopwatch.call(void 0, "Build options resolution");
789
+ const workspaceConfig = await _chunkIVLCYFXDjs.getWorkspaceConfig.call(void 0, true, {
790
+ workspaceRoot: workspaceRoot3.dir
791
+ });
792
+ _chunkV7LBWOVVjs.writeDebug.call(void 0, " \u2699\uFE0F Resolving build options", workspaceConfig);
793
+ const stopwatch = _chunkV7LBWOVVjs.getStopwatch.call(void 0, "Build options resolution");
1538
794
  const projectGraph = await _devkit.createProjectGraphAsync.call(void 0, {
1539
795
  exitOnError: true
1540
796
  });
1541
- const projectJsonPath = _chunkTEEOPHLZjs.joinPaths.call(void 0, workspaceRoot3.dir, projectRoot, "project.json");
797
+ const projectJsonPath = _chunkV7LBWOVVjs.joinPaths.call(void 0, workspaceRoot3.dir, projectRoot, "project.json");
1542
798
  if (!_fs.existsSync.call(void 0, projectJsonPath)) {
1543
799
  throw new Error("Cannot find project.json configuration");
1544
800
  }
1545
801
  const projectJsonFile = await _promises2.default.readFile(projectJsonPath, "utf8");
1546
802
  const projectJson = JSON.parse(projectJsonFile);
1547
- const projectName = projectJson.name;
803
+ const projectName = projectJson.name || userOptions.name;
1548
804
  const projectConfigurations = _devkit.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
1549
- if (!_optionalChain([projectConfigurations, 'optionalAccess', _80 => _80.projects, 'optionalAccess', _81 => _81[projectName]])) {
805
+ if (!_optionalChain([projectConfigurations, 'optionalAccess', _52 => _52.projects, 'optionalAccess', _53 => _53[projectName]])) {
1550
806
  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.");
1551
807
  }
1552
808
  const options = _defu2.default.call(void 0, userOptions, DEFAULT_BUILD_OPTIONS);
1553
809
  options.name ??= `${projectName}-${options.format}`;
1554
810
  options.target ??= DEFAULT_TARGET;
1555
- const packageJsonPath = _chunkTEEOPHLZjs.joinPaths.call(void 0, workspaceRoot3.dir, options.projectRoot, "package.json");
811
+ const packageJsonPath = _chunkV7LBWOVVjs.joinPaths.call(void 0, workspaceRoot3.dir, options.projectRoot, "package.json");
1556
812
  if (!_fs.existsSync.call(void 0, packageJsonPath)) {
1557
813
  throw new Error("Cannot find package.json configuration");
1558
814
  }
1559
815
  const env = getEnv("esbuild", options);
1560
- const result = {
816
+ const resolvedOptions = {
1561
817
  ...options,
1562
- config,
1563
- mainFields: options.platform === "node" ? [
1564
- "module",
1565
- "main"
1566
- ] : [
1567
- "browser",
1568
- "module",
1569
- "main"
1570
- ],
818
+ tsconfig: _chunkV7LBWOVVjs.joinPaths.call(void 0, projectRoot, userOptions.tsconfig ? userOptions.tsconfig.replace(projectRoot, "") : "tsconfig.json"),
819
+ distDir: "dist",
820
+ name: projectName,
821
+ metafile: userOptions.mode === "development",
1571
822
  ...userOptions,
1572
- tsconfig: _chunkTEEOPHLZjs.joinPaths.call(void 0, projectRoot, userOptions.tsconfig ? userOptions.tsconfig.replace(projectRoot, "") : "tsconfig.json"),
1573
- format: options.format || "cjs",
1574
- entryPoints: await getEntryPoints(config, projectRoot, projectJson.sourceRoot, _nullishCoalesce(userOptions.entry, () => ( "./src/index.ts")), false),
1575
- outdir: userOptions.outputPath || _chunkTEEOPHLZjs.joinPaths.call(void 0, "dist", projectRoot),
1576
- distDir: userOptions.distDir || "dist",
1577
- plugins: [],
1578
- name: userOptions.name || projectName,
1579
- projectConfigurations,
1580
- projectName,
1581
- projectGraph,
1582
- sourceRoot: userOptions.sourceRoot || projectJson.sourceRoot || _chunkTEEOPHLZjs.joinPaths.call(void 0, projectRoot, "src"),
1583
- minify: userOptions.minify || !userOptions.debug,
1584
- verbose: userOptions.verbose || _chunkTEEOPHLZjs.isVerbose.call(void 0, ) || userOptions.debug === true,
1585
- includeSrc: userOptions.includeSrc === true,
1586
- metafile: userOptions.metafile !== false,
1587
- generatePackageJson: userOptions.generatePackageJson !== false,
1588
- clean: userOptions.clean !== false,
1589
- assets: _nullishCoalesce(userOptions.assets, () => ( [])),
1590
- injectShims: userOptions.injectShims !== true,
1591
- bundle: userOptions.bundle !== false,
1592
- keepNames: true,
1593
- watch: userOptions.watch === true,
1594
- footer: userOptions.footer,
1595
- banner: {
1596
- js: options.banner || DEFAULT_COMPILED_BANNER,
1597
- css: options.banner || DEFAULT_COMPILED_BANNER
1598
- },
1599
- splitting: options.format === "iife" ? false : typeof options.splitting === "boolean" ? options.splitting : options.format === "esm",
1600
- treeShaking: options.format === "esm",
823
+ clean: false,
824
+ target: userOptions.target || options.target,
825
+ splitting: options.format === "iife" ? false : options.treeshake === void 0 ? options.splitting : true,
1601
826
  env,
1602
827
  define: {
1603
- STORM_FORMAT: JSON.stringify(options.format || "cjs"),
1604
- ...options.format === "cjs" && options.injectShims ? {
1605
- "import.meta.url": "importMetaUrl"
1606
- } : {},
828
+ STORM_FORMAT: JSON.stringify(options.format),
1607
829
  ...options.define,
1608
830
  ...Object.keys(env || {}).reduce((res, key) => {
1609
831
  const value = JSON.stringify(env[key]);
@@ -1614,167 +836,98 @@ var resolveOptions = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
1614
836
  [`import.meta.env.${safeKey}`]: value
1615
837
  };
1616
838
  }, {})
1617
- },
1618
- inject: [
1619
- options.format === "cjs" && options.injectShims ? _chunkTEEOPHLZjs.joinPaths.call(void 0, __dirname, "../assets/cjs_shims.js") : void 0,
1620
- options.format === "esm" && options.injectShims && options.platform === "node" ? _chunkTEEOPHLZjs.joinPaths.call(void 0, __dirname, "../assets/esm_shims.js") : void 0
1621
- ].filter(Boolean)
839
+ }
1622
840
  };
1623
- result.plugins = _nullishCoalesce(userOptions.plugins, () => ( getDefaultBuildPlugins(userOptions, result)));
1624
- if (options.inject && Array.isArray(options.inject) && options.inject.length > 0) {
1625
- result.inject = options.inject.reduce((ret, inj) => {
1626
- if (inj && typeof inj === "string" && ret.includes(inj)) {
1627
- ret.push(inj);
1628
- }
1629
- return ret;
1630
- }, result.inject);
1631
- }
1632
- delete result.entry;
1633
- delete result.outputPath;
1634
841
  stopwatch();
1635
- return result;
1636
- }, "resolveOptions");
1637
- async function generatePackageJson(context2) {
1638
- if (context2.options.generatePackageJson !== false && _fs.existsSync.call(void 0, _chunkTEEOPHLZjs.joinPaths.call(void 0, context2.options.projectRoot, "package.json"))) {
1639
- _chunkTEEOPHLZjs.writeDebug.call(void 0, " \u270D\uFE0F Writing package.json file", context2.options.config);
1640
- const stopwatch = _chunkTEEOPHLZjs.getStopwatch.call(void 0, "Write package.json file");
1641
- const packageJsonPath = _chunkTEEOPHLZjs.joinPaths.call(void 0, context2.options.projectRoot, "project.json");
842
+ return {
843
+ options: resolvedOptions,
844
+ clean: userOptions.clean !== false,
845
+ workspaceConfig,
846
+ projectConfigurations,
847
+ projectName,
848
+ projectGraph,
849
+ sourceRoot: resolvedOptions.sourceRoot || projectJson.sourceRoot || _chunkV7LBWOVVjs.joinPaths.call(void 0, resolvedOptions.projectRoot, "src"),
850
+ outputPath: resolvedOptions.outputPath || _chunkV7LBWOVVjs.joinPaths.call(void 0, workspaceConfig.workspaceRoot, "dist", resolvedOptions.projectRoot),
851
+ minify: resolvedOptions.minify || resolvedOptions.mode === "production"
852
+ };
853
+ }
854
+ _chunkJ5SB6L2Ljs.__name.call(void 0, resolveContext, "resolveContext");
855
+ async function generatePackageJson(context) {
856
+ if (context.options.generatePackageJson !== false && _fs.existsSync.call(void 0, _chunkV7LBWOVVjs.joinPaths.call(void 0, context.options.projectRoot, "package.json"))) {
857
+ _chunkV7LBWOVVjs.writeDebug.call(void 0, " \u270D\uFE0F Writing package.json file", context.workspaceConfig);
858
+ const stopwatch = _chunkV7LBWOVVjs.getStopwatch.call(void 0, "Write package.json file");
859
+ const packageJsonPath = _chunkV7LBWOVVjs.joinPaths.call(void 0, context.options.projectRoot, "project.json");
1642
860
  if (!_fs.existsSync.call(void 0, packageJsonPath)) {
1643
861
  throw new Error("Cannot find package.json configuration");
1644
862
  }
1645
- const packageJsonFile = await _promises2.default.readFile(_chunkTEEOPHLZjs.joinPaths.call(void 0, context2.options.config.workspaceRoot, context2.options.projectRoot, "package.json"), "utf8");
863
+ const packageJsonFile = await _promises2.default.readFile(_chunkV7LBWOVVjs.joinPaths.call(void 0, context.workspaceConfig.workspaceRoot, context.options.projectRoot, "package.json"), "utf8");
1646
864
  let packageJson = JSON.parse(packageJsonFile);
1647
865
  if (!packageJson) {
1648
866
  throw new Error("Cannot find package.json configuration file");
1649
867
  }
1650
- packageJson = await addPackageDependencies(context2.options.config.workspaceRoot, context2.options.projectRoot, context2.options.projectName, packageJson);
1651
- packageJson = await addWorkspacePackageJsonFields(context2.options.config, context2.options.projectRoot, context2.options.sourceRoot, context2.options.projectName, false, packageJson);
1652
- packageJson.exports ??= {};
1653
- packageJson.exports["./package.json"] ??= "./package.json";
1654
- packageJson.exports["."] ??= `.${context2.options.distDir ? `/${context2.options.distDir}` : ""}/index.js`;
1655
- for (const entryPoint of context2.options.entryPoints) {
1656
- if (entryPoint.out) {
1657
- const entry = entryPoint.out.replaceAll("\\", "/").replaceAll(/^(\.\/)*/g, "").replace(/\.([cm])?[jt]s(x)?$/g, "");
1658
- packageJson.exports[`./${entry}`] ??= `.${context2.options.distDir ? `/${context2.options.distDir}` : ""}/${entry}.js`;
868
+ packageJson = await addPackageDependencies(context.workspaceConfig.workspaceRoot, context.options.projectRoot, context.projectName, packageJson);
869
+ packageJson = await addWorkspacePackageJsonFields(context.workspaceConfig, context.options.projectRoot, context.sourceRoot, context.projectName, false, packageJson);
870
+ if (context.options.entry) {
871
+ packageJson.exports ??= {};
872
+ packageJson.exports["./package.json"] ??= "./package.json";
873
+ packageJson.exports["."] ??= `.${context.options.distDir ? `/${context.options.distDir}` : ""}/index.js`;
874
+ const entryPoints = Array.isArray(context.options.entry) ? context.options.entry : Object.keys(context.options.entry);
875
+ for (const entryPoint of entryPoints) {
876
+ if (context.options.entry[entryPoint]) {
877
+ const entry = context.options.entry[entryPoint].replaceAll("\\", "/").replaceAll(/^(\.\/)*/g, "").replace(/\.([cm])?[jt]s(x)?$/g, "");
878
+ packageJson.exports[`./${entry}`] ??= `.${context.options.distDir ? `/${context.options.distDir}` : ""}/${entry}.js`;
879
+ }
1659
880
  }
1660
- }
1661
- if (context2.options.format === "esm") {
1662
- packageJson.module = packageJson.type === "module" ? `.${context2.options.distDir ? `/${context2.options.distDir}` : ""}/index.js` : `.${context2.options.distDir ? `/${context2.options.distDir}` : ""}/index.mjs`;
1663
- } else {
1664
- packageJson.main = packageJson.type === "commonjs" ? `.${context2.options.distDir ? `/${context2.options.distDir}` : ""}/index.js` : `.${context2.options.distDir ? `/${context2.options.distDir}` : ""}/index.cjs`;
1665
- }
1666
- packageJson.types = `.${context2.options.distDir ? `/${context2.options.distDir}` : ""}/index.d.ts`;
1667
- packageJson.exports = Object.keys(packageJson.exports).reduce((ret, key) => {
1668
- if (key.endsWith("/index") && !ret[key.replace("/index", "")]) {
1669
- ret[key.replace("/index", "")] = packageJson.exports[key];
881
+ if (context.options.format === "esm") {
882
+ packageJson.module = packageJson.type === "module" ? `.${context.options.distDir ? `/${context.options.distDir}` : ""}/index.js` : `.${context.options.distDir ? `/${context.options.distDir}` : ""}/index.mjs`;
883
+ } else {
884
+ packageJson.main = packageJson.type === "commonjs" ? `.${context.options.distDir ? `/${context.options.distDir}` : ""}/index.js` : `.${context.options.distDir ? `/${context.options.distDir}` : ""}/index.cjs`;
1670
885
  }
1671
- return ret;
1672
- }, packageJson.exports);
1673
- await _devkit.writeJsonFile.call(void 0, _chunkTEEOPHLZjs.joinPaths.call(void 0, context2.options.outdir, "package.json"), packageJson);
886
+ packageJson.types = `.${context.options.distDir ? `/${context.options.distDir}` : ""}/index.d.ts`;
887
+ packageJson.exports = Object.keys(packageJson.exports).reduce((ret, key) => {
888
+ if (key.endsWith("/index") && !ret[key.replace("/index", "")]) {
889
+ ret[key.replace("/index", "")] = packageJson.exports[key];
890
+ }
891
+ return ret;
892
+ }, packageJson.exports);
893
+ }
894
+ await _devkit.writeJsonFile.call(void 0, _chunkV7LBWOVVjs.joinPaths.call(void 0, context.outputPath, "package.json"), packageJson);
1674
895
  stopwatch();
1675
896
  }
1676
- return context2;
897
+ return context;
1677
898
  }
1678
899
  _chunkJ5SB6L2Ljs.__name.call(void 0, generatePackageJson, "generatePackageJson");
1679
- async function createOptions(options) {
1680
- return _estoolkit.flatten.call(void 0, await Promise.all(_compat.map.call(void 0, options, (opt) => [
1681
- // we defer it so that we don't trigger glob immediately
1682
- () => resolveOptions(opt)
1683
- ])));
1684
- }
1685
- _chunkJ5SB6L2Ljs.__name.call(void 0, createOptions, "createOptions");
1686
- async function generateContext(getOptions) {
1687
- const options = await getOptions();
1688
- const rendererEngine = new RendererEngine([
1689
- shebangRenderer,
1690
- ...options.renderers || []
1691
- ]);
1692
- return {
1693
- options,
1694
- rendererEngine
1695
- };
1696
- }
1697
- _chunkJ5SB6L2Ljs.__name.call(void 0, generateContext, "generateContext");
1698
- async function executeEsBuild(context2) {
1699
- _chunkTEEOPHLZjs.writeDebug.call(void 0, ` \u{1F680} Running ${context2.options.name} build`, context2.options.config);
1700
- const stopwatch = _chunkTEEOPHLZjs.getStopwatch.call(void 0, `${context2.options.name} build`);
1701
- if (process.env.STORM_WATCH) {
1702
- const ctx = await esbuild2.context(context2.options);
1703
- watch(ctx, context2.options);
1704
- }
1705
- const options = {
1706
- ...context2.options
1707
- };
1708
- options.outdir = _chunkTEEOPHLZjs.joinPaths.call(void 0, context2.options.outdir, context2.options.distDir);
1709
- if (!options.inject || !Array.isArray(options.inject) || options.inject.length === 0 || // eslint-disable-next-line no-constant-binary-expression, @typescript-eslint/no-explicit-any
1710
- options.inject === {}) {
1711
- delete options.inject;
1712
- }
1713
- delete options.dts;
1714
- delete options.env;
1715
- delete options.name;
1716
- delete options.assets;
1717
- delete options.mode;
1718
- delete options.orgName;
1719
- delete options.watch;
1720
- delete options.clean;
1721
- delete options.debug;
1722
- delete options.generatePackageJson;
1723
- delete options.distDir;
1724
- delete options.includeSrc;
1725
- delete options.verbose;
1726
- delete options.projectRoot;
1727
- delete options.projectName;
1728
- delete options.projectGraph;
1729
- delete options.projectConfigurations;
1730
- delete options.renderers;
1731
- delete options.config;
1732
- delete options.injectShims;
1733
- delete options.external;
1734
- _chunkTEEOPHLZjs.writeTrace.call(void 0, `Run esbuild (${context2.options.name}) with the following options:
1735
- ${_chunkTEEOPHLZjs.formatLogMessage.call(void 0, {
1736
- ...options,
1737
- define: "<Hidden>"
1738
- })}`, context2.options.config);
1739
- const result = await esbuild2.build(options);
1740
- await esbuild2.stop();
1741
- if (result.metafile) {
1742
- const metafilePath = `${context2.options.outdir}/${context2.options.name}.meta.json`;
1743
- await _promises2.default.writeFile(metafilePath, JSON.stringify(result.metafile));
1744
- }
900
+ async function executeTsup(context) {
901
+ _chunkV7LBWOVVjs.writeDebug.call(void 0, ` \u{1F680} Running ${context.options.name} build`, context.workspaceConfig);
902
+ const stopwatch = _chunkV7LBWOVVjs.getStopwatch.call(void 0, `${context.options.name} build`);
903
+ await _tsup.build.call(void 0, {
904
+ ...context.options,
905
+ outDir: context.outputPath,
906
+ workspaceConfig: context.workspaceConfig
907
+ });
1745
908
  stopwatch();
1746
- return context2;
1747
- }
1748
- _chunkJ5SB6L2Ljs.__name.call(void 0, executeEsBuild, "executeEsBuild");
1749
- async function executeTypescript(context2) {
1750
- if (_optionalChain([context2, 'access', _82 => _82.result, 'optionalAccess', _83 => _83.errors, 'access', _84 => _84.length]) === 0 && context2.options.dts) {
1751
- _chunkTEEOPHLZjs.writeDebug.call(void 0, ` \u{1F4CB} Running TypeScript Compiler for ${context2.options.name}`, context2.options.config);
1752
- const stopwatch = _chunkTEEOPHLZjs.getStopwatch.call(void 0, `${context2.options.name} asset copy`);
1753
- await emitDts(context2.options.config, context2.options.tsconfig, context2.options.tsconfigRaw, true);
1754
- stopwatch();
1755
- }
1756
- return context2;
909
+ return context;
1757
910
  }
1758
- _chunkJ5SB6L2Ljs.__name.call(void 0, executeTypescript, "executeTypescript");
1759
- async function copyBuildAssets(context2) {
1760
- if (_optionalChain([context2, 'access', _85 => _85.result, 'optionalAccess', _86 => _86.errors, 'access', _87 => _87.length]) === 0) {
1761
- _chunkTEEOPHLZjs.writeDebug.call(void 0, ` \u{1F4CB} Copying asset files to output directory: ${context2.options.outdir}`, context2.options.config);
1762
- const stopwatch = _chunkTEEOPHLZjs.getStopwatch.call(void 0, `${context2.options.name} asset copy`);
1763
- await copyAssets(context2.options.config, _nullishCoalesce(context2.options.assets, () => ( [])), context2.options.outdir, context2.options.projectRoot, context2.options.sourceRoot, true, false);
911
+ _chunkJ5SB6L2Ljs.__name.call(void 0, executeTsup, "executeTsup");
912
+ async function copyBuildAssets(context) {
913
+ if (_optionalChain([context, 'access', _54 => _54.result, 'optionalAccess', _55 => _55.errors, 'access', _56 => _56.length]) === 0) {
914
+ _chunkV7LBWOVVjs.writeDebug.call(void 0, ` \u{1F4CB} Copying asset files to output directory: ${context.outputPath}`, context.workspaceConfig);
915
+ const stopwatch = _chunkV7LBWOVVjs.getStopwatch.call(void 0, `${context.options.name} asset copy`);
916
+ await copyAssets(context.workspaceConfig, _nullishCoalesce(context.options.assets, () => ( [])), context.outputPath, context.options.projectRoot, context.sourceRoot, true, false);
1764
917
  stopwatch();
1765
918
  }
1766
- return context2;
919
+ return context;
1767
920
  }
1768
921
  _chunkJ5SB6L2Ljs.__name.call(void 0, copyBuildAssets, "copyBuildAssets");
1769
- async function reportResults(context2) {
1770
- if (_optionalChain([context2, 'access', _88 => _88.result, 'optionalAccess', _89 => _89.errors, 'access', _90 => _90.length]) === 0) {
1771
- if (context2.result.warnings.length > 0) {
1772
- _chunkTEEOPHLZjs.writeWarning.call(void 0, ` \u{1F6A7} The following warnings occurred during the build: ${context2.result.warnings.map((warning) => warning.text).join("\n")}`, context2.options.config);
922
+ async function reportResults(context) {
923
+ if (_optionalChain([context, 'access', _57 => _57.result, 'optionalAccess', _58 => _58.errors, 'access', _59 => _59.length]) === 0) {
924
+ if (context.result.warnings.length > 0) {
925
+ _chunkV7LBWOVVjs.writeWarning.call(void 0, ` \u{1F6A7} The following warnings occurred during the build: ${context.result.warnings.map((warning) => warning.text).join("\n")}`, context.workspaceConfig);
1773
926
  }
1774
- _chunkTEEOPHLZjs.writeSuccess.call(void 0, ` \u{1F4E6} The ${context2.options.name} build completed successfully`, context2.options.config);
1775
- } else if (_optionalChain([context2, 'access', _91 => _91.result, 'optionalAccess', _92 => _92.errors]) && _optionalChain([context2, 'access', _93 => _93.result, 'optionalAccess', _94 => _94.errors, 'access', _95 => _95.length]) > 0) {
1776
- _chunkTEEOPHLZjs.writeError.call(void 0, ` \u274C The ${context2.options.name} build failed with the following errors: ${context2.result.errors.map((error) => error.text).join("\n")}`, context2.options.config);
1777
- throw new Error(`The ${context2.options.name} build failed with the following errors: ${context2.result.errors.map((error) => error.text).join("\n")}`);
927
+ _chunkV7LBWOVVjs.writeSuccess.call(void 0, ` \u{1F4E6} The ${context.options.name} build completed successfully`, context.workspaceConfig);
928
+ } else if (_optionalChain([context, 'access', _60 => _60.result, 'optionalAccess', _61 => _61.errors]) && _optionalChain([context, 'access', _62 => _62.result, 'optionalAccess', _63 => _63.errors, 'access', _64 => _64.length]) > 0) {
929
+ _chunkV7LBWOVVjs.writeError.call(void 0, ` \u274C The ${context.options.name} build failed with the following errors: ${context.result.errors.map((error) => error.text).join("\n")}`, context.workspaceConfig);
930
+ throw new Error(`The ${context.options.name} build failed with the following errors: ${context.result.errors.map((error) => error.text).join("\n")}`);
1778
931
  }
1779
932
  }
1780
933
  _chunkJ5SB6L2Ljs.__name.call(void 0, reportResults, "reportResults");
@@ -1785,7 +938,7 @@ async function dependencyCheck(options) {
1785
938
  if (process.env.CI && !process.env.BUILDKITE) {
1786
939
  return void 0;
1787
940
  }
1788
- const buildPromise = esbuild2.build({
941
+ const buildPromise = esbuild.build({
1789
942
  entryPoints: _globby.globbySync.call(void 0, "**/*.{j,t}s", {
1790
943
  // We don't check dependencies in ecosystem tests because tests are isolated from the build.
1791
944
  ignore: [
@@ -1808,19 +961,19 @@ async function dependencyCheck(options) {
1808
961
  return void 0;
1809
962
  }
1810
963
  _chunkJ5SB6L2Ljs.__name.call(void 0, dependencyCheck, "dependencyCheck");
1811
- async function cleanOutputPath(context2) {
1812
- if (context2.options.clean !== false && context2.options.outdir) {
1813
- _chunkTEEOPHLZjs.writeDebug.call(void 0, ` \u{1F9F9} Cleaning ${context2.options.name} output path: ${context2.options.outdir}`, context2.options.config);
1814
- const stopwatch = _chunkTEEOPHLZjs.getStopwatch.call(void 0, `${context2.options.name} output clean`);
1815
- await cleanDirectories(context2.options.name, context2.options.outdir, context2.options.config);
964
+ async function cleanOutputPath(context) {
965
+ if (context.clean !== false && context.outputPath) {
966
+ _chunkV7LBWOVVjs.writeDebug.call(void 0, ` \u{1F9F9} Cleaning ${context.options.name} output path: ${context.outputPath}`, context.workspaceConfig);
967
+ const stopwatch = _chunkV7LBWOVVjs.getStopwatch.call(void 0, `${context.options.name} output clean`);
968
+ await cleanDirectories(context.outputPath);
1816
969
  stopwatch();
1817
970
  }
1818
- return context2;
971
+ return context;
1819
972
  }
1820
973
  _chunkJ5SB6L2Ljs.__name.call(void 0, cleanOutputPath, "cleanOutputPath");
1821
- async function build3(options) {
1822
- _chunkTEEOPHLZjs.writeDebug.call(void 0, ` \u26A1 Executing Storm ESBuild pipeline`);
1823
- const stopwatch = _chunkTEEOPHLZjs.getStopwatch.call(void 0, "ESBuild pipeline");
974
+ async function build2(options) {
975
+ _chunkV7LBWOVVjs.writeDebug.call(void 0, ` \u26A1 Executing Storm ESBuild pipeline`);
976
+ const stopwatch = _chunkV7LBWOVVjs.getStopwatch.call(void 0, "ESBuild pipeline");
1824
977
  try {
1825
978
  const opts = Array.isArray(options) ? options : [
1826
979
  options
@@ -1828,57 +981,36 @@ async function build3(options) {
1828
981
  if (opts.length === 0) {
1829
982
  throw new Error("No build options were provided");
1830
983
  }
1831
- void transduce.async(opts, dependencyCheck);
1832
- await transduce.async(await createOptions(opts), pipe.async(generateContext, cleanOutputPath, generatePackageJson, executeTypescript, executeEsBuild, copyBuildAssets, reportResults));
1833
- _chunkTEEOPHLZjs.writeSuccess.call(void 0, " \u{1F3C1} ESBuild pipeline build completed successfully");
984
+ const context = await resolveContext(options);
985
+ await cleanOutputPath(context);
986
+ await Promise.all([
987
+ dependencyCheck(context.options),
988
+ generatePackageJson(context),
989
+ copyBuildAssets(context),
990
+ executeTsup(context)
991
+ ]);
992
+ await reportResults(context);
993
+ _chunkV7LBWOVVjs.writeSuccess.call(void 0, " \u{1F3C1} ESBuild pipeline build completed successfully");
1834
994
  } catch (error) {
1835
- _chunkTEEOPHLZjs.writeFatal.call(void 0, "Fatal errors that the build process could not recover from have occured. The build process has been terminated.");
995
+ _chunkV7LBWOVVjs.writeFatal.call(void 0, "Fatal errors that the build process could not recover from have occured. The build process has been terminated.");
1836
996
  throw error;
1837
997
  } finally {
1838
998
  stopwatch();
1839
999
  }
1840
1000
  }
1841
- _chunkJ5SB6L2Ljs.__name.call(void 0, build3, "build");
1842
- var watch = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (context2, options) => {
1843
- if (!options.watch) {
1844
- return context2;
1845
- }
1846
- const config = {
1847
- ignoreInitial: true,
1848
- useFsEvents: true,
1849
- ignored: [
1850
- "./src/__tests__/**/*",
1851
- "./package.json"
1852
- ]
1853
- };
1854
- const changeWatcher = _chokidar.watch.call(void 0, [
1855
- "./src/**/*"
1856
- ], config);
1857
- const fastRebuild = _estoolkit.debounce.call(void 0, async () => {
1858
- const timeBefore = Date.now();
1859
- const rebuildResult = await handle.async(() => {
1860
- return context2.rebuild();
1861
- });
1862
- if (rebuildResult instanceof Error) {
1863
- _chunkTEEOPHLZjs.writeError.call(void 0, rebuildResult.message);
1864
- }
1865
- _chunkTEEOPHLZjs.writeTrace.call(void 0, `${Date.now() - timeBefore}ms [${_nullishCoalesce(options.name, () => ( ""))}]`);
1866
- }, 10);
1867
- changeWatcher.on("change", fastRebuild);
1868
- return void 0;
1869
- }, "watch");
1001
+ _chunkJ5SB6L2Ljs.__name.call(void 0, build2, "build");
1870
1002
 
1871
1003
  // ../workspace-tools/src/executors/esbuild/executor.ts
1872
- async function esbuildExecutorFn(options, context2, config) {
1873
- _chunkTEEOPHLZjs.writeInfo.call(void 0, "\u{1F4E6} Running Storm ESBuild executor on the workspace", config);
1874
- if (!_optionalChain([context2, 'access', _96 => _96.projectsConfigurations, 'optionalAccess', _97 => _97.projects]) || !context2.projectName || !context2.projectsConfigurations.projects[context2.projectName] || !_optionalChain([context2, 'access', _98 => _98.projectsConfigurations, 'access', _99 => _99.projects, 'access', _100 => _100[context2.projectName], 'optionalAccess', _101 => _101.root])) {
1004
+ async function esbuildExecutorFn(options, context, config) {
1005
+ _chunkV7LBWOVVjs.writeInfo.call(void 0, "\u{1F4E6} Running Storm ESBuild executor on the workspace", config);
1006
+ if (!_optionalChain([context, 'access', _65 => _65.projectsConfigurations, 'optionalAccess', _66 => _66.projects]) || !context.projectName || !context.projectsConfigurations.projects[context.projectName] || !_optionalChain([context, 'access', _67 => _67.projectsConfigurations, 'access', _68 => _68.projects, 'access', _69 => _69[context.projectName], 'optionalAccess', _70 => _70.root])) {
1875
1007
  throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace.");
1876
1008
  }
1877
- await build3({
1009
+ await build2({
1878
1010
  ...options,
1879
- projectRoot: _optionalChain([context2, 'access', _102 => _102.projectsConfigurations, 'access', _103 => _103.projects, 'optionalAccess', _104 => _104[context2.projectName], 'access', _105 => _105.root]),
1880
- projectName: context2.projectName,
1881
- sourceRoot: _optionalChain([context2, 'access', _106 => _106.projectsConfigurations, 'access', _107 => _107.projects, 'optionalAccess', _108 => _108[context2.projectName], 'optionalAccess', _109 => _109.sourceRoot]),
1011
+ projectRoot: _optionalChain([context, 'access', _71 => _71.projectsConfigurations, 'access', _72 => _72.projects, 'optionalAccess', _73 => _73[context.projectName], 'access', _74 => _74.root]),
1012
+ name: context.projectName,
1013
+ sourceRoot: _optionalChain([context, 'access', _75 => _75.projectsConfigurations, 'access', _76 => _76.projects, 'optionalAccess', _77 => _77[context.projectName], 'optionalAccess', _78 => _78.sourceRoot]),
1882
1014
  format: options.format,
1883
1015
  platform: options.format
1884
1016
  });
@@ -1912,7 +1044,7 @@ var _prettier = require('prettier');
1912
1044
  var _readyamlfile = require('read-yaml-file'); var _readyamlfile2 = _interopRequireDefault(_readyamlfile);
1913
1045
 
1914
1046
  // ../workspace-tools/src/executors/npm-publish/executor.ts
1915
- var LARGE_BUFFER3 = 1024 * 1e6;
1047
+ var LARGE_BUFFER2 = 1024 * 1e6;
1916
1048
 
1917
1049
  // ../workspace-tools/src/executors/size-limit/executor.ts
1918
1050
 
@@ -1920,19 +1052,19 @@ var _esbuild2 = require('@size-limit/esbuild'); var _esbuild3 = _interopRequireD
1920
1052
  var _esbuildwhy = require('@size-limit/esbuild-why'); var _esbuildwhy2 = _interopRequireDefault(_esbuildwhy);
1921
1053
  var _file = require('@size-limit/file'); var _file2 = _interopRequireDefault(_file);
1922
1054
  var _sizelimit = require('size-limit'); var _sizelimit2 = _interopRequireDefault(_sizelimit);
1923
- async function sizeLimitExecutorFn(options, context2, config) {
1924
- if (!_optionalChain([context2, 'optionalAccess', _110 => _110.projectName]) || !_optionalChain([context2, 'access', _111 => _111.projectsConfigurations, 'optionalAccess', _112 => _112.projects]) || !context2.projectsConfigurations.projects[context2.projectName]) {
1055
+ async function sizeLimitExecutorFn(options, context, config) {
1056
+ if (!_optionalChain([context, 'optionalAccess', _79 => _79.projectName]) || !_optionalChain([context, 'access', _80 => _80.projectsConfigurations, 'optionalAccess', _81 => _81.projects]) || !context.projectsConfigurations.projects[context.projectName]) {
1925
1057
  throw new Error("The Size-Limit process failed because the context is not valid. Please run this command from a workspace.");
1926
1058
  }
1927
- _chunkTEEOPHLZjs.writeInfo.call(void 0, `\u{1F4CF} Running Size-Limit on ${context2.projectName}`, config);
1059
+ _chunkV7LBWOVVjs.writeInfo.call(void 0, `\u{1F4CF} Running Size-Limit on ${context.projectName}`, config);
1928
1060
  _sizelimit2.default.call(void 0, [
1929
1061
  _file2.default,
1930
1062
  _esbuild3.default,
1931
1063
  _esbuildwhy2.default
1932
1064
  ], {
1933
- checks: _nullishCoalesce(_nullishCoalesce(options.entry, () => ( _optionalChain([context2, 'access', _113 => _113.projectsConfigurations, 'access', _114 => _114.projects, 'access', _115 => _115[context2.projectName], 'optionalAccess', _116 => _116.sourceRoot]))), () => ( _devkit.joinPathFragments.call(void 0, _nullishCoalesce(_optionalChain([context2, 'access', _117 => _117.projectsConfigurations, 'access', _118 => _118.projects, 'access', _119 => _119[context2.projectName], 'optionalAccess', _120 => _120.root]), () => ( "./")), "src")))
1065
+ checks: _nullishCoalesce(_nullishCoalesce(options.entry, () => ( _optionalChain([context, 'access', _82 => _82.projectsConfigurations, 'access', _83 => _83.projects, 'access', _84 => _84[context.projectName], 'optionalAccess', _85 => _85.sourceRoot]))), () => ( _devkit.joinPathFragments.call(void 0, _nullishCoalesce(_optionalChain([context, 'access', _86 => _86.projectsConfigurations, 'access', _87 => _87.projects, 'access', _88 => _88[context.projectName], 'optionalAccess', _89 => _89.root]), () => ( "./")), "src")))
1934
1066
  }).then((result) => {
1935
- _chunkTEEOPHLZjs.writeInfo.call(void 0, `\u{1F4CF} ${context2.projectName} Size-Limit result: ${JSON.stringify(result)}`, config);
1067
+ _chunkV7LBWOVVjs.writeInfo.call(void 0, `\u{1F4CF} ${context.projectName} Size-Limit result: ${JSON.stringify(result)}`, config);
1936
1068
  });
1937
1069
  return {
1938
1070
  success: true
@@ -1953,11 +1085,11 @@ var _fsextra = require('fs-extra');
1953
1085
  var _TypiaProgrammerjs = require('typia/lib/programmers/TypiaProgrammer.js');
1954
1086
  async function typiaExecutorFn(options, _, config) {
1955
1087
  if (options.clean !== false) {
1956
- _chunkTEEOPHLZjs.writeInfo.call(void 0, `\u{1F9F9} Cleaning output path: ${options.outputPath}`, config);
1088
+ _chunkV7LBWOVVjs.writeInfo.call(void 0, `\u{1F9F9} Cleaning output path: ${options.outputPath}`, config);
1957
1089
  _fsextra.removeSync.call(void 0, options.outputPath);
1958
1090
  }
1959
1091
  await Promise.all(options.entry.map((entry) => {
1960
- _chunkTEEOPHLZjs.writeInfo.call(void 0, `\u{1F680} Running Typia on entry: ${entry}`, config);
1092
+ _chunkV7LBWOVVjs.writeInfo.call(void 0, `\u{1F680} Running Typia on entry: ${entry}`, config);
1961
1093
  return _TypiaProgrammerjs.TypiaProgrammer.build({
1962
1094
  input: entry,
1963
1095
  output: options.outputPath,
@@ -1987,32 +1119,32 @@ var executor_default8 = withRunExecutor("Typia runtime validation generator", ty
1987
1119
  // ../workspace-tools/src/executors/unbuild/executor.ts
1988
1120
 
1989
1121
  var _jiti = require('jiti');
1990
- async function unbuildExecutorFn(options, context2, config) {
1991
- _chunkTEEOPHLZjs.writeInfo.call(void 0, "\u{1F4E6} Running Storm Unbuild executor on the workspace", config);
1992
- if (!_optionalChain([context2, 'access', _121 => _121.projectsConfigurations, 'optionalAccess', _122 => _122.projects]) || !context2.projectName || !context2.projectsConfigurations.projects[context2.projectName]) {
1122
+ async function unbuildExecutorFn(options, context, config) {
1123
+ _chunkV7LBWOVVjs.writeInfo.call(void 0, "\u{1F4E6} Running Storm Unbuild executor on the workspace", config);
1124
+ if (!_optionalChain([context, 'access', _90 => _90.projectsConfigurations, 'optionalAccess', _91 => _91.projects]) || !context.projectName || !context.projectsConfigurations.projects[context.projectName]) {
1993
1125
  throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace root directory.");
1994
1126
  }
1995
- if (!context2.projectsConfigurations.projects[context2.projectName].root) {
1127
+ if (!context.projectsConfigurations.projects[context.projectName].root) {
1996
1128
  throw new Error("The Build process failed because the project root is not valid. Please run this command from a workspace root directory.");
1997
1129
  }
1998
- if (!context2.projectsConfigurations.projects[context2.projectName].sourceRoot) {
1130
+ if (!context.projectsConfigurations.projects[context.projectName].sourceRoot) {
1999
1131
  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.");
2000
1132
  }
2001
1133
  const jiti = _jiti.createJiti.call(void 0, config.workspaceRoot, {
2002
- fsCache: config.skipCache ? false : _chunkTEEOPHLZjs.joinPaths.call(void 0, config.workspaceRoot, config.directories.cache || "node_modules/.cache/storm", "jiti"),
1134
+ fsCache: config.skipCache ? false : _chunkV7LBWOVVjs.joinPaths.call(void 0, config.workspaceRoot, config.directories.cache || "node_modules/.cache/storm", "jiti"),
2003
1135
  interopDefault: true
2004
1136
  });
2005
1137
  const stormUnbuild = await jiti.import(jiti.esmResolve("@storm-software/unbuild/build"));
2006
1138
  await stormUnbuild.build(_defu.defu.call(void 0, {
2007
1139
  ...options,
2008
- projectRoot: context2.projectsConfigurations.projects[context2.projectName].root,
2009
- projectName: context2.projectName,
2010
- sourceRoot: context2.projectsConfigurations.projects[context2.projectName].sourceRoot,
1140
+ projectRoot: context.projectsConfigurations.projects[context.projectName].root,
1141
+ projectName: context.projectName,
1142
+ sourceRoot: context.projectsConfigurations.projects[context.projectName].sourceRoot,
2011
1143
  platform: options.platform
2012
1144
  }, {
2013
1145
  stubOptions: {
2014
1146
  jiti: {
2015
- fsCache: config.skipCache ? false : _chunkTEEOPHLZjs.joinPaths.call(void 0, config.workspaceRoot, config.directories.cache || "node_modules/.cache/storm", "jiti")
1147
+ fsCache: config.skipCache ? false : _chunkV7LBWOVVjs.joinPaths.call(void 0, config.workspaceRoot, config.directories.cache || "node_modules/.cache/storm", "jiti")
2016
1148
  }
2017
1149
  },
2018
1150
  rollup: {
@@ -2060,58 +1192,58 @@ var executor_default9 = withRunExecutor("TypeScript Unbuild build", unbuildExecu
2060
1192
  var withRunGenerator = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (name, generatorFn, generatorOptions = {
2061
1193
  skipReadingConfig: false
2062
1194
  }) => async (tree, _options) => {
2063
- const stopwatch = _chunkTEEOPHLZjs.getStopwatch.call(void 0, name);
1195
+ const stopwatch = _chunkV7LBWOVVjs.getStopwatch.call(void 0, name);
2064
1196
  let options = _options;
2065
1197
  let config;
2066
1198
  try {
2067
- _chunkTEEOPHLZjs.writeInfo.call(void 0, `\u26A1 Running the ${name} generator...
1199
+ _chunkV7LBWOVVjs.writeInfo.call(void 0, `\u26A1 Running the ${name} generator...
2068
1200
 
2069
1201
  `, config);
2070
- const workspaceRoot3 = _chunkTEEOPHLZjs.findWorkspaceRoot.call(void 0, );
1202
+ const workspaceRoot3 = _chunkV7LBWOVVjs.findWorkspaceRoot.call(void 0, );
2071
1203
  if (!generatorOptions.skipReadingConfig) {
2072
- _chunkTEEOPHLZjs.writeDebug.call(void 0, `Loading the Storm Config from environment variables and storm.config.js file...
1204
+ _chunkV7LBWOVVjs.writeDebug.call(void 0, `Loading the Storm Config from environment variables and storm.config.js file...
2073
1205
  - workspaceRoot: ${workspaceRoot3}`, config);
2074
- config = await _chunkXFPT4O23js.getConfig.call(void 0, workspaceRoot3);
1206
+ config = await _chunkIVLCYFXDjs.getConfig.call(void 0, workspaceRoot3);
2075
1207
  }
2076
- if (_optionalChain([generatorOptions, 'optionalAccess', _123 => _123.hooks, 'optionalAccess', _124 => _124.applyDefaultOptions])) {
2077
- _chunkTEEOPHLZjs.writeDebug.call(void 0, "Running the applyDefaultOptions hook...", config);
1208
+ if (_optionalChain([generatorOptions, 'optionalAccess', _92 => _92.hooks, 'optionalAccess', _93 => _93.applyDefaultOptions])) {
1209
+ _chunkV7LBWOVVjs.writeDebug.call(void 0, "Running the applyDefaultOptions hook...", config);
2078
1210
  options = await Promise.resolve(generatorOptions.hooks.applyDefaultOptions(options, config));
2079
- _chunkTEEOPHLZjs.writeDebug.call(void 0, "Completed the applyDefaultOptions hook", config);
1211
+ _chunkV7LBWOVVjs.writeDebug.call(void 0, "Completed the applyDefaultOptions hook", config);
2080
1212
  }
2081
- _chunkTEEOPHLZjs.writeTrace.call(void 0, `Generator schema options \u2699\uFE0F
1213
+ _chunkV7LBWOVVjs.writeTrace.call(void 0, `Generator schema options \u2699\uFE0F
2082
1214
  ${Object.keys(_nullishCoalesce(options, () => ( {}))).map((key) => ` - ${key}=${JSON.stringify(options[key])}`).join("\n")}`, config);
2083
1215
  const tokenized = await applyWorkspaceTokens(options, {
2084
1216
  workspaceRoot: tree.root,
2085
1217
  config
2086
1218
  }, applyWorkspaceBaseTokens);
2087
- if (_optionalChain([generatorOptions, 'optionalAccess', _125 => _125.hooks, 'optionalAccess', _126 => _126.preProcess])) {
2088
- _chunkTEEOPHLZjs.writeDebug.call(void 0, "Running the preProcess hook...", config);
1219
+ if (_optionalChain([generatorOptions, 'optionalAccess', _94 => _94.hooks, 'optionalAccess', _95 => _95.preProcess])) {
1220
+ _chunkV7LBWOVVjs.writeDebug.call(void 0, "Running the preProcess hook...", config);
2089
1221
  await Promise.resolve(generatorOptions.hooks.preProcess(tokenized, config));
2090
- _chunkTEEOPHLZjs.writeDebug.call(void 0, "Completed the preProcess hook", config);
1222
+ _chunkV7LBWOVVjs.writeDebug.call(void 0, "Completed the preProcess hook", config);
2091
1223
  }
2092
1224
  const result = await Promise.resolve(generatorFn(tree, tokenized, config));
2093
1225
  if (result) {
2094
- if (result.success === false || result.error && _optionalChain([result, 'optionalAccess', _127 => _127.error, 'optionalAccess', _128 => _128.message]) && typeof _optionalChain([result, 'optionalAccess', _129 => _129.error, 'optionalAccess', _130 => _130.message]) === "string" && _optionalChain([result, 'optionalAccess', _131 => _131.error, 'optionalAccess', _132 => _132.name]) && typeof _optionalChain([result, 'optionalAccess', _133 => _133.error, 'optionalAccess', _134 => _134.name]) === "string") {
1226
+ if (result.success === false || result.error && _optionalChain([result, 'optionalAccess', _96 => _96.error, 'optionalAccess', _97 => _97.message]) && typeof _optionalChain([result, 'optionalAccess', _98 => _98.error, 'optionalAccess', _99 => _99.message]) === "string" && _optionalChain([result, 'optionalAccess', _100 => _100.error, 'optionalAccess', _101 => _101.name]) && typeof _optionalChain([result, 'optionalAccess', _102 => _102.error, 'optionalAccess', _103 => _103.name]) === "string") {
2095
1227
  throw new Error(`The ${name} generator failed to run`, {
2096
- cause: _optionalChain([result, 'optionalAccess', _135 => _135.error])
1228
+ cause: _optionalChain([result, 'optionalAccess', _104 => _104.error])
2097
1229
  });
2098
1230
  } else if (result.success && result.data) {
2099
1231
  return result;
2100
1232
  }
2101
1233
  }
2102
- if (_optionalChain([generatorOptions, 'optionalAccess', _136 => _136.hooks, 'optionalAccess', _137 => _137.postProcess])) {
2103
- _chunkTEEOPHLZjs.writeDebug.call(void 0, "Running the postProcess hook...", config);
1234
+ if (_optionalChain([generatorOptions, 'optionalAccess', _105 => _105.hooks, 'optionalAccess', _106 => _106.postProcess])) {
1235
+ _chunkV7LBWOVVjs.writeDebug.call(void 0, "Running the postProcess hook...", config);
2104
1236
  await Promise.resolve(generatorOptions.hooks.postProcess(config));
2105
- _chunkTEEOPHLZjs.writeDebug.call(void 0, "Completed the postProcess hook", config);
1237
+ _chunkV7LBWOVVjs.writeDebug.call(void 0, "Completed the postProcess hook", config);
2106
1238
  }
2107
1239
  return () => {
2108
- _chunkTEEOPHLZjs.writeSuccess.call(void 0, `Completed running the ${name} generator!
1240
+ _chunkV7LBWOVVjs.writeSuccess.call(void 0, `Completed running the ${name} generator!
2109
1241
  `, config);
2110
1242
  };
2111
1243
  } catch (error) {
2112
1244
  return () => {
2113
- _chunkTEEOPHLZjs.writeFatal.call(void 0, "A fatal error occurred while running the generator - the process was forced to terminate", config);
2114
- _chunkTEEOPHLZjs.writeError.call(void 0, `An exception was thrown in the generator's process
1245
+ _chunkV7LBWOVVjs.writeFatal.call(void 0, "A fatal error occurred while running the generator - the process was forced to terminate", config);
1246
+ _chunkV7LBWOVVjs.writeError.call(void 0, `An exception was thrown in the generator's process
2115
1247
  - Details: ${error.message}
2116
1248
  - Stacktrace: ${error.stack}`, config);
2117
1249
  };
@@ -2157,7 +1289,7 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
2157
1289
  const projectConfig = {
2158
1290
  root: normalized.directory,
2159
1291
  projectType: "library",
2160
- sourceRoot: _chunkTEEOPHLZjs.joinPaths.call(void 0, _nullishCoalesce(normalized.directory, () => ( "")), "src"),
1292
+ sourceRoot: _chunkV7LBWOVVjs.joinPaths.call(void 0, _nullishCoalesce(normalized.directory, () => ( "")), "src"),
2161
1293
  targets: {
2162
1294
  build: {
2163
1295
  executor: options.buildExecutor,
@@ -2166,11 +1298,11 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
2166
1298
  ],
2167
1299
  options: {
2168
1300
  entry: [
2169
- _chunkTEEOPHLZjs.joinPaths.call(void 0, normalized.projectRoot, "src", "index.ts")
1301
+ _chunkV7LBWOVVjs.joinPaths.call(void 0, normalized.projectRoot, "src", "index.ts")
2170
1302
  ],
2171
1303
  outputPath: getOutputPath(normalized),
2172
- tsconfig: _chunkTEEOPHLZjs.joinPaths.call(void 0, normalized.projectRoot, "tsconfig.json"),
2173
- project: _chunkTEEOPHLZjs.joinPaths.call(void 0, normalized.projectRoot, "package.json"),
1304
+ tsconfig: _chunkV7LBWOVVjs.joinPaths.call(void 0, normalized.projectRoot, "tsconfig.json"),
1305
+ project: _chunkV7LBWOVVjs.joinPaths.call(void 0, normalized.projectRoot, "package.json"),
2174
1306
  defaultConfiguration: "production",
2175
1307
  platform: "neutral",
2176
1308
  assets: [
@@ -2209,22 +1341,22 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
2209
1341
  _devkit.addProjectConfiguration.call(void 0, tree, normalized.name, projectConfig);
2210
1342
  let repository = {
2211
1343
  type: "github",
2212
- url: _optionalChain([config, 'optionalAccess', _138 => _138.repository]) || `https://github.com/${_optionalChain([config, 'optionalAccess', _139 => _139.organization]) || "storm-software"}/${_optionalChain([config, 'optionalAccess', _140 => _140.namespace]) || _optionalChain([config, 'optionalAccess', _141 => _141.name]) || "repository"}.git`
1344
+ url: _optionalChain([config, 'optionalAccess', _107 => _107.repository]) || `https://github.com/${_optionalChain([config, 'optionalAccess', _108 => _108.organization]) || "storm-software"}/${_optionalChain([config, 'optionalAccess', _109 => _109.namespace]) || _optionalChain([config, 'optionalAccess', _110 => _110.name]) || "repository"}.git`
2213
1345
  };
2214
1346
  let description = options.description || "A package developed by Storm Software used to create modern, scalable web applications.";
2215
1347
  if (tree.exists("package.json")) {
2216
1348
  const packageJson = _devkit.readJson.call(void 0, tree, "package.json");
2217
- if (_optionalChain([packageJson, 'optionalAccess', _142 => _142.repository])) {
1349
+ if (_optionalChain([packageJson, 'optionalAccess', _111 => _111.repository])) {
2218
1350
  repository = packageJson.repository;
2219
1351
  }
2220
- if (_optionalChain([packageJson, 'optionalAccess', _143 => _143.description])) {
1352
+ if (_optionalChain([packageJson, 'optionalAccess', _112 => _112.description])) {
2221
1353
  description = packageJson.description;
2222
1354
  }
2223
1355
  }
2224
1356
  if (!normalized.importPath) {
2225
1357
  normalized.importPath = normalized.name;
2226
1358
  }
2227
- const packageJsonPath = _chunkTEEOPHLZjs.joinPaths.call(void 0, normalized.projectRoot, "package.json");
1359
+ const packageJsonPath = _chunkV7LBWOVVjs.joinPaths.call(void 0, normalized.projectRoot, "package.json");
2228
1360
  if (tree.exists(packageJsonPath)) {
2229
1361
  _devkit.updateJson.call(void 0, tree, packageJsonPath, (json) => {
2230
1362
  if (!normalized.importPath) {
@@ -2272,30 +1404,30 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
2272
1404
  _devkit.updateJson.call(void 0, tree, "package.json", (json) => ({
2273
1405
  ...json,
2274
1406
  pnpm: {
2275
- ..._optionalChain([json, 'optionalAccess', _144 => _144.pnpm]),
1407
+ ..._optionalChain([json, 'optionalAccess', _113 => _113.pnpm]),
2276
1408
  overrides: {
2277
- ..._optionalChain([json, 'optionalAccess', _145 => _145.pnpm, 'optionalAccess', _146 => _146.overrides]),
1409
+ ..._optionalChain([json, 'optionalAccess', _114 => _114.pnpm, 'optionalAccess', _115 => _115.overrides]),
2278
1410
  [_nullishCoalesce(normalized.importPath, () => ( ""))]: "workspace:*"
2279
1411
  }
2280
1412
  }
2281
1413
  }));
2282
1414
  }
2283
1415
  _js.addTsConfigPath.call(void 0, tree, normalized.importPath, [
2284
- _chunkTEEOPHLZjs.joinPaths.call(void 0, normalized.projectRoot, "./src", `index.${normalized.js ? "js" : "ts"}`)
1416
+ _chunkV7LBWOVVjs.joinPaths.call(void 0, normalized.projectRoot, "./src", `index.${normalized.js ? "js" : "ts"}`)
2285
1417
  ]);
2286
- _js.addTsConfigPath.call(void 0, tree, _chunkTEEOPHLZjs.joinPaths.call(void 0, normalized.importPath, "/*"), [
2287
- _chunkTEEOPHLZjs.joinPaths.call(void 0, normalized.projectRoot, "./src", "/*")
1418
+ _js.addTsConfigPath.call(void 0, tree, _chunkV7LBWOVVjs.joinPaths.call(void 0, normalized.importPath, "/*"), [
1419
+ _chunkV7LBWOVVjs.joinPaths.call(void 0, normalized.projectRoot, "./src", "/*")
2288
1420
  ]);
2289
1421
  if (tree.exists("package.json")) {
2290
1422
  const packageJson = _devkit.readJson.call(void 0, tree, "package.json");
2291
- if (_optionalChain([packageJson, 'optionalAccess', _147 => _147.repository])) {
1423
+ if (_optionalChain([packageJson, 'optionalAccess', _116 => _116.repository])) {
2292
1424
  repository = packageJson.repository;
2293
1425
  }
2294
- if (_optionalChain([packageJson, 'optionalAccess', _148 => _148.description])) {
1426
+ if (_optionalChain([packageJson, 'optionalAccess', _117 => _117.description])) {
2295
1427
  description = packageJson.description;
2296
1428
  }
2297
1429
  }
2298
- const tsconfigPath = _chunkTEEOPHLZjs.joinPaths.call(void 0, normalized.projectRoot, "tsconfig.json");
1430
+ const tsconfigPath = _chunkV7LBWOVVjs.joinPaths.call(void 0, normalized.projectRoot, "tsconfig.json");
2299
1431
  if (tree.exists(tsconfigPath)) {
2300
1432
  _devkit.updateJson.call(void 0, tree, tsconfigPath, (json) => {
2301
1433
  json.composite ??= true;
@@ -2333,42 +1465,42 @@ function getOutputPath(options) {
2333
1465
  } else {
2334
1466
  parts.push(options.projectRoot);
2335
1467
  }
2336
- return _chunkTEEOPHLZjs.joinPaths.call(void 0, ...parts);
1468
+ return _chunkV7LBWOVVjs.joinPaths.call(void 0, ...parts);
2337
1469
  }
2338
1470
  _chunkJ5SB6L2Ljs.__name.call(void 0, getOutputPath, "getOutputPath");
2339
1471
  function createProjectTsConfigJson(tree, options) {
2340
1472
  const tsconfig = {
2341
1473
  extends: options.rootProject ? void 0 : _js.getRelativePathToRootTsConfig.call(void 0, tree, options.projectRoot),
2342
- ..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _149 => _149.tsconfigOptions]), () => ( {})),
1474
+ ..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _118 => _118.tsconfigOptions]), () => ( {})),
2343
1475
  compilerOptions: {
2344
1476
  ...options.rootProject ? _js.tsConfigBaseOptions : {},
2345
- outDir: _chunkTEEOPHLZjs.joinPaths.call(void 0, _devkit.offsetFromRoot.call(void 0, options.projectRoot), "dist/out-tsc"),
1477
+ outDir: _chunkV7LBWOVVjs.joinPaths.call(void 0, _devkit.offsetFromRoot.call(void 0, options.projectRoot), "dist/out-tsc"),
2346
1478
  noEmit: true,
2347
- ..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _150 => _150.tsconfigOptions, 'optionalAccess', _151 => _151.compilerOptions]), () => ( {}))
1479
+ ..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _119 => _119.tsconfigOptions, 'optionalAccess', _120 => _120.compilerOptions]), () => ( {}))
2348
1480
  },
2349
1481
  files: [
2350
- ..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _152 => _152.tsconfigOptions, 'optionalAccess', _153 => _153.files]), () => ( []))
1482
+ ..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _121 => _121.tsconfigOptions, 'optionalAccess', _122 => _122.files]), () => ( []))
2351
1483
  ],
2352
1484
  include: [
2353
- ..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _154 => _154.tsconfigOptions, 'optionalAccess', _155 => _155.include]), () => ( [])),
1485
+ ..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _123 => _123.tsconfigOptions, 'optionalAccess', _124 => _124.include]), () => ( [])),
2354
1486
  "src/**/*.ts",
2355
1487
  "src/**/*.js",
2356
1488
  "bin/**/*"
2357
1489
  ],
2358
1490
  exclude: [
2359
- ..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _156 => _156.tsconfigOptions, 'optionalAccess', _157 => _157.exclude]), () => ( [])),
1491
+ ..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _125 => _125.tsconfigOptions, 'optionalAccess', _126 => _126.exclude]), () => ( [])),
2360
1492
  "jest.config.ts",
2361
1493
  "src/**/*.spec.ts",
2362
1494
  "src/**/*.test.ts"
2363
1495
  ]
2364
1496
  };
2365
- _devkit.writeJson.call(void 0, tree, _chunkTEEOPHLZjs.joinPaths.call(void 0, options.projectRoot, "tsconfig.json"), tsconfig);
1497
+ _devkit.writeJson.call(void 0, tree, _chunkV7LBWOVVjs.joinPaths.call(void 0, options.projectRoot, "tsconfig.json"), tsconfig);
2366
1498
  }
2367
1499
  _chunkJ5SB6L2Ljs.__name.call(void 0, createProjectTsConfigJson, "createProjectTsConfigJson");
2368
1500
  async function normalizeOptions(tree, options, config) {
2369
1501
  let importPath = options.importPath;
2370
- if (!importPath && _optionalChain([config, 'optionalAccess', _158 => _158.namespace])) {
2371
- importPath = `@${_optionalChain([config, 'optionalAccess', _159 => _159.namespace])}/${options.name}`;
1502
+ if (!importPath && _optionalChain([config, 'optionalAccess', _127 => _127.namespace])) {
1503
+ importPath = `@${_optionalChain([config, 'optionalAccess', _128 => _128.namespace])}/${options.name}`;
2372
1504
  }
2373
1505
  if (options.publishable) {
2374
1506
  if (!importPath) {
@@ -2422,7 +1554,7 @@ _chunkJ5SB6L2Ljs.__name.call(void 0, normalizeOptions, "normalizeOptions");
2422
1554
 
2423
1555
  // ../workspace-tools/src/generators/browser-library/generator.ts
2424
1556
  async function browserLibraryGeneratorFn(tree, schema, config) {
2425
- const filesDir = _chunkTEEOPHLZjs.joinPaths.call(void 0, __dirname, "src", "generators", "browser-library", "files");
1557
+ const filesDir = _chunkV7LBWOVVjs.joinPaths.call(void 0, __dirname, "src", "generators", "browser-library", "files");
2426
1558
  const tsLibraryGeneratorOptions = {
2427
1559
  buildExecutor: "@storm-software/workspace-tools:unbuild",
2428
1560
  platform: "browser",
@@ -2494,19 +1626,19 @@ var generator_default = withRunGenerator("TypeScript Library Creator (Browser Pl
2494
1626
 
2495
1627
  var _zodtojsonschema = require('zod-to-json-schema');
2496
1628
  async function configSchemaGeneratorFn(tree, options, config) {
2497
- _chunkTEEOPHLZjs.writeInfo.call(void 0, "\u{1F4E6} Running Storm Workspace Configuration JSON Schema generator", config);
2498
- _chunkTEEOPHLZjs.writeTrace.call(void 0, `Determining the Storm Workspace Configuration JSON Schema...`, config);
2499
- const jsonSchema = _zodtojsonschema.zodToJsonSchema.call(void 0, _chunkTEEOPHLZjs.stormWorkspaceConfigSchema, {
1629
+ _chunkV7LBWOVVjs.writeInfo.call(void 0, "\u{1F4E6} Running Storm Workspace Configuration JSON Schema generator", config);
1630
+ _chunkV7LBWOVVjs.writeTrace.call(void 0, `Determining the Storm Workspace Configuration JSON Schema...`, config);
1631
+ const jsonSchema = _zodtojsonschema.zodToJsonSchema.call(void 0, _chunkV7LBWOVVjs.stormWorkspaceConfigSchema, {
2500
1632
  name: "StormWorkspaceConfiguration"
2501
1633
  });
2502
- _chunkTEEOPHLZjs.writeTrace.call(void 0, jsonSchema, config);
2503
- const outputPath = options.outputFile.replaceAll("{workspaceRoot}", "").replaceAll(_nullishCoalesce(_optionalChain([config, 'optionalAccess', _160 => _160.workspaceRoot]), () => ( _chunkTEEOPHLZjs.findWorkspaceRoot.call(void 0, ))), _optionalChain([options, 'access', _161 => _161.outputFile, 'optionalAccess', _162 => _162.startsWith, 'call', _163 => _163("./")]) ? "" : "./");
2504
- _chunkTEEOPHLZjs.writeTrace.call(void 0, `\u{1F4DD} Writing Storm Configuration JSON Schema to "${outputPath}"`, config);
1634
+ _chunkV7LBWOVVjs.writeTrace.call(void 0, jsonSchema, config);
1635
+ const outputPath = options.outputFile.replaceAll("{workspaceRoot}", "").replaceAll(_nullishCoalesce(_optionalChain([config, 'optionalAccess', _129 => _129.workspaceRoot]), () => ( _chunkV7LBWOVVjs.findWorkspaceRoot.call(void 0, ))), _optionalChain([options, 'access', _130 => _130.outputFile, 'optionalAccess', _131 => _131.startsWith, 'call', _132 => _132("./")]) ? "" : "./");
1636
+ _chunkV7LBWOVVjs.writeTrace.call(void 0, `\u{1F4DD} Writing Storm Configuration JSON Schema to "${outputPath}"`, config);
2505
1637
  _devkit.writeJson.call(void 0, tree, outputPath, jsonSchema, {
2506
1638
  spaces: 2
2507
1639
  });
2508
1640
  await _devkit.formatFiles.call(void 0, tree);
2509
- _chunkTEEOPHLZjs.writeSuccess.call(void 0, "\u{1F680} Storm Configuration JSON Schema creation has completed successfully!", config);
1641
+ _chunkV7LBWOVVjs.writeSuccess.call(void 0, "\u{1F680} Storm Configuration JSON Schema creation has completed successfully!", config);
2510
1642
  return {
2511
1643
  success: true
2512
1644
  };
@@ -2527,7 +1659,7 @@ var generator_default2 = withRunGenerator("Configuration Schema Creator", config
2527
1659
  // ../workspace-tools/src/generators/neutral-library/generator.ts
2528
1660
 
2529
1661
  async function neutralLibraryGeneratorFn(tree, schema, config) {
2530
- const filesDir = _chunkTEEOPHLZjs.joinPaths.call(void 0, __dirname, "src", "generators", "neutral-library", "files");
1662
+ const filesDir = _chunkV7LBWOVVjs.joinPaths.call(void 0, __dirname, "src", "generators", "neutral-library", "files");
2531
1663
  const tsLibraryGeneratorOptions = {
2532
1664
  ...schema,
2533
1665
  platform: "neutral",
@@ -2570,7 +1702,7 @@ var generator_default3 = withRunGenerator("TypeScript Library Creator (Neutral P
2570
1702
  // ../workspace-tools/src/generators/node-library/generator.ts
2571
1703
 
2572
1704
  async function nodeLibraryGeneratorFn(tree, schema, config) {
2573
- const filesDir = _chunkTEEOPHLZjs.joinPaths.call(void 0, __dirname, "src", "generators", "node-library", "files");
1705
+ const filesDir = _chunkV7LBWOVVjs.joinPaths.call(void 0, __dirname, "src", "generators", "node-library", "files");
2574
1706
  const tsLibraryGeneratorOptions = {
2575
1707
  platform: "node",
2576
1708
  devDependencies: {
@@ -2764,7 +1896,7 @@ async function presetGeneratorFn(tree, options) {
2764
1896
  };
2765
1897
  return json;
2766
1898
  });
2767
- _devkit.generateFiles.call(void 0, tree, path6.join(__dirname, "files"), projectRoot, {
1899
+ _devkit.generateFiles.call(void 0, tree, path3.join(__dirname, "files"), projectRoot, {
2768
1900
  ...options,
2769
1901
  pnpmVersion,
2770
1902
  nodeVersion