@storm-software/projen 0.9.52 → 0.9.54

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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  # Changelog for Storm Ops - Projen
4
4
 
5
+ ## [0.9.53](https://github.com/storm-software/storm-ops/releases/tag/projen%400.9.53) (2025-04-16)
6
+
7
+ ### Miscellaneous
8
+
9
+ - **monorepo:** Regenerate README markdown files
10
+ ([762e7076f](https://github.com/storm-software/storm-ops/commit/762e7076f))
11
+
5
12
  ## [0.9.52](https://github.com/storm-software/storm-ops/releases/tag/projen%400.9.52) (2025-04-15)
6
13
 
7
14
  ### Miscellaneous
package/README.md CHANGED
@@ -21,7 +21,7 @@ This package is part of the <b>⚡Storm-Ops</b> monorepo. The Storm-Ops packages
21
21
 
22
22
  <h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
23
23
 
24
- [![Version](https://img.shields.io/badge/version-0.9.51-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with Fumadocs](https://img.shields.io/badge/documented_with-fumadocs-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://fumadocs.vercel.app/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/storm-ops/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
24
+ [![Version](https://img.shields.io/badge/version-0.9.53-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with Fumadocs](https://img.shields.io/badge/documented_with-fumadocs-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://fumadocs.vercel.app/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/storm-ops/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
25
25
 
26
26
  <!-- prettier-ignore-start -->
27
27
  <!-- markdownlint-disable -->
@@ -1,4 +1,4 @@
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; }
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;
2
2
 
3
3
 
4
4
  var _chunkRMDWM2XCjs = require('./chunk-RMDWM2XC.js');
@@ -228,7 +228,7 @@ var stormWorkspaceConfigSchema = _zod2.default.object({
228
228
  "staging",
229
229
  "production"
230
230
  ]).default("production").describe("The current runtime environment mode for the package"),
231
- workspaceRoot: _zod2.default.string().trim().default("").describe("The root directory of the workspace"),
231
+ workspaceRoot: _zod2.default.string().trim().describe("The root directory of the workspace"),
232
232
  externalPackagePatterns: _zod2.default.array(_zod2.default.string()).default([]).describe("The build will use these package patterns to determine if they should be external to the bundle"),
233
233
  skipCache: _zod2.default.boolean().default(false).describe("Should all known types of workspace caching be skipped?"),
234
234
  directories: WorkspaceDirectoryConfigSchema,
@@ -797,7 +797,7 @@ var getConfigFile = /* @__PURE__ */ _chunk3HFBGYEUjs.__name.call(void 0, async (
797
797
  }
798
798
  }
799
799
  }
800
- if (!config) {
800
+ if (!config || Object.keys(config).length === 0) {
801
801
  return void 0;
802
802
  }
803
803
  config.configFile = configFile;
@@ -860,12 +860,12 @@ var getConfigEnv = /* @__PURE__ */ _chunk3HFBGYEUjs.__name.call(void 0, () => {
860
860
  configFile: process.env[`${prefix}CONFIG_FILE`] ? _chunkRMDWM2XCjs.correctPaths.call(void 0, process.env[`${prefix}CONFIG_FILE`]) : void 0,
861
861
  workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`] ? _chunkRMDWM2XCjs.correctPaths.call(void 0, process.env[`${prefix}WORKSPACE_ROOT`]) : void 0,
862
862
  directories: {
863
- cache: process.env[`${prefix}CACHE_DIR`] ? _chunkRMDWM2XCjs.correctPaths.call(void 0, process.env[`${prefix}CACHE_DIR`]) : void 0,
864
- data: process.env[`${prefix}DATA_DIR`] ? _chunkRMDWM2XCjs.correctPaths.call(void 0, process.env[`${prefix}DATA_DIR`]) : void 0,
865
- config: process.env[`${prefix}CONFIG_DIR`] ? _chunkRMDWM2XCjs.correctPaths.call(void 0, process.env[`${prefix}CONFIG_DIR`]) : void 0,
866
- temp: process.env[`${prefix}TEMP_DIR`] ? _chunkRMDWM2XCjs.correctPaths.call(void 0, process.env[`${prefix}TEMP_DIR`]) : void 0,
867
- log: process.env[`${prefix}LOG_DIR`] ? _chunkRMDWM2XCjs.correctPaths.call(void 0, process.env[`${prefix}LOG_DIR`]) : void 0,
868
- build: process.env[`${prefix}BUILD_DIR`] ? _chunkRMDWM2XCjs.correctPaths.call(void 0, process.env[`${prefix}BUILD_DIR`]) : void 0
863
+ cache: process.env[`${prefix}CACHE_DIR`] ? _chunkRMDWM2XCjs.correctPaths.call(void 0, process.env[`${prefix}CACHE_DIR`]) : process.env[`${prefix}CACHE_DIRECTORY`] ? _chunkRMDWM2XCjs.correctPaths.call(void 0, process.env[`${prefix}CACHE_DIRECTORY`]) : void 0,
864
+ data: process.env[`${prefix}DATA_DIR`] ? _chunkRMDWM2XCjs.correctPaths.call(void 0, process.env[`${prefix}DATA_DIR`]) : process.env[`${prefix}DATA_DIRECTORY`] ? _chunkRMDWM2XCjs.correctPaths.call(void 0, process.env[`${prefix}DATA_DIRECTORY`]) : void 0,
865
+ config: process.env[`${prefix}CONFIG_DIR`] ? _chunkRMDWM2XCjs.correctPaths.call(void 0, process.env[`${prefix}CONFIG_DIR`]) : process.env[`${prefix}CONFIG_DIRECTORY`] ? _chunkRMDWM2XCjs.correctPaths.call(void 0, process.env[`${prefix}CONFIG_DIRECTORY`]) : void 0,
866
+ temp: process.env[`${prefix}TEMP_DIR`] ? _chunkRMDWM2XCjs.correctPaths.call(void 0, process.env[`${prefix}TEMP_DIR`]) : process.env[`${prefix}TEMP_DIRECTORY`] ? _chunkRMDWM2XCjs.correctPaths.call(void 0, process.env[`${prefix}TEMP_DIRECTORY`]) : void 0,
867
+ log: process.env[`${prefix}LOG_DIR`] ? _chunkRMDWM2XCjs.correctPaths.call(void 0, process.env[`${prefix}LOG_DIR`]) : process.env[`${prefix}LOG_DIRECTORY`] ? _chunkRMDWM2XCjs.correctPaths.call(void 0, process.env[`${prefix}LOG_DIRECTORY`]) : void 0,
868
+ build: process.env[`${prefix}BUILD_DIR`] ? _chunkRMDWM2XCjs.correctPaths.call(void 0, process.env[`${prefix}BUILD_DIR`]) : process.env[`${prefix}BUILD_DIRECTORY`] ? _chunkRMDWM2XCjs.correctPaths.call(void 0, process.env[`${prefix}BUILD_DIRECTORY`]) : void 0
869
869
  },
870
870
  skipCache: process.env[`${prefix}SKIP_CACHE`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CACHE`]) : void 0,
871
871
  mode: (_nullishCoalesce(_nullishCoalesce(process.env[`${prefix}MODE`], () => ( process.env.NODE_ENV)), () => ( process.env.ENVIRONMENT))) || void 0,
@@ -1086,21 +1086,27 @@ var setConfigEnv = /* @__PURE__ */ _chunk3HFBGYEUjs.__name.call(void 0, (config)
1086
1086
  if (config.directories) {
1087
1087
  if (!config.skipCache && config.directories.cache) {
1088
1088
  process.env[`${prefix}CACHE_DIR`] = _chunkRMDWM2XCjs.correctPaths.call(void 0, config.directories.cache);
1089
+ process.env[`${prefix}CACHE_DIRECTORY`] = process.env[`${prefix}CACHE_DIR`];
1089
1090
  }
1090
1091
  if (config.directories.data) {
1091
1092
  process.env[`${prefix}DATA_DIR`] = _chunkRMDWM2XCjs.correctPaths.call(void 0, config.directories.data);
1093
+ process.env[`${prefix}DATA_DIRECTORY`] = process.env[`${prefix}DATA_DIR`];
1092
1094
  }
1093
1095
  if (config.directories.config) {
1094
1096
  process.env[`${prefix}CONFIG_DIR`] = _chunkRMDWM2XCjs.correctPaths.call(void 0, config.directories.config);
1097
+ process.env[`${prefix}CONFIG_DIRECTORY`] = process.env[`${prefix}CONFIG_DIR`];
1095
1098
  }
1096
1099
  if (config.directories.temp) {
1097
1100
  process.env[`${prefix}TEMP_DIR`] = _chunkRMDWM2XCjs.correctPaths.call(void 0, config.directories.temp);
1101
+ process.env[`${prefix}TEMP_DIRECTORY`] = process.env[`${prefix}TEMP_DIR`];
1098
1102
  }
1099
1103
  if (config.directories.log) {
1100
1104
  process.env[`${prefix}LOG_DIR`] = _chunkRMDWM2XCjs.correctPaths.call(void 0, config.directories.log);
1105
+ process.env[`${prefix}LOG_DIRECTORY`] = process.env[`${prefix}LOG_DIR`];
1101
1106
  }
1102
1107
  if (config.directories.build) {
1103
1108
  process.env[`${prefix}BUILD_DIR`] = _chunkRMDWM2XCjs.correctPaths.call(void 0, config.directories.build);
1109
+ process.env[`${prefix}BUILD_DIRECTORY`] = process.env[`${prefix}BUILD_DIR`];
1104
1110
  }
1105
1111
  }
1106
1112
  if (config.skipCache !== void 0) {
@@ -1268,7 +1274,7 @@ var setBaseThemeColorConfigEnv = /* @__PURE__ */ _chunk3HFBGYEUjs.__name.call(vo
1268
1274
  // ../config-tools/src/create-storm-config.ts
1269
1275
  var _extension_cache = /* @__PURE__ */ new WeakMap();
1270
1276
  var _static_cache = void 0;
1271
- var createStormWorkspaceConfig = /* @__PURE__ */ _chunk3HFBGYEUjs.__name.call(void 0, async (extensionName, schema, workspaceRoot3, skipLogs = false) => {
1277
+ var createStormWorkspaceConfig = /* @__PURE__ */ _chunk3HFBGYEUjs.__name.call(void 0, async (extensionName, schema, workspaceRoot3, skipLogs = false, useDefault = true) => {
1272
1278
  let result;
1273
1279
  if (!_optionalChain([_static_cache, 'optionalAccess', _57 => _57.data]) || !_optionalChain([_static_cache, 'optionalAccess', _58 => _58.timestamp]) || _static_cache.timestamp < Date.now() - 8e3) {
1274
1280
  let _workspaceRoot = workspaceRoot3;
@@ -1276,13 +1282,18 @@ var createStormWorkspaceConfig = /* @__PURE__ */ _chunk3HFBGYEUjs.__name.call(vo
1276
1282
  _workspaceRoot = findWorkspaceRoot();
1277
1283
  }
1278
1284
  const configEnv = getConfigEnv();
1279
- const defaultConfig = await getDefaultConfig(_workspaceRoot);
1280
1285
  const configFile = await getConfigFile(_workspaceRoot);
1281
- if (!configFile && !skipLogs) {
1282
- 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", {
1283
- logLevel: "all"
1284
- });
1286
+ if (!configFile) {
1287
+ if (!skipLogs) {
1288
+ 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", {
1289
+ logLevel: "all"
1290
+ });
1291
+ }
1292
+ if (useDefault === false) {
1293
+ return void 0;
1294
+ }
1285
1295
  }
1296
+ const defaultConfig = await getDefaultConfig(_workspaceRoot);
1286
1297
  result = await stormWorkspaceConfigSchema.parseAsync(_defu2.default.call(void 0, configEnv, configFile, defaultConfig));
1287
1298
  result.workspaceRoot ??= _workspaceRoot;
1288
1299
  } else {
@@ -1315,7 +1326,7 @@ var createConfigExtension = /* @__PURE__ */ _chunk3HFBGYEUjs.__name.call(void 0,
1315
1326
  return extension;
1316
1327
  }, "createConfigExtension");
1317
1328
  var loadStormWorkspaceConfig = /* @__PURE__ */ _chunk3HFBGYEUjs.__name.call(void 0, async (workspaceRoot3, skipLogs = false) => {
1318
- const config = await createStormWorkspaceConfig(void 0, void 0, workspaceRoot3, skipLogs);
1329
+ const config = await createStormWorkspaceConfig(void 0, void 0, workspaceRoot3, skipLogs, true);
1319
1330
  setConfigEnv(config);
1320
1331
  if (!skipLogs && !config.skipConfigLogging) {
1321
1332
  writeTrace(`\u2699\uFE0F Using Storm Workspace configuration:
@@ -2323,7 +2334,7 @@ _chunk3HFBGYEUjs.__name.call(void 0, bundleTypeDefinitions, "bundleTypeDefinitio
2323
2334
  var tscPlugin = /* @__PURE__ */ _chunk3HFBGYEUjs.__name.call(void 0, (options, resolvedOptions) => ({
2324
2335
  name: "storm:tsc",
2325
2336
  setup(build4) {
2326
- if (options.emitTypes === false) {
2337
+ if (options.dts === false) {
2327
2338
  return;
2328
2339
  }
2329
2340
  build4.onStart(async () => {
@@ -2375,7 +2386,7 @@ var getDefaultBuildPlugins = /* @__PURE__ */ _chunk3HFBGYEUjs.__name.call(void 0
2375
2386
  var DEFAULT_BUILD_OPTIONS = {
2376
2387
  platform: "node",
2377
2388
  target: "node22",
2378
- format: "cjs",
2389
+ format: "esm",
2379
2390
  external: [],
2380
2391
  logLevel: "error",
2381
2392
  tsconfig: "tsconfig.json",
@@ -2526,6 +2537,156 @@ var shebangRenderer = {
2526
2537
  }
2527
2538
  };
2528
2539
 
2540
+ // ../esbuild/src/tsc.ts
2541
+ _chunk3HFBGYEUjs.init_cjs_shims.call(void 0, );
2542
+ var _bundlerequire = require('bundle-require');
2543
+
2544
+
2545
+
2546
+ var _typescript = require('typescript'); var _typescript2 = _interopRequireDefault(_typescript);
2547
+ function ensureTempDeclarationDir(workspaceConfig) {
2548
+ const root = workspaceConfig.directories.temp || _path.join.call(void 0, workspaceConfig.workspaceRoot, "tmp");
2549
+ const dirPath = _path.join.call(void 0, root, ".tsc", "declaration");
2550
+ if (_fs.existsSync.call(void 0, dirPath)) {
2551
+ return dirPath;
2552
+ }
2553
+ _fs.mkdirSync.call(void 0, dirPath, {
2554
+ recursive: true
2555
+ });
2556
+ const gitIgnorePath = _path.join.call(void 0, root, ".tsc", ".gitignore");
2557
+ _fs.writeFileSync.call(void 0, gitIgnorePath, "**/*\n");
2558
+ return dirPath;
2559
+ }
2560
+ _chunk3HFBGYEUjs.__name.call(void 0, ensureTempDeclarationDir, "ensureTempDeclarationDir");
2561
+ function slash(path7) {
2562
+ const isExtendedLengthPath = path7.startsWith("\\\\?\\");
2563
+ if (isExtendedLengthPath) {
2564
+ return path7;
2565
+ }
2566
+ return path7.replace(/\\/g, "/");
2567
+ }
2568
+ _chunk3HFBGYEUjs.__name.call(void 0, slash, "slash");
2569
+ function toAbsolutePath(workspaceConfig, p, cwd) {
2570
+ if (_path.isAbsolute.call(void 0, p)) {
2571
+ return p;
2572
+ }
2573
+ return slash(_path.normalize.call(void 0, _path.join.call(void 0, cwd || workspaceConfig.workspaceRoot, p)));
2574
+ }
2575
+ _chunk3HFBGYEUjs.__name.call(void 0, toAbsolutePath, "toAbsolutePath");
2576
+ var AliasPool = (_class = class AliasPool2 {constructor() { _class.prototype.__init.call(this); }
2577
+ static {
2578
+ _chunk3HFBGYEUjs.__name.call(void 0, this, "AliasPool");
2579
+ }
2580
+ __init() {this.seen = /* @__PURE__ */ new Set()}
2581
+ assign(name) {
2582
+ let suffix = 0;
2583
+ let alias = name === "default" ? "default_alias" : name;
2584
+ while (this.seen.has(alias)) {
2585
+ alias = `${name}_alias_${++suffix}`;
2586
+ if (suffix >= 1e3) {
2587
+ throw new Error("Alias generation exceeded limit. Possible infinite loop detected.");
2588
+ }
2589
+ }
2590
+ this.seen.add(alias);
2591
+ return alias;
2592
+ }
2593
+ }, _class);
2594
+ function getExports(workspaceConfig, program, fileMapping) {
2595
+ const checker = program.getTypeChecker();
2596
+ const aliasPool = new AliasPool();
2597
+ const assignAlias = aliasPool.assign.bind(aliasPool);
2598
+ function extractExports(sourceFileName) {
2599
+ const cwd = program.getCurrentDirectory();
2600
+ sourceFileName = toAbsolutePath(workspaceConfig, sourceFileName, cwd);
2601
+ const sourceFile = program.getSourceFile(sourceFileName);
2602
+ if (!sourceFile) {
2603
+ return [];
2604
+ }
2605
+ const destFileName = fileMapping.get(sourceFileName);
2606
+ if (!destFileName) {
2607
+ return [];
2608
+ }
2609
+ const moduleSymbol = checker.getSymbolAtLocation(sourceFile);
2610
+ if (!moduleSymbol) {
2611
+ return [];
2612
+ }
2613
+ const exports = [];
2614
+ const exportSymbols = checker.getExportsOfModule(moduleSymbol);
2615
+ exportSymbols.forEach((symbol) => {
2616
+ const name = symbol.getName();
2617
+ exports.push({
2618
+ kind: "named",
2619
+ sourceFileName,
2620
+ destFileName,
2621
+ name,
2622
+ alias: assignAlias(name),
2623
+ isTypeOnly: false
2624
+ });
2625
+ });
2626
+ return exports;
2627
+ }
2628
+ _chunk3HFBGYEUjs.__name.call(void 0, extractExports, "extractExports");
2629
+ return program.getRootFileNames().flatMap(extractExports);
2630
+ }
2631
+ _chunk3HFBGYEUjs.__name.call(void 0, getExports, "getExports");
2632
+ function emitDtsFiles(workspaceConfig, program, host, emitOnlyDtsFiles = true, customTransformers) {
2633
+ const fileMapping = /* @__PURE__ */ new Map();
2634
+ const writeFile3 = /* @__PURE__ */ _chunk3HFBGYEUjs.__name.call(void 0, (fileName, text, writeByteOrderMark, onError, sourceFiles, data) => {
2635
+ const sourceFile = _optionalChain([sourceFiles, 'optionalAccess', _127 => _127[0]]);
2636
+ const sourceFileName = _optionalChain([sourceFile, 'optionalAccess', _128 => _128.fileName]);
2637
+ if (sourceFileName && !fileName.endsWith(".map")) {
2638
+ const cwd = program.getCurrentDirectory();
2639
+ fileMapping.set(toAbsolutePath(workspaceConfig, sourceFileName, cwd), toAbsolutePath(workspaceConfig, fileName, cwd));
2640
+ }
2641
+ return host.writeFile(fileName, text, writeByteOrderMark, onError, sourceFiles, data);
2642
+ }, "writeFile");
2643
+ const emitResult = program.emit(void 0, writeFile3, void 0, emitOnlyDtsFiles, customTransformers);
2644
+ const diagnostics = _typescript2.default.getPreEmitDiagnostics(program).concat(emitResult.diagnostics);
2645
+ const diagnosticMessages = [];
2646
+ diagnostics.forEach((diagnostic) => {
2647
+ if (diagnostic.file) {
2648
+ const { line, character } = _typescript2.default.getLineAndCharacterOfPosition(diagnostic.file, diagnostic.start);
2649
+ const message = _typescript2.default.flattenDiagnosticMessageText(diagnostic.messageText, "\n");
2650
+ diagnosticMessages.push(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`);
2651
+ } else {
2652
+ const message = _typescript2.default.flattenDiagnosticMessageText(diagnostic.messageText, "\n");
2653
+ diagnosticMessages.push(message);
2654
+ }
2655
+ });
2656
+ const diagnosticMessage = diagnosticMessages.join("\n");
2657
+ if (diagnosticMessage) {
2658
+ writeError(`Failed to emit declaration files.
2659
+
2660
+ ${diagnosticMessage}`, workspaceConfig);
2661
+ throw new Error("TypeScript compilation failed");
2662
+ }
2663
+ return fileMapping;
2664
+ }
2665
+ _chunk3HFBGYEUjs.__name.call(void 0, emitDtsFiles, "emitDtsFiles");
2666
+ function emitDts(workspaceConfig, tsconfig, tsconfigRaw, emitOnlyDtsFiles = true, customTransformers) {
2667
+ const rawTsconfig = _bundlerequire.loadTsConfig.call(void 0, workspaceConfig.workspaceRoot, tsconfig);
2668
+ if (!rawTsconfig) {
2669
+ throw new Error(`Unable to find ${tsconfig || "tsconfig.json"} in ${workspaceConfig.workspaceRoot}`);
2670
+ }
2671
+ const declarationDir = ensureTempDeclarationDir(workspaceConfig);
2672
+ const parsedTsconfig = _typescript2.default.parseJsonConfigFileContent(_defu2.default.call(void 0, {
2673
+ compilerOptions: {
2674
+ // Enable declaration emit and disable javascript emit
2675
+ noEmit: false,
2676
+ declaration: true,
2677
+ declarationMap: true,
2678
+ declarationDir,
2679
+ emitDeclarationOnly: true
2680
+ }
2681
+ }, _nullishCoalesce(_optionalChain([tsconfigRaw, 'optionalAccess', _129 => _129.compilerOptions]), () => ( {})), _nullishCoalesce(rawTsconfig.data, () => ( {}))), _typescript2.default.sys, tsconfig ? _path.dirname.call(void 0, tsconfig) : "./");
2682
+ const options = parsedTsconfig.options;
2683
+ const host = _typescript2.default.createCompilerHost(options);
2684
+ const program = _typescript2.default.createProgram(parsedTsconfig.fileNames, options, host);
2685
+ const fileMapping = emitDtsFiles(workspaceConfig, program, host, emitOnlyDtsFiles, customTransformers);
2686
+ return getExports(workspaceConfig, program, fileMapping);
2687
+ }
2688
+ _chunk3HFBGYEUjs.__name.call(void 0, emitDts, "emitDts");
2689
+
2529
2690
  // ../esbuild/src/utilities/get-entry-points.ts
2530
2691
  _chunk3HFBGYEUjs.init_cjs_shims.call(void 0, );
2531
2692
 
@@ -2656,7 +2817,7 @@ function pipeSync(fn, ...fns) {
2656
2817
  return (...args) => {
2657
2818
  let result = fn(...args);
2658
2819
  for (let i = 0; result !== skip && i < fns.length; ++i) {
2659
- result = _optionalChain([fns, 'access', _127 => _127[i], 'optionalCall', _128 => _128(result)]);
2820
+ result = _optionalChain([fns, 'access', _130 => _130[i], 'optionalCall', _131 => _131(result)]);
2660
2821
  }
2661
2822
  return result;
2662
2823
  };
@@ -2666,7 +2827,7 @@ function pipeAsync(fn, ...fns) {
2666
2827
  return async (...args) => {
2667
2828
  let result = await fn(...args);
2668
2829
  for (let i = 0; result !== skip && i < fns.length; ++i) {
2669
- result = await _optionalChain([fns, 'access', _129 => _129[i], 'optionalCall', _130 => _130(result)]);
2830
+ result = await _optionalChain([fns, 'access', _132 => _132[i], 'optionalCall', _133 => _133(result)]);
2670
2831
  }
2671
2832
  return result;
2672
2833
  };
@@ -2696,7 +2857,7 @@ var resolveOptions = /* @__PURE__ */ _chunk3HFBGYEUjs.__name.call(void 0, async
2696
2857
  const projectJson = JSON.parse(projectJsonFile);
2697
2858
  const projectName = projectJson.name;
2698
2859
  const projectConfigurations = _devkit.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
2699
- if (!_optionalChain([projectConfigurations, 'optionalAccess', _131 => _131.projects, 'optionalAccess', _132 => _132[projectName]])) {
2860
+ if (!_optionalChain([projectConfigurations, 'optionalAccess', _134 => _134.projects, 'optionalAccess', _135 => _135[projectName]])) {
2700
2861
  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.");
2701
2862
  }
2702
2863
  const options = _defu2.default.call(void 0, userOptions, DEFAULT_BUILD_OPTIONS);
@@ -2860,6 +3021,7 @@ async function executeEsBuild(context2) {
2860
3021
  options.inject === {}) {
2861
3022
  delete options.inject;
2862
3023
  }
3024
+ delete options.dts;
2863
3025
  delete options.env;
2864
3026
  delete options.name;
2865
3027
  delete options.assets;
@@ -2895,8 +3057,18 @@ ${formatLogMessage({
2895
3057
  return context2;
2896
3058
  }
2897
3059
  _chunk3HFBGYEUjs.__name.call(void 0, executeEsBuild, "executeEsBuild");
3060
+ async function executeTypescript(context2) {
3061
+ if (_optionalChain([context2, 'access', _136 => _136.result, 'optionalAccess', _137 => _137.errors, 'access', _138 => _138.length]) === 0 && context2.options.dts) {
3062
+ writeDebug(` \u{1F4CB} Running TypeScript Compiler for ${context2.options.name}`, context2.options.config);
3063
+ const stopwatch = getStopwatch(`${context2.options.name} asset copy`);
3064
+ await emitDts(context2.options.config, context2.options.tsconfig, context2.options.tsconfigRaw, true);
3065
+ stopwatch();
3066
+ }
3067
+ return context2;
3068
+ }
3069
+ _chunk3HFBGYEUjs.__name.call(void 0, executeTypescript, "executeTypescript");
2898
3070
  async function copyBuildAssets(context2) {
2899
- if (_optionalChain([context2, 'access', _133 => _133.result, 'optionalAccess', _134 => _134.errors, 'access', _135 => _135.length]) === 0) {
3071
+ if (_optionalChain([context2, 'access', _139 => _139.result, 'optionalAccess', _140 => _140.errors, 'access', _141 => _141.length]) === 0) {
2900
3072
  writeDebug(` \u{1F4CB} Copying asset files to output directory: ${context2.options.outdir}`, context2.options.config);
2901
3073
  const stopwatch = getStopwatch(`${context2.options.name} asset copy`);
2902
3074
  await copyAssets(context2.options.config, _nullishCoalesce(context2.options.assets, () => ( [])), context2.options.outdir, context2.options.projectRoot, context2.options.sourceRoot, true, false);
@@ -2906,11 +3078,14 @@ async function copyBuildAssets(context2) {
2906
3078
  }
2907
3079
  _chunk3HFBGYEUjs.__name.call(void 0, copyBuildAssets, "copyBuildAssets");
2908
3080
  async function reportResults(context2) {
2909
- if (_optionalChain([context2, 'access', _136 => _136.result, 'optionalAccess', _137 => _137.errors, 'access', _138 => _138.length]) === 0) {
3081
+ if (_optionalChain([context2, 'access', _142 => _142.result, 'optionalAccess', _143 => _143.errors, 'access', _144 => _144.length]) === 0) {
2910
3082
  if (context2.result.warnings.length > 0) {
2911
3083
  writeWarning(` \u{1F6A7} The following warnings occurred during the build: ${context2.result.warnings.map((warning) => warning.text).join("\n")}`, context2.options.config);
2912
3084
  }
2913
3085
  writeSuccess(` \u{1F4E6} The ${context2.options.name} build completed successfully`, context2.options.config);
3086
+ } else if (_optionalChain([context2, 'access', _145 => _145.result, 'optionalAccess', _146 => _146.errors]) && _optionalChain([context2, 'access', _147 => _147.result, 'optionalAccess', _148 => _148.errors, 'access', _149 => _149.length]) > 0) {
3087
+ writeError(` \u274C The ${context2.options.name} build failed with the following errors: ${context2.result.errors.map((error) => error.text).join("\n")}`, context2.options.config);
3088
+ throw new Error(`The ${context2.options.name} build failed with the following errors: ${context2.result.errors.map((error) => error.text).join("\n")}`);
2914
3089
  }
2915
3090
  }
2916
3091
  _chunk3HFBGYEUjs.__name.call(void 0, reportResults, "reportResults");
@@ -2965,7 +3140,7 @@ async function build3(options) {
2965
3140
  throw new Error("No build options were provided");
2966
3141
  }
2967
3142
  void transduce.async(opts, dependencyCheck);
2968
- await transduce.async(await createOptions(opts), pipe.async(generateContext, cleanOutputPath, generatePackageJson, executeEsBuild, copyBuildAssets, reportResults));
3143
+ await transduce.async(await createOptions(opts), pipe.async(generateContext, cleanOutputPath, generatePackageJson, executeTypescript, executeEsBuild, copyBuildAssets, reportResults));
2969
3144
  writeSuccess(" \u{1F3C1} ESBuild pipeline build completed successfully");
2970
3145
  } catch (error) {
2971
3146
  writeFatal("Fatal errors that the build process could not recover from have occured. The build process has been terminated.");
@@ -3007,14 +3182,14 @@ var watch = /* @__PURE__ */ _chunk3HFBGYEUjs.__name.call(void 0, (context2, opti
3007
3182
  // ../workspace-tools/src/executors/esbuild/executor.ts
3008
3183
  async function esbuildExecutorFn(options, context2, config) {
3009
3184
  writeInfo("\u{1F4E6} Running Storm ESBuild executor on the workspace", config);
3010
- if (!_optionalChain([context2, 'access', _139 => _139.projectsConfigurations, 'optionalAccess', _140 => _140.projects]) || !context2.projectName || !context2.projectsConfigurations.projects[context2.projectName] || !_optionalChain([context2, 'access', _141 => _141.projectsConfigurations, 'access', _142 => _142.projects, 'access', _143 => _143[context2.projectName], 'optionalAccess', _144 => _144.root])) {
3185
+ if (!_optionalChain([context2, 'access', _150 => _150.projectsConfigurations, 'optionalAccess', _151 => _151.projects]) || !context2.projectName || !context2.projectsConfigurations.projects[context2.projectName] || !_optionalChain([context2, 'access', _152 => _152.projectsConfigurations, 'access', _153 => _153.projects, 'access', _154 => _154[context2.projectName], 'optionalAccess', _155 => _155.root])) {
3011
3186
  throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace.");
3012
3187
  }
3013
3188
  await build3({
3014
3189
  ...options,
3015
- projectRoot: _optionalChain([context2, 'access', _145 => _145.projectsConfigurations, 'access', _146 => _146.projects, 'optionalAccess', _147 => _147[context2.projectName], 'access', _148 => _148.root]),
3190
+ projectRoot: _optionalChain([context2, 'access', _156 => _156.projectsConfigurations, 'access', _157 => _157.projects, 'optionalAccess', _158 => _158[context2.projectName], 'access', _159 => _159.root]),
3016
3191
  projectName: context2.projectName,
3017
- sourceRoot: _optionalChain([context2, 'access', _149 => _149.projectsConfigurations, 'access', _150 => _150.projects, 'optionalAccess', _151 => _151[context2.projectName], 'optionalAccess', _152 => _152.sourceRoot]),
3192
+ sourceRoot: _optionalChain([context2, 'access', _160 => _160.projectsConfigurations, 'access', _161 => _161.projects, 'optionalAccess', _162 => _162[context2.projectName], 'optionalAccess', _163 => _163.sourceRoot]),
3018
3193
  format: options.format,
3019
3194
  platform: options.format
3020
3195
  });
@@ -3060,7 +3235,7 @@ var _esbuildwhy = require('@size-limit/esbuild-why'); var _esbuildwhy2 = _intero
3060
3235
  var _file = require('@size-limit/file'); var _file2 = _interopRequireDefault(_file);
3061
3236
  var _sizelimit = require('size-limit'); var _sizelimit2 = _interopRequireDefault(_sizelimit);
3062
3237
  async function sizeLimitExecutorFn(options, context2, config) {
3063
- if (!_optionalChain([context2, 'optionalAccess', _153 => _153.projectName]) || !_optionalChain([context2, 'access', _154 => _154.projectsConfigurations, 'optionalAccess', _155 => _155.projects]) || !context2.projectsConfigurations.projects[context2.projectName]) {
3238
+ if (!_optionalChain([context2, 'optionalAccess', _164 => _164.projectName]) || !_optionalChain([context2, 'access', _165 => _165.projectsConfigurations, 'optionalAccess', _166 => _166.projects]) || !context2.projectsConfigurations.projects[context2.projectName]) {
3064
3239
  throw new Error("The Size-Limit process failed because the context is not valid. Please run this command from a workspace.");
3065
3240
  }
3066
3241
  writeInfo(`\u{1F4CF} Running Size-Limit on ${context2.projectName}`, config);
@@ -3069,7 +3244,7 @@ async function sizeLimitExecutorFn(options, context2, config) {
3069
3244
  _esbuild3.default,
3070
3245
  _esbuildwhy2.default
3071
3246
  ], {
3072
- checks: _nullishCoalesce(_nullishCoalesce(options.entry, () => ( _optionalChain([context2, 'access', _156 => _156.projectsConfigurations, 'access', _157 => _157.projects, 'access', _158 => _158[context2.projectName], 'optionalAccess', _159 => _159.sourceRoot]))), () => ( _devkit.joinPathFragments.call(void 0, _nullishCoalesce(_optionalChain([context2, 'access', _160 => _160.projectsConfigurations, 'access', _161 => _161.projects, 'access', _162 => _162[context2.projectName], 'optionalAccess', _163 => _163.root]), () => ( "./")), "src")))
3247
+ checks: _nullishCoalesce(_nullishCoalesce(options.entry, () => ( _optionalChain([context2, 'access', _167 => _167.projectsConfigurations, 'access', _168 => _168.projects, 'access', _169 => _169[context2.projectName], 'optionalAccess', _170 => _170.sourceRoot]))), () => ( _devkit.joinPathFragments.call(void 0, _nullishCoalesce(_optionalChain([context2, 'access', _171 => _171.projectsConfigurations, 'access', _172 => _172.projects, 'access', _173 => _173[context2.projectName], 'optionalAccess', _174 => _174.root]), () => ( "./")), "src")))
3073
3248
  }).then((result) => {
3074
3249
  writeInfo(`\u{1F4CF} ${context2.projectName} Size-Limit result: ${JSON.stringify(result)}`, config);
3075
3250
  });
@@ -3130,7 +3305,7 @@ _chunk3HFBGYEUjs.init_cjs_shims.call(void 0, );
3130
3305
  var _jiti = require('jiti');
3131
3306
  async function unbuildExecutorFn(options, context2, config) {
3132
3307
  writeInfo("\u{1F4E6} Running Storm Unbuild executor on the workspace", config);
3133
- if (!_optionalChain([context2, 'access', _164 => _164.projectsConfigurations, 'optionalAccess', _165 => _165.projects]) || !context2.projectName || !context2.projectsConfigurations.projects[context2.projectName]) {
3308
+ if (!_optionalChain([context2, 'access', _175 => _175.projectsConfigurations, 'optionalAccess', _176 => _176.projects]) || !context2.projectName || !context2.projectsConfigurations.projects[context2.projectName]) {
3134
3309
  throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace root directory.");
3135
3310
  }
3136
3311
  if (!context2.projectsConfigurations.projects[context2.projectName].root) {
@@ -3219,7 +3394,7 @@ var withRunGenerator = /* @__PURE__ */ _chunk3HFBGYEUjs.__name.call(void 0, (nam
3219
3394
  - workspaceRoot: ${workspaceRoot3}`, config);
3220
3395
  config = await getConfig(workspaceRoot3);
3221
3396
  }
3222
- if (_optionalChain([generatorOptions, 'optionalAccess', _166 => _166.hooks, 'optionalAccess', _167 => _167.applyDefaultOptions])) {
3397
+ if (_optionalChain([generatorOptions, 'optionalAccess', _177 => _177.hooks, 'optionalAccess', _178 => _178.applyDefaultOptions])) {
3223
3398
  writeDebug("Running the applyDefaultOptions hook...", config);
3224
3399
  options = await Promise.resolve(generatorOptions.hooks.applyDefaultOptions(options, config));
3225
3400
  writeDebug("Completed the applyDefaultOptions hook", config);
@@ -3230,22 +3405,22 @@ ${Object.keys(_nullishCoalesce(options, () => ( {}))).map((key) => ` - ${key}=${
3230
3405
  workspaceRoot: tree.root,
3231
3406
  config
3232
3407
  }, applyWorkspaceBaseTokens);
3233
- if (_optionalChain([generatorOptions, 'optionalAccess', _168 => _168.hooks, 'optionalAccess', _169 => _169.preProcess])) {
3408
+ if (_optionalChain([generatorOptions, 'optionalAccess', _179 => _179.hooks, 'optionalAccess', _180 => _180.preProcess])) {
3234
3409
  writeDebug("Running the preProcess hook...", config);
3235
3410
  await Promise.resolve(generatorOptions.hooks.preProcess(tokenized, config));
3236
3411
  writeDebug("Completed the preProcess hook", config);
3237
3412
  }
3238
3413
  const result = await Promise.resolve(generatorFn(tree, tokenized, config));
3239
3414
  if (result) {
3240
- if (result.success === false || result.error && _optionalChain([result, 'optionalAccess', _170 => _170.error, 'optionalAccess', _171 => _171.message]) && typeof _optionalChain([result, 'optionalAccess', _172 => _172.error, 'optionalAccess', _173 => _173.message]) === "string" && _optionalChain([result, 'optionalAccess', _174 => _174.error, 'optionalAccess', _175 => _175.name]) && typeof _optionalChain([result, 'optionalAccess', _176 => _176.error, 'optionalAccess', _177 => _177.name]) === "string") {
3415
+ if (result.success === false || result.error && _optionalChain([result, 'optionalAccess', _181 => _181.error, 'optionalAccess', _182 => _182.message]) && typeof _optionalChain([result, 'optionalAccess', _183 => _183.error, 'optionalAccess', _184 => _184.message]) === "string" && _optionalChain([result, 'optionalAccess', _185 => _185.error, 'optionalAccess', _186 => _186.name]) && typeof _optionalChain([result, 'optionalAccess', _187 => _187.error, 'optionalAccess', _188 => _188.name]) === "string") {
3241
3416
  throw new Error(`The ${name} generator failed to run`, {
3242
- cause: _optionalChain([result, 'optionalAccess', _178 => _178.error])
3417
+ cause: _optionalChain([result, 'optionalAccess', _189 => _189.error])
3243
3418
  });
3244
3419
  } else if (result.success && result.data) {
3245
3420
  return result;
3246
3421
  }
3247
3422
  }
3248
- if (_optionalChain([generatorOptions, 'optionalAccess', _179 => _179.hooks, 'optionalAccess', _180 => _180.postProcess])) {
3423
+ if (_optionalChain([generatorOptions, 'optionalAccess', _190 => _190.hooks, 'optionalAccess', _191 => _191.postProcess])) {
3249
3424
  writeDebug("Running the postProcess hook...", config);
3250
3425
  await Promise.resolve(generatorOptions.hooks.postProcess(config));
3251
3426
  writeDebug("Completed the postProcess hook", config);
@@ -3414,15 +3589,15 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
3414
3589
  _devkit.addProjectConfiguration.call(void 0, tree, normalized.name, projectConfig);
3415
3590
  let repository = {
3416
3591
  type: "github",
3417
- url: _optionalChain([config, 'optionalAccess', _181 => _181.repository]) || `https://github.com/${_optionalChain([config, 'optionalAccess', _182 => _182.organization]) || "storm-software"}/${_optionalChain([config, 'optionalAccess', _183 => _183.namespace]) || _optionalChain([config, 'optionalAccess', _184 => _184.name]) || "repository"}.git`
3592
+ url: _optionalChain([config, 'optionalAccess', _192 => _192.repository]) || `https://github.com/${_optionalChain([config, 'optionalAccess', _193 => _193.organization]) || "storm-software"}/${_optionalChain([config, 'optionalAccess', _194 => _194.namespace]) || _optionalChain([config, 'optionalAccess', _195 => _195.name]) || "repository"}.git`
3418
3593
  };
3419
3594
  let description = options.description || "A package developed by Storm Software used to create modern, scalable web applications.";
3420
3595
  if (tree.exists("package.json")) {
3421
3596
  const packageJson = _devkit.readJson.call(void 0, tree, "package.json");
3422
- if (_optionalChain([packageJson, 'optionalAccess', _185 => _185.repository])) {
3597
+ if (_optionalChain([packageJson, 'optionalAccess', _196 => _196.repository])) {
3423
3598
  repository = packageJson.repository;
3424
3599
  }
3425
- if (_optionalChain([packageJson, 'optionalAccess', _186 => _186.description])) {
3600
+ if (_optionalChain([packageJson, 'optionalAccess', _197 => _197.description])) {
3426
3601
  description = packageJson.description;
3427
3602
  }
3428
3603
  }
@@ -3477,9 +3652,9 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
3477
3652
  _devkit.updateJson.call(void 0, tree, "package.json", (json) => ({
3478
3653
  ...json,
3479
3654
  pnpm: {
3480
- ..._optionalChain([json, 'optionalAccess', _187 => _187.pnpm]),
3655
+ ..._optionalChain([json, 'optionalAccess', _198 => _198.pnpm]),
3481
3656
  overrides: {
3482
- ..._optionalChain([json, 'optionalAccess', _188 => _188.pnpm, 'optionalAccess', _189 => _189.overrides]),
3657
+ ..._optionalChain([json, 'optionalAccess', _199 => _199.pnpm, 'optionalAccess', _200 => _200.overrides]),
3483
3658
  [_nullishCoalesce(normalized.importPath, () => ( ""))]: "workspace:*"
3484
3659
  }
3485
3660
  }
@@ -3493,10 +3668,10 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
3493
3668
  ]);
3494
3669
  if (tree.exists("package.json")) {
3495
3670
  const packageJson = _devkit.readJson.call(void 0, tree, "package.json");
3496
- if (_optionalChain([packageJson, 'optionalAccess', _190 => _190.repository])) {
3671
+ if (_optionalChain([packageJson, 'optionalAccess', _201 => _201.repository])) {
3497
3672
  repository = packageJson.repository;
3498
3673
  }
3499
- if (_optionalChain([packageJson, 'optionalAccess', _191 => _191.description])) {
3674
+ if (_optionalChain([packageJson, 'optionalAccess', _202 => _202.description])) {
3500
3675
  description = packageJson.description;
3501
3676
  }
3502
3677
  }
@@ -3544,24 +3719,24 @@ _chunk3HFBGYEUjs.__name.call(void 0, getOutputPath, "getOutputPath");
3544
3719
  function createProjectTsConfigJson(tree, options) {
3545
3720
  const tsconfig = {
3546
3721
  extends: options.rootProject ? void 0 : _js.getRelativePathToRootTsConfig.call(void 0, tree, options.projectRoot),
3547
- ..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _192 => _192.tsconfigOptions]), () => ( {})),
3722
+ ..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _203 => _203.tsconfigOptions]), () => ( {})),
3548
3723
  compilerOptions: {
3549
3724
  ...options.rootProject ? _js.tsConfigBaseOptions : {},
3550
3725
  outDir: _chunkRMDWM2XCjs.joinPaths.call(void 0, _devkit.offsetFromRoot.call(void 0, options.projectRoot), "dist/out-tsc"),
3551
3726
  noEmit: true,
3552
- ..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _193 => _193.tsconfigOptions, 'optionalAccess', _194 => _194.compilerOptions]), () => ( {}))
3727
+ ..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _204 => _204.tsconfigOptions, 'optionalAccess', _205 => _205.compilerOptions]), () => ( {}))
3553
3728
  },
3554
3729
  files: [
3555
- ..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _195 => _195.tsconfigOptions, 'optionalAccess', _196 => _196.files]), () => ( []))
3730
+ ..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _206 => _206.tsconfigOptions, 'optionalAccess', _207 => _207.files]), () => ( []))
3556
3731
  ],
3557
3732
  include: [
3558
- ..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _197 => _197.tsconfigOptions, 'optionalAccess', _198 => _198.include]), () => ( [])),
3733
+ ..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _208 => _208.tsconfigOptions, 'optionalAccess', _209 => _209.include]), () => ( [])),
3559
3734
  "src/**/*.ts",
3560
3735
  "src/**/*.js",
3561
3736
  "bin/**/*"
3562
3737
  ],
3563
3738
  exclude: [
3564
- ..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _199 => _199.tsconfigOptions, 'optionalAccess', _200 => _200.exclude]), () => ( [])),
3739
+ ..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _210 => _210.tsconfigOptions, 'optionalAccess', _211 => _211.exclude]), () => ( [])),
3565
3740
  "jest.config.ts",
3566
3741
  "src/**/*.spec.ts",
3567
3742
  "src/**/*.test.ts"
@@ -3572,8 +3747,8 @@ function createProjectTsConfigJson(tree, options) {
3572
3747
  _chunk3HFBGYEUjs.__name.call(void 0, createProjectTsConfigJson, "createProjectTsConfigJson");
3573
3748
  async function normalizeOptions(tree, options, config) {
3574
3749
  let importPath = options.importPath;
3575
- if (!importPath && _optionalChain([config, 'optionalAccess', _201 => _201.namespace])) {
3576
- importPath = `@${_optionalChain([config, 'optionalAccess', _202 => _202.namespace])}/${options.name}`;
3750
+ if (!importPath && _optionalChain([config, 'optionalAccess', _212 => _212.namespace])) {
3751
+ importPath = `@${_optionalChain([config, 'optionalAccess', _213 => _213.namespace])}/${options.name}`;
3577
3752
  }
3578
3753
  if (options.publishable) {
3579
3754
  if (!importPath) {
@@ -3706,7 +3881,7 @@ async function configSchemaGeneratorFn(tree, options, config) {
3706
3881
  name: "StormWorkspaceConfiguration"
3707
3882
  });
3708
3883
  writeTrace(jsonSchema, config);
3709
- const outputPath = options.outputFile.replaceAll("{workspaceRoot}", "").replaceAll(_nullishCoalesce(_optionalChain([config, 'optionalAccess', _203 => _203.workspaceRoot]), () => ( findWorkspaceRoot())), _optionalChain([options, 'access', _204 => _204.outputFile, 'optionalAccess', _205 => _205.startsWith, 'call', _206 => _206("./")]) ? "" : "./");
3884
+ const outputPath = options.outputFile.replaceAll("{workspaceRoot}", "").replaceAll(_nullishCoalesce(_optionalChain([config, 'optionalAccess', _214 => _214.workspaceRoot]), () => ( findWorkspaceRoot())), _optionalChain([options, 'access', _215 => _215.outputFile, 'optionalAccess', _216 => _216.startsWith, 'call', _217 => _217("./")]) ? "" : "./");
3710
3885
  writeTrace(`\u{1F4DD} Writing Storm Configuration JSON Schema to "${outputPath}"`, config);
3711
3886
  _devkit.writeJson.call(void 0, tree, outputPath, jsonSchema, {
3712
3887
  spaces: 2
@@ -229,7 +229,7 @@ var stormWorkspaceConfigSchema = z.object({
229
229
  "staging",
230
230
  "production"
231
231
  ]).default("production").describe("The current runtime environment mode for the package"),
232
- workspaceRoot: z.string().trim().default("").describe("The root directory of the workspace"),
232
+ workspaceRoot: z.string().trim().describe("The root directory of the workspace"),
233
233
  externalPackagePatterns: z.array(z.string()).default([]).describe("The build will use these package patterns to determine if they should be external to the bundle"),
234
234
  skipCache: z.boolean().default(false).describe("Should all known types of workspace caching be skipped?"),
235
235
  directories: WorkspaceDirectoryConfigSchema,
@@ -798,7 +798,7 @@ var getConfigFile = /* @__PURE__ */ __name(async (filePath, additionalFileNames
798
798
  }
799
799
  }
800
800
  }
801
- if (!config) {
801
+ if (!config || Object.keys(config).length === 0) {
802
802
  return void 0;
803
803
  }
804
804
  config.configFile = configFile;
@@ -861,12 +861,12 @@ var getConfigEnv = /* @__PURE__ */ __name(() => {
861
861
  configFile: process.env[`${prefix}CONFIG_FILE`] ? correctPaths(process.env[`${prefix}CONFIG_FILE`]) : void 0,
862
862
  workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`] ? correctPaths(process.env[`${prefix}WORKSPACE_ROOT`]) : void 0,
863
863
  directories: {
864
- cache: process.env[`${prefix}CACHE_DIR`] ? correctPaths(process.env[`${prefix}CACHE_DIR`]) : void 0,
865
- data: process.env[`${prefix}DATA_DIR`] ? correctPaths(process.env[`${prefix}DATA_DIR`]) : void 0,
866
- config: process.env[`${prefix}CONFIG_DIR`] ? correctPaths(process.env[`${prefix}CONFIG_DIR`]) : void 0,
867
- temp: process.env[`${prefix}TEMP_DIR`] ? correctPaths(process.env[`${prefix}TEMP_DIR`]) : void 0,
868
- log: process.env[`${prefix}LOG_DIR`] ? correctPaths(process.env[`${prefix}LOG_DIR`]) : void 0,
869
- build: process.env[`${prefix}BUILD_DIR`] ? correctPaths(process.env[`${prefix}BUILD_DIR`]) : void 0
864
+ 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,
865
+ 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,
866
+ 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,
867
+ 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,
868
+ 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,
869
+ 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
870
870
  },
871
871
  skipCache: process.env[`${prefix}SKIP_CACHE`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CACHE`]) : void 0,
872
872
  mode: (process.env[`${prefix}MODE`] ?? process.env.NODE_ENV ?? process.env.ENVIRONMENT) || void 0,
@@ -1087,21 +1087,27 @@ var setConfigEnv = /* @__PURE__ */ __name((config) => {
1087
1087
  if (config.directories) {
1088
1088
  if (!config.skipCache && config.directories.cache) {
1089
1089
  process.env[`${prefix}CACHE_DIR`] = correctPaths(config.directories.cache);
1090
+ process.env[`${prefix}CACHE_DIRECTORY`] = process.env[`${prefix}CACHE_DIR`];
1090
1091
  }
1091
1092
  if (config.directories.data) {
1092
1093
  process.env[`${prefix}DATA_DIR`] = correctPaths(config.directories.data);
1094
+ process.env[`${prefix}DATA_DIRECTORY`] = process.env[`${prefix}DATA_DIR`];
1093
1095
  }
1094
1096
  if (config.directories.config) {
1095
1097
  process.env[`${prefix}CONFIG_DIR`] = correctPaths(config.directories.config);
1098
+ process.env[`${prefix}CONFIG_DIRECTORY`] = process.env[`${prefix}CONFIG_DIR`];
1096
1099
  }
1097
1100
  if (config.directories.temp) {
1098
1101
  process.env[`${prefix}TEMP_DIR`] = correctPaths(config.directories.temp);
1102
+ process.env[`${prefix}TEMP_DIRECTORY`] = process.env[`${prefix}TEMP_DIR`];
1099
1103
  }
1100
1104
  if (config.directories.log) {
1101
1105
  process.env[`${prefix}LOG_DIR`] = correctPaths(config.directories.log);
1106
+ process.env[`${prefix}LOG_DIRECTORY`] = process.env[`${prefix}LOG_DIR`];
1102
1107
  }
1103
1108
  if (config.directories.build) {
1104
1109
  process.env[`${prefix}BUILD_DIR`] = correctPaths(config.directories.build);
1110
+ process.env[`${prefix}BUILD_DIRECTORY`] = process.env[`${prefix}BUILD_DIR`];
1105
1111
  }
1106
1112
  }
1107
1113
  if (config.skipCache !== void 0) {
@@ -1269,7 +1275,7 @@ var setBaseThemeColorConfigEnv = /* @__PURE__ */ __name((prefix, config) => {
1269
1275
  // ../config-tools/src/create-storm-config.ts
1270
1276
  var _extension_cache = /* @__PURE__ */ new WeakMap();
1271
1277
  var _static_cache = void 0;
1272
- var createStormWorkspaceConfig = /* @__PURE__ */ __name(async (extensionName, schema, workspaceRoot3, skipLogs = false) => {
1278
+ var createStormWorkspaceConfig = /* @__PURE__ */ __name(async (extensionName, schema, workspaceRoot3, skipLogs = false, useDefault = true) => {
1273
1279
  let result;
1274
1280
  if (!_static_cache?.data || !_static_cache?.timestamp || _static_cache.timestamp < Date.now() - 8e3) {
1275
1281
  let _workspaceRoot = workspaceRoot3;
@@ -1277,13 +1283,18 @@ var createStormWorkspaceConfig = /* @__PURE__ */ __name(async (extensionName, sc
1277
1283
  _workspaceRoot = findWorkspaceRoot();
1278
1284
  }
1279
1285
  const configEnv = getConfigEnv();
1280
- const defaultConfig = await getDefaultConfig(_workspaceRoot);
1281
1286
  const configFile = await getConfigFile(_workspaceRoot);
1282
- if (!configFile && !skipLogs) {
1283
- 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", {
1284
- logLevel: "all"
1285
- });
1287
+ if (!configFile) {
1288
+ if (!skipLogs) {
1289
+ 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", {
1290
+ logLevel: "all"
1291
+ });
1292
+ }
1293
+ if (useDefault === false) {
1294
+ return void 0;
1295
+ }
1286
1296
  }
1297
+ const defaultConfig = await getDefaultConfig(_workspaceRoot);
1287
1298
  result = await stormWorkspaceConfigSchema.parseAsync(defu2(configEnv, configFile, defaultConfig));
1288
1299
  result.workspaceRoot ??= _workspaceRoot;
1289
1300
  } else {
@@ -1316,7 +1327,7 @@ var createConfigExtension = /* @__PURE__ */ __name((extensionName, schema) => {
1316
1327
  return extension;
1317
1328
  }, "createConfigExtension");
1318
1329
  var loadStormWorkspaceConfig = /* @__PURE__ */ __name(async (workspaceRoot3, skipLogs = false) => {
1319
- const config = await createStormWorkspaceConfig(void 0, void 0, workspaceRoot3, skipLogs);
1330
+ const config = await createStormWorkspaceConfig(void 0, void 0, workspaceRoot3, skipLogs, true);
1320
1331
  setConfigEnv(config);
1321
1332
  if (!skipLogs && !config.skipConfigLogging) {
1322
1333
  writeTrace(`\u2699\uFE0F Using Storm Workspace configuration:
@@ -1919,12 +1930,12 @@ import { createTaskGraph, mapTargetDefaultsToDependencies } from "nx/src/tasks-r
1919
1930
 
1920
1931
  // ../esbuild/src/build.ts
1921
1932
  import { watch as createWatcher } from "chokidar";
1922
- import defu4 from "defu";
1933
+ import defu5 from "defu";
1923
1934
  import { debounce, flatten } from "es-toolkit";
1924
1935
  import { map } from "es-toolkit/compat";
1925
1936
  import * as esbuild2 from "esbuild";
1926
1937
  import { globbySync } from "globby";
1927
- import { existsSync as existsSync6 } from "node:fs";
1938
+ import { existsSync as existsSync7 } from "node:fs";
1928
1939
  import hf from "node:fs/promises";
1929
1940
  import { findWorkspaceRoot as findWorkspaceRoot2 } from "nx/src/utils/find-workspace-root";
1930
1941
 
@@ -2324,7 +2335,7 @@ __name(bundleTypeDefinitions, "bundleTypeDefinitions");
2324
2335
  var tscPlugin = /* @__PURE__ */ __name((options, resolvedOptions) => ({
2325
2336
  name: "storm:tsc",
2326
2337
  setup(build4) {
2327
- if (options.emitTypes === false) {
2338
+ if (options.dts === false) {
2328
2339
  return;
2329
2340
  }
2330
2341
  build4.onStart(async () => {
@@ -2376,7 +2387,7 @@ var getDefaultBuildPlugins = /* @__PURE__ */ __name((options, resolvedOptions) =
2376
2387
  var DEFAULT_BUILD_OPTIONS = {
2377
2388
  platform: "node",
2378
2389
  target: "node22",
2379
- format: "cjs",
2390
+ format: "esm",
2380
2391
  external: [],
2381
2392
  logLevel: "error",
2382
2393
  tsconfig: "tsconfig.json",
@@ -2527,6 +2538,156 @@ var shebangRenderer = {
2527
2538
  }
2528
2539
  };
2529
2540
 
2541
+ // ../esbuild/src/tsc.ts
2542
+ init_esm_shims();
2543
+ import { loadTsConfig } from "bundle-require";
2544
+ import defu4 from "defu";
2545
+ import { existsSync as existsSync6, mkdirSync, writeFileSync } from "node:fs";
2546
+ import { dirname as dirname2, isAbsolute, join as join3, normalize } from "node:path";
2547
+ import ts from "typescript";
2548
+ function ensureTempDeclarationDir(workspaceConfig) {
2549
+ const root = workspaceConfig.directories.temp || join3(workspaceConfig.workspaceRoot, "tmp");
2550
+ const dirPath = join3(root, ".tsc", "declaration");
2551
+ if (existsSync6(dirPath)) {
2552
+ return dirPath;
2553
+ }
2554
+ mkdirSync(dirPath, {
2555
+ recursive: true
2556
+ });
2557
+ const gitIgnorePath = join3(root, ".tsc", ".gitignore");
2558
+ writeFileSync(gitIgnorePath, "**/*\n");
2559
+ return dirPath;
2560
+ }
2561
+ __name(ensureTempDeclarationDir, "ensureTempDeclarationDir");
2562
+ function slash(path7) {
2563
+ const isExtendedLengthPath = path7.startsWith("\\\\?\\");
2564
+ if (isExtendedLengthPath) {
2565
+ return path7;
2566
+ }
2567
+ return path7.replace(/\\/g, "/");
2568
+ }
2569
+ __name(slash, "slash");
2570
+ function toAbsolutePath(workspaceConfig, p, cwd) {
2571
+ if (isAbsolute(p)) {
2572
+ return p;
2573
+ }
2574
+ return slash(normalize(join3(cwd || workspaceConfig.workspaceRoot, p)));
2575
+ }
2576
+ __name(toAbsolutePath, "toAbsolutePath");
2577
+ var AliasPool = class AliasPool2 {
2578
+ static {
2579
+ __name(this, "AliasPool");
2580
+ }
2581
+ seen = /* @__PURE__ */ new Set();
2582
+ assign(name) {
2583
+ let suffix = 0;
2584
+ let alias = name === "default" ? "default_alias" : name;
2585
+ while (this.seen.has(alias)) {
2586
+ alias = `${name}_alias_${++suffix}`;
2587
+ if (suffix >= 1e3) {
2588
+ throw new Error("Alias generation exceeded limit. Possible infinite loop detected.");
2589
+ }
2590
+ }
2591
+ this.seen.add(alias);
2592
+ return alias;
2593
+ }
2594
+ };
2595
+ function getExports(workspaceConfig, program, fileMapping) {
2596
+ const checker = program.getTypeChecker();
2597
+ const aliasPool = new AliasPool();
2598
+ const assignAlias = aliasPool.assign.bind(aliasPool);
2599
+ function extractExports(sourceFileName) {
2600
+ const cwd = program.getCurrentDirectory();
2601
+ sourceFileName = toAbsolutePath(workspaceConfig, sourceFileName, cwd);
2602
+ const sourceFile = program.getSourceFile(sourceFileName);
2603
+ if (!sourceFile) {
2604
+ return [];
2605
+ }
2606
+ const destFileName = fileMapping.get(sourceFileName);
2607
+ if (!destFileName) {
2608
+ return [];
2609
+ }
2610
+ const moduleSymbol = checker.getSymbolAtLocation(sourceFile);
2611
+ if (!moduleSymbol) {
2612
+ return [];
2613
+ }
2614
+ const exports = [];
2615
+ const exportSymbols = checker.getExportsOfModule(moduleSymbol);
2616
+ exportSymbols.forEach((symbol) => {
2617
+ const name = symbol.getName();
2618
+ exports.push({
2619
+ kind: "named",
2620
+ sourceFileName,
2621
+ destFileName,
2622
+ name,
2623
+ alias: assignAlias(name),
2624
+ isTypeOnly: false
2625
+ });
2626
+ });
2627
+ return exports;
2628
+ }
2629
+ __name(extractExports, "extractExports");
2630
+ return program.getRootFileNames().flatMap(extractExports);
2631
+ }
2632
+ __name(getExports, "getExports");
2633
+ function emitDtsFiles(workspaceConfig, program, host, emitOnlyDtsFiles = true, customTransformers) {
2634
+ const fileMapping = /* @__PURE__ */ new Map();
2635
+ const writeFile3 = /* @__PURE__ */ __name((fileName, text, writeByteOrderMark, onError, sourceFiles, data) => {
2636
+ const sourceFile = sourceFiles?.[0];
2637
+ const sourceFileName = sourceFile?.fileName;
2638
+ if (sourceFileName && !fileName.endsWith(".map")) {
2639
+ const cwd = program.getCurrentDirectory();
2640
+ fileMapping.set(toAbsolutePath(workspaceConfig, sourceFileName, cwd), toAbsolutePath(workspaceConfig, fileName, cwd));
2641
+ }
2642
+ return host.writeFile(fileName, text, writeByteOrderMark, onError, sourceFiles, data);
2643
+ }, "writeFile");
2644
+ const emitResult = program.emit(void 0, writeFile3, void 0, emitOnlyDtsFiles, customTransformers);
2645
+ const diagnostics = ts.getPreEmitDiagnostics(program).concat(emitResult.diagnostics);
2646
+ const diagnosticMessages = [];
2647
+ diagnostics.forEach((diagnostic) => {
2648
+ if (diagnostic.file) {
2649
+ const { line, character } = ts.getLineAndCharacterOfPosition(diagnostic.file, diagnostic.start);
2650
+ const message = ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n");
2651
+ diagnosticMessages.push(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`);
2652
+ } else {
2653
+ const message = ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n");
2654
+ diagnosticMessages.push(message);
2655
+ }
2656
+ });
2657
+ const diagnosticMessage = diagnosticMessages.join("\n");
2658
+ if (diagnosticMessage) {
2659
+ writeError(`Failed to emit declaration files.
2660
+
2661
+ ${diagnosticMessage}`, workspaceConfig);
2662
+ throw new Error("TypeScript compilation failed");
2663
+ }
2664
+ return fileMapping;
2665
+ }
2666
+ __name(emitDtsFiles, "emitDtsFiles");
2667
+ function emitDts(workspaceConfig, tsconfig, tsconfigRaw, emitOnlyDtsFiles = true, customTransformers) {
2668
+ const rawTsconfig = loadTsConfig(workspaceConfig.workspaceRoot, tsconfig);
2669
+ if (!rawTsconfig) {
2670
+ throw new Error(`Unable to find ${tsconfig || "tsconfig.json"} in ${workspaceConfig.workspaceRoot}`);
2671
+ }
2672
+ const declarationDir = ensureTempDeclarationDir(workspaceConfig);
2673
+ const parsedTsconfig = ts.parseJsonConfigFileContent(defu4({
2674
+ compilerOptions: {
2675
+ // Enable declaration emit and disable javascript emit
2676
+ noEmit: false,
2677
+ declaration: true,
2678
+ declarationMap: true,
2679
+ declarationDir,
2680
+ emitDeclarationOnly: true
2681
+ }
2682
+ }, tsconfigRaw?.compilerOptions ?? {}, rawTsconfig.data ?? {}), ts.sys, tsconfig ? dirname2(tsconfig) : "./");
2683
+ const options = parsedTsconfig.options;
2684
+ const host = ts.createCompilerHost(options);
2685
+ const program = ts.createProgram(parsedTsconfig.fileNames, options, host);
2686
+ const fileMapping = emitDtsFiles(workspaceConfig, program, host, emitOnlyDtsFiles, customTransformers);
2687
+ return getExports(workspaceConfig, program, fileMapping);
2688
+ }
2689
+ __name(emitDts, "emitDts");
2690
+
2530
2691
  // ../esbuild/src/utilities/get-entry-points.ts
2531
2692
  init_esm_shims();
2532
2693
  import { glob as glob3 } from "glob";
@@ -2690,7 +2851,7 @@ var resolveOptions = /* @__PURE__ */ __name(async (userOptions) => {
2690
2851
  exitOnError: true
2691
2852
  });
2692
2853
  const projectJsonPath = joinPaths(workspaceRoot3.dir, projectRoot, "project.json");
2693
- if (!existsSync6(projectJsonPath)) {
2854
+ if (!existsSync7(projectJsonPath)) {
2694
2855
  throw new Error("Cannot find project.json configuration");
2695
2856
  }
2696
2857
  const projectJsonFile = await hf.readFile(projectJsonPath, "utf8");
@@ -2700,11 +2861,11 @@ var resolveOptions = /* @__PURE__ */ __name(async (userOptions) => {
2700
2861
  if (!projectConfigurations?.projects?.[projectName]) {
2701
2862
  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.");
2702
2863
  }
2703
- const options = defu4(userOptions, DEFAULT_BUILD_OPTIONS);
2864
+ const options = defu5(userOptions, DEFAULT_BUILD_OPTIONS);
2704
2865
  options.name ??= `${projectName}-${options.format}`;
2705
2866
  options.target ??= DEFAULT_TARGET;
2706
2867
  const packageJsonPath = joinPaths(workspaceRoot3.dir, options.projectRoot, "package.json");
2707
- if (!existsSync6(packageJsonPath)) {
2868
+ if (!existsSync7(packageJsonPath)) {
2708
2869
  throw new Error("Cannot find package.json configuration");
2709
2870
  }
2710
2871
  const env = getEnv("esbuild", options);
@@ -2786,11 +2947,11 @@ var resolveOptions = /* @__PURE__ */ __name(async (userOptions) => {
2786
2947
  return result;
2787
2948
  }, "resolveOptions");
2788
2949
  async function generatePackageJson(context2) {
2789
- if (context2.options.generatePackageJson !== false && existsSync6(joinPaths(context2.options.projectRoot, "package.json"))) {
2950
+ if (context2.options.generatePackageJson !== false && existsSync7(joinPaths(context2.options.projectRoot, "package.json"))) {
2790
2951
  writeDebug(" \u270D\uFE0F Writing package.json file", context2.options.config);
2791
2952
  const stopwatch = getStopwatch("Write package.json file");
2792
2953
  const packageJsonPath = joinPaths(context2.options.projectRoot, "project.json");
2793
- if (!existsSync6(packageJsonPath)) {
2954
+ if (!existsSync7(packageJsonPath)) {
2794
2955
  throw new Error("Cannot find package.json configuration");
2795
2956
  }
2796
2957
  const packageJsonFile = await hf.readFile(joinPaths(context2.options.config.workspaceRoot, context2.options.projectRoot, "package.json"), "utf8");
@@ -2861,6 +3022,7 @@ async function executeEsBuild(context2) {
2861
3022
  options.inject === {}) {
2862
3023
  delete options.inject;
2863
3024
  }
3025
+ delete options.dts;
2864
3026
  delete options.env;
2865
3027
  delete options.name;
2866
3028
  delete options.assets;
@@ -2896,6 +3058,16 @@ ${formatLogMessage({
2896
3058
  return context2;
2897
3059
  }
2898
3060
  __name(executeEsBuild, "executeEsBuild");
3061
+ async function executeTypescript(context2) {
3062
+ if (context2.result?.errors.length === 0 && context2.options.dts) {
3063
+ writeDebug(` \u{1F4CB} Running TypeScript Compiler for ${context2.options.name}`, context2.options.config);
3064
+ const stopwatch = getStopwatch(`${context2.options.name} asset copy`);
3065
+ await emitDts(context2.options.config, context2.options.tsconfig, context2.options.tsconfigRaw, true);
3066
+ stopwatch();
3067
+ }
3068
+ return context2;
3069
+ }
3070
+ __name(executeTypescript, "executeTypescript");
2899
3071
  async function copyBuildAssets(context2) {
2900
3072
  if (context2.result?.errors.length === 0) {
2901
3073
  writeDebug(` \u{1F4CB} Copying asset files to output directory: ${context2.options.outdir}`, context2.options.config);
@@ -2912,6 +3084,9 @@ async function reportResults(context2) {
2912
3084
  writeWarning(` \u{1F6A7} The following warnings occurred during the build: ${context2.result.warnings.map((warning) => warning.text).join("\n")}`, context2.options.config);
2913
3085
  }
2914
3086
  writeSuccess(` \u{1F4E6} The ${context2.options.name} build completed successfully`, context2.options.config);
3087
+ } else if (context2.result?.errors && context2.result?.errors.length > 0) {
3088
+ writeError(` \u274C The ${context2.options.name} build failed with the following errors: ${context2.result.errors.map((error) => error.text).join("\n")}`, context2.options.config);
3089
+ throw new Error(`The ${context2.options.name} build failed with the following errors: ${context2.result.errors.map((error) => error.text).join("\n")}`);
2915
3090
  }
2916
3091
  }
2917
3092
  __name(reportResults, "reportResults");
@@ -2966,7 +3141,7 @@ async function build3(options) {
2966
3141
  throw new Error("No build options were provided");
2967
3142
  }
2968
3143
  void transduce.async(opts, dependencyCheck);
2969
- await transduce.async(await createOptions(opts), pipe.async(generateContext, cleanOutputPath, generatePackageJson, executeEsBuild, copyBuildAssets, reportResults));
3144
+ await transduce.async(await createOptions(opts), pipe.async(generateContext, cleanOutputPath, generatePackageJson, executeTypescript, executeEsBuild, copyBuildAssets, reportResults));
2970
3145
  writeSuccess(" \u{1F3C1} ESBuild pipeline build completed successfully");
2971
3146
  } catch (error) {
2972
3147
  writeFatal("Fatal errors that the build process could not recover from have occured. The build process has been terminated.");
@@ -3045,7 +3220,7 @@ import { readFile as readFile6 } from "node:fs/promises";
3045
3220
 
3046
3221
  // ../workspace-tools/src/utils/pnpm-deps-update.ts
3047
3222
  init_esm_shims();
3048
- import { existsSync as existsSync7 } from "node:fs";
3223
+ import { existsSync as existsSync8 } from "node:fs";
3049
3224
  import { readFile as readFile5, writeFile as writeFile2 } from "node:fs/promises";
3050
3225
  import { format } from "prettier";
3051
3226
  import readYamlFile from "read-yaml-file";
@@ -3127,7 +3302,7 @@ var executor_default8 = withRunExecutor("Typia runtime validation generator", ty
3127
3302
 
3128
3303
  // ../workspace-tools/src/executors/unbuild/executor.ts
3129
3304
  init_esm_shims();
3130
- import { defu as defu5 } from "defu";
3305
+ import { defu as defu6 } from "defu";
3131
3306
  import { createJiti } from "jiti";
3132
3307
  async function unbuildExecutorFn(options, context2, config) {
3133
3308
  writeInfo("\u{1F4E6} Running Storm Unbuild executor on the workspace", config);
@@ -3145,7 +3320,7 @@ async function unbuildExecutorFn(options, context2, config) {
3145
3320
  interopDefault: true
3146
3321
  });
3147
3322
  const stormUnbuild = await jiti.import(jiti.esmResolve("@storm-software/unbuild/build"));
3148
- await stormUnbuild.build(defu5({
3323
+ await stormUnbuild.build(defu6({
3149
3324
  ...options,
3150
3325
  projectRoot: context2.projectsConfigurations.projects[context2.projectName].root,
3151
3326
  projectName: context2.projectName,
@@ -4732,29 +4907,29 @@ import { retrieveProjectConfigurationsWithoutPluginInference } from "nx/src/proj
4732
4907
  // ../workspace-tools/src/utils/lock-file.ts
4733
4908
  init_esm_shims();
4734
4909
  import { output as output2, readJsonFile, workspaceRoot as workspaceRoot2 } from "@nx/devkit";
4735
- import { existsSync as existsSync8 } from "node:fs";
4736
- import { join as join4 } from "node:path";
4910
+ import { existsSync as existsSync9 } from "node:fs";
4911
+ import { join as join5 } from "node:path";
4737
4912
  import { getNpmLockfileDependencies, getNpmLockfileNodes } from "nx/src/plugins/js/lock-file/npm-parser";
4738
4913
  import { getPnpmLockfileDependencies, getPnpmLockfileNodes } from "nx/src/plugins/js/lock-file/pnpm-parser";
4739
4914
  import { getYarnLockfileDependencies, getYarnLockfileNodes } from "nx/src/plugins/js/lock-file/yarn-parser";
4740
4915
  var YARN_LOCK_FILE = "yarn.lock";
4741
4916
  var NPM_LOCK_FILE = "package-lock.json";
4742
4917
  var PNPM_LOCK_FILE = "pnpm-lock.yaml";
4743
- var YARN_LOCK_PATH = join4(workspaceRoot2, YARN_LOCK_FILE);
4744
- var NPM_LOCK_PATH = join4(workspaceRoot2, NPM_LOCK_FILE);
4745
- var PNPM_LOCK_PATH = join4(workspaceRoot2, PNPM_LOCK_FILE);
4918
+ var YARN_LOCK_PATH = join5(workspaceRoot2, YARN_LOCK_FILE);
4919
+ var NPM_LOCK_PATH = join5(workspaceRoot2, NPM_LOCK_FILE);
4920
+ var PNPM_LOCK_PATH = join5(workspaceRoot2, PNPM_LOCK_FILE);
4746
4921
 
4747
4922
  // ../workspace-tools/src/utils/package-helpers.ts
4748
4923
  init_esm_shims();
4749
4924
  import { joinPathFragments as joinPathFragments6, readJsonFile as readJsonFile2 } from "@nx/devkit";
4750
- import { existsSync as existsSync9 } from "node:fs";
4925
+ import { existsSync as existsSync10 } from "node:fs";
4751
4926
 
4752
4927
  // ../workspace-tools/src/utils/plugin-helpers.ts
4753
4928
  init_esm_shims();
4754
4929
  import { readJsonFile as readJsonFile3 } from "@nx/devkit";
4755
- import defu6 from "defu";
4756
- import { existsSync as existsSync10 } from "node:fs";
4757
- import { dirname as dirname2, join as join5 } from "node:path";
4930
+ import defu7 from "defu";
4931
+ import { existsSync as existsSync11 } from "node:fs";
4932
+ import { dirname as dirname3, join as join6 } from "node:path";
4758
4933
 
4759
4934
  // ../workspace-tools/src/utils/typia-transform.ts
4760
4935
  init_esm_shims();
@@ -1,9 +1,9 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-FC4VZESQ.js');
2
2
 
3
3
 
4
- var _chunkRB3ISR5Zjs = require('./chunk-RB3ISR5Z.js');
4
+ var _chunk6TMYNO5Kjs = require('./chunk-6TMYNO5K.js');
5
5
  require('./chunk-RMDWM2XC.js');
6
6
  require('./chunk-3HFBGYEU.js');
7
7
 
8
8
 
9
- exports.initGeneratorFn = _chunkRB3ISR5Zjs.initGeneratorFn;
9
+ exports.initGeneratorFn = _chunk6TMYNO5Kjs.initGeneratorFn;
@@ -1,7 +1,7 @@
1
1
  import "./chunk-M7C76CZM.mjs";
2
2
  import {
3
3
  initGeneratorFn
4
- } from "./chunk-2GR7WKWK.mjs";
4
+ } from "./chunk-FCVTETPK.mjs";
5
5
  import "./chunk-HDDGB4GM.mjs";
6
6
  import "./chunk-7XLPJ5AL.mjs";
7
7
  export {
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@
4
4
  var _chunkGBSU3GE2js = require('./chunk-GBSU3GE2.js');
5
5
 
6
6
 
7
- var _chunkRB3ISR5Zjs = require('./chunk-RB3ISR5Z.js');
7
+ var _chunk6TMYNO5Kjs = require('./chunk-6TMYNO5K.js');
8
8
  require('./chunk-RMDWM2XC.js');
9
9
 
10
10
 
@@ -16,10 +16,10 @@ var _chunk3HFBGYEUjs = require('./chunk-3HFBGYEU.js');
16
16
  // index.ts
17
17
  var index_exports = {};
18
18
  _chunk3HFBGYEUjs.__export.call(void 0, index_exports, {
19
- initGeneratorFn: () => _chunkRB3ISR5Zjs.initGeneratorFn
19
+ initGeneratorFn: () => _chunk6TMYNO5Kjs.initGeneratorFn
20
20
  });
21
21
  _chunk3HFBGYEUjs.init_cjs_shims.call(void 0, );
22
22
  _chunk3HFBGYEUjs.__reExport.call(void 0, index_exports, _chunk3HFBGYEUjs.__toESM.call(void 0, _chunkGBSU3GE2js.require_components.call(void 0, )));
23
23
 
24
24
 
25
- exports.initGeneratorFn = _chunkRB3ISR5Zjs.initGeneratorFn;
25
+ exports.initGeneratorFn = _chunk6TMYNO5Kjs.initGeneratorFn;
package/dist/index.mjs CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-UCPSNJBN.mjs";
5
5
  import {
6
6
  initGeneratorFn
7
- } from "./chunk-2GR7WKWK.mjs";
7
+ } from "./chunk-FCVTETPK.mjs";
8
8
  import "./chunk-HDDGB4GM.mjs";
9
9
  import {
10
10
  __export,
@@ -75,7 +75,7 @@ declare const stormWorkspaceConfigSchema: z.ZodObject<{
75
75
  url?: string | undefined;
76
76
  }>;
77
77
  mode: z.ZodDefault<z.ZodEnum<["development", "staging", "production"]>>;
78
- workspaceRoot: z.ZodDefault<z.ZodString>;
78
+ workspaceRoot: z.ZodString;
79
79
  externalPackagePatterns: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
80
80
  skipCache: z.ZodDefault<z.ZodBoolean>;
81
81
  directories: z.ZodObject<{
@@ -1072,6 +1072,7 @@ declare const stormWorkspaceConfigSchema: z.ZodObject<{
1072
1072
  codesFile?: string | undefined;
1073
1073
  url?: string | undefined;
1074
1074
  };
1075
+ workspaceRoot: string;
1075
1076
  directories: {
1076
1077
  cache?: string | undefined;
1077
1078
  data?: string | undefined;
@@ -1242,7 +1243,6 @@ declare const stormWorkspaceConfigSchema: z.ZodObject<{
1242
1243
  preid?: string | undefined;
1243
1244
  owner?: string | undefined;
1244
1245
  mode?: "development" | "staging" | "production" | undefined;
1245
- workspaceRoot?: string | undefined;
1246
1246
  externalPackagePatterns?: string[] | undefined;
1247
1247
  skipCache?: boolean | undefined;
1248
1248
  packageManager?: "npm" | "yarn" | "pnpm" | "bun" | undefined;
@@ -75,7 +75,7 @@ declare const stormWorkspaceConfigSchema: z.ZodObject<{
75
75
  url?: string | undefined;
76
76
  }>;
77
77
  mode: z.ZodDefault<z.ZodEnum<["development", "staging", "production"]>>;
78
- workspaceRoot: z.ZodDefault<z.ZodString>;
78
+ workspaceRoot: z.ZodString;
79
79
  externalPackagePatterns: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
80
80
  skipCache: z.ZodDefault<z.ZodBoolean>;
81
81
  directories: z.ZodObject<{
@@ -1072,6 +1072,7 @@ declare const stormWorkspaceConfigSchema: z.ZodObject<{
1072
1072
  codesFile?: string | undefined;
1073
1073
  url?: string | undefined;
1074
1074
  };
1075
+ workspaceRoot: string;
1075
1076
  directories: {
1076
1077
  cache?: string | undefined;
1077
1078
  data?: string | undefined;
@@ -1242,7 +1243,6 @@ declare const stormWorkspaceConfigSchema: z.ZodObject<{
1242
1243
  preid?: string | undefined;
1243
1244
  owner?: string | undefined;
1244
1245
  mode?: "development" | "staging" | "production" | undefined;
1245
- workspaceRoot?: string | undefined;
1246
1246
  externalPackagePatterns?: string[] | undefined;
1247
1247
  skipCache?: boolean | undefined;
1248
1248
  packageManager?: "npm" | "yarn" | "pnpm" | "bun" | undefined;
@@ -1,10 +1,10 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
3
 
4
- var _chunkRB3ISR5Zjs = require('../../../chunk-RB3ISR5Z.js');
4
+ var _chunk6TMYNO5Kjs = require('../../../chunk-6TMYNO5K.js');
5
5
  require('../../../chunk-RMDWM2XC.js');
6
6
  require('../../../chunk-3HFBGYEU.js');
7
7
 
8
8
 
9
9
 
10
- exports.default = _chunkRB3ISR5Zjs.generator_default; exports.initGeneratorFn = _chunkRB3ISR5Zjs.initGeneratorFn;
10
+ exports.default = _chunk6TMYNO5Kjs.generator_default; exports.initGeneratorFn = _chunk6TMYNO5Kjs.initGeneratorFn;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  generator_default,
3
3
  initGeneratorFn
4
- } from "../../../chunk-2GR7WKWK.mjs";
4
+ } from "../../../chunk-FCVTETPK.mjs";
5
5
  import "../../../chunk-HDDGB4GM.mjs";
6
6
  import "../../../chunk-7XLPJ5AL.mjs";
7
7
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storm-software/projen",
3
- "version": "0.9.52",
3
+ "version": "0.9.54",
4
4
  "type": "commonjs",
5
5
  "description": "Tools for managing Projen configuration automation within a Nx workspace.",
6
6
  "repository": {