@storm-software/unbuild 0.25.3 → 0.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,12 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
- var _chunkKUMAH6IZcjs = require('./chunk-KUMAH6IZ.cjs');
3
+ var _chunkTRA2WJ3Wcjs = require('./chunk-TRA2WJ3W.cjs');
4
4
 
5
5
 
6
- var _chunkADWBQYE6cjs = require('./chunk-ADWBQYE6.cjs');
6
+ var _chunkHO6B5DC7cjs = require('./chunk-HO6B5DC7.cjs');
7
7
 
8
8
 
9
- var _chunkLUXNRUAPcjs = require('./chunk-LUXNRUAP.cjs');
9
+ var _chunkKAXKUEZ7cjs = require('./chunk-KAXKUEZ7.cjs');
10
10
 
11
11
 
12
12
 
@@ -28,7 +28,8 @@ var _chunkLUXNRUAPcjs = require('./chunk-LUXNRUAP.cjs');
28
28
 
29
29
 
30
30
 
31
- var _chunk36OA7HRFcjs = require('./chunk-36OA7HRF.cjs');
31
+
32
+ var _chunkGHVDJY3Scjs = require('./chunk-GHVDJY3S.cjs');
32
33
 
33
34
 
34
35
 
@@ -55,35 +56,6 @@ var _resolve2 = require('resolve'); var _resolve3 = _interopRequireDefault(_reso
55
56
  // ../build-tools/src/utilities/copy-assets.ts
56
57
 
57
58
 
58
-
59
- // ../config-tools/src/logger/create-logger.ts
60
- var _chalk = require('chalk'); var _chalk2 = _interopRequireDefault(_chalk);
61
- async function createLogger(config) {
62
- const workspaceRoot = _chunk36OA7HRFcjs.findWorkspaceRoot.call(void 0, );
63
- if (!workspaceRoot) {
64
- throw new Error("Cannot find workspace root");
65
- }
66
- const writeFatal = _chunk36OA7HRFcjs.getLogFn.call(void 0, _chunk36OA7HRFcjs.LogLevel.FATAL, config, _chalk2.default);
67
- const writeError = _chunk36OA7HRFcjs.getLogFn.call(void 0, _chunk36OA7HRFcjs.LogLevel.ERROR, config, _chalk2.default);
68
- const writeWarning2 = _chunk36OA7HRFcjs.getLogFn.call(void 0, _chunk36OA7HRFcjs.LogLevel.WARN, config, _chalk2.default);
69
- const writeInfo = _chunk36OA7HRFcjs.getLogFn.call(void 0, _chunk36OA7HRFcjs.LogLevel.INFO, config, _chalk2.default);
70
- const writeSuccess = _chunk36OA7HRFcjs.getLogFn.call(void 0, _chunk36OA7HRFcjs.LogLevel.SUCCESS, config, _chalk2.default);
71
- const writeDebug2 = _chunk36OA7HRFcjs.getLogFn.call(void 0, _chunk36OA7HRFcjs.LogLevel.DEBUG, config, _chalk2.default);
72
- const writeTrace2 = _chunk36OA7HRFcjs.getLogFn.call(void 0, _chunk36OA7HRFcjs.LogLevel.DEBUG, config, _chalk2.default);
73
- return {
74
- fatal: writeFatal,
75
- error: writeError,
76
- warning: writeWarning2,
77
- info: writeInfo,
78
- success: writeSuccess,
79
- debug: writeDebug2,
80
- trace: writeTrace2,
81
- getStopwatch: _chunk36OA7HRFcjs.getStopwatch
82
- };
83
- }
84
- _chunkYDYGZTJKcjs.__name.call(void 0, createLogger, "createLogger");
85
-
86
- // ../build-tools/src/utilities/copy-assets.ts
87
59
  var _glob = require('glob');
88
60
  var _promises = require('fs/promises'); var _promises2 = _interopRequireDefault(_promises);
89
61
 
@@ -91,7 +63,7 @@ var _promises = require('fs/promises'); var _promises2 = _interopRequireDefault(
91
63
  var _c12 = require('c12');
92
64
  var _defu = require('defu'); var _defu2 = _interopRequireDefault(_defu);
93
65
  var getConfigFileByName = /* @__PURE__ */ _chunkYDYGZTJKcjs.__name.call(void 0, async (fileName, filePath, options = {}) => {
94
- const workspacePath = filePath || _chunk36OA7HRFcjs.findWorkspaceRoot.call(void 0, filePath);
66
+ const workspacePath = filePath || _chunkGHVDJY3Scjs.findWorkspaceRoot.call(void 0, filePath);
95
67
  let config = await _c12.loadConfig.call(void 0, {
96
68
  cwd: workspacePath,
97
69
  packageJson: true,
@@ -99,7 +71,7 @@ var getConfigFileByName = /* @__PURE__ */ _chunkYDYGZTJKcjs.__name.call(void 0,
99
71
  envName: _optionalChain([fileName, 'optionalAccess', _2 => _2.toUpperCase, 'call', _3 => _3()]),
100
72
  jitiOptions: {
101
73
  debug: false,
102
- fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : _chunk36OA7HRFcjs.joinPaths.call(void 0, process.env.STORM_CACHE_DIR || "node_modules/.cache/storm", "jiti")
74
+ fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : _chunkGHVDJY3Scjs.joinPaths.call(void 0, process.env.STORM_CACHE_DIR || "node_modules/.cache/storm", "jiti")
103
75
  },
104
76
  ...options
105
77
  });
@@ -111,7 +83,7 @@ var getConfigFileByName = /* @__PURE__ */ _chunkYDYGZTJKcjs.__name.call(void 0,
111
83
  envName: _optionalChain([fileName, 'optionalAccess', _4 => _4.toUpperCase, 'call', _5 => _5()]),
112
84
  jitiOptions: {
113
85
  debug: false,
114
- fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : _chunk36OA7HRFcjs.joinPaths.call(void 0, process.env.STORM_CACHE_DIR || "node_modules/.cache/storm", "jiti")
86
+ fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : _chunkGHVDJY3Scjs.joinPaths.call(void 0, process.env.STORM_CACHE_DIR || "node_modules/.cache/storm", "jiti")
115
87
  },
116
88
  configFile: fileName,
117
89
  ...options
@@ -120,12 +92,12 @@ var getConfigFileByName = /* @__PURE__ */ _chunkYDYGZTJKcjs.__name.call(void 0,
120
92
  return config;
121
93
  }, "getConfigFileByName");
122
94
  var getConfigFile = /* @__PURE__ */ _chunkYDYGZTJKcjs.__name.call(void 0, async (filePath, additionalFileNames = []) => {
123
- const workspacePath = filePath ? filePath : _chunk36OA7HRFcjs.findWorkspaceRoot.call(void 0, filePath);
95
+ const workspacePath = filePath ? filePath : _chunkGHVDJY3Scjs.findWorkspaceRoot.call(void 0, filePath);
124
96
  const result = await getConfigFileByName("storm", workspacePath);
125
97
  let config = result.config;
126
98
  const configFile = result.configFile;
127
99
  if (config && configFile && Object.keys(config).length > 0) {
128
- _chunk36OA7HRFcjs.writeSystem.call(void 0, `Found Storm configuration file "${configFile.includes(`${workspacePath}/`) ? configFile.replace(`${workspacePath}/`, "") : configFile}" at "${workspacePath}"`, {
100
+ _chunkGHVDJY3Scjs.writeSystem.call(void 0, `Found Storm configuration file "${configFile.includes(`${workspacePath}/`) ? configFile.replace(`${workspacePath}/`, "") : configFile}" at "${workspacePath}"`, {
129
101
  logLevel: "all"
130
102
  });
131
103
  }
@@ -133,7 +105,7 @@ var getConfigFile = /* @__PURE__ */ _chunkYDYGZTJKcjs.__name.call(void 0, async
133
105
  const results = await Promise.all(additionalFileNames.map((fileName) => getConfigFileByName(fileName, workspacePath)));
134
106
  for (const result2 of results) {
135
107
  if (_optionalChain([result2, 'optionalAccess', _6 => _6.config]) && _optionalChain([result2, 'optionalAccess', _7 => _7.configFile]) && Object.keys(result2.config).length > 0) {
136
- _chunk36OA7HRFcjs.writeSystem.call(void 0, `Found alternative configuration file "${result2.configFile.includes(`${workspacePath}/`) ? result2.configFile.replace(`${workspacePath}/`, "") : result2.configFile}" at "${workspacePath}"`, {
108
+ _chunkGHVDJY3Scjs.writeSystem.call(void 0, `Found alternative configuration file "${result2.configFile.includes(`${workspacePath}/`) ? result2.configFile.replace(`${workspacePath}/`, "") : result2.configFile}" at "${workspacePath}"`, {
137
109
  logLevel: "all"
138
110
  });
139
111
  config = _defu2.default.call(void 0, _nullishCoalesce(result2.config, () => ( {})), _nullishCoalesce(config, () => ( {})));
@@ -170,15 +142,15 @@ var getConfigEnv = /* @__PURE__ */ _chunkYDYGZTJKcjs.__name.call(void 0, () => {
170
142
  licensing: process.env[`${prefix}LICENSING`] || void 0,
171
143
  timezone: process.env[`${prefix}TIMEZONE`] || process.env.TZ || void 0,
172
144
  locale: process.env[`${prefix}LOCALE`] || process.env.LOCALE || void 0,
173
- configFile: process.env[`${prefix}CONFIG_FILE`] ? _chunk36OA7HRFcjs.correctPaths.call(void 0, process.env[`${prefix}CONFIG_FILE`]) : void 0,
174
- workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`] ? _chunk36OA7HRFcjs.correctPaths.call(void 0, process.env[`${prefix}WORKSPACE_ROOT`]) : void 0,
145
+ configFile: process.env[`${prefix}CONFIG_FILE`] ? _chunkGHVDJY3Scjs.correctPaths.call(void 0, process.env[`${prefix}CONFIG_FILE`]) : void 0,
146
+ workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`] ? _chunkGHVDJY3Scjs.correctPaths.call(void 0, process.env[`${prefix}WORKSPACE_ROOT`]) : void 0,
175
147
  directories: {
176
- cache: process.env[`${prefix}CACHE_DIR`] ? _chunk36OA7HRFcjs.correctPaths.call(void 0, process.env[`${prefix}CACHE_DIR`]) : void 0,
177
- data: process.env[`${prefix}DATA_DIR`] ? _chunk36OA7HRFcjs.correctPaths.call(void 0, process.env[`${prefix}DATA_DIR`]) : void 0,
178
- config: process.env[`${prefix}CONFIG_DIR`] ? _chunk36OA7HRFcjs.correctPaths.call(void 0, process.env[`${prefix}CONFIG_DIR`]) : void 0,
179
- temp: process.env[`${prefix}TEMP_DIR`] ? _chunk36OA7HRFcjs.correctPaths.call(void 0, process.env[`${prefix}TEMP_DIR`]) : void 0,
180
- log: process.env[`${prefix}LOG_DIR`] ? _chunk36OA7HRFcjs.correctPaths.call(void 0, process.env[`${prefix}LOG_DIR`]) : void 0,
181
- build: process.env[`${prefix}BUILD_DIR`] ? _chunk36OA7HRFcjs.correctPaths.call(void 0, process.env[`${prefix}BUILD_DIR`]) : void 0
148
+ cache: process.env[`${prefix}CACHE_DIR`] ? _chunkGHVDJY3Scjs.correctPaths.call(void 0, process.env[`${prefix}CACHE_DIR`]) : void 0,
149
+ data: process.env[`${prefix}DATA_DIR`] ? _chunkGHVDJY3Scjs.correctPaths.call(void 0, process.env[`${prefix}DATA_DIR`]) : void 0,
150
+ config: process.env[`${prefix}CONFIG_DIR`] ? _chunkGHVDJY3Scjs.correctPaths.call(void 0, process.env[`${prefix}CONFIG_DIR`]) : void 0,
151
+ temp: process.env[`${prefix}TEMP_DIR`] ? _chunkGHVDJY3Scjs.correctPaths.call(void 0, process.env[`${prefix}TEMP_DIR`]) : void 0,
152
+ log: process.env[`${prefix}LOG_DIR`] ? _chunkGHVDJY3Scjs.correctPaths.call(void 0, process.env[`${prefix}LOG_DIR`]) : void 0,
153
+ build: process.env[`${prefix}BUILD_DIR`] ? _chunkGHVDJY3Scjs.correctPaths.call(void 0, process.env[`${prefix}BUILD_DIR`]) : void 0
182
154
  },
183
155
  skipCache: process.env[`${prefix}SKIP_CACHE`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CACHE`]) : void 0,
184
156
  env: (_nullishCoalesce(_nullishCoalesce(process.env[`${prefix}ENV`], () => ( process.env.NODE_ENV)), () => ( process.env.ENVIRONMENT))) || void 0,
@@ -201,23 +173,23 @@ var getConfigEnv = /* @__PURE__ */ _chunkYDYGZTJKcjs.__name.call(void 0, () => {
201
173
  cyclone: process.env[`${prefix}REGISTRY_CYCLONE`] || void 0,
202
174
  container: process.env[`${prefix}REGISTRY_CONTAINER`] || void 0
203
175
  },
204
- logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) ? _chunk36OA7HRFcjs.getLogLevelLabel.call(void 0, Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) : process.env[`${prefix}LOG_LEVEL`] : void 0
176
+ logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) ? _chunkGHVDJY3Scjs.getLogLevelLabel.call(void 0, Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) : process.env[`${prefix}LOG_LEVEL`] : void 0
205
177
  };
206
- const themeNames = Object.keys(process.env).filter((envKey) => envKey.startsWith(`${prefix}COLOR_`) && _chunk36OA7HRFcjs.COLOR_KEYS.every((colorKey) => !envKey.startsWith(`${prefix}COLOR_LIGHT_${colorKey}`) && !envKey.startsWith(`${prefix}COLOR_DARK_${colorKey}`)));
178
+ const themeNames = Object.keys(process.env).filter((envKey) => envKey.startsWith(`${prefix}COLOR_`) && _chunkGHVDJY3Scjs.COLOR_KEYS.every((colorKey) => !envKey.startsWith(`${prefix}COLOR_LIGHT_${colorKey}`) && !envKey.startsWith(`${prefix}COLOR_DARK_${colorKey}`)));
207
179
  config.colors = themeNames.length > 0 ? themeNames.reduce((ret, themeName) => {
208
180
  ret[themeName] = getThemeColorConfigEnv(prefix, themeName);
209
181
  return ret;
210
182
  }, {}) : getThemeColorConfigEnv(prefix);
211
- if (config.docs === _chunk36OA7HRFcjs.STORM_DEFAULT_DOCS) {
212
- if (config.homepage === _chunk36OA7HRFcjs.STORM_DEFAULT_HOMEPAGE) {
213
- config.docs = `${_chunk36OA7HRFcjs.STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/docs`;
183
+ if (config.docs === _chunkGHVDJY3Scjs.STORM_DEFAULT_DOCS) {
184
+ if (config.homepage === _chunkGHVDJY3Scjs.STORM_DEFAULT_HOMEPAGE) {
185
+ config.docs = `${_chunkGHVDJY3Scjs.STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/docs`;
214
186
  } else {
215
187
  config.docs = `${config.homepage}/docs`;
216
188
  }
217
189
  }
218
- if (config.licensing === _chunk36OA7HRFcjs.STORM_DEFAULT_LICENSING) {
219
- if (config.homepage === _chunk36OA7HRFcjs.STORM_DEFAULT_HOMEPAGE) {
220
- config.licensing = `${_chunk36OA7HRFcjs.STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/licensing`;
190
+ if (config.licensing === _chunkGHVDJY3Scjs.STORM_DEFAULT_LICENSING) {
191
+ if (config.homepage === _chunkGHVDJY3Scjs.STORM_DEFAULT_HOMEPAGE) {
192
+ config.licensing = `${_chunkGHVDJY3Scjs.STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/licensing`;
221
193
  } else {
222
194
  config.licensing = `${config.homepage}/docs`;
223
195
  }
@@ -355,31 +327,31 @@ var setConfigEnv = /* @__PURE__ */ _chunkYDYGZTJKcjs.__name.call(void 0, (config
355
327
  process.env.LANG = config.locale ? `${config.locale.replaceAll("-", "_")}.UTF-8` : "en_US.UTF-8";
356
328
  }
357
329
  if (config.configFile) {
358
- process.env[`${prefix}CONFIG_FILE`] = _chunk36OA7HRFcjs.correctPaths.call(void 0, config.configFile);
330
+ process.env[`${prefix}CONFIG_FILE`] = _chunkGHVDJY3Scjs.correctPaths.call(void 0, config.configFile);
359
331
  }
360
332
  if (config.workspaceRoot) {
361
- process.env[`${prefix}WORKSPACE_ROOT`] = _chunk36OA7HRFcjs.correctPaths.call(void 0, config.workspaceRoot);
362
- process.env.NX_WORKSPACE_ROOT = _chunk36OA7HRFcjs.correctPaths.call(void 0, config.workspaceRoot);
363
- process.env.NX_WORKSPACE_ROOT_PATH = _chunk36OA7HRFcjs.correctPaths.call(void 0, config.workspaceRoot);
333
+ process.env[`${prefix}WORKSPACE_ROOT`] = _chunkGHVDJY3Scjs.correctPaths.call(void 0, config.workspaceRoot);
334
+ process.env.NX_WORKSPACE_ROOT = _chunkGHVDJY3Scjs.correctPaths.call(void 0, config.workspaceRoot);
335
+ process.env.NX_WORKSPACE_ROOT_PATH = _chunkGHVDJY3Scjs.correctPaths.call(void 0, config.workspaceRoot);
364
336
  }
365
337
  if (config.directories) {
366
338
  if (!config.skipCache && config.directories.cache) {
367
- process.env[`${prefix}CACHE_DIR`] = _chunk36OA7HRFcjs.correctPaths.call(void 0, config.directories.cache);
339
+ process.env[`${prefix}CACHE_DIR`] = _chunkGHVDJY3Scjs.correctPaths.call(void 0, config.directories.cache);
368
340
  }
369
341
  if (config.directories.data) {
370
- process.env[`${prefix}DATA_DIR`] = _chunk36OA7HRFcjs.correctPaths.call(void 0, config.directories.data);
342
+ process.env[`${prefix}DATA_DIR`] = _chunkGHVDJY3Scjs.correctPaths.call(void 0, config.directories.data);
371
343
  }
372
344
  if (config.directories.config) {
373
- process.env[`${prefix}CONFIG_DIR`] = _chunk36OA7HRFcjs.correctPaths.call(void 0, config.directories.config);
345
+ process.env[`${prefix}CONFIG_DIR`] = _chunkGHVDJY3Scjs.correctPaths.call(void 0, config.directories.config);
374
346
  }
375
347
  if (config.directories.temp) {
376
- process.env[`${prefix}TEMP_DIR`] = _chunk36OA7HRFcjs.correctPaths.call(void 0, config.directories.temp);
348
+ process.env[`${prefix}TEMP_DIR`] = _chunkGHVDJY3Scjs.correctPaths.call(void 0, config.directories.temp);
377
349
  }
378
350
  if (config.directories.log) {
379
- process.env[`${prefix}LOG_DIR`] = _chunk36OA7HRFcjs.correctPaths.call(void 0, config.directories.log);
351
+ process.env[`${prefix}LOG_DIR`] = _chunkGHVDJY3Scjs.correctPaths.call(void 0, config.directories.log);
380
352
  }
381
353
  if (config.directories.build) {
382
- process.env[`${prefix}BUILD_DIR`] = _chunk36OA7HRFcjs.correctPaths.call(void 0, config.directories.build);
354
+ process.env[`${prefix}BUILD_DIR`] = _chunkGHVDJY3Scjs.correctPaths.call(void 0, config.directories.build);
383
355
  }
384
356
  }
385
357
  if (config.skipCache !== void 0) {
@@ -433,8 +405,8 @@ var setConfigEnv = /* @__PURE__ */ _chunkYDYGZTJKcjs.__name.call(void 0, (config
433
405
  if (config.logLevel) {
434
406
  process.env[`${prefix}LOG_LEVEL`] = String(config.logLevel);
435
407
  process.env.LOG_LEVEL = String(config.logLevel);
436
- process.env.NX_VERBOSE_LOGGING = String(_chunk36OA7HRFcjs.getLogLevel.call(void 0, config.logLevel) >= _chunk36OA7HRFcjs.LogLevel.DEBUG ? true : false);
437
- process.env.RUST_BACKTRACE = _chunk36OA7HRFcjs.getLogLevel.call(void 0, config.logLevel) >= _chunk36OA7HRFcjs.LogLevel.DEBUG ? "full" : "none";
408
+ process.env.NX_VERBOSE_LOGGING = String(_chunkGHVDJY3Scjs.getLogLevel.call(void 0, config.logLevel) >= _chunkGHVDJY3Scjs.LogLevel.DEBUG ? true : false);
409
+ process.env.RUST_BACKTRACE = _chunkGHVDJY3Scjs.getLogLevel.call(void 0, config.logLevel) >= _chunkGHVDJY3Scjs.LogLevel.DEBUG ? "full" : "none";
438
410
  }
439
411
  process.env[`${prefix}CONFIG`] = JSON.stringify(config);
440
412
  for (const key of Object.keys(_nullishCoalesce(config.extensions, () => ( {})))) {
@@ -544,23 +516,23 @@ var _static_cache = void 0;
544
516
  var loadStormConfig = /* @__PURE__ */ _chunkYDYGZTJKcjs.__name.call(void 0, async (workspaceRoot) => {
545
517
  let config = {};
546
518
  if (_optionalChain([_static_cache, 'optionalAccess', _30 => _30.data]) && _optionalChain([_static_cache, 'optionalAccess', _31 => _31.timestamp]) && _static_cache.timestamp >= Date.now() + 3e4) {
547
- _chunk36OA7HRFcjs.writeTrace.call(void 0, `Configuration cache hit - ${_static_cache.timestamp}`, _static_cache.data);
519
+ _chunkGHVDJY3Scjs.writeTrace.call(void 0, `Configuration cache hit - ${_static_cache.timestamp}`, _static_cache.data);
548
520
  return _static_cache.data;
549
521
  }
550
522
  let _workspaceRoot = workspaceRoot;
551
523
  if (!_workspaceRoot) {
552
- _workspaceRoot = _chunk36OA7HRFcjs.findWorkspaceRoot.call(void 0, );
524
+ _workspaceRoot = _chunkGHVDJY3Scjs.findWorkspaceRoot.call(void 0, );
553
525
  }
554
526
  const configFile = await getConfigFile(_workspaceRoot);
555
527
  if (!configFile) {
556
- _chunk36OA7HRFcjs.writeWarning.call(void 0, "No Storm config file found in the current workspace. Please ensure this is the expected behavior - you can add a `storm.json` file to the root of your workspace if it is not.\n", {
528
+ _chunkGHVDJY3Scjs.writeWarning.call(void 0, "No Storm config file found in the current workspace. Please ensure this is the expected behavior - you can add a `storm.json` file to the root of your workspace if it is not.\n", {
557
529
  logLevel: "all"
558
530
  });
559
531
  }
560
- config = _defu2.default.call(void 0, getConfigEnv(), configFile, _chunk36OA7HRFcjs.getDefaultConfig.call(void 0, _workspaceRoot));
532
+ config = _defu2.default.call(void 0, getConfigEnv(), configFile, _chunkGHVDJY3Scjs.getDefaultConfig.call(void 0, _workspaceRoot));
561
533
  setConfigEnv(config);
562
- _chunk36OA7HRFcjs.writeTrace.call(void 0, `\u2699\uFE0F Using Storm configuration:
563
- ${_chunk36OA7HRFcjs.formatLogMessage.call(void 0, config)}`, config);
534
+ _chunkGHVDJY3Scjs.writeTrace.call(void 0, `\u2699\uFE0F Using Storm configuration:
535
+ ${_chunkGHVDJY3Scjs.formatLogMessage.call(void 0, config)}`, config);
564
536
  return config;
565
537
  }, "loadStormConfig");
566
538
 
@@ -573,7 +545,7 @@ var readNxConfig = /* @__PURE__ */ _chunkYDYGZTJKcjs.__name.call(void 0, async (
573
545
  const config = await loadStormConfig();
574
546
  rootDir = config.workspaceRoot;
575
547
  }
576
- const nxJsonPath = _chunk36OA7HRFcjs.joinPaths.call(void 0, rootDir, "nx.json");
548
+ const nxJsonPath = _chunkGHVDJY3Scjs.joinPaths.call(void 0, rootDir, "nx.json");
577
549
  if (!_fs.existsSync.call(void 0, nxJsonPath)) {
578
550
  throw new Error("Cannot find project.json configuration");
579
551
  }
@@ -620,7 +592,7 @@ var copyAssets = /* @__PURE__ */ _chunkYDYGZTJKcjs.__name.call(void 0, async (co
620
592
  }
621
593
  const buildTarget = _optionalChain([projectsConfigurations, 'access', _40 => _40.projects, 'access', _41 => _41[projectName], 'access', _42 => _42.targets, 'optionalAccess', _43 => _43.build]);
622
594
  if (!buildTarget) {
623
- throw new Error(`The Build process failed because the project does not have a valid build target in the project.json file. Check if the file exists in the root of the project at ${_chunk36OA7HRFcjs.joinPaths.call(void 0, projectRoot, "project.json")}`);
595
+ throw new Error(`The Build process failed because the project does not have a valid build target in the project.json file. Check if the file exists in the root of the project at ${_chunkGHVDJY3Scjs.joinPaths.call(void 0, projectRoot, "project.json")}`);
624
596
  }
625
597
  const result = await _js.copyAssets.call(void 0, {
626
598
  assets,
@@ -635,18 +607,18 @@ var copyAssets = /* @__PURE__ */ _chunkYDYGZTJKcjs.__name.call(void 0, async (co
635
607
  projectsConfigurations,
636
608
  nxJsonConfiguration: nxJson,
637
609
  cwd: config.workspaceRoot,
638
- isVerbose: _chunk36OA7HRFcjs.isVerbose.call(void 0, config.logLevel)
610
+ isVerbose: _chunkGHVDJY3Scjs.isVerbose.call(void 0, config.logLevel)
639
611
  });
640
612
  if (!result.success) {
641
613
  throw new Error("The Build process failed trying to copy assets");
642
614
  }
643
615
  if (includeSrc === true) {
644
- _chunk36OA7HRFcjs.writeDebug.call(void 0, `\u{1F4DD} Adding banner and writing source files: ${_chunk36OA7HRFcjs.joinPaths.call(void 0, outputPath, "src")}`, config);
616
+ _chunkGHVDJY3Scjs.writeDebug.call(void 0, `\u{1F4DD} Adding banner and writing source files: ${_chunkGHVDJY3Scjs.joinPaths.call(void 0, outputPath, "src")}`, config);
645
617
  const files = await _glob.glob.call(void 0, [
646
- _chunk36OA7HRFcjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.ts"),
647
- _chunk36OA7HRFcjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.tsx"),
648
- _chunk36OA7HRFcjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.js"),
649
- _chunk36OA7HRFcjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.jsx")
618
+ _chunkGHVDJY3Scjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.ts"),
619
+ _chunkGHVDJY3Scjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.tsx"),
620
+ _chunkGHVDJY3Scjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.js"),
621
+ _chunkGHVDJY3Scjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.jsx")
650
622
  ]);
651
623
  await Promise.allSettled(files.map(async (file) => _promises.writeFile.call(void 0, file, `${banner && typeof banner === "string" ? banner.startsWith("//") ? banner : `// ${banner}` : ""}
652
624
 
@@ -668,7 +640,7 @@ var addPackageDependencies = /* @__PURE__ */ _chunkYDYGZTJKcjs.__name.call(void
668
640
  for (const project of projectDependencies.dependencies.filter((dep) => dep.node.type === "lib" && dep.node.data.root !== projectRoot && dep.node.data.root !== workspaceRoot)) {
669
641
  const projectNode = project.node;
670
642
  if (projectNode.data.root) {
671
- const projectPackageJsonPath = _chunk36OA7HRFcjs.joinPaths.call(void 0, workspaceRoot, projectNode.data.root, "package.json");
643
+ const projectPackageJsonPath = _chunkGHVDJY3Scjs.joinPaths.call(void 0, workspaceRoot, projectNode.data.root, "package.json");
672
644
  if (_fs.existsSync.call(void 0, projectPackageJsonPath)) {
673
645
  const projectPackageJsonContent = await _promises.readFile.call(void 0, projectPackageJsonPath, "utf8");
674
646
  const projectPackageJson = JSON.parse(projectPackageJsonContent);
@@ -679,7 +651,7 @@ var addPackageDependencies = /* @__PURE__ */ _chunkYDYGZTJKcjs.__name.call(void
679
651
  }
680
652
  }
681
653
  if (localPackages.length > 0) {
682
- _chunk36OA7HRFcjs.writeTrace.call(void 0, `\u{1F4E6} Adding local packages to package.json: ${localPackages.map((p) => p.name).join(", ")}`);
654
+ _chunkGHVDJY3Scjs.writeTrace.call(void 0, `\u{1F4E6} Adding local packages to package.json: ${localPackages.map((p) => p.name).join(", ")}`);
683
655
  packageJson.peerDependencies = localPackages.reduce((ret, localPackage) => {
684
656
  if (!ret[localPackage.name]) {
685
657
  ret[localPackage.name] = `>=${localPackage.version || "0.0.1"}`;
@@ -701,13 +673,13 @@ var addPackageDependencies = /* @__PURE__ */ _chunkYDYGZTJKcjs.__name.call(void
701
673
  return ret;
702
674
  }, _nullishCoalesce(packageJson.peerDependencies, () => ( {})));
703
675
  } else {
704
- _chunk36OA7HRFcjs.writeTrace.call(void 0, "\u{1F4E6} No local packages dependencies to add to package.json");
676
+ _chunkGHVDJY3Scjs.writeTrace.call(void 0, "\u{1F4E6} No local packages dependencies to add to package.json");
705
677
  }
706
678
  return packageJson;
707
679
  }, "addPackageDependencies");
708
680
  var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunkYDYGZTJKcjs.__name.call(void 0, async (config, projectRoot, sourceRoot, projectName, includeSrc = false, packageJson) => {
709
- const workspaceRoot = config.workspaceRoot ? config.workspaceRoot : _chunk36OA7HRFcjs.findWorkspaceRoot.call(void 0, );
710
- const workspacePackageJsonContent = await _promises.readFile.call(void 0, _chunk36OA7HRFcjs.joinPaths.call(void 0, workspaceRoot, "package.json"), "utf8");
681
+ const workspaceRoot = config.workspaceRoot ? config.workspaceRoot : _chunkGHVDJY3Scjs.findWorkspaceRoot.call(void 0, );
682
+ const workspacePackageJsonContent = await _promises.readFile.call(void 0, _chunkGHVDJY3Scjs.joinPaths.call(void 0, workspaceRoot, "package.json"), "utf8");
711
683
  const workspacePackageJson = JSON.parse(workspacePackageJsonContent);
712
684
  packageJson.type ??= "module";
713
685
  packageJson.sideEffects ??= false;
@@ -716,7 +688,7 @@ var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunkYDYGZTJKcjs.__name.cal
716
688
  if (distSrc.startsWith("/")) {
717
689
  distSrc = distSrc.substring(1);
718
690
  }
719
- packageJson.source ??= `${_chunk36OA7HRFcjs.joinPaths.call(void 0, distSrc, "index.ts").replaceAll("\\", "/")}`;
691
+ packageJson.source ??= `${_chunkGHVDJY3Scjs.joinPaths.call(void 0, distSrc, "index.ts").replaceAll("\\", "/")}`;
720
692
  }
721
693
  packageJson.files ??= [
722
694
  "dist/**/*"
@@ -747,7 +719,7 @@ var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunkYDYGZTJKcjs.__name.cal
747
719
  ];
748
720
  }
749
721
  packageJson.repository ??= workspacePackageJson.repository;
750
- packageJson.repository.directory ??= projectRoot ? projectRoot : _chunk36OA7HRFcjs.joinPaths.call(void 0, "packages", projectName);
722
+ packageJson.repository.directory ??= projectRoot ? projectRoot : _chunkGHVDJY3Scjs.joinPaths.call(void 0, "packages", projectName);
751
723
  return packageJson;
752
724
  }, "addWorkspacePackageJsonFields");
753
725
  var addPackageJsonExport = /* @__PURE__ */ _chunkYDYGZTJKcjs.__name.call(void 0, (file, type = "module", sourceRoot) => {
@@ -807,7 +779,6 @@ var _createtaskgraph = require('nx/src/tasks-runner/create-task-graph');
807
779
 
808
780
  // src/build.ts
809
781
 
810
- var _jiti = require('jiti');
811
782
 
812
783
 
813
784
 
@@ -824,7 +795,7 @@ var _hookable = require('hookable');
824
795
  var _prettybytes = require('pretty-bytes'); var _prettybytes2 = _interopRequireDefault(_prettybytes);
825
796
  var _tinyglobby = require('tinyglobby');
826
797
 
827
-
798
+ var _jiti = require('jiti');
828
799
  var _rollup = require('rollup');
829
800
  var _rollupplugindts = require('rollup-plugin-dts'); var _rollupplugindts2 = _interopRequireDefault(_rollupplugindts);
830
801
  var _plugincommonjs = require('@rollup/plugin-commonjs'); var _plugincommonjs2 = _interopRequireDefault(_plugincommonjs);
@@ -2245,35 +2216,25 @@ _chunkYDYGZTJKcjs.__name.call(void 0, _build, "_build");
2245
2216
 
2246
2217
 
2247
2218
  // src/build.ts
2248
- async function resolveOptions(options) {
2249
- const projectRoot = options.projectRoot;
2250
- if (!projectRoot) {
2251
- throw new Error("Cannot find project root");
2252
- }
2253
- const outputPath = options.outputPath || _chunk36OA7HRFcjs.joinPaths.call(void 0, "dist", projectRoot);
2254
- const workspaceRoot = _findworkspaceroot.findWorkspaceRoot.call(void 0, projectRoot);
2255
- if (!workspaceRoot) {
2256
- throw new Error("Cannot find workspace root");
2257
- }
2258
- const config = await loadStormConfig(workspaceRoot.dir);
2259
- const logger = await createLogger(config);
2260
- logger.debug(" \u2699\uFE0F Resolving build options");
2261
- const stopwatch = logger.getStopwatch("Build options resolution");
2219
+ async function resolveOptions(options, config) {
2220
+ _chunkGHVDJY3Scjs.writeDebug.call(void 0, " \u2699\uFE0F Resolving build options", config);
2221
+ const stopwatch = _chunkGHVDJY3Scjs.getStopwatch.call(void 0, "Build options resolution");
2262
2222
  if (options.configPath) {
2263
- const configFile = await _chunkLUXNRUAPcjs.loadConfig.call(void 0, options.configPath);
2223
+ const configFile = await _chunkKAXKUEZ7cjs.loadConfig.call(void 0, options.configPath);
2264
2224
  if (configFile) {
2265
2225
  options = _defu2.default.call(void 0, options, configFile);
2266
2226
  }
2267
2227
  }
2228
+ const outputPath = options.outputPath || _chunkGHVDJY3Scjs.joinPaths.call(void 0, "dist", options.projectRoot);
2268
2229
  const projectGraph = _devkit.readCachedProjectGraph.call(void 0, );
2269
- const projectJsonPath = _chunk36OA7HRFcjs.joinPaths.call(void 0, config.workspaceRoot, projectRoot, "project.json");
2230
+ const projectJsonPath = _chunkGHVDJY3Scjs.joinPaths.call(void 0, config.workspaceRoot, options.projectRoot, "project.json");
2270
2231
  if (!_fs.existsSync.call(void 0, projectJsonPath)) {
2271
2232
  throw new Error("Cannot find project.json configuration");
2272
2233
  }
2273
2234
  const projectJsonContent = await _promises.readFile.call(void 0, projectJsonPath, "utf8");
2274
2235
  const projectJson = JSON.parse(projectJsonContent);
2275
2236
  const projectName = projectJson.name;
2276
- const packageJsonPath = _chunk36OA7HRFcjs.joinPaths.call(void 0, workspaceRoot.dir, projectRoot, "package.json");
2237
+ const packageJsonPath = _chunkGHVDJY3Scjs.joinPaths.call(void 0, config.workspaceRoot, options.projectRoot, "package.json");
2277
2238
  if (!_fs.existsSync.call(void 0, packageJsonPath)) {
2278
2239
  throw new Error("Cannot find package.json configuration");
2279
2240
  }
@@ -2281,51 +2242,45 @@ async function resolveOptions(options) {
2281
2242
  const packageJson = JSON.parse(packageJsonContent);
2282
2243
  let tsconfig = options.tsconfig;
2283
2244
  if (!tsconfig) {
2284
- tsconfig = _chunk36OA7HRFcjs.joinPaths.call(void 0, workspaceRoot.dir, projectRoot, "tsconfig.json");
2245
+ tsconfig = _chunkGHVDJY3Scjs.joinPaths.call(void 0, config.workspaceRoot, options.projectRoot, "tsconfig.json");
2285
2246
  }
2286
2247
  if (!_fs.existsSync.call(void 0, tsconfig)) {
2287
2248
  throw new Error("Cannot find tsconfig.json configuration");
2288
2249
  }
2289
2250
  let sourceRoot = projectJson.sourceRoot;
2290
2251
  if (!sourceRoot) {
2291
- sourceRoot = _chunk36OA7HRFcjs.joinPaths.call(void 0, projectRoot, "src");
2252
+ sourceRoot = _chunkGHVDJY3Scjs.joinPaths.call(void 0, options.projectRoot, "src");
2292
2253
  }
2293
2254
  if (!_fs.existsSync.call(void 0, sourceRoot)) {
2294
2255
  throw new Error("Cannot find sourceRoot directory");
2295
2256
  }
2296
- const result = _buildablelibsutils.calculateProjectBuildableDependencies.call(void 0, void 0, projectGraph, workspaceRoot.dir, projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
2257
+ const result = _buildablelibsutils.calculateProjectBuildableDependencies.call(void 0, void 0, projectGraph, config.workspaceRoot, projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
2297
2258
  let dependencies = result.dependencies;
2298
2259
  const tsLibDependency = _js.getHelperDependency.call(void 0, _js.HelperDependency.tsc, tsconfig, dependencies, projectGraph, true);
2299
2260
  if (tsLibDependency) {
2300
2261
  dependencies = dependencies.filter((deps) => deps.name !== tsLibDependency.name);
2301
2262
  dependencies.push(tsLibDependency);
2302
2263
  }
2303
- const jiti = _jiti.createJiti.call(void 0, config.workspaceRoot, {
2304
- fsCache: config.skipCache ? false : _chunk36OA7HRFcjs.joinPaths.call(void 0, config.directories.cache || "node_modules/.cache/storm", "jiti"),
2305
- interopDefault: true
2306
- });
2307
2264
  const resolvedOptions = {
2308
2265
  name: projectName,
2309
2266
  config,
2310
- projectRoot,
2267
+ projectRoot: options.projectRoot,
2311
2268
  sourceRoot,
2312
2269
  projectName,
2313
2270
  tsconfig,
2314
- jiti,
2315
- logger,
2316
2271
  clean: false,
2317
2272
  entries: [
2318
2273
  {
2319
2274
  builder: "mkdist",
2320
- input: `.${sourceRoot.replace(projectRoot, "")}`,
2321
- outDir: _chunk36OA7HRFcjs.joinPaths.call(void 0, _path.relative.call(void 0, _chunk36OA7HRFcjs.joinPaths.call(void 0, config.workspaceRoot, projectRoot), config.workspaceRoot).replaceAll("\\", "/"), outputPath, "dist").replaceAll("\\", "/"),
2275
+ input: `.${sourceRoot.replace(options.projectRoot, "")}`,
2276
+ outDir: _chunkGHVDJY3Scjs.joinPaths.call(void 0, _path.relative.call(void 0, _chunkGHVDJY3Scjs.joinPaths.call(void 0, config.workspaceRoot, options.projectRoot), config.workspaceRoot).replaceAll("\\", "/"), outputPath, "dist").replaceAll("\\", "/"),
2322
2277
  declaration: options.emitTypes !== false,
2323
2278
  format: "esm"
2324
2279
  },
2325
2280
  {
2326
2281
  builder: "mkdist",
2327
- input: `.${sourceRoot.replace(projectRoot, "")}`,
2328
- outDir: _chunk36OA7HRFcjs.joinPaths.call(void 0, _path.relative.call(void 0, _chunk36OA7HRFcjs.joinPaths.call(void 0, config.workspaceRoot, projectRoot), config.workspaceRoot).replaceAll("\\", "/"), outputPath, "dist").replaceAll("\\", "/"),
2282
+ input: `.${sourceRoot.replace(options.projectRoot, "")}`,
2283
+ outDir: _chunkGHVDJY3Scjs.joinPaths.call(void 0, _path.relative.call(void 0, _chunkGHVDJY3Scjs.joinPaths.call(void 0, config.workspaceRoot, options.projectRoot), config.workspaceRoot).replaceAll("\\", "/"), outputPath, "dist").replaceAll("\\", "/"),
2329
2284
  declaration: options.emitTypes !== false,
2330
2285
  format: "cjs",
2331
2286
  ext: "cjs"
@@ -2383,7 +2338,7 @@ async function resolveOptions(options) {
2383
2338
  splitting: options.splitting !== false,
2384
2339
  treeShaking: options.treeShaking !== false,
2385
2340
  color: true,
2386
- logLevel: config.logLevel === _chunk36OA7HRFcjs.LogLevelLabel.FATAL ? _chunk36OA7HRFcjs.LogLevelLabel.ERROR : _chunk36OA7HRFcjs.isVerbose.call(void 0, ) ? "verbose" : config.logLevel
2341
+ logLevel: config.logLevel === _chunkGHVDJY3Scjs.LogLevelLabel.FATAL ? _chunkGHVDJY3Scjs.LogLevelLabel.ERROR : _chunkGHVDJY3Scjs.isVerbose.call(void 0, ) ? "verbose" : config.logLevel
2387
2342
  }
2388
2343
  }
2389
2344
  };
@@ -2400,7 +2355,7 @@ async function resolveOptions(options) {
2400
2355
  if (options.rollup) {
2401
2356
  let rollup2 = {};
2402
2357
  if (typeof options.rollup === "string") {
2403
- const rollupFile = await _chunkLUXNRUAPcjs.loadConfig.call(void 0, options.rollup);
2358
+ const rollupFile = await _chunkKAXKUEZ7cjs.loadConfig.call(void 0, options.rollup);
2404
2359
  if (rollupFile) {
2405
2360
  rollup2 = rollupFile;
2406
2361
  }
@@ -2411,7 +2366,7 @@ async function resolveOptions(options) {
2411
2366
  }
2412
2367
  resolvedOptions.hooks = {
2413
2368
  "rollup:options": /* @__PURE__ */ _chunkYDYGZTJKcjs.__name.call(void 0, async (ctx, opts) => {
2414
- opts.plugins = await _asyncNullishCoalesce(options.plugins, async () => ( await _chunkADWBQYE6cjs.getDefaultBuildPlugins.call(void 0, options, resolvedOptions)));
2369
+ opts.plugins = await _asyncNullishCoalesce(options.plugins, async () => ( await _chunkHO6B5DC7cjs.getDefaultBuildPlugins.call(void 0, options, resolvedOptions)));
2415
2370
  }, "rollup:options")
2416
2371
  };
2417
2372
  stopwatch();
@@ -2419,29 +2374,29 @@ async function resolveOptions(options) {
2419
2374
  }
2420
2375
  _chunkYDYGZTJKcjs.__name.call(void 0, resolveOptions, "resolveOptions");
2421
2376
  async function generatePackageJson(options) {
2422
- if (options.generatePackageJson !== false && _fs.existsSync.call(void 0, _chunk36OA7HRFcjs.joinPaths.call(void 0, options.projectRoot, "package.json"))) {
2423
- options.logger.debug(" \u270D\uFE0F Writing package.json file");
2424
- const stopwatch = options.logger.getStopwatch("Write package.json file");
2425
- const packageJsonPath = _chunk36OA7HRFcjs.joinPaths.call(void 0, options.projectRoot, "project.json");
2377
+ if (options.generatePackageJson !== false && _fs.existsSync.call(void 0, _chunkGHVDJY3Scjs.joinPaths.call(void 0, options.projectRoot, "package.json"))) {
2378
+ _chunkGHVDJY3Scjs.writeDebug.call(void 0, " \u270D\uFE0F Writing package.json file", options.config);
2379
+ const stopwatch = _chunkGHVDJY3Scjs.getStopwatch.call(void 0, "Write package.json file");
2380
+ const packageJsonPath = _chunkGHVDJY3Scjs.joinPaths.call(void 0, options.projectRoot, "project.json");
2426
2381
  if (!_fs.existsSync.call(void 0, packageJsonPath)) {
2427
2382
  throw new Error("Cannot find package.json configuration");
2428
2383
  }
2429
- let packageJsonContent = await _promises.readFile.call(void 0, _chunk36OA7HRFcjs.joinPaths.call(void 0, options.config.workspaceRoot, options.projectRoot, "package.json"), "utf8");
2384
+ let packageJsonContent = await _promises.readFile.call(void 0, _chunkGHVDJY3Scjs.joinPaths.call(void 0, options.config.workspaceRoot, options.projectRoot, "package.json"), "utf8");
2430
2385
  if (!packageJsonContent) {
2431
2386
  throw new Error("Cannot find package.json configuration file");
2432
2387
  }
2433
2388
  let packageJson = JSON.parse(packageJsonContent);
2434
2389
  packageJson = await addPackageDependencies(options.config.workspaceRoot, options.projectRoot, options.projectName, packageJson);
2435
2390
  packageJson = await addWorkspacePackageJsonFields(options.config, options.projectRoot, options.sourceRoot, options.projectName, false, packageJson);
2436
- await _devkit.writeJsonFile.call(void 0, _chunk36OA7HRFcjs.joinPaths.call(void 0, options.outDir, "package.json"), await addPackageJsonExports(options.sourceRoot, packageJson));
2391
+ await _devkit.writeJsonFile.call(void 0, _chunkGHVDJY3Scjs.joinPaths.call(void 0, options.outDir, "package.json"), await addPackageJsonExports(options.sourceRoot, packageJson));
2437
2392
  stopwatch();
2438
2393
  }
2439
2394
  return options;
2440
2395
  }
2441
2396
  _chunkYDYGZTJKcjs.__name.call(void 0, generatePackageJson, "generatePackageJson");
2442
2397
  async function executeUnbuild(options) {
2443
- options.logger.debug(` \u{1F680} Running ${options.name} (${options.projectRoot}) build`);
2444
- const stopwatch = options.logger.getStopwatch(`${options.name} (${options.projectRoot}) build`);
2398
+ _chunkGHVDJY3Scjs.writeDebug.call(void 0, ` \u{1F680} Running ${options.name} (${options.projectRoot}) build`, options.config);
2399
+ const stopwatch = _chunkGHVDJY3Scjs.getStopwatch.call(void 0, `${options.name} (${options.projectRoot}) build`);
2445
2400
  try {
2446
2401
  await build(options.projectRoot, false, {
2447
2402
  ...options,
@@ -2454,8 +2409,8 @@ async function executeUnbuild(options) {
2454
2409
  }
2455
2410
  _chunkYDYGZTJKcjs.__name.call(void 0, executeUnbuild, "executeUnbuild");
2456
2411
  async function copyBuildAssets(options) {
2457
- options.logger.debug(` \u{1F4CB} Copying asset files to output directory: ${options.outDir}`);
2458
- const stopwatch = options.logger.getStopwatch(`${options.name} asset copy`);
2412
+ _chunkGHVDJY3Scjs.writeDebug.call(void 0, ` \u{1F4CB} Copying asset files to output directory: ${options.outDir}`, options.config);
2413
+ const stopwatch = _chunkGHVDJY3Scjs.getStopwatch.call(void 0, `${options.name} asset copy`);
2459
2414
  await copyAssets(options.config, _nullishCoalesce(options.assets, () => ( [])), options.outDir, options.projectRoot, options.projectName, options.sourceRoot, options.generatePackageJson, options.includeSrc);
2460
2415
  stopwatch();
2461
2416
  return options;
@@ -2463,26 +2418,36 @@ async function copyBuildAssets(options) {
2463
2418
  _chunkYDYGZTJKcjs.__name.call(void 0, copyBuildAssets, "copyBuildAssets");
2464
2419
  async function cleanOutputPath(options) {
2465
2420
  if (options.clean !== false && options.outDir) {
2466
- options.logger.debug(` \u{1F9F9} Cleaning ${options.name} output path: ${options.outDir}`);
2467
- const stopwatch = options.logger.getStopwatch(`${options.name} output clean`);
2468
- await _chunkKUMAH6IZcjs.cleanDirectories.call(void 0, options.name, options.outDir, options.config);
2421
+ _chunkGHVDJY3Scjs.writeDebug.call(void 0, ` \u{1F9F9} Cleaning ${options.name} output path: ${options.outDir}`, options.config);
2422
+ const stopwatch = _chunkGHVDJY3Scjs.getStopwatch.call(void 0, `${options.name} output clean`);
2423
+ await _chunkTRA2WJ3Wcjs.cleanDirectories.call(void 0, options.name, options.outDir, options.config);
2469
2424
  stopwatch();
2470
2425
  }
2471
2426
  return options;
2472
2427
  }
2473
2428
  _chunkYDYGZTJKcjs.__name.call(void 0, cleanOutputPath, "cleanOutputPath");
2474
2429
  async function build2(options) {
2475
- const resolvedOptions = await resolveOptions(options);
2476
- resolvedOptions.logger.debug(` \u26A1 Executing Storm Unbuild pipeline`);
2477
- const stopwatch = resolvedOptions.logger.getStopwatch("Unbuild pipeline");
2430
+ const projectRoot = options.projectRoot;
2431
+ if (!projectRoot) {
2432
+ throw new Error("Cannot find project root");
2433
+ }
2434
+ const workspaceRoot = _findworkspaceroot.findWorkspaceRoot.call(void 0, projectRoot);
2435
+ if (!workspaceRoot) {
2436
+ throw new Error("Cannot find workspace root");
2437
+ }
2438
+ const config = await loadStormConfig(workspaceRoot.dir);
2439
+ _chunkGHVDJY3Scjs.writeDebug.call(void 0, ` \u26A1 Executing Storm Unbuild pipeline`, config);
2440
+ const stopwatch = _chunkGHVDJY3Scjs.getStopwatch.call(void 0, "Unbuild pipeline");
2478
2441
  try {
2442
+ options.projectRoot = projectRoot;
2443
+ const resolvedOptions = await resolveOptions(options, config);
2479
2444
  await cleanOutputPath(resolvedOptions);
2480
2445
  await generatePackageJson(resolvedOptions);
2481
2446
  await executeUnbuild(resolvedOptions);
2482
2447
  await copyBuildAssets(resolvedOptions);
2483
- resolvedOptions.logger.success(` \u{1F3C1} The ${resolvedOptions.name} build completed successfully`);
2448
+ _chunkGHVDJY3Scjs.writeSuccess.call(void 0, ` \u{1F3C1} The ${resolvedOptions.name} build completed successfully`, config);
2484
2449
  } catch (error) {
2485
- resolvedOptions.logger.fatal(" \u274C Fatal errors occurred during the build that could not be recovered from. The build process has been terminated.");
2450
+ _chunkGHVDJY3Scjs.writeFatal.call(void 0, " \u274C Fatal errors occurred during the build that could not be recovered from. The build process has been terminated.", config);
2486
2451
  throw error;
2487
2452
  } finally {
2488
2453
  stopwatch();
@@ -1,5 +1,8 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
+ var _chunkGHVDJY3Scjs = require('./chunk-GHVDJY3S.cjs');
4
+
5
+
3
6
  var _chunkYDYGZTJKcjs = require('./chunk-YDYGZTJK.cjs');
4
7
 
5
8
  // src/plugins/on-error.ts
@@ -7,18 +10,18 @@ var onErrorPlugin = /* @__PURE__ */ _chunkYDYGZTJKcjs.__name.call(void 0, (optio
7
10
  name: "storm:on-error",
8
11
  buildEnd(error) {
9
12
  if (error) {
10
- resolvedOptions.logger.error(`The following errors occurred during the build:
13
+ _chunkGHVDJY3Scjs.writeError.call(void 0, `The following errors occurred during the build:
11
14
  ${error ? error.message : "Unknown build error"}
12
15
 
13
- `);
16
+ `, resolvedOptions.config);
14
17
  throw new Error("Storm unbuild process failed with errors.");
15
18
  }
16
19
  },
17
20
  renderError(error) {
18
- resolvedOptions.logger.error(`The following errors occurred during the build:
21
+ _chunkGHVDJY3Scjs.writeError.call(void 0, `The following errors occurred during the build:
19
22
  ${error ? error.message : "Unknown build error"}
20
23
 
21
- `);
24
+ `, resolvedOptions.config);
22
25
  throw new Error("Storm unbuild process failed with errors.");
23
26
  }
24
27
  }), "onErrorPlugin");
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  writeInfo
3
- } from "./chunk-RWW6C7JH.js";
3
+ } from "./chunk-BRHZNXQM.js";
4
4
  import {
5
5
  __name
6
6
  } from "./chunk-3GQAWCBQ.js";