@storm-software/esbuild 0.31.54 → 0.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/README.md +1 -1
  2. package/bin/esbuild.cjs +227460 -164
  3. package/dist/build.cjs +10 -9
  4. package/dist/build.js +9 -8
  5. package/dist/{chunk-OFHMWQZF.cjs → chunk-5LN4W7RS.cjs} +1 -1
  6. package/dist/{chunk-DNS6VZGL.cjs → chunk-63NDGTHK.cjs} +3 -3
  7. package/dist/{chunk-UPETSYAV.js → chunk-7BSG4BIG.js} +22 -5
  8. package/dist/{chunk-KYYHVNV4.cjs → chunk-BFF4J5BM.cjs} +2 -2
  9. package/dist/{chunk-E2ITHLMT.js → chunk-EQ6TXPLW.js} +1 -1
  10. package/dist/{chunk-TBKEDSCT.cjs → chunk-FPWMBDIC.cjs} +60 -43
  11. package/dist/{chunk-ASASYO7N.cjs → chunk-FYFB2IQY.cjs} +3 -3
  12. package/dist/{chunk-ADHPYHOT.js → chunk-IY7XC4HQ.js} +2 -2
  13. package/dist/{chunk-LT3W6G2F.cjs → chunk-LTOF4OBR.cjs} +57 -46
  14. package/dist/{chunk-6AQHAXIU.js → chunk-M4O2EJ6Z.js} +1 -1
  15. package/dist/{chunk-L2BA5U5E.js → chunk-OJYYP3OG.js} +32 -21
  16. package/dist/{chunk-E4SGSVQK.js → chunk-UAKT6QUX.js} +1 -1
  17. package/dist/{chunk-SLCDPX5I.js → chunk-V3JNF263.js} +1 -1
  18. package/dist/{chunk-HTG42YEH.cjs → chunk-VFORKCNS.cjs} +3 -3
  19. package/dist/chunk-VK6V4C6A.cjs +163 -0
  20. package/dist/chunk-YXPXX5XP.js +163 -0
  21. package/dist/clean.cjs +3 -3
  22. package/dist/clean.d.cts +2 -1284
  23. package/dist/clean.d.ts +2 -1284
  24. package/dist/clean.js +2 -2
  25. package/dist/config.cjs +6 -6
  26. package/dist/config.js +5 -5
  27. package/dist/index.cjs +21 -9
  28. package/dist/index.d.cts +4 -1
  29. package/dist/index.d.ts +4 -1
  30. package/dist/index.js +20 -8
  31. package/dist/plugins/deps-check.cjs +3 -3
  32. package/dist/plugins/deps-check.js +2 -2
  33. package/dist/plugins/on-error.cjs +3 -3
  34. package/dist/plugins/on-error.js +2 -2
  35. package/dist/plugins/tsc.cjs +3 -3
  36. package/dist/plugins/tsc.js +2 -2
  37. package/dist/tsc.cjs +17 -0
  38. package/dist/tsc.d.cts +22 -0
  39. package/dist/tsc.d.ts +22 -0
  40. package/dist/tsc.js +17 -0
  41. package/dist/types-BnhJ2mlc.d.cts +1286 -0
  42. package/dist/types-BnhJ2mlc.d.ts +1286 -0
  43. package/dist/types.d.cts +23 -4
  44. package/dist/types.d.ts +23 -4
  45. package/package.json +4 -4
@@ -1,18 +1,21 @@
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(); } } 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 _chunkEZGTDCYMcjs = require('./chunk-EZGTDCYM.cjs');
4
+
5
+
3
6
  var _chunkS6M44SSZcjs = require('./chunk-S6M44SSZ.cjs');
4
7
 
5
8
 
6
9
  var _chunkWRBUO7H6cjs = require('./chunk-WRBUO7H6.cjs');
7
10
 
8
11
 
9
- var _chunkKYYHVNV4cjs = require('./chunk-KYYHVNV4.cjs');
12
+ var _chunkBFF4J5BMcjs = require('./chunk-BFF4J5BM.cjs');
10
13
 
11
14
 
12
15
  var _chunkSSEYS7LIcjs = require('./chunk-SSEYS7LI.cjs');
13
16
 
14
17
 
15
- var _chunkDNS6VZGLcjs = require('./chunk-DNS6VZGL.cjs');
18
+ var _chunk63NDGTHKcjs = require('./chunk-63NDGTHK.cjs');
16
19
 
17
20
 
18
21
 
@@ -28,7 +31,7 @@ var _chunkDNS6VZGLcjs = require('./chunk-DNS6VZGL.cjs');
28
31
 
29
32
 
30
33
 
31
- var _chunkOFHMWQZFcjs = require('./chunk-OFHMWQZF.cjs');
34
+ var _chunk5LN4W7RScjs = require('./chunk-5LN4W7RS.cjs');
32
35
 
33
36
 
34
37
 
@@ -38,9 +41,6 @@ var _chunkXITTOHOGcjs = require('./chunk-XITTOHOG.cjs');
38
41
  var _chunkCGFDQ5AJcjs = require('./chunk-CGFDQ5AJ.cjs');
39
42
 
40
43
 
41
- var _chunkEZGTDCYMcjs = require('./chunk-EZGTDCYM.cjs');
42
-
43
-
44
44
  var _chunkBGYQAVKQcjs = require('./chunk-BGYQAVKQ.cjs');
45
45
 
46
46
  // ../build-tools/src/config.ts
@@ -97,7 +97,7 @@ var copyAssets = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, async (co
97
97
  output: "src/"
98
98
  });
99
99
  }
100
- _chunkOFHMWQZFcjs.writeTrace.call(void 0, `\u{1F4DD} Copying the following assets to the output directory:
100
+ _chunk5LN4W7RScjs.writeTrace.call(void 0, `\u{1F4DD} Copying the following assets to the output directory:
101
101
  ${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${pendingAsset} -> ${outputPath}` : ` - ${pendingAsset.input}/${pendingAsset.glob} -> ${_chunkXITTOHOGcjs.joinPaths.call(void 0, outputPath, pendingAsset.output)}`).join("\n")}`, config);
102
102
  const assetHandler = new (0, _copyassetshandler.CopyAssetsHandler)({
103
103
  projectDir: projectRoot,
@@ -107,7 +107,7 @@ ${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${p
107
107
  });
108
108
  await assetHandler.processAllAssetsOnce();
109
109
  if (includeSrc === true) {
110
- _chunkOFHMWQZFcjs.writeDebug.call(void 0, `\u{1F4DD} Adding banner and writing source files: ${_chunkXITTOHOGcjs.joinPaths.call(void 0, outputPath, "src")}`, config);
110
+ _chunk5LN4W7RScjs.writeDebug.call(void 0, `\u{1F4DD} Adding banner and writing source files: ${_chunkXITTOHOGcjs.joinPaths.call(void 0, outputPath, "src")}`, config);
111
111
  const files = await _glob.glob.call(void 0, [
112
112
  _chunkXITTOHOGcjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.ts"),
113
113
  _chunkXITTOHOGcjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.tsx"),
@@ -146,7 +146,7 @@ var addPackageDependencies = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void
146
146
  }
147
147
  }
148
148
  if (localPackages.length > 0) {
149
- _chunkOFHMWQZFcjs.writeTrace.call(void 0, `\u{1F4E6} Adding local packages to package.json: ${localPackages.map((p) => p.name).join(", ")}`);
149
+ _chunk5LN4W7RScjs.writeTrace.call(void 0, `\u{1F4E6} Adding local packages to package.json: ${localPackages.map((p) => p.name).join(", ")}`);
150
150
  const projectJsonFile = await _promises.readFile.call(void 0, _chunkXITTOHOGcjs.joinPaths.call(void 0, projectRoot, "project.json"), "utf8");
151
151
  const projectJson = JSON.parse(projectJsonFile);
152
152
  const projectName2 = projectJson.name;
@@ -180,12 +180,12 @@ var addPackageDependencies = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void
180
180
  return ret;
181
181
  }, _nullishCoalesce(packageJson.devDependencies, () => ( {})));
182
182
  } else {
183
- _chunkOFHMWQZFcjs.writeTrace.call(void 0, "\u{1F4E6} No local packages dependencies to add to package.json");
183
+ _chunk5LN4W7RScjs.writeTrace.call(void 0, "\u{1F4E6} No local packages dependencies to add to package.json");
184
184
  }
185
185
  return packageJson;
186
186
  }, "addPackageDependencies");
187
187
  var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, async (config, projectRoot, sourceRoot, projectName, includeSrc = false, packageJson) => {
188
- const workspaceRoot = config.workspaceRoot ? config.workspaceRoot : _chunkOFHMWQZFcjs.findWorkspaceRoot.call(void 0, );
188
+ const workspaceRoot = config.workspaceRoot ? config.workspaceRoot : _chunk5LN4W7RScjs.findWorkspaceRoot.call(void 0, );
189
189
  const workspacePackageJsonContent = await _promises.readFile.call(void 0, _chunkXITTOHOGcjs.joinPaths.call(void 0, workspaceRoot, "package.json"), "utf8");
190
190
  const workspacePackageJson = JSON.parse(workspacePackageJsonContent);
191
191
  packageJson.type ??= "module";
@@ -234,7 +234,7 @@ var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.cal
234
234
  var _c12 = require('c12');
235
235
  var _defu = require('defu'); var _defu2 = _interopRequireDefault(_defu);
236
236
  var getConfigFileByName = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, async (fileName, filePath, options = {}) => {
237
- const workspacePath = filePath || _chunkOFHMWQZFcjs.findWorkspaceRoot.call(void 0, filePath);
237
+ const workspacePath = filePath || _chunk5LN4W7RScjs.findWorkspaceRoot.call(void 0, filePath);
238
238
  const configs = await Promise.all([
239
239
  _c12.loadConfig.call(void 0, {
240
240
  cwd: workspacePath,
@@ -263,12 +263,12 @@ var getConfigFileByName = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0,
263
263
  return _defu2.default.call(void 0, _nullishCoalesce(configs[0], () => ( {})), _nullishCoalesce(configs[1], () => ( {})));
264
264
  }, "getConfigFileByName");
265
265
  var getConfigFile = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, async (filePath, additionalFileNames = []) => {
266
- const workspacePath = filePath ? filePath : _chunkOFHMWQZFcjs.findWorkspaceRoot.call(void 0, filePath);
266
+ const workspacePath = filePath ? filePath : _chunk5LN4W7RScjs.findWorkspaceRoot.call(void 0, filePath);
267
267
  const result = await getConfigFileByName("storm-workspace", workspacePath);
268
268
  let config = result.config;
269
269
  const configFile = result.configFile;
270
270
  if (config && configFile && Object.keys(config).length > 0 && !config.skipConfigLogging) {
271
- _chunkOFHMWQZFcjs.writeTrace.call(void 0, `Found Storm configuration file "${configFile.includes(`${workspacePath}/`) ? configFile.replace(`${workspacePath}/`, "") : configFile}" at "${workspacePath}"`, {
271
+ _chunk5LN4W7RScjs.writeTrace.call(void 0, `Found Storm configuration file "${configFile.includes(`${workspacePath}/`) ? configFile.replace(`${workspacePath}/`, "") : configFile}" at "${workspacePath}"`, {
272
272
  logLevel: "all"
273
273
  });
274
274
  }
@@ -277,7 +277,7 @@ var getConfigFile = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, async
277
277
  for (const result2 of results) {
278
278
  if (_optionalChain([result2, 'optionalAccess', _28 => _28.config]) && _optionalChain([result2, 'optionalAccess', _29 => _29.configFile]) && Object.keys(result2.config).length > 0) {
279
279
  if (!config.skipConfigLogging && !result2.config.skipConfigLogging) {
280
- _chunkOFHMWQZFcjs.writeTrace.call(void 0, `Found alternative configuration file "${result2.configFile.includes(`${workspacePath}/`) ? result2.configFile.replace(`${workspacePath}/`, "") : result2.configFile}" at "${workspacePath}"`, {
280
+ _chunk5LN4W7RScjs.writeTrace.call(void 0, `Found alternative configuration file "${result2.configFile.includes(`${workspacePath}/`) ? result2.configFile.replace(`${workspacePath}/`, "") : result2.configFile}" at "${workspacePath}"`, {
281
281
  logLevel: "all"
282
282
  });
283
283
  }
@@ -285,7 +285,7 @@ var getConfigFile = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, async
285
285
  }
286
286
  }
287
287
  }
288
- if (!config) {
288
+ if (!config || Object.keys(config).length === 0) {
289
289
  return void 0;
290
290
  }
291
291
  config.configFile = configFile;
@@ -346,12 +346,12 @@ var getConfigEnv = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, () => {
346
346
  configFile: process.env[`${prefix}CONFIG_FILE`] ? _chunkXITTOHOGcjs.correctPaths.call(void 0, process.env[`${prefix}CONFIG_FILE`]) : void 0,
347
347
  workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`] ? _chunkXITTOHOGcjs.correctPaths.call(void 0, process.env[`${prefix}WORKSPACE_ROOT`]) : void 0,
348
348
  directories: {
349
- cache: process.env[`${prefix}CACHE_DIR`] ? _chunkXITTOHOGcjs.correctPaths.call(void 0, process.env[`${prefix}CACHE_DIR`]) : void 0,
350
- data: process.env[`${prefix}DATA_DIR`] ? _chunkXITTOHOGcjs.correctPaths.call(void 0, process.env[`${prefix}DATA_DIR`]) : void 0,
351
- config: process.env[`${prefix}CONFIG_DIR`] ? _chunkXITTOHOGcjs.correctPaths.call(void 0, process.env[`${prefix}CONFIG_DIR`]) : void 0,
352
- temp: process.env[`${prefix}TEMP_DIR`] ? _chunkXITTOHOGcjs.correctPaths.call(void 0, process.env[`${prefix}TEMP_DIR`]) : void 0,
353
- log: process.env[`${prefix}LOG_DIR`] ? _chunkXITTOHOGcjs.correctPaths.call(void 0, process.env[`${prefix}LOG_DIR`]) : void 0,
354
- build: process.env[`${prefix}BUILD_DIR`] ? _chunkXITTOHOGcjs.correctPaths.call(void 0, process.env[`${prefix}BUILD_DIR`]) : void 0
349
+ cache: process.env[`${prefix}CACHE_DIR`] ? _chunkXITTOHOGcjs.correctPaths.call(void 0, process.env[`${prefix}CACHE_DIR`]) : process.env[`${prefix}CACHE_DIRECTORY`] ? _chunkXITTOHOGcjs.correctPaths.call(void 0, process.env[`${prefix}CACHE_DIRECTORY`]) : void 0,
350
+ data: process.env[`${prefix}DATA_DIR`] ? _chunkXITTOHOGcjs.correctPaths.call(void 0, process.env[`${prefix}DATA_DIR`]) : process.env[`${prefix}DATA_DIRECTORY`] ? _chunkXITTOHOGcjs.correctPaths.call(void 0, process.env[`${prefix}DATA_DIRECTORY`]) : void 0,
351
+ config: process.env[`${prefix}CONFIG_DIR`] ? _chunkXITTOHOGcjs.correctPaths.call(void 0, process.env[`${prefix}CONFIG_DIR`]) : process.env[`${prefix}CONFIG_DIRECTORY`] ? _chunkXITTOHOGcjs.correctPaths.call(void 0, process.env[`${prefix}CONFIG_DIRECTORY`]) : void 0,
352
+ temp: process.env[`${prefix}TEMP_DIR`] ? _chunkXITTOHOGcjs.correctPaths.call(void 0, process.env[`${prefix}TEMP_DIR`]) : process.env[`${prefix}TEMP_DIRECTORY`] ? _chunkXITTOHOGcjs.correctPaths.call(void 0, process.env[`${prefix}TEMP_DIRECTORY`]) : void 0,
353
+ log: process.env[`${prefix}LOG_DIR`] ? _chunkXITTOHOGcjs.correctPaths.call(void 0, process.env[`${prefix}LOG_DIR`]) : process.env[`${prefix}LOG_DIRECTORY`] ? _chunkXITTOHOGcjs.correctPaths.call(void 0, process.env[`${prefix}LOG_DIRECTORY`]) : void 0,
354
+ build: process.env[`${prefix}BUILD_DIR`] ? _chunkXITTOHOGcjs.correctPaths.call(void 0, process.env[`${prefix}BUILD_DIR`]) : process.env[`${prefix}BUILD_DIRECTORY`] ? _chunkXITTOHOGcjs.correctPaths.call(void 0, process.env[`${prefix}BUILD_DIRECTORY`]) : void 0
355
355
  },
356
356
  skipCache: process.env[`${prefix}SKIP_CACHE`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CACHE`]) : void 0,
357
357
  mode: (_nullishCoalesce(_nullishCoalesce(process.env[`${prefix}MODE`], () => ( process.env.NODE_ENV)), () => ( process.env.ENVIRONMENT))) || void 0,
@@ -374,24 +374,24 @@ var getConfigEnv = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, () => {
374
374
  cyclone: process.env[`${prefix}REGISTRY_CYCLONE`] || void 0,
375
375
  container: process.env[`${prefix}REGISTRY_CONTAINER`] || void 0
376
376
  },
377
- 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`])) ? _chunkOFHMWQZFcjs.getLogLevelLabel.call(void 0, Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) : process.env[`${prefix}LOG_LEVEL`] : void 0,
377
+ 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`])) ? _chunk5LN4W7RScjs.getLogLevelLabel.call(void 0, Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) : process.env[`${prefix}LOG_LEVEL`] : void 0,
378
378
  skipConfigLogging: process.env[`${prefix}SKIP_CONFIG_LOGGING`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CONFIG_LOGGING`]) : void 0
379
379
  };
380
- const themeNames = Object.keys(process.env).filter((envKey) => envKey.startsWith(`${prefix}COLOR_`) && _chunkOFHMWQZFcjs.COLOR_KEYS.every((colorKey) => !envKey.startsWith(`${prefix}COLOR_LIGHT_${colorKey}`) && !envKey.startsWith(`${prefix}COLOR_DARK_${colorKey}`)));
380
+ const themeNames = Object.keys(process.env).filter((envKey) => envKey.startsWith(`${prefix}COLOR_`) && _chunk5LN4W7RScjs.COLOR_KEYS.every((colorKey) => !envKey.startsWith(`${prefix}COLOR_LIGHT_${colorKey}`) && !envKey.startsWith(`${prefix}COLOR_DARK_${colorKey}`)));
381
381
  config.colors = themeNames.length > 0 ? themeNames.reduce((ret, themeName) => {
382
382
  ret[themeName] = getThemeColorConfigEnv(prefix, themeName);
383
383
  return ret;
384
384
  }, {}) : getThemeColorConfigEnv(prefix);
385
- if (config.docs === _chunkOFHMWQZFcjs.STORM_DEFAULT_DOCS) {
386
- if (config.homepage === _chunkOFHMWQZFcjs.STORM_DEFAULT_HOMEPAGE) {
387
- config.docs = `${_chunkOFHMWQZFcjs.STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/docs`;
385
+ if (config.docs === _chunk5LN4W7RScjs.STORM_DEFAULT_DOCS) {
386
+ if (config.homepage === _chunk5LN4W7RScjs.STORM_DEFAULT_HOMEPAGE) {
387
+ config.docs = `${_chunk5LN4W7RScjs.STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/docs`;
388
388
  } else {
389
389
  config.docs = `${config.homepage}/docs`;
390
390
  }
391
391
  }
392
- if (config.licensing === _chunkOFHMWQZFcjs.STORM_DEFAULT_LICENSING) {
393
- if (config.homepage === _chunkOFHMWQZFcjs.STORM_DEFAULT_HOMEPAGE) {
394
- config.licensing = `${_chunkOFHMWQZFcjs.STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/licensing`;
392
+ if (config.licensing === _chunk5LN4W7RScjs.STORM_DEFAULT_LICENSING) {
393
+ if (config.homepage === _chunk5LN4W7RScjs.STORM_DEFAULT_HOMEPAGE) {
394
+ config.licensing = `${_chunk5LN4W7RScjs.STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/licensing`;
395
395
  } else {
396
396
  config.licensing = `${config.homepage}/docs`;
397
397
  }
@@ -571,21 +571,27 @@ var setConfigEnv = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (config
571
571
  if (config.directories) {
572
572
  if (!config.skipCache && config.directories.cache) {
573
573
  process.env[`${prefix}CACHE_DIR`] = _chunkXITTOHOGcjs.correctPaths.call(void 0, config.directories.cache);
574
+ process.env[`${prefix}CACHE_DIRECTORY`] = process.env[`${prefix}CACHE_DIR`];
574
575
  }
575
576
  if (config.directories.data) {
576
577
  process.env[`${prefix}DATA_DIR`] = _chunkXITTOHOGcjs.correctPaths.call(void 0, config.directories.data);
578
+ process.env[`${prefix}DATA_DIRECTORY`] = process.env[`${prefix}DATA_DIR`];
577
579
  }
578
580
  if (config.directories.config) {
579
581
  process.env[`${prefix}CONFIG_DIR`] = _chunkXITTOHOGcjs.correctPaths.call(void 0, config.directories.config);
582
+ process.env[`${prefix}CONFIG_DIRECTORY`] = process.env[`${prefix}CONFIG_DIR`];
580
583
  }
581
584
  if (config.directories.temp) {
582
585
  process.env[`${prefix}TEMP_DIR`] = _chunkXITTOHOGcjs.correctPaths.call(void 0, config.directories.temp);
586
+ process.env[`${prefix}TEMP_DIRECTORY`] = process.env[`${prefix}TEMP_DIR`];
583
587
  }
584
588
  if (config.directories.log) {
585
589
  process.env[`${prefix}LOG_DIR`] = _chunkXITTOHOGcjs.correctPaths.call(void 0, config.directories.log);
590
+ process.env[`${prefix}LOG_DIRECTORY`] = process.env[`${prefix}LOG_DIR`];
586
591
  }
587
592
  if (config.directories.build) {
588
593
  process.env[`${prefix}BUILD_DIR`] = _chunkXITTOHOGcjs.correctPaths.call(void 0, config.directories.build);
594
+ process.env[`${prefix}BUILD_DIRECTORY`] = process.env[`${prefix}BUILD_DIR`];
589
595
  }
590
596
  }
591
597
  if (config.skipCache !== void 0) {
@@ -639,8 +645,8 @@ var setConfigEnv = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (config
639
645
  if (config.logLevel) {
640
646
  process.env[`${prefix}LOG_LEVEL`] = String(config.logLevel);
641
647
  process.env.LOG_LEVEL = String(config.logLevel);
642
- process.env.NX_VERBOSE_LOGGING = String(_chunkOFHMWQZFcjs.getLogLevel.call(void 0, config.logLevel) >= _chunkOFHMWQZFcjs.LogLevel.DEBUG ? true : false);
643
- process.env.RUST_BACKTRACE = _chunkOFHMWQZFcjs.getLogLevel.call(void 0, config.logLevel) >= _chunkOFHMWQZFcjs.LogLevel.DEBUG ? "full" : "none";
648
+ process.env.NX_VERBOSE_LOGGING = String(_chunk5LN4W7RScjs.getLogLevel.call(void 0, config.logLevel) >= _chunk5LN4W7RScjs.LogLevel.DEBUG ? true : false);
649
+ process.env.RUST_BACKTRACE = _chunk5LN4W7RScjs.getLogLevel.call(void 0, config.logLevel) >= _chunk5LN4W7RScjs.LogLevel.DEBUG ? "full" : "none";
644
650
  }
645
651
  if (config.skipConfigLogging !== void 0) {
646
652
  process.env[`${prefix}SKIP_CONFIG_LOGGING`] = String(config.skipConfigLogging);
@@ -753,22 +759,27 @@ var setBaseThemeColorConfigEnv = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(v
753
759
  // ../config-tools/src/create-storm-config.ts
754
760
  var _extension_cache = /* @__PURE__ */ new WeakMap();
755
761
  var _static_cache = void 0;
756
- var createStormWorkspaceConfig = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, async (extensionName, schema, workspaceRoot, skipLogs = false) => {
762
+ var createStormWorkspaceConfig = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, async (extensionName, schema, workspaceRoot, skipLogs = false, useDefault = true) => {
757
763
  let result;
758
764
  if (!_optionalChain([_static_cache, 'optionalAccess', _52 => _52.data]) || !_optionalChain([_static_cache, 'optionalAccess', _53 => _53.timestamp]) || _static_cache.timestamp < Date.now() - 8e3) {
759
765
  let _workspaceRoot = workspaceRoot;
760
766
  if (!_workspaceRoot) {
761
- _workspaceRoot = _chunkOFHMWQZFcjs.findWorkspaceRoot.call(void 0, );
767
+ _workspaceRoot = _chunk5LN4W7RScjs.findWorkspaceRoot.call(void 0, );
762
768
  }
763
769
  const configEnv = getConfigEnv();
764
- const defaultConfig = await _chunkOFHMWQZFcjs.getDefaultConfig.call(void 0, _workspaceRoot);
765
770
  const configFile = await getConfigFile(_workspaceRoot);
766
- if (!configFile && !skipLogs) {
767
- _chunkOFHMWQZFcjs.writeWarning.call(void 0, "No Storm Workspace configuration file found in the current repository. Please ensure this is the expected behavior - you can add a `storm-workspace.json` file to the root of your workspace if it is not.\n", {
768
- logLevel: "all"
769
- });
771
+ if (!configFile) {
772
+ if (!skipLogs) {
773
+ _chunk5LN4W7RScjs.writeWarning.call(void 0, "No Storm Workspace configuration file found in the current repository. Please ensure this is the expected behavior - you can add a `storm-workspace.json` file to the root of your workspace if it is not.\n", {
774
+ logLevel: "all"
775
+ });
776
+ }
777
+ if (useDefault === false) {
778
+ return void 0;
779
+ }
770
780
  }
771
- result = await _chunkOFHMWQZFcjs.stormWorkspaceConfigSchema.parseAsync(_defu2.default.call(void 0, configEnv, configFile, defaultConfig));
781
+ const defaultConfig = await _chunk5LN4W7RScjs.getDefaultConfig.call(void 0, _workspaceRoot);
782
+ result = await _chunk5LN4W7RScjs.stormWorkspaceConfigSchema.parseAsync(_defu2.default.call(void 0, configEnv, configFile, defaultConfig));
772
783
  result.workspaceRoot ??= _workspaceRoot;
773
784
  } else {
774
785
  result = _static_cache.data;
@@ -800,11 +811,11 @@ var createConfigExtension = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0
800
811
  return extension;
801
812
  }, "createConfigExtension");
802
813
  var loadStormWorkspaceConfig = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, async (workspaceRoot, skipLogs = false) => {
803
- const config = await createStormWorkspaceConfig(void 0, void 0, workspaceRoot, skipLogs);
814
+ const config = await createStormWorkspaceConfig(void 0, void 0, workspaceRoot, skipLogs, true);
804
815
  setConfigEnv(config);
805
816
  if (!skipLogs && !config.skipConfigLogging) {
806
- _chunkOFHMWQZFcjs.writeTrace.call(void 0, `\u2699\uFE0F Using Storm Workspace configuration:
807
- ${_chunkOFHMWQZFcjs.formatLogMessage.call(void 0, config)}`, config);
817
+ _chunk5LN4W7RScjs.writeTrace.call(void 0, `\u2699\uFE0F Using Storm Workspace configuration:
818
+ ${_chunk5LN4W7RScjs.formatLogMessage.call(void 0, config)}`, config);
808
819
  }
809
820
  return config;
810
821
  }, "loadStormWorkspaceConfig");
@@ -845,13 +856,13 @@ var getDefaultBuildPlugins = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void
845
856
  _chunkEZGTDCYMcjs.fixImportsPlugin.call(void 0, options, resolvedOptions),
846
857
  _chunkS6M44SSZcjs.nativeNodeModulesPlugin.call(void 0, options, resolvedOptions),
847
858
  _chunkCGFDQ5AJcjs.esmSplitCodeToCjsPlugin.call(void 0, options, resolvedOptions),
848
- _chunkDNS6VZGLcjs.tscPlugin.call(void 0, options, resolvedOptions),
849
- _chunkKYYHVNV4cjs.onErrorPlugin.call(void 0, options, resolvedOptions)
859
+ _chunk63NDGTHKcjs.tscPlugin.call(void 0, options, resolvedOptions),
860
+ _chunkBFF4J5BMcjs.onErrorPlugin.call(void 0, options, resolvedOptions)
850
861
  ], "getDefaultBuildPlugins");
851
862
  var DEFAULT_BUILD_OPTIONS = {
852
863
  platform: "node",
853
864
  target: "node22",
854
- format: "cjs",
865
+ format: "esm",
855
866
  external: [],
856
867
  logLevel: "error",
857
868
  tsconfig: "tsconfig.json",
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getStopwatch,
3
3
  writeDebug
4
- } from "./chunk-E2ITHLMT.js";
4
+ } from "./chunk-EQ6TXPLW.js";
5
5
  import {
6
6
  __name
7
7
  } from "./chunk-3GQAWCBQ.js";
@@ -1,3 +1,6 @@
1
+ import {
2
+ fixImportsPlugin
3
+ } from "./chunk-GWG4HOQ6.js";
1
4
  import {
2
5
  nativeNodeModulesPlugin
3
6
  } from "./chunk-T5272PC2.js";
@@ -6,13 +9,13 @@ import {
6
9
  } from "./chunk-LYDEMC26.js";
7
10
  import {
8
11
  onErrorPlugin
9
- } from "./chunk-E4SGSVQK.js";
12
+ } from "./chunk-UAKT6QUX.js";
10
13
  import {
11
14
  resolvePathsPlugin
12
15
  } from "./chunk-Q3LOGZKI.js";
13
16
  import {
14
17
  tscPlugin
15
- } from "./chunk-ADHPYHOT.js";
18
+ } from "./chunk-IY7XC4HQ.js";
16
19
  import {
17
20
  COLOR_KEYS,
18
21
  LogLevel,
@@ -28,7 +31,7 @@ import {
28
31
  writeDebug,
29
32
  writeTrace,
30
33
  writeWarning
31
- } from "./chunk-E2ITHLMT.js";
34
+ } from "./chunk-EQ6TXPLW.js";
32
35
  import {
33
36
  correctPaths,
34
37
  joinPaths
@@ -36,9 +39,6 @@ import {
36
39
  import {
37
40
  esmSplitCodeToCjsPlugin
38
41
  } from "./chunk-YNQ45EAM.js";
39
- import {
40
- fixImportsPlugin
41
- } from "./chunk-GWG4HOQ6.js";
42
42
  import {
43
43
  __name
44
44
  } from "./chunk-3GQAWCBQ.js";
@@ -285,7 +285,7 @@ var getConfigFile = /* @__PURE__ */ __name(async (filePath, additionalFileNames
285
285
  }
286
286
  }
287
287
  }
288
- if (!config) {
288
+ if (!config || Object.keys(config).length === 0) {
289
289
  return void 0;
290
290
  }
291
291
  config.configFile = configFile;
@@ -346,12 +346,12 @@ var getConfigEnv = /* @__PURE__ */ __name(() => {
346
346
  configFile: process.env[`${prefix}CONFIG_FILE`] ? correctPaths(process.env[`${prefix}CONFIG_FILE`]) : void 0,
347
347
  workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`] ? correctPaths(process.env[`${prefix}WORKSPACE_ROOT`]) : void 0,
348
348
  directories: {
349
- cache: process.env[`${prefix}CACHE_DIR`] ? correctPaths(process.env[`${prefix}CACHE_DIR`]) : void 0,
350
- data: process.env[`${prefix}DATA_DIR`] ? correctPaths(process.env[`${prefix}DATA_DIR`]) : void 0,
351
- config: process.env[`${prefix}CONFIG_DIR`] ? correctPaths(process.env[`${prefix}CONFIG_DIR`]) : void 0,
352
- temp: process.env[`${prefix}TEMP_DIR`] ? correctPaths(process.env[`${prefix}TEMP_DIR`]) : void 0,
353
- log: process.env[`${prefix}LOG_DIR`] ? correctPaths(process.env[`${prefix}LOG_DIR`]) : void 0,
354
- build: process.env[`${prefix}BUILD_DIR`] ? correctPaths(process.env[`${prefix}BUILD_DIR`]) : void 0
349
+ cache: process.env[`${prefix}CACHE_DIR`] ? correctPaths(process.env[`${prefix}CACHE_DIR`]) : process.env[`${prefix}CACHE_DIRECTORY`] ? correctPaths(process.env[`${prefix}CACHE_DIRECTORY`]) : void 0,
350
+ data: process.env[`${prefix}DATA_DIR`] ? correctPaths(process.env[`${prefix}DATA_DIR`]) : process.env[`${prefix}DATA_DIRECTORY`] ? correctPaths(process.env[`${prefix}DATA_DIRECTORY`]) : void 0,
351
+ config: process.env[`${prefix}CONFIG_DIR`] ? correctPaths(process.env[`${prefix}CONFIG_DIR`]) : process.env[`${prefix}CONFIG_DIRECTORY`] ? correctPaths(process.env[`${prefix}CONFIG_DIRECTORY`]) : void 0,
352
+ temp: process.env[`${prefix}TEMP_DIR`] ? correctPaths(process.env[`${prefix}TEMP_DIR`]) : process.env[`${prefix}TEMP_DIRECTORY`] ? correctPaths(process.env[`${prefix}TEMP_DIRECTORY`]) : void 0,
353
+ log: process.env[`${prefix}LOG_DIR`] ? correctPaths(process.env[`${prefix}LOG_DIR`]) : process.env[`${prefix}LOG_DIRECTORY`] ? correctPaths(process.env[`${prefix}LOG_DIRECTORY`]) : void 0,
354
+ build: process.env[`${prefix}BUILD_DIR`] ? correctPaths(process.env[`${prefix}BUILD_DIR`]) : process.env[`${prefix}BUILD_DIRECTORY`] ? correctPaths(process.env[`${prefix}BUILD_DIRECTORY`]) : void 0
355
355
  },
356
356
  skipCache: process.env[`${prefix}SKIP_CACHE`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CACHE`]) : void 0,
357
357
  mode: (process.env[`${prefix}MODE`] ?? process.env.NODE_ENV ?? process.env.ENVIRONMENT) || void 0,
@@ -571,21 +571,27 @@ var setConfigEnv = /* @__PURE__ */ __name((config) => {
571
571
  if (config.directories) {
572
572
  if (!config.skipCache && config.directories.cache) {
573
573
  process.env[`${prefix}CACHE_DIR`] = correctPaths(config.directories.cache);
574
+ process.env[`${prefix}CACHE_DIRECTORY`] = process.env[`${prefix}CACHE_DIR`];
574
575
  }
575
576
  if (config.directories.data) {
576
577
  process.env[`${prefix}DATA_DIR`] = correctPaths(config.directories.data);
578
+ process.env[`${prefix}DATA_DIRECTORY`] = process.env[`${prefix}DATA_DIR`];
577
579
  }
578
580
  if (config.directories.config) {
579
581
  process.env[`${prefix}CONFIG_DIR`] = correctPaths(config.directories.config);
582
+ process.env[`${prefix}CONFIG_DIRECTORY`] = process.env[`${prefix}CONFIG_DIR`];
580
583
  }
581
584
  if (config.directories.temp) {
582
585
  process.env[`${prefix}TEMP_DIR`] = correctPaths(config.directories.temp);
586
+ process.env[`${prefix}TEMP_DIRECTORY`] = process.env[`${prefix}TEMP_DIR`];
583
587
  }
584
588
  if (config.directories.log) {
585
589
  process.env[`${prefix}LOG_DIR`] = correctPaths(config.directories.log);
590
+ process.env[`${prefix}LOG_DIRECTORY`] = process.env[`${prefix}LOG_DIR`];
586
591
  }
587
592
  if (config.directories.build) {
588
593
  process.env[`${prefix}BUILD_DIR`] = correctPaths(config.directories.build);
594
+ process.env[`${prefix}BUILD_DIRECTORY`] = process.env[`${prefix}BUILD_DIR`];
589
595
  }
590
596
  }
591
597
  if (config.skipCache !== void 0) {
@@ -753,7 +759,7 @@ var setBaseThemeColorConfigEnv = /* @__PURE__ */ __name((prefix, config) => {
753
759
  // ../config-tools/src/create-storm-config.ts
754
760
  var _extension_cache = /* @__PURE__ */ new WeakMap();
755
761
  var _static_cache = void 0;
756
- var createStormWorkspaceConfig = /* @__PURE__ */ __name(async (extensionName, schema, workspaceRoot, skipLogs = false) => {
762
+ var createStormWorkspaceConfig = /* @__PURE__ */ __name(async (extensionName, schema, workspaceRoot, skipLogs = false, useDefault = true) => {
757
763
  let result;
758
764
  if (!_static_cache?.data || !_static_cache?.timestamp || _static_cache.timestamp < Date.now() - 8e3) {
759
765
  let _workspaceRoot = workspaceRoot;
@@ -761,13 +767,18 @@ var createStormWorkspaceConfig = /* @__PURE__ */ __name(async (extensionName, sc
761
767
  _workspaceRoot = findWorkspaceRoot();
762
768
  }
763
769
  const configEnv = getConfigEnv();
764
- const defaultConfig = await getDefaultConfig(_workspaceRoot);
765
770
  const configFile = await getConfigFile(_workspaceRoot);
766
- if (!configFile && !skipLogs) {
767
- writeWarning("No Storm Workspace configuration file found in the current repository. Please ensure this is the expected behavior - you can add a `storm-workspace.json` file to the root of your workspace if it is not.\n", {
768
- logLevel: "all"
769
- });
771
+ if (!configFile) {
772
+ if (!skipLogs) {
773
+ writeWarning("No Storm Workspace configuration file found in the current repository. Please ensure this is the expected behavior - you can add a `storm-workspace.json` file to the root of your workspace if it is not.\n", {
774
+ logLevel: "all"
775
+ });
776
+ }
777
+ if (useDefault === false) {
778
+ return void 0;
779
+ }
770
780
  }
781
+ const defaultConfig = await getDefaultConfig(_workspaceRoot);
771
782
  result = await stormWorkspaceConfigSchema.parseAsync(defu2(configEnv, configFile, defaultConfig));
772
783
  result.workspaceRoot ??= _workspaceRoot;
773
784
  } else {
@@ -800,7 +811,7 @@ var createConfigExtension = /* @__PURE__ */ __name((extensionName, schema) => {
800
811
  return extension;
801
812
  }, "createConfigExtension");
802
813
  var loadStormWorkspaceConfig = /* @__PURE__ */ __name(async (workspaceRoot, skipLogs = false) => {
803
- const config = await createStormWorkspaceConfig(void 0, void 0, workspaceRoot, skipLogs);
814
+ const config = await createStormWorkspaceConfig(void 0, void 0, workspaceRoot, skipLogs, true);
804
815
  setConfigEnv(config);
805
816
  if (!skipLogs && !config.skipConfigLogging) {
806
817
  writeTrace(`\u2699\uFE0F Using Storm Workspace configuration:
@@ -851,7 +862,7 @@ var getDefaultBuildPlugins = /* @__PURE__ */ __name((options, resolvedOptions) =
851
862
  var DEFAULT_BUILD_OPTIONS = {
852
863
  platform: "node",
853
864
  target: "node22",
854
- format: "cjs",
865
+ format: "esm",
855
866
  external: [],
856
867
  logLevel: "error",
857
868
  tsconfig: "tsconfig.json",
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  writeError
3
- } from "./chunk-E2ITHLMT.js";
3
+ } from "./chunk-EQ6TXPLW.js";
4
4
  import {
5
5
  __name
6
6
  } from "./chunk-3GQAWCBQ.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  writeError,
3
3
  writeWarning
4
- } from "./chunk-E2ITHLMT.js";
4
+ } from "./chunk-EQ6TXPLW.js";
5
5
  import {
6
6
  __name,
7
7
  __require
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
3
 
4
- var _chunkOFHMWQZFcjs = require('./chunk-OFHMWQZF.cjs');
4
+ var _chunk5LN4W7RScjs = require('./chunk-5LN4W7RS.cjs');
5
5
 
6
6
 
7
7
  var _chunkBGYQAVKQcjs = require('./chunk-BGYQAVKQ.cjs');
@@ -9,8 +9,8 @@ var _chunkBGYQAVKQcjs = require('./chunk-BGYQAVKQ.cjs');
9
9
  // src/clean.ts
10
10
  var _promises = require('fs/promises');
11
11
  async function clean(name = "ESBuild", directory, config) {
12
- _chunkOFHMWQZFcjs.writeDebug.call(void 0, ` \u{1F9F9} Cleaning ${name} output path: ${directory}`, config);
13
- const stopwatch = _chunkOFHMWQZFcjs.getStopwatch.call(void 0, `${name} output clean`);
12
+ _chunk5LN4W7RScjs.writeDebug.call(void 0, ` \u{1F9F9} Cleaning ${name} output path: ${directory}`, config);
13
+ const stopwatch = _chunk5LN4W7RScjs.getStopwatch.call(void 0, `${name} output clean`);
14
14
  await cleanDirectories(name, directory, config);
15
15
  stopwatch();
16
16
  }
@@ -0,0 +1,163 @@
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(); } } 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;
2
+
3
+ var _chunk5LN4W7RScjs = require('./chunk-5LN4W7RS.cjs');
4
+
5
+
6
+ var _chunkBGYQAVKQcjs = require('./chunk-BGYQAVKQ.cjs');
7
+
8
+ // src/tsc.ts
9
+ var _bundlerequire = require('bundle-require');
10
+ var _defu = require('defu'); var _defu2 = _interopRequireDefault(_defu);
11
+ var _fs = require('fs');
12
+ var _path = require('path');
13
+ var _typescript = require('typescript'); var _typescript2 = _interopRequireDefault(_typescript);
14
+ function ensureTempDeclarationDir(workspaceConfig) {
15
+ const root = workspaceConfig.directories.temp || _path.join.call(void 0, workspaceConfig.workspaceRoot, "tmp");
16
+ const dirPath = _path.join.call(void 0, root, ".tsc", "declaration");
17
+ if (_fs.existsSync.call(void 0, dirPath)) {
18
+ return dirPath;
19
+ }
20
+ _fs.mkdirSync.call(void 0, dirPath, {
21
+ recursive: true
22
+ });
23
+ const gitIgnorePath = _path.join.call(void 0, root, ".tsc", ".gitignore");
24
+ _fs.writeFileSync.call(void 0, gitIgnorePath, "**/*\n");
25
+ return dirPath;
26
+ }
27
+ _chunkBGYQAVKQcjs.__name.call(void 0, ensureTempDeclarationDir, "ensureTempDeclarationDir");
28
+ function slash(path) {
29
+ const isExtendedLengthPath = path.startsWith("\\\\?\\");
30
+ if (isExtendedLengthPath) {
31
+ return path;
32
+ }
33
+ return path.replace(/\\/g, "/");
34
+ }
35
+ _chunkBGYQAVKQcjs.__name.call(void 0, slash, "slash");
36
+ function toAbsolutePath(workspaceConfig, p, cwd) {
37
+ if (_path.isAbsolute.call(void 0, p)) {
38
+ return p;
39
+ }
40
+ return slash(_path.normalize.call(void 0, _path.join.call(void 0, cwd || workspaceConfig.workspaceRoot, p)));
41
+ }
42
+ _chunkBGYQAVKQcjs.__name.call(void 0, toAbsolutePath, "toAbsolutePath");
43
+ var AliasPool = (_class = class AliasPool2 {constructor() { _class.prototype.__init.call(this); }
44
+ static {
45
+ _chunkBGYQAVKQcjs.__name.call(void 0, this, "AliasPool");
46
+ }
47
+ __init() {this.seen = /* @__PURE__ */ new Set()}
48
+ assign(name) {
49
+ let suffix = 0;
50
+ let alias = name === "default" ? "default_alias" : name;
51
+ while (this.seen.has(alias)) {
52
+ alias = `${name}_alias_${++suffix}`;
53
+ if (suffix >= 1e3) {
54
+ throw new Error("Alias generation exceeded limit. Possible infinite loop detected.");
55
+ }
56
+ }
57
+ this.seen.add(alias);
58
+ return alias;
59
+ }
60
+ }, _class);
61
+ function getExports(workspaceConfig, program, fileMapping) {
62
+ const checker = program.getTypeChecker();
63
+ const aliasPool = new AliasPool();
64
+ const assignAlias = aliasPool.assign.bind(aliasPool);
65
+ function extractExports(sourceFileName) {
66
+ const cwd = program.getCurrentDirectory();
67
+ sourceFileName = toAbsolutePath(workspaceConfig, sourceFileName, cwd);
68
+ const sourceFile = program.getSourceFile(sourceFileName);
69
+ if (!sourceFile) {
70
+ return [];
71
+ }
72
+ const destFileName = fileMapping.get(sourceFileName);
73
+ if (!destFileName) {
74
+ return [];
75
+ }
76
+ const moduleSymbol = checker.getSymbolAtLocation(sourceFile);
77
+ if (!moduleSymbol) {
78
+ return [];
79
+ }
80
+ const exports = [];
81
+ const exportSymbols = checker.getExportsOfModule(moduleSymbol);
82
+ exportSymbols.forEach((symbol) => {
83
+ const name = symbol.getName();
84
+ exports.push({
85
+ kind: "named",
86
+ sourceFileName,
87
+ destFileName,
88
+ name,
89
+ alias: assignAlias(name),
90
+ isTypeOnly: false
91
+ });
92
+ });
93
+ return exports;
94
+ }
95
+ _chunkBGYQAVKQcjs.__name.call(void 0, extractExports, "extractExports");
96
+ return program.getRootFileNames().flatMap(extractExports);
97
+ }
98
+ _chunkBGYQAVKQcjs.__name.call(void 0, getExports, "getExports");
99
+ function emitDtsFiles(workspaceConfig, program, host, emitOnlyDtsFiles = true, customTransformers) {
100
+ const fileMapping = /* @__PURE__ */ new Map();
101
+ const writeFile = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (fileName, text, writeByteOrderMark, onError, sourceFiles, data) => {
102
+ const sourceFile = _optionalChain([sourceFiles, 'optionalAccess', _ => _[0]]);
103
+ const sourceFileName = _optionalChain([sourceFile, 'optionalAccess', _2 => _2.fileName]);
104
+ if (sourceFileName && !fileName.endsWith(".map")) {
105
+ const cwd = program.getCurrentDirectory();
106
+ fileMapping.set(toAbsolutePath(workspaceConfig, sourceFileName, cwd), toAbsolutePath(workspaceConfig, fileName, cwd));
107
+ }
108
+ return host.writeFile(fileName, text, writeByteOrderMark, onError, sourceFiles, data);
109
+ }, "writeFile");
110
+ const emitResult = program.emit(void 0, writeFile, void 0, emitOnlyDtsFiles, customTransformers);
111
+ const diagnostics = _typescript2.default.getPreEmitDiagnostics(program).concat(emitResult.diagnostics);
112
+ const diagnosticMessages = [];
113
+ diagnostics.forEach((diagnostic) => {
114
+ if (diagnostic.file) {
115
+ const { line, character } = _typescript2.default.getLineAndCharacterOfPosition(diagnostic.file, diagnostic.start);
116
+ const message = _typescript2.default.flattenDiagnosticMessageText(diagnostic.messageText, "\n");
117
+ diagnosticMessages.push(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`);
118
+ } else {
119
+ const message = _typescript2.default.flattenDiagnosticMessageText(diagnostic.messageText, "\n");
120
+ diagnosticMessages.push(message);
121
+ }
122
+ });
123
+ const diagnosticMessage = diagnosticMessages.join("\n");
124
+ if (diagnosticMessage) {
125
+ _chunk5LN4W7RScjs.writeError.call(void 0, `Failed to emit declaration files.
126
+
127
+ ${diagnosticMessage}`, workspaceConfig);
128
+ throw new Error("TypeScript compilation failed");
129
+ }
130
+ return fileMapping;
131
+ }
132
+ _chunkBGYQAVKQcjs.__name.call(void 0, emitDtsFiles, "emitDtsFiles");
133
+ function emitDts(workspaceConfig, tsconfig, tsconfigRaw, emitOnlyDtsFiles = true, customTransformers) {
134
+ const rawTsconfig = _bundlerequire.loadTsConfig.call(void 0, workspaceConfig.workspaceRoot, tsconfig);
135
+ if (!rawTsconfig) {
136
+ throw new Error(`Unable to find ${tsconfig || "tsconfig.json"} in ${workspaceConfig.workspaceRoot}`);
137
+ }
138
+ const declarationDir = ensureTempDeclarationDir(workspaceConfig);
139
+ const parsedTsconfig = _typescript2.default.parseJsonConfigFileContent(_defu2.default.call(void 0, {
140
+ compilerOptions: {
141
+ // Enable declaration emit and disable javascript emit
142
+ noEmit: false,
143
+ declaration: true,
144
+ declarationMap: true,
145
+ declarationDir,
146
+ emitDeclarationOnly: true
147
+ }
148
+ }, _nullishCoalesce(_optionalChain([tsconfigRaw, 'optionalAccess', _3 => _3.compilerOptions]), () => ( {})), _nullishCoalesce(rawTsconfig.data, () => ( {}))), _typescript2.default.sys, tsconfig ? _path.dirname.call(void 0, tsconfig) : "./");
149
+ const options = parsedTsconfig.options;
150
+ const host = _typescript2.default.createCompilerHost(options);
151
+ const program = _typescript2.default.createProgram(parsedTsconfig.fileNames, options, host);
152
+ const fileMapping = emitDtsFiles(workspaceConfig, program, host, emitOnlyDtsFiles, customTransformers);
153
+ return getExports(workspaceConfig, program, fileMapping);
154
+ }
155
+ _chunkBGYQAVKQcjs.__name.call(void 0, emitDts, "emitDts");
156
+
157
+
158
+
159
+
160
+
161
+
162
+
163
+ exports.ensureTempDeclarationDir = ensureTempDeclarationDir; exports.slash = slash; exports.toAbsolutePath = toAbsolutePath; exports.emitDtsFiles = emitDtsFiles; exports.emitDts = emitDts;