@storm-software/workspace-tools 1.43.4 → 1.43.6

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.
@@ -44822,9 +44822,9 @@ var require_brace_expansion2 = __commonJS({
44822
44822
  }
44823
44823
  });
44824
44824
 
44825
- // node_modules/.pnpm/tsup@8.0.0_patch_hash=nuoomzsk544j3zoy4w6xlebf4m_@microsoft+api-extractor@7.38.3_@swc+core@1._jyfln4hbxbrplmay2o7yiqfmdy/node_modules/tsup/dist/chunk-EPAEWGCP.js
44825
+ // node_modules/.pnpm/tsup@8.0.0_patch_hash=xmhwxzi2nqhltf2r7syhjyoc7i_@microsoft+api-extractor@7.38.3_@swc+core@1._6zprvhhd4zzf6xxclnutwtxcvy/node_modules/tsup/dist/chunk-EPAEWGCP.js
44826
44826
  var require_chunk_EPAEWGCP = __commonJS({
44827
- "node_modules/.pnpm/tsup@8.0.0_patch_hash=nuoomzsk544j3zoy4w6xlebf4m_@microsoft+api-extractor@7.38.3_@swc+core@1._jyfln4hbxbrplmay2o7yiqfmdy/node_modules/tsup/dist/chunk-EPAEWGCP.js"(exports) {
44827
+ "node_modules/.pnpm/tsup@8.0.0_patch_hash=xmhwxzi2nqhltf2r7syhjyoc7i_@microsoft+api-extractor@7.38.3_@swc+core@1._6zprvhhd4zzf6xxclnutwtxcvy/node_modules/tsup/dist/chunk-EPAEWGCP.js"(exports) {
44828
44828
  "use strict";
44829
44829
  Object.defineProperty(exports, "__esModule", { value: true });
44830
44830
  var version = "8.0.0";
@@ -46471,9 +46471,9 @@ var require_resolve_from2 = __commonJS({
46471
46471
  }
46472
46472
  });
46473
46473
 
46474
- // node_modules/.pnpm/tsup@8.0.0_patch_hash=nuoomzsk544j3zoy4w6xlebf4m_@microsoft+api-extractor@7.38.3_@swc+core@1._jyfln4hbxbrplmay2o7yiqfmdy/node_modules/tsup/dist/chunk-GQ77QZBO.js
46474
+ // node_modules/.pnpm/tsup@8.0.0_patch_hash=xmhwxzi2nqhltf2r7syhjyoc7i_@microsoft+api-extractor@7.38.3_@swc+core@1._6zprvhhd4zzf6xxclnutwtxcvy/node_modules/tsup/dist/chunk-GQ77QZBO.js
46475
46475
  var require_chunk_GQ77QZBO = __commonJS({
46476
- "node_modules/.pnpm/tsup@8.0.0_patch_hash=nuoomzsk544j3zoy4w6xlebf4m_@microsoft+api-extractor@7.38.3_@swc+core@1._jyfln4hbxbrplmay2o7yiqfmdy/node_modules/tsup/dist/chunk-GQ77QZBO.js"(exports) {
46476
+ "node_modules/.pnpm/tsup@8.0.0_patch_hash=xmhwxzi2nqhltf2r7syhjyoc7i_@microsoft+api-extractor@7.38.3_@swc+core@1._6zprvhhd4zzf6xxclnutwtxcvy/node_modules/tsup/dist/chunk-GQ77QZBO.js"(exports) {
46477
46477
  "use strict";
46478
46478
  Object.defineProperty(exports, "__esModule", { value: true });
46479
46479
  function _interopRequireDefault(obj) {
@@ -46751,9 +46751,9 @@ var require_chunk_GQ77QZBO = __commonJS({
46751
46751
  }
46752
46752
  });
46753
46753
 
46754
- // node_modules/.pnpm/tsup@8.0.0_patch_hash=nuoomzsk544j3zoy4w6xlebf4m_@microsoft+api-extractor@7.38.3_@swc+core@1._jyfln4hbxbrplmay2o7yiqfmdy/node_modules/tsup/dist/chunk-UIX4URMV.js
46754
+ // node_modules/.pnpm/tsup@8.0.0_patch_hash=xmhwxzi2nqhltf2r7syhjyoc7i_@microsoft+api-extractor@7.38.3_@swc+core@1._6zprvhhd4zzf6xxclnutwtxcvy/node_modules/tsup/dist/chunk-UIX4URMV.js
46755
46755
  var require_chunk_UIX4URMV = __commonJS({
46756
- "node_modules/.pnpm/tsup@8.0.0_patch_hash=nuoomzsk544j3zoy4w6xlebf4m_@microsoft+api-extractor@7.38.3_@swc+core@1._jyfln4hbxbrplmay2o7yiqfmdy/node_modules/tsup/dist/chunk-UIX4URMV.js"(exports) {
46756
+ "node_modules/.pnpm/tsup@8.0.0_patch_hash=xmhwxzi2nqhltf2r7syhjyoc7i_@microsoft+api-extractor@7.38.3_@swc+core@1._6zprvhhd4zzf6xxclnutwtxcvy/node_modules/tsup/dist/chunk-UIX4URMV.js"(exports) {
46757
46757
  "use strict";
46758
46758
  Object.defineProperty(exports, "__esModule", { value: true });
46759
46759
  function _interopRequireWildcard(obj) {
@@ -47246,8 +47246,8 @@ var require_dist2 = __commonJS({
47246
47246
  loadTsConfig: () => loadTsConfig2
47247
47247
  });
47248
47248
  module2.exports = __toCommonJS2(src_exports);
47249
- var import_path4 = __toESM2(require("path"), 1);
47250
- var import_fs4 = __toESM2(require("fs"), 1);
47249
+ var import_path2 = __toESM2(require("path"), 1);
47250
+ var import_fs2 = __toESM2(require("fs"), 1);
47251
47251
  var singleComment = Symbol("singleComment");
47252
47252
  var multiComment = Symbol("multiComment");
47253
47253
  var stripWithoutWhitespace = () => "";
@@ -47342,29 +47342,29 @@ var require_dist2 = __commonJS({
47342
47342
  }
47343
47343
  }
47344
47344
  var req = false ? createRequire(import_meta.url) : require;
47345
- var findUp = (name, startDir, stopDir = import_path4.default.parse(startDir).root) => {
47345
+ var findUp = (name, startDir, stopDir = import_path2.default.parse(startDir).root) => {
47346
47346
  let dir = startDir;
47347
47347
  while (dir !== stopDir) {
47348
- const file = import_path4.default.join(dir, name);
47349
- if (import_fs4.default.existsSync(file))
47348
+ const file = import_path2.default.join(dir, name);
47349
+ if (import_fs2.default.existsSync(file))
47350
47350
  return file;
47351
47351
  if (!file.endsWith(".json")) {
47352
47352
  const fileWithExt = file + ".json";
47353
- if (import_fs4.default.existsSync(fileWithExt))
47353
+ if (import_fs2.default.existsSync(fileWithExt))
47354
47354
  return fileWithExt;
47355
47355
  }
47356
- dir = import_path4.default.dirname(dir);
47356
+ dir = import_path2.default.dirname(dir);
47357
47357
  }
47358
47358
  return null;
47359
47359
  };
47360
47360
  var resolveTsConfigFromFile = (cwd, filename) => {
47361
- if (import_path4.default.isAbsolute(filename))
47362
- return import_fs4.default.existsSync(filename) ? filename : null;
47361
+ if (import_path2.default.isAbsolute(filename))
47362
+ return import_fs2.default.existsSync(filename) ? filename : null;
47363
47363
  return findUp(filename, cwd);
47364
47364
  };
47365
47365
  var resolveTsConfigFromExtends = (cwd, name) => {
47366
- if (import_path4.default.isAbsolute(name))
47367
- return import_fs4.default.existsSync(name) ? name : null;
47366
+ if (import_path2.default.isAbsolute(name))
47367
+ return import_fs2.default.existsSync(name) ? name : null;
47368
47368
  if (name.startsWith("."))
47369
47369
  return findUp(name, cwd);
47370
47370
  const id = req.resolve(name, { paths: [cwd] });
@@ -47372,14 +47372,14 @@ var require_dist2 = __commonJS({
47372
47372
  };
47373
47373
  var loadTsConfigInternal = (dir = process.cwd(), name = "tsconfig.json", isExtends = false) => {
47374
47374
  var _a, _b;
47375
- dir = import_path4.default.resolve(dir);
47375
+ dir = import_path2.default.resolve(dir);
47376
47376
  const id = isExtends ? resolveTsConfigFromExtends(dir, name) : resolveTsConfigFromFile(dir, name);
47377
47377
  if (!id)
47378
47378
  return null;
47379
- const data = jsoncParse(import_fs4.default.readFileSync(id, "utf-8"));
47380
- const configDir = import_path4.default.dirname(id);
47379
+ const data = jsoncParse(import_fs2.default.readFileSync(id, "utf-8"));
47380
+ const configDir = import_path2.default.dirname(id);
47381
47381
  if ((_a = data.compilerOptions) == null ? void 0 : _a.baseUrl) {
47382
- data.compilerOptions.baseUrl = import_path4.default.join(
47382
+ data.compilerOptions.baseUrl = import_path2.default.join(
47383
47383
  configDir,
47384
47384
  data.compilerOptions.baseUrl
47385
47385
  );
@@ -47456,17 +47456,17 @@ var require_dist3 = __commonJS({
47456
47456
  tsconfigPathsToRegExp: () => tsconfigPathsToRegExp
47457
47457
  });
47458
47458
  module2.exports = __toCommonJS2(src_exports);
47459
- var import_fs22 = __toESM2(require("fs"), 1);
47460
- var import_path22 = __toESM2(require("path"), 1);
47459
+ var import_fs2 = __toESM2(require("fs"), 1);
47460
+ var import_path2 = __toESM2(require("path"), 1);
47461
47461
  var import_url3 = require("url");
47462
47462
  var import_esbuild = require("esbuild");
47463
47463
  var import_load_tsconfig = require_dist2();
47464
- var import_fs4 = __toESM2(require("fs"), 1);
47465
- var import_path4 = __toESM2(require("path"), 1);
47464
+ var import_fs3 = __toESM2(require("fs"), 1);
47465
+ var import_path3 = __toESM2(require("path"), 1);
47466
47466
  var getPkgType = () => {
47467
47467
  try {
47468
47468
  const pkg = JSON.parse(
47469
- import_fs4.default.readFileSync(import_path4.default.resolve("package.json"), "utf-8")
47469
+ import_fs3.default.readFileSync(import_path3.default.resolve("package.json"), "utf-8")
47470
47470
  );
47471
47471
  return pkg.type;
47472
47472
  } catch (error) {
@@ -47475,7 +47475,7 @@ var require_dist3 = __commonJS({
47475
47475
  function guessFormat(inputFile) {
47476
47476
  if (!usingDynamicImport)
47477
47477
  return "cjs";
47478
- const ext2 = import_path4.default.extname(inputFile);
47478
+ const ext2 = import_path3.default.extname(inputFile);
47479
47479
  const type = getPkgType();
47480
47480
  if (ext2 === ".js") {
47481
47481
  return type === "module" ? "esm" : "cjs";
@@ -47532,7 +47532,7 @@ var require_dist3 = __commonJS({
47532
47532
  name: "bundle-require:external",
47533
47533
  setup(ctx) {
47534
47534
  ctx.onResolve({ filter: /.*/ }, async (args) => {
47535
- if (args.path[0] === "." || import_path22.default.isAbsolute(args.path)) {
47535
+ if (args.path[0] === "." || import_path2.default.isAbsolute(args.path)) {
47536
47536
  return;
47537
47537
  }
47538
47538
  if (match2(args.path, external)) {
@@ -47561,11 +47561,11 @@ var require_dist3 = __commonJS({
47561
47561
  "import.meta.url": IMPORT_META_URL_VAR_NAME
47562
47562
  };
47563
47563
  ctx.onLoad({ filter: JS_EXT_RE }, async (args) => {
47564
- const contents = await import_fs22.default.promises.readFile(args.path, "utf-8");
47564
+ const contents = await import_fs2.default.promises.readFile(args.path, "utf-8");
47565
47565
  const injectLines = [
47566
47566
  `const ${FILENAME_VAR_NAME} = ${JSON.stringify(args.path)};`,
47567
47567
  `const ${DIRNAME_VAR_NAME} = ${JSON.stringify(
47568
- import_path22.default.dirname(args.path)
47568
+ import_path2.default.dirname(args.path)
47569
47569
  )};`,
47570
47570
  `const ${IMPORT_META_URL_VAR_NAME} = ${JSON.stringify(
47571
47571
  (0, import_url3.pathToFileURL)(args.path).href
@@ -47573,7 +47573,7 @@ var require_dist3 = __commonJS({
47573
47573
  ];
47574
47574
  return {
47575
47575
  contents: injectLines.join("") + contents,
47576
- loader: inferLoader(import_path22.default.extname(args.path))
47576
+ loader: inferLoader(import_path2.default.extname(args.path))
47577
47577
  };
47578
47578
  });
47579
47579
  }
@@ -47599,7 +47599,7 @@ var require_dist3 = __commonJS({
47599
47599
  const { text } = result.outputFiles[0];
47600
47600
  const getOutputFile = options.getOutputFile || defaultGetOutputFile;
47601
47601
  const outfile = getOutputFile(options.filepath, format2);
47602
- await import_fs22.default.promises.writeFile(outfile, text, "utf8");
47602
+ await import_fs2.default.promises.writeFile(outfile, text, "utf8");
47603
47603
  let mod;
47604
47604
  const req = options.require || dynamicImport;
47605
47605
  try {
@@ -47609,7 +47609,7 @@ var require_dist3 = __commonJS({
47609
47609
  );
47610
47610
  } finally {
47611
47611
  if (!preserveTemporaryFile) {
47612
- await import_fs22.default.promises.unlink(outfile);
47612
+ await import_fs2.default.promises.unlink(outfile);
47613
47613
  }
47614
47614
  }
47615
47615
  return {
@@ -47687,9 +47687,9 @@ var require_dist3 = __commonJS({
47687
47687
  }
47688
47688
  });
47689
47689
 
47690
- // node_modules/.pnpm/tsup@8.0.0_patch_hash=nuoomzsk544j3zoy4w6xlebf4m_@microsoft+api-extractor@7.38.3_@swc+core@1._jyfln4hbxbrplmay2o7yiqfmdy/node_modules/tsup/dist/chunk-7G76EW2R.js
47690
+ // node_modules/.pnpm/tsup@8.0.0_patch_hash=xmhwxzi2nqhltf2r7syhjyoc7i_@microsoft+api-extractor@7.38.3_@swc+core@1._6zprvhhd4zzf6xxclnutwtxcvy/node_modules/tsup/dist/chunk-7G76EW2R.js
47691
47691
  var require_chunk_7G76EW2R = __commonJS({
47692
- "node_modules/.pnpm/tsup@8.0.0_patch_hash=nuoomzsk544j3zoy4w6xlebf4m_@microsoft+api-extractor@7.38.3_@swc+core@1._jyfln4hbxbrplmay2o7yiqfmdy/node_modules/tsup/dist/chunk-7G76EW2R.js"(exports) {
47692
+ "node_modules/.pnpm/tsup@8.0.0_patch_hash=xmhwxzi2nqhltf2r7syhjyoc7i_@microsoft+api-extractor@7.38.3_@swc+core@1._6zprvhhd4zzf6xxclnutwtxcvy/node_modules/tsup/dist/chunk-7G76EW2R.js"(exports) {
47693
47693
  "use strict";
47694
47694
  Object.defineProperty(exports, "__esModule", { value: true });
47695
47695
  function _interopRequireDefault(obj) {
@@ -101426,9 +101426,9 @@ var require_chokidar = __commonJS({
101426
101426
  }
101427
101427
  });
101428
101428
 
101429
- // node_modules/.pnpm/tsup@8.0.0_patch_hash=nuoomzsk544j3zoy4w6xlebf4m_@microsoft+api-extractor@7.38.3_@swc+core@1._jyfln4hbxbrplmay2o7yiqfmdy/node_modules/tsup/dist/index.js
101429
+ // node_modules/.pnpm/tsup@8.0.0_patch_hash=xmhwxzi2nqhltf2r7syhjyoc7i_@microsoft+api-extractor@7.38.3_@swc+core@1._6zprvhhd4zzf6xxclnutwtxcvy/node_modules/tsup/dist/index.js
101430
101430
  var require_dist6 = __commonJS({
101431
- "node_modules/.pnpm/tsup@8.0.0_patch_hash=nuoomzsk544j3zoy4w6xlebf4m_@microsoft+api-extractor@7.38.3_@swc+core@1._jyfln4hbxbrplmay2o7yiqfmdy/node_modules/tsup/dist/index.js"(exports) {
101431
+ "node_modules/.pnpm/tsup@8.0.0_patch_hash=xmhwxzi2nqhltf2r7syhjyoc7i_@microsoft+api-extractor@7.38.3_@swc+core@1._6zprvhhd4zzf6xxclnutwtxcvy/node_modules/tsup/dist/index.js"(exports) {
101432
101432
  "use strict";
101433
101433
  Object.defineProperty(exports, "__esModule", { value: true });
101434
101434
  function _interopRequireDefault(obj) {
@@ -103762,10 +103762,7 @@ var require_dist6 = __commonJS({
103762
103762
  const program = _typescript2.default.createProgram({
103763
103763
  rootNames: compilerOptions.fileNames,
103764
103764
  options: compilerOptions.options,
103765
- host: {
103766
- ...host,
103767
- jsDocParsingMode: _typescript2.default.JSDocParsingMode?.ParseAll !== void 0 ? _typescript2.default.JSDocParsingMode.ParseAll : 0
103768
- }
103765
+ host
103769
103766
  });
103770
103767
  const fileMapping = emitDtsFiles(program, host, options);
103771
103768
  if (!fileMapping || fileMapping.size === 0) {
@@ -126395,17 +126392,17 @@ var LogLevelLabel = {
126395
126392
  };
126396
126393
 
126397
126394
  // packages/config-tools/src/utilities/find-up.ts
126398
- var import_fs = require("fs");
126399
- var import_path = require("path");
126395
+ var import_node_fs = require("node:fs");
126396
+ var import_node_path = require("node:path");
126400
126397
  var MAX_PATH_SEARCH_DEPTH = 30;
126401
126398
  var depth = 0;
126402
126399
  function findFolderUp(startPath, endFileNames) {
126403
126400
  const _startPath = startPath ?? process.cwd();
126404
- if (endFileNames.some((endFileName) => (0, import_fs.existsSync)((0, import_path.join)(_startPath, endFileName)))) {
126401
+ if (endFileNames.some((endFileName) => (0, import_node_fs.existsSync)((0, import_node_path.join)(_startPath, endFileName)))) {
126405
126402
  return _startPath;
126406
126403
  }
126407
126404
  if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
126408
- const parent = (0, import_path.join)(_startPath, "..");
126405
+ const parent = (0, import_node_path.join)(_startPath, "..");
126409
126406
  return findFolderUp(parent, endFileNames);
126410
126407
  }
126411
126408
  return void 0;
@@ -126464,8 +126461,8 @@ Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
126464
126461
  }
126465
126462
 
126466
126463
  // packages/config-tools/src/utilities/get-default-config.ts
126467
- var import_fs2 = require("fs");
126468
- var import_path2 = require("path");
126464
+ var import_node_fs2 = require("node:fs");
126465
+ var import_node_path2 = require("node:path");
126469
126466
 
126470
126467
  // node_modules/.pnpm/zod@3.22.4/node_modules/zod/lib/index.mjs
126471
126468
  var util;
@@ -130134,8 +130131,8 @@ var getDefaultConfig = (config = {}, root) => {
130134
130131
  let license = DefaultStormConfig.license;
130135
130132
  let homepage = DefaultStormConfig.homepage;
130136
130133
  const workspaceRoot = findWorkspaceRoot(root);
130137
- if ((0, import_fs2.existsSync)((0, import_path2.join)(workspaceRoot, "package.json"))) {
130138
- const file = (0, import_fs2.readFileSync)((0, import_path2.join)(workspaceRoot, "package.json"), {
130134
+ if ((0, import_node_fs2.existsSync)((0, import_node_path2.join)(workspaceRoot, "package.json"))) {
130135
+ const file = (0, import_node_fs2.readFileSync)((0, import_node_path2.join)(workspaceRoot, "package.json"), {
130139
130136
  encoding: "utf-8"
130140
130137
  });
130141
130138
  if (file) {
@@ -130236,12 +130233,14 @@ var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
130236
130233
  console.error(
130237
130234
  `
130238
130235
 
130236
+
130239
130237
  ${chalk.bold.hex(config?.colors?.fatal ? config.colors.fatal : "#1fb2a6")(
130240
130238
  ">"
130241
130239
  )} ${chalk.bold.bgHex(config?.colors?.fatal ? config.colors.fatal : "#1fb2a6").white(" \u{1F480} Fatal ")} ${chalk.reset.hex(
130242
130240
  config?.colors?.fatal ? config.colors.fatal : "#1fb2a6"
130243
130241
  )(message)}
130244
130242
 
130243
+
130245
130244
  `
130246
130245
  );
130247
130246
  };
@@ -130251,12 +130250,14 @@ var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
130251
130250
  console.error(
130252
130251
  `
130253
130252
 
130253
+
130254
130254
  ${chalk.bold.hex(config?.colors?.error ? config.colors.error : "#7d1a1a")(
130255
130255
  ">"
130256
130256
  )} ${chalk.bold.bgHex(config?.colors?.error ? config.colors.error : "#7d1a1a").white(" \u{1F6D1} Error ")} ${chalk.reset.hex(
130257
130257
  config?.colors?.error ? config.colors.error : "#7d1a1a"
130258
130258
  )(message)}
130259
130259
 
130260
+
130260
130261
  `
130261
130262
  );
130262
130263
  };
@@ -130266,12 +130267,14 @@ var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
130266
130267
  console.warn(
130267
130268
  `
130268
130269
 
130270
+
130269
130271
  ${chalk.bold.hex(config?.colors?.warning ? config.colors.warning : "#fcc419")(
130270
130272
  ">"
130271
130273
  )} ${chalk.bold.bgHex(config?.colors?.warning ? config.colors.warning : "#fcc419").white(" \u26A0\uFE0F Warn ")} ${chalk.reset.hex(
130272
130274
  config?.colors?.warning ? config.colors.warning : "#fcc419"
130273
130275
  )(message)}
130274
130276
 
130277
+
130275
130278
  `
130276
130279
  );
130277
130280
  };
@@ -130281,12 +130284,14 @@ var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
130281
130284
  console.info(
130282
130285
  `
130283
130286
 
130287
+
130284
130288
  ${chalk.bold.hex(config?.colors?.info ? config.colors.info : "#0ea5e9")(
130285
130289
  ">"
130286
130290
  )} ${chalk.bold.bgHex(config?.colors?.info ? config.colors.info : "#0ea5e9").white(" \u{1F4EC} Info ")} ${chalk.reset.hex(
130287
130291
  config?.colors?.info ? config.colors.info : "#0ea5e9"
130288
130292
  )(message)}
130289
130293
 
130294
+
130290
130295
  `
130291
130296
  );
130292
130297
  };
@@ -130296,12 +130301,14 @@ var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
130296
130301
  console.info(
130297
130302
  `
130298
130303
 
130304
+
130299
130305
  ${chalk.bold.hex(config?.colors?.success ? config.colors.success : "#087f5b")(
130300
130306
  ">"
130301
130307
  )} ${chalk.bold.bgHex(config?.colors?.success ? config.colors.success : "#087f5b").white(" \u{1F389} Success ")} ${chalk.reset.hex(
130302
130308
  config?.colors?.success ? config.colors.success : "#087f5b"
130303
130309
  )(message)}
130304
130310
 
130311
+
130305
130312
  `
130306
130313
  );
130307
130314
  };
@@ -130311,12 +130318,14 @@ var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
130311
130318
  console.debug(
130312
130319
  `
130313
130320
 
130321
+
130314
130322
  ${chalk.bold.hex(config?.colors?.primary ? config.colors.primary : "#1fb2a6")(
130315
130323
  ">"
130316
130324
  )} ${chalk.bold.bgHex(config?.colors?.primary ? config.colors.primary : "#1fb2a6").white(" \u{1F9EA} Debug ")} ${chalk.reset.hex(
130317
130325
  config?.colors?.primary ? config.colors.primary : "#1fb2a6"
130318
130326
  )(message)}
130319
130327
 
130328
+
130320
130329
  `
130321
130330
  );
130322
130331
  };
@@ -130325,12 +130334,14 @@ var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
130325
130334
  console.log(
130326
130335
  `
130327
130336
 
130337
+
130328
130338
  ${chalk.bold.hex(config?.colors?.primary ? config.colors.primary : "#1fb2a6")(
130329
130339
  ">"
130330
130340
  )} ${chalk.bold.bgHex(config?.colors?.primary ? config.colors.primary : "#1fb2a6").white(" \u{1F4E2} System ")} ${chalk.bold.hex(
130331
130341
  config?.colors?.primary ? config.colors.primary : "#1fb2a6"
130332
130342
  )(message)}
130333
130343
 
130344
+
130334
130345
  `
130335
130346
  );
130336
130347
  };
@@ -130490,16 +130501,6 @@ var setConfigEnv = (config) => {
130490
130501
  }
130491
130502
  };
130492
130503
 
130493
- // packages/config-tools/src/utilities/prepare-workspace.ts
130494
- var prepareWorkspace = async () => {
130495
- const _STORM_CONFIG = getDefaultConfig({
130496
- ...await getConfigFile(),
130497
- ...getConfigEnv()
130498
- });
130499
- setConfigEnv(_STORM_CONFIG);
130500
- return _STORM_CONFIG;
130501
- };
130502
-
130503
130504
  // packages/config-tools/src/env/get-env.ts
130504
130505
  var getExtensionEnv = (extensionName) => {
130505
130506
  const prefix = `STORM_EXTENSION_${extensionName.toUpperCase()}_`;
@@ -130567,6 +130568,32 @@ var getConfigEnv = () => {
130567
130568
  }, config);
130568
130569
  };
130569
130570
 
130571
+ // packages/config-tools/src/create-storm-config.ts
130572
+ var loadStormConfig = async (workspaceRoot) => {
130573
+ let config = {};
130574
+ let _workspaceRoot = workspaceRoot;
130575
+ if (!_workspaceRoot) {
130576
+ _workspaceRoot = findWorkspaceRoot();
130577
+ }
130578
+ const configFile = await getDefaultConfig(
130579
+ {
130580
+ ...await getConfigFile(_workspaceRoot),
130581
+ ...getConfigEnv()
130582
+ },
130583
+ _workspaceRoot
130584
+ );
130585
+ if (configFile) {
130586
+ config = StormConfigSchema.parse(configFile);
130587
+ } else {
130588
+ writeWarning(
130589
+ config,
130590
+ "No Storm config file found in the current workspace. Please ensure this is the expected behavior - you can add a `storm.config.js` file to the root of your workspace if it is not."
130591
+ );
130592
+ }
130593
+ setConfigEnv(config);
130594
+ return config;
130595
+ };
130596
+
130570
130597
  // packages/workspace-tools/src/utils/get-workspace-root.ts
130571
130598
  var import_find_workspace_root2 = require("nx/src/utils/find-workspace-root.js");
130572
130599
  var getWorkspaceRoot = () => {
@@ -130679,7 +130706,7 @@ var withRunExecutor = (name, executorFn, executorOptions) => async (_options, co
130679
130706
  - projectName: ${projectName}
130680
130707
  `
130681
130708
  );
130682
- config = await prepareWorkspace();
130709
+ config = await loadStormConfig(workspaceRoot);
130683
130710
  writeTrace(
130684
130711
  config,
130685
130712
  `Loaded Storm config into env:
@@ -130780,9 +130807,9 @@ ${commentStart} ----------------------------------------------------------------
130780
130807
  };
130781
130808
 
130782
130809
  // packages/workspace-tools/src/executors/tsup/executor.ts
130783
- var import_node_fs = require("node:fs");
130810
+ var import_node_fs3 = require("node:fs");
130784
130811
  var import_promises2 = require("node:fs/promises");
130785
- var import_node_path = require("node:path");
130812
+ var import_node_path3 = require("node:path");
130786
130813
  var import_esbuild_decorators = __toESM(require_src());
130787
130814
  var import_devkit2 = __toESM(require_devkit());
130788
130815
  var import_js = __toESM(require_src2());
@@ -133393,10 +133420,10 @@ var LRUCache = class _LRUCache {
133393
133420
  };
133394
133421
 
133395
133422
  // node_modules/.pnpm/path-scurry@1.10.1/node_modules/path-scurry/dist/mjs/index.js
133396
- var import_path3 = require("path");
133423
+ var import_path = require("path");
133397
133424
  var import_url = require("url");
133398
133425
  var actualFS = __toESM(require("fs"), 1);
133399
- var import_fs3 = require("fs");
133426
+ var import_fs = require("fs");
133400
133427
  var import_promises = require("fs/promises");
133401
133428
 
133402
133429
  // node_modules/.pnpm/minipass@7.0.4/node_modules/minipass/dist/esm/index.js
@@ -134278,12 +134305,12 @@ var Minipass = class extends import_events.EventEmitter {
134278
134305
  };
134279
134306
 
134280
134307
  // node_modules/.pnpm/path-scurry@1.10.1/node_modules/path-scurry/dist/mjs/index.js
134281
- var realpathSync = import_fs3.realpathSync.native;
134308
+ var realpathSync = import_fs.realpathSync.native;
134282
134309
  var defaultFS = {
134283
- lstatSync: import_fs3.lstatSync,
134284
- readdir: import_fs3.readdir,
134285
- readdirSync: import_fs3.readdirSync,
134286
- readlinkSync: import_fs3.readlinkSync,
134310
+ lstatSync: import_fs.lstatSync,
134311
+ readdir: import_fs.readdir,
134312
+ readdirSync: import_fs.readdirSync,
134313
+ readlinkSync: import_fs.readlinkSync,
134287
134314
  realpathSync,
134288
134315
  promises: {
134289
134316
  lstat: import_promises.lstat,
@@ -135279,7 +135306,7 @@ var PathWin32 = class _PathWin32 extends PathBase {
135279
135306
  * @internal
135280
135307
  */
135281
135308
  getRootString(path2) {
135282
- return import_path3.win32.parse(path2).root;
135309
+ return import_path.win32.parse(path2).root;
135283
135310
  }
135284
135311
  /**
135285
135312
  * @internal
@@ -135919,7 +135946,7 @@ var PathScurryWin32 = class extends PathScurryBase {
135919
135946
  sep = "\\";
135920
135947
  constructor(cwd = process.cwd(), opts = {}) {
135921
135948
  const { nocase = true } = opts;
135922
- super(cwd, import_path3.win32, "\\", { ...opts, nocase });
135949
+ super(cwd, import_path.win32, "\\", { ...opts, nocase });
135923
135950
  this.nocase = nocase;
135924
135951
  for (let p = this.cwd; p; p = p.parent) {
135925
135952
  p.nocase = this.nocase;
@@ -135929,7 +135956,7 @@ var PathScurryWin32 = class extends PathScurryBase {
135929
135956
  * @internal
135930
135957
  */
135931
135958
  parseRootPath(dir) {
135932
- return import_path3.win32.parse(dir).root.toUpperCase();
135959
+ return import_path.win32.parse(dir).root.toUpperCase();
135933
135960
  }
135934
135961
  /**
135935
135962
  * @internal
@@ -135951,7 +135978,7 @@ var PathScurryPosix = class extends PathScurryBase {
135951
135978
  sep = "/";
135952
135979
  constructor(cwd = process.cwd(), opts = {}) {
135953
135980
  const { nocase = false } = opts;
135954
- super(cwd, import_path3.posix, "/", { ...opts, nocase });
135981
+ super(cwd, import_path.posix, "/", { ...opts, nocase });
135955
135982
  this.nocase = nocase;
135956
135983
  }
135957
135984
  /**
@@ -137147,416 +137174,405 @@ var getTypiaTransform = (program, diagnostics) => (0, import_transform.default)(
137147
137174
 
137148
137175
  // packages/workspace-tools/src/executors/tsup/executor.ts
137149
137176
  async function tsupExecutorFn(options, context, config) {
137150
- try {
137151
- writeInfo(config, "\u{1F4E6} Running Storm build executor on the workspace");
137152
- getLogLevel(config?.logLevel) >= LogLevel.TRACE && writeDebug(
137153
- config,
137154
- `\u2699\uFE0F Executor options:
137177
+ writeInfo(config, "\u{1F4E6} Running Storm build executor on the workspace");
137178
+ getLogLevel(config?.logLevel) >= LogLevel.TRACE && writeDebug(
137179
+ config,
137180
+ `\u2699\uFE0F Executor options:
137155
137181
  ${Object.keys(options).map(
137156
- (key) => `${key}: ${!options[key] || _isPrimitive(options[key]) ? options[key] : JSON.stringify(options[key])}`
137157
- ).join("\n")}
137182
+ (key) => `${key}: ${!options[key] || _isPrimitive(options[key]) ? options[key] : JSON.stringify(options[key])}`
137183
+ ).join("\n")}
137158
137184
  `
137185
+ );
137186
+ if (!context.projectsConfigurations?.projects || !context.projectName || !context.projectsConfigurations.projects[context.projectName]) {
137187
+ throw new Error(
137188
+ "The Build process failed because the context is not valid. Please run this command from a workspace."
137159
137189
  );
137160
- if (!context.projectsConfigurations?.projects || !context.projectName || !context.projectsConfigurations.projects[context.projectName]) {
137161
- throw new Error(
137162
- "The Build process failed because the context is not valid. Please run this command from a workspace."
137163
- );
137164
- }
137165
- const workspaceRoot = getWorkspaceRoot();
137166
- const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
137167
- const sourceRoot = context.projectsConfigurations.projects[context.projectName].sourceRoot;
137168
- if (options.clean !== false) {
137169
- if (getLogLevel(config?.logLevel) >= LogLevel.DEBUG) {
137170
- writeInfo(config, `\u{1F9F9} Cleaning output path: ${options.outputPath}`);
137171
- }
137172
- (0, import_fs_extra.removeSync)(options.outputPath);
137190
+ }
137191
+ const workspaceRoot = getWorkspaceRoot();
137192
+ const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
137193
+ const sourceRoot = context.projectsConfigurations.projects[context.projectName].sourceRoot;
137194
+ if (options.clean !== false) {
137195
+ if (getLogLevel(config?.logLevel) >= LogLevel.DEBUG) {
137196
+ writeInfo(config, `\u{1F9F9} Cleaning output path: ${options.outputPath}`);
137173
137197
  }
137174
- const assets = Array.from(options.assets);
137198
+ (0, import_fs_extra.removeSync)(options.outputPath);
137199
+ }
137200
+ const assets = Array.from(options.assets);
137201
+ assets.push({
137202
+ input: projectRoot,
137203
+ glob: "*.md",
137204
+ output: "/"
137205
+ });
137206
+ assets.push({
137207
+ input: "",
137208
+ glob: "LICENSE",
137209
+ output: "."
137210
+ });
137211
+ if (options.generatePackageJson === false) {
137175
137212
  assets.push({
137176
137213
  input: projectRoot,
137177
- glob: "*.md",
137178
- output: "/"
137214
+ glob: "**/package.json",
137215
+ output: "."
137179
137216
  });
137217
+ }
137218
+ if (options.includeSrc === true) {
137180
137219
  assets.push({
137181
- input: "",
137182
- glob: "LICENSE",
137183
- output: "."
137220
+ input: sourceRoot,
137221
+ glob: "**/{*.ts,*.tsx,*.js,*.jsx}",
137222
+ output: "src/"
137184
137223
  });
137185
- if (options.generatePackageJson === false) {
137186
- assets.push({
137187
- input: projectRoot,
137188
- glob: "**/package.json",
137189
- output: "."
137190
- });
137191
- }
137192
- if (options.includeSrc === true) {
137193
- assets.push({
137194
- input: sourceRoot,
137195
- glob: "**/{*.ts,*.tsx,*.js,*.jsx}",
137196
- output: "src/"
137197
- });
137198
- }
137199
- const result = await (0, import_js.copyAssets)(
137200
- { assets, watch: options.watch, outputPath: options.outputPath },
137201
- context
137202
- );
137203
- if (!result.success) {
137204
- throw new Error("The Build process failed trying to copy assets");
137205
- }
137206
- const pathToPackageJson = (0, import_node_path.join)(context.root, projectRoot, "package.json");
137207
- const packageJson = (0, import_fileutils.fileExists)(pathToPackageJson) ? (0, import_devkit2.readJsonFile)(pathToPackageJson) : { name: context.projectName, version: "0.0.1" };
137208
- const workspacePackageJson = (0, import_devkit2.readJsonFile)((0, import_node_path.join)(workspaceRoot, "package.json"));
137209
- options.external = options.external || [];
137210
- if (workspacePackageJson?.dependencies) {
137211
- options.external = Object.keys(workspacePackageJson?.dependencies).reduce(
137212
- (ret, key) => {
137213
- if (!ret.includes(key)) {
137214
- ret.push(key);
137215
- }
137216
- return ret;
137217
- },
137218
- options.external
137219
- );
137220
- }
137221
- const externalDependencies = options.external.reduce(
137222
- (ret, name) => {
137223
- if (!packageJson?.devDependencies?.[name]) {
137224
- const externalNode = context.projectGraph.externalNodes[`npm:${name}`];
137225
- if (externalNode) {
137226
- ret.push({
137227
- name,
137228
- outputs: [],
137229
- node: externalNode
137230
- });
137231
- }
137224
+ }
137225
+ const result = await (0, import_js.copyAssets)(
137226
+ { assets, watch: options.watch, outputPath: options.outputPath },
137227
+ context
137228
+ );
137229
+ if (!result.success) {
137230
+ throw new Error("The Build process failed trying to copy assets");
137231
+ }
137232
+ const pathToPackageJson = (0, import_node_path3.join)(context.root, projectRoot, "package.json");
137233
+ const packageJson = (0, import_fileutils.fileExists)(pathToPackageJson) ? (0, import_devkit2.readJsonFile)(pathToPackageJson) : { name: context.projectName, version: "0.0.1" };
137234
+ const workspacePackageJson = (0, import_devkit2.readJsonFile)((0, import_node_path3.join)(workspaceRoot, "package.json"));
137235
+ options.external = options.external || [];
137236
+ if (workspacePackageJson?.dependencies) {
137237
+ options.external = Object.keys(workspacePackageJson?.dependencies).reduce(
137238
+ (ret, key) => {
137239
+ if (!ret.includes(key)) {
137240
+ ret.push(key);
137232
137241
  }
137233
137242
  return ret;
137234
137243
  },
137235
- []
137244
+ options.external
137236
137245
  );
137237
- const implicitDependencies = context.projectsConfigurations.projects[context.projectName].implicitDependencies;
137238
- const internalDependencies = [];
137239
- const projectConfigs = await Promise.resolve(getProjectConfigurations());
137240
- if (getLogLevel(config?.logLevel) >= LogLevel.TRACE) {
137241
- writeDebug(config, "Project Configs:");
137242
- console.log(projectConfigs);
137243
- }
137244
- if (implicitDependencies && implicitDependencies.length > 0) {
137245
- options.external = implicitDependencies.reduce((ret, key) => {
137246
- if (getLogLevel(config?.logLevel) >= LogLevel.DEBUG) {
137247
- writeDebug(config, `\u26A1 Adding implicit dependency: ${key}`);
137248
- }
137249
- const projectConfig = projectConfigs[key];
137250
- if (projectConfig?.targets?.build) {
137251
- const projectPackageJson = (0, import_devkit2.readJsonFile)(projectConfig.targets?.build.options.project);
137252
- if (projectPackageJson?.name && !options.external.includes(projectPackageJson.name)) {
137253
- ret.push(projectPackageJson.name);
137254
- internalDependencies.push(projectPackageJson.name);
137255
- }
137256
- }
137257
- return ret;
137258
- }, options.external);
137259
- }
137260
- if (options.bundle === false) {
137261
- for (const thirdPartyDependency of getExternalDependencies(
137262
- context.projectName,
137263
- context.projectGraph
137264
- )) {
137265
- const packageConfig = thirdPartyDependency.node.data;
137266
- if (packageConfig?.packageName) {
137267
- options.external.push(packageConfig.packageName);
137268
- if (!packageJson?.devDependencies?.[packageConfig.packageName]) {
137269
- externalDependencies.push(thirdPartyDependency);
137270
- }
137246
+ }
137247
+ const externalDependencies = options.external.reduce(
137248
+ (ret, name) => {
137249
+ if (!packageJson?.devDependencies?.[name]) {
137250
+ const externalNode = context.projectGraph.externalNodes[`npm:${name}`];
137251
+ if (externalNode) {
137252
+ ret.push({
137253
+ name,
137254
+ outputs: [],
137255
+ node: externalNode
137256
+ });
137271
137257
  }
137272
137258
  }
137273
- }
137274
- if (getLogLevel(config?.logLevel) >= LogLevel.TRACE) {
137275
- console.log(`Building with the following dependencies marked as external:
137276
- ${externalDependencies.map((dep) => {
137277
- return `name: ${dep.name}, node: ${dep.node}, outputs: ${dep.outputs}`;
137278
- }).join("\n")}`);
137279
- }
137280
- const prettierOptions = {
137281
- plugins: ["prettier-plugin-packagejson"],
137282
- trailingComma: "none",
137283
- tabWidth: 2,
137284
- semi: true,
137285
- singleQuote: false,
137286
- quoteProps: "preserve",
137287
- insertPragma: false,
137288
- bracketSameLine: true,
137289
- printWidth: 80,
137290
- bracketSpacing: true,
137291
- arrowParens: "avoid",
137292
- endOfLine: "lf"
137293
- };
137294
- const entryPoints = [];
137295
- if (options.entry) {
137296
- entryPoints.push(options.entry);
137297
- }
137298
- if (options.emitOnAll === true) {
137299
- entryPoints.push((0, import_devkit2.joinPathFragments)(sourceRoot, "**/*.{ts,tsx}"));
137300
- }
137301
- if (options.additionalEntryPoints) {
137302
- entryPoints.push(...options.additionalEntryPoints);
137303
- }
137304
- const entry = globSync(entryPoints, {
137305
- withFileTypes: true
137306
- }).reduce((ret, filePath) => {
137307
- let formattedPath = workspaceRoot.replaceAll("\\", "/");
137308
- if (formattedPath.toUpperCase().startsWith("C:")) {
137309
- formattedPath = formattedPath.substring(2);
137310
- }
137311
- let propertyKey = (0, import_devkit2.joinPathFragments)(filePath.path, removeExtension(filePath.name)).replaceAll("\\", "/").replaceAll(formattedPath, "").replaceAll(sourceRoot, "").replaceAll(projectRoot, "");
137312
- if (propertyKey) {
137313
- while (propertyKey.startsWith("/")) {
137314
- propertyKey = propertyKey.substring(1);
137315
- }
137316
- if (getLogLevel(config?.logLevel) >= LogLevel.DEBUG) {
137317
- console.debug(
137318
- `Trying to add entry point ${propertyKey} at "${(0, import_devkit2.joinPathFragments)(
137319
- filePath.path,
137320
- filePath.name
137321
- )}"`
137322
- );
137323
- }
137324
- if (!(propertyKey in ret)) {
137325
- ret[propertyKey] = (0, import_devkit2.joinPathFragments)(filePath.path, filePath.name);
137259
+ return ret;
137260
+ },
137261
+ []
137262
+ );
137263
+ const implicitDependencies = context.projectsConfigurations.projects[context.projectName].implicitDependencies;
137264
+ const internalDependencies = [];
137265
+ const projectConfigs = await Promise.resolve(getProjectConfigurations());
137266
+ if (getLogLevel(config?.logLevel) >= LogLevel.TRACE) {
137267
+ writeDebug(config, "Project Configs:");
137268
+ console.log(projectConfigs);
137269
+ }
137270
+ if (implicitDependencies && implicitDependencies.length > 0) {
137271
+ options.external = implicitDependencies.reduce((ret, key) => {
137272
+ if (getLogLevel(config?.logLevel) >= LogLevel.DEBUG) {
137273
+ writeDebug(config, `\u26A1 Adding implicit dependency: ${key}`);
137274
+ }
137275
+ const projectConfig = projectConfigs[key];
137276
+ if (projectConfig?.targets?.build) {
137277
+ const projectPackageJson = (0, import_devkit2.readJsonFile)(projectConfig.targets?.build.options.project);
137278
+ if (projectPackageJson?.name && !options.external.includes(projectPackageJson.name)) {
137279
+ ret.push(projectPackageJson.name);
137280
+ internalDependencies.push(projectPackageJson.name);
137326
137281
  }
137327
137282
  }
137328
137283
  return ret;
137329
- }, {});
137330
- if (options.generatePackageJson !== false) {
137331
- const projectGraph = (0, import_devkit2.readCachedProjectGraph)();
137332
- packageJson.dependencies = void 0;
137333
- for (const externalDependency of externalDependencies) {
137334
- const packageConfig = externalDependency.node.data;
137335
- if (packageConfig?.packageName && !!(projectGraph.externalNodes[externalDependency.node.name]?.type === "npm")) {
137336
- const { packageName, version } = packageConfig;
137337
- if (workspacePackageJson.dependencies?.[packageName] || workspacePackageJson.devDependencies?.[packageName] || packageJson?.devDependencies?.[packageName]) {
137338
- return null;
137339
- }
137340
- packageJson.dependencies ??= {};
137341
- packageJson.dependencies[packageName] = projectGraph.nodes[externalDependency.node.name] ? "latest" : version;
137284
+ }, options.external);
137285
+ }
137286
+ if (options.bundle === false) {
137287
+ for (const thirdPartyDependency of getExternalDependencies(
137288
+ context.projectName,
137289
+ context.projectGraph
137290
+ )) {
137291
+ const packageConfig = thirdPartyDependency.node.data;
137292
+ if (packageConfig?.packageName) {
137293
+ options.external.push(packageConfig.packageName);
137294
+ if (!packageJson?.devDependencies?.[packageConfig.packageName]) {
137295
+ externalDependencies.push(thirdPartyDependency);
137342
137296
  }
137343
137297
  }
137344
- for (const packageName of internalDependencies) {
137345
- if (!packageJson?.devDependencies?.[packageName]) {
137346
- packageJson.dependencies ??= {};
137347
- packageJson.dependencies[packageName] = "latest";
137298
+ }
137299
+ }
137300
+ writeTrace(
137301
+ config,
137302
+ `Building with the following dependencies marked as external:
137303
+ ${externalDependencies.map((dep) => {
137304
+ return `name: ${dep.name}, node: ${dep.node}, outputs: ${dep.outputs}`;
137305
+ }).join("\n")}`
137306
+ );
137307
+ const prettierOptions = {
137308
+ plugins: ["prettier-plugin-packagejson"],
137309
+ trailingComma: "none",
137310
+ tabWidth: 2,
137311
+ semi: true,
137312
+ singleQuote: false,
137313
+ quoteProps: "preserve",
137314
+ insertPragma: false,
137315
+ bracketSameLine: true,
137316
+ printWidth: 80,
137317
+ bracketSpacing: true,
137318
+ arrowParens: "avoid",
137319
+ endOfLine: "lf"
137320
+ };
137321
+ const entryPoints = [];
137322
+ if (options.entry) {
137323
+ entryPoints.push(options.entry);
137324
+ }
137325
+ if (options.emitOnAll === true) {
137326
+ entryPoints.push((0, import_devkit2.joinPathFragments)(sourceRoot, "**/*.{ts,tsx}"));
137327
+ }
137328
+ if (options.additionalEntryPoints) {
137329
+ entryPoints.push(...options.additionalEntryPoints);
137330
+ }
137331
+ const entry = globSync(entryPoints, {
137332
+ withFileTypes: true
137333
+ }).reduce((ret, filePath) => {
137334
+ let formattedPath = workspaceRoot.replaceAll("\\", "/");
137335
+ if (formattedPath.toUpperCase().startsWith("C:")) {
137336
+ formattedPath = formattedPath.substring(2);
137337
+ }
137338
+ let propertyKey = (0, import_devkit2.joinPathFragments)(filePath.path, removeExtension(filePath.name)).replaceAll("\\", "/").replaceAll(formattedPath, "").replaceAll(sourceRoot, "").replaceAll(projectRoot, "");
137339
+ if (propertyKey) {
137340
+ while (propertyKey.startsWith("/")) {
137341
+ propertyKey = propertyKey.substring(1);
137342
+ }
137343
+ writeDebug(
137344
+ config,
137345
+ `Trying to add entry point ${propertyKey} at "${(0, import_devkit2.joinPathFragments)(
137346
+ filePath.path,
137347
+ filePath.name
137348
+ )}"`
137349
+ );
137350
+ if (!(propertyKey in ret)) {
137351
+ ret[propertyKey] = (0, import_devkit2.joinPathFragments)(filePath.path, filePath.name);
137352
+ }
137353
+ }
137354
+ return ret;
137355
+ }, {});
137356
+ if (options.generatePackageJson !== false) {
137357
+ const projectGraph = (0, import_devkit2.readCachedProjectGraph)();
137358
+ packageJson.dependencies = void 0;
137359
+ for (const externalDependency of externalDependencies) {
137360
+ const packageConfig = externalDependency.node.data;
137361
+ if (packageConfig?.packageName && !!(projectGraph.externalNodes[externalDependency.node.name]?.type === "npm")) {
137362
+ const { packageName, version } = packageConfig;
137363
+ if (workspacePackageJson.dependencies?.[packageName] || workspacePackageJson.devDependencies?.[packageName] || packageJson?.devDependencies?.[packageName]) {
137364
+ return null;
137348
137365
  }
137366
+ packageJson.dependencies ??= {};
137367
+ packageJson.dependencies[packageName] = projectGraph.nodes[externalDependency.node.name] ? "latest" : version;
137349
137368
  }
137350
- const distPaths = !options?.getConfig || _isFunction(options.getConfig) ? ["dist/"] : Object.keys(options.getConfig).map((key) => `${key}/`);
137351
- packageJson.type = "module";
137352
- if (distPaths.length > 0) {
137353
- packageJson.exports ??= {
137354
- ".": {
137369
+ }
137370
+ for (const packageName of internalDependencies) {
137371
+ if (!packageJson?.devDependencies?.[packageName]) {
137372
+ packageJson.dependencies ??= {};
137373
+ packageJson.dependencies[packageName] = "latest";
137374
+ }
137375
+ }
137376
+ const distPaths = !options?.getConfig || _isFunction(options.getConfig) ? ["dist/"] : Object.keys(options.getConfig).map((key) => `${key}/`);
137377
+ packageJson.type = "module";
137378
+ if (distPaths.length > 0) {
137379
+ packageJson.exports ??= {
137380
+ ".": {
137381
+ import: {
137382
+ types: `./${distPaths[0]}index.d.ts`,
137383
+ default: `./${distPaths[0]}index.js`
137384
+ },
137385
+ require: {
137386
+ types: `./${distPaths[0]}index.d.cts`,
137387
+ default: `./${distPaths[0]}index.cjs`
137388
+ },
137389
+ default: {
137390
+ types: `./${distPaths[0]}index.d.ts`,
137391
+ default: `./${distPaths[0]}index.js`
137392
+ },
137393
+ ...(options.additionalEntryPoints ?? []).map((entryPoint) => ({
137394
+ [removeExtension(entryPoint).replace(sourceRoot, "")]: {
137395
+ types: (0, import_node_path3.join)(
137396
+ `./${distPaths[0]}`,
137397
+ `${removeExtension(entryPoint.replace(sourceRoot, ""))}.d.ts`
137398
+ ),
137399
+ default: (0, import_node_path3.join)(
137400
+ `./${distPaths[0]}`,
137401
+ `${removeExtension(entryPoint.replace(sourceRoot, ""))}.js`
137402
+ )
137403
+ }
137404
+ }))
137405
+ },
137406
+ "./package.json": "./package.json"
137407
+ };
137408
+ packageJson.exports = Object.keys(entry).reduce((ret, key) => {
137409
+ let packageJsonKey = key.startsWith("./") ? key : `./${key}`;
137410
+ packageJsonKey = packageJsonKey.replaceAll("/index", "");
137411
+ if (!ret[packageJsonKey]) {
137412
+ ret[packageJsonKey] = {
137355
137413
  import: {
137356
137414
  types: `./${distPaths[0]}index.d.ts`,
137357
- default: `./${distPaths[0]}index.js`
137415
+ default: `./${distPaths[0]}${key}.js`
137358
137416
  },
137359
137417
  require: {
137360
137418
  types: `./${distPaths[0]}index.d.cts`,
137361
- default: `./${distPaths[0]}index.cjs`
137419
+ default: `./${distPaths[0]}${key}.cjs`
137362
137420
  },
137363
137421
  default: {
137364
137422
  types: `./${distPaths[0]}index.d.ts`,
137365
- default: `./${distPaths[0]}index.js`
137366
- },
137367
- ...(options.additionalEntryPoints ?? []).map((entryPoint) => ({
137368
- [removeExtension(entryPoint).replace(sourceRoot, "")]: {
137369
- types: (0, import_node_path.join)(
137370
- `./${distPaths[0]}`,
137371
- `${removeExtension(entryPoint.replace(sourceRoot, ""))}.d.ts`
137372
- ),
137373
- default: (0, import_node_path.join)(
137374
- `./${distPaths[0]}`,
137375
- `${removeExtension(entryPoint.replace(sourceRoot, ""))}.js`
137376
- )
137377
- }
137378
- }))
137379
- },
137380
- "./package.json": "./package.json"
137381
- };
137382
- packageJson.exports = Object.keys(entry).reduce((ret, key) => {
137383
- let packageJsonKey = key.startsWith("./") ? key : `./${key}`;
137384
- packageJsonKey = packageJsonKey.replaceAll("/index", "");
137385
- if (!ret[packageJsonKey]) {
137386
- ret[packageJsonKey] = {
137387
- import: {
137388
- types: `./${distPaths[0]}index.d.ts`,
137389
- default: `./${distPaths[0]}${key}.js`
137390
- },
137391
- require: {
137392
- types: `./${distPaths[0]}index.d.cts`,
137393
- default: `./${distPaths[0]}${key}.cjs`
137394
- },
137395
- default: {
137396
- types: `./${distPaths[0]}index.d.ts`,
137397
- default: `./${distPaths[0]}${key}.js`
137398
- }
137399
- };
137400
- }
137401
- return ret;
137402
- }, packageJson.exports);
137403
- packageJson.funding ??= workspacePackageJson.funding;
137404
- packageJson.types ??= `${distPaths.length > 1 ? distPaths[1] : distPaths[0]}index.d.ts`;
137405
- packageJson.typings ??= `${distPaths.length > 1 ? distPaths[1] : distPaths[0]}index.d.ts`;
137406
- packageJson.typescript ??= {
137407
- definition: `${distPaths.length > 1 ? distPaths[1] : distPaths[0]}index.d.ts`
137408
- };
137409
- packageJson.main ??= `${distPaths.length > 1 ? distPaths[1] : distPaths[0]}index.cjs`;
137410
- packageJson.module ??= `${distPaths.length > 1 ? distPaths[1] : distPaths[0]}index.js`;
137411
- if (options.platform && options.platform !== "node") {
137412
- packageJson.browser ??= `${distPaths[0]}index.global.js`;
137413
- }
137414
- if (options.includeSrc === true) {
137415
- let distSrc = sourceRoot.replace(projectRoot, "");
137416
- if (distSrc.startsWith("/")) {
137417
- distSrc = distSrc.substring(1);
137418
- }
137419
- packageJson.source ??= `${(0, import_node_path.join)(distSrc, "index.ts").replaceAll("\\", "/")}`;
137420
- }
137421
- packageJson.sideEffects ??= false;
137422
- packageJson.files ??= ["dist/**/*"];
137423
- if (options.includeSrc === true && !packageJson.files.includes("src")) {
137424
- packageJson.files.push("src/**/*");
137423
+ default: `./${distPaths[0]}${key}.js`
137424
+ }
137425
+ };
137425
137426
  }
137426
- }
137427
- packageJson.publishConfig ??= {
137428
- access: "public"
137429
- };
137430
- packageJson.description ??= workspacePackageJson.description;
137431
- packageJson.homepage ??= workspacePackageJson.homepage;
137432
- packageJson.bugs ??= workspacePackageJson.bugs;
137433
- packageJson.author ??= workspacePackageJson.author;
137434
- packageJson.license ??= workspacePackageJson.license;
137435
- packageJson.keywords ??= workspacePackageJson.keywords;
137436
- packageJson.repository ??= workspacePackageJson.repository;
137437
- packageJson.repository.directory ??= projectRoot ? projectRoot : (0, import_node_path.join)("packages", context.projectName);
137438
- const packageJsonPath = (0, import_node_path.join)(context.root, options.outputPath, "package.json");
137439
- if (getLogLevel(config?.logLevel) >= LogLevel.DEBUG) {
137440
- writeDebug(config, `\u26A1 Writing package.json file to: ${packageJsonPath}`);
137441
- }
137442
- (0, import_node_fs.writeFileSync)(
137443
- packageJsonPath,
137444
- await (0, import_prettier.format)(JSON.stringify(packageJson), {
137445
- ...prettierOptions,
137446
- parser: "json"
137447
- })
137448
- );
137449
- }
137450
- if (options.includeSrc === true) {
137451
- const files = globSync([
137452
- (0, import_devkit2.joinPathFragments)(context.root, options.outputPath, "src/**/*.ts"),
137453
- (0, import_devkit2.joinPathFragments)(context.root, options.outputPath, "src/**/*.tsx"),
137454
- (0, import_devkit2.joinPathFragments)(context.root, options.outputPath, "src/**/*.js"),
137455
- (0, import_devkit2.joinPathFragments)(context.root, options.outputPath, "src/**/*.jsx")
137456
- ]);
137457
- await Promise.allSettled(
137458
- files.map(
137459
- async (file) => (0, import_promises2.writeFile)(
137460
- file,
137461
- await (0, import_prettier.format)(
137462
- `${options.banner ? options.banner.startsWith("//") ? options.banner : `// ${options.banner}` : ""}
137463
-
137464
- ${(0, import_node_fs.readFileSync)(file, "utf-8")}`,
137465
- {
137466
- ...prettierOptions,
137467
- parser: "typescript"
137468
- }
137469
- ),
137470
- "utf-8"
137471
- )
137472
- )
137473
- );
137474
- }
137475
- const stormEnv = Object.keys(options.env).filter((key) => key.startsWith("STORM_")).reduce((ret, key) => {
137476
- ret[key] = options.env[key];
137477
- return ret;
137478
- }, {});
137479
- options.plugins.push(
137480
- (0, import_esbuild_decorators.esbuildDecorators)({
137481
- tsconfig: options.tsConfig,
137482
- cwd: workspaceRoot
137427
+ return ret;
137428
+ }, packageJson.exports);
137429
+ packageJson.funding ??= workspacePackageJson.funding;
137430
+ packageJson.types ??= `${distPaths.length > 1 ? distPaths[1] : distPaths[0]}index.d.ts`;
137431
+ packageJson.typings ??= `${distPaths.length > 1 ? distPaths[1] : distPaths[0]}index.d.ts`;
137432
+ packageJson.typescript ??= {
137433
+ definition: `${distPaths.length > 1 ? distPaths[1] : distPaths[0]}index.d.ts`
137434
+ };
137435
+ packageJson.main ??= `${distPaths.length > 1 ? distPaths[1] : distPaths[0]}index.cjs`;
137436
+ packageJson.module ??= `${distPaths.length > 1 ? distPaths[1] : distPaths[0]}index.js`;
137437
+ if (options.platform && options.platform !== "node") {
137438
+ packageJson.browser ??= `${distPaths[0]}index.global.js`;
137439
+ }
137440
+ if (options.includeSrc === true) {
137441
+ let distSrc = sourceRoot.replace(projectRoot, "");
137442
+ if (distSrc.startsWith("/")) {
137443
+ distSrc = distSrc.substring(1);
137444
+ }
137445
+ packageJson.source ??= `${(0, import_node_path3.join)(distSrc, "index.ts").replaceAll("\\", "/")}`;
137446
+ }
137447
+ packageJson.sideEffects ??= false;
137448
+ packageJson.files ??= ["dist/**/*"];
137449
+ if (options.includeSrc === true && !packageJson.files.includes("src")) {
137450
+ packageJson.files.push("src/**/*");
137451
+ }
137452
+ }
137453
+ packageJson.publishConfig ??= {
137454
+ access: "public"
137455
+ };
137456
+ packageJson.description ??= workspacePackageJson.description;
137457
+ packageJson.homepage ??= workspacePackageJson.homepage;
137458
+ packageJson.bugs ??= workspacePackageJson.bugs;
137459
+ packageJson.author ??= workspacePackageJson.author;
137460
+ packageJson.license ??= workspacePackageJson.license;
137461
+ packageJson.keywords ??= workspacePackageJson.keywords;
137462
+ packageJson.repository ??= workspacePackageJson.repository;
137463
+ packageJson.repository.directory ??= projectRoot ? projectRoot : (0, import_node_path3.join)("packages", context.projectName);
137464
+ const packageJsonPath = (0, import_node_path3.join)(context.root, options.outputPath, "package.json");
137465
+ writeDebug(config, `\u26A1 Writing package.json file to: ${packageJsonPath}`);
137466
+ (0, import_node_fs3.writeFileSync)(
137467
+ packageJsonPath,
137468
+ await (0, import_prettier.format)(JSON.stringify(packageJson), {
137469
+ ...prettierOptions,
137470
+ parser: "json"
137483
137471
  })
137484
137472
  );
137485
- options.plugins.push(environmentPlugin(stormEnv));
137486
- const getConfigOptions = {
137487
- ...options,
137488
- define: {
137489
- __STORM_CONFIG: JSON.stringify(stormEnv)
137490
- },
137491
- env: {
137492
- __STORM_CONFIG: JSON.stringify(stormEnv),
137493
- ...stormEnv
137494
- },
137495
- dtsTsConfig: getNormalizedTsConfig(
137496
- context.root,
137497
- options.outputPath,
137498
- (0, import_tsc.createTypeScriptCompilationOptions)(
137499
- (0, import_normalize_options.normalizeOptions)(
137473
+ } else {
137474
+ writeWarning(config, "Skipping writing to package.json file");
137475
+ }
137476
+ if (options.includeSrc === true) {
137477
+ const files = globSync([
137478
+ (0, import_devkit2.joinPathFragments)(context.root, options.outputPath, "src/**/*.ts"),
137479
+ (0, import_devkit2.joinPathFragments)(context.root, options.outputPath, "src/**/*.tsx"),
137480
+ (0, import_devkit2.joinPathFragments)(context.root, options.outputPath, "src/**/*.js"),
137481
+ (0, import_devkit2.joinPathFragments)(context.root, options.outputPath, "src/**/*.jsx")
137482
+ ]);
137483
+ await Promise.allSettled(
137484
+ files.map(
137485
+ async (file) => (0, import_promises2.writeFile)(
137486
+ file,
137487
+ await (0, import_prettier.format)(
137488
+ `${options.banner ? options.banner.startsWith("//") ? options.banner : `// ${options.banner}` : ""}
137489
+
137490
+ ${(0, import_node_fs3.readFileSync)(file, "utf-8")}`,
137500
137491
  {
137501
- ...options,
137502
- watch: false,
137503
- main: options.entry,
137504
- transformers: options.skipTypia ? [] : ["typia/lib/transform"]
137505
- },
137506
- context.root,
137507
- sourceRoot,
137508
- workspaceRoot
137492
+ ...prettierOptions,
137493
+ parser: "typescript"
137494
+ }
137509
137495
  ),
137510
- context
137496
+ "utf-8"
137511
137497
  )
137512
- ),
137513
- banner: options.banner ? {
137514
- js: `${options.banner}
137498
+ )
137499
+ );
137500
+ }
137501
+ const stormEnv = Object.keys(options.env).filter((key) => key.startsWith("STORM_")).reduce((ret, key) => {
137502
+ ret[key] = options.env[key];
137503
+ return ret;
137504
+ }, {});
137505
+ options.plugins.push(
137506
+ (0, import_esbuild_decorators.esbuildDecorators)({
137507
+ tsconfig: options.tsConfig,
137508
+ cwd: workspaceRoot
137509
+ })
137510
+ );
137511
+ options.plugins.push(environmentPlugin(stormEnv));
137512
+ const getConfigOptions = {
137513
+ ...options,
137514
+ define: {
137515
+ __STORM_CONFIG: JSON.stringify(stormEnv)
137516
+ },
137517
+ env: {
137518
+ __STORM_CONFIG: JSON.stringify(stormEnv),
137519
+ ...stormEnv
137520
+ },
137521
+ dtsTsConfig: getNormalizedTsConfig(
137522
+ context.root,
137523
+ options.outputPath,
137524
+ (0, import_tsc.createTypeScriptCompilationOptions)(
137525
+ (0, import_normalize_options.normalizeOptions)(
137526
+ {
137527
+ ...options,
137528
+ watch: false,
137529
+ main: options.entry,
137530
+ transformers: options.skipTypia ? [] : ["typia/lib/transform"]
137531
+ },
137532
+ context.root,
137533
+ sourceRoot,
137534
+ workspaceRoot
137535
+ ),
137536
+ context
137537
+ )
137538
+ ),
137539
+ banner: options.banner ? {
137540
+ js: `${options.banner}
137515
137541
 
137516
137542
  `,
137517
- css: `/*
137543
+ css: `/*
137518
137544
  ${options.banner}
137519
137545
  */
137520
137546
 
137521
137547
  `
137522
- } : void 0,
137523
- outputPath: options.outputPath,
137524
- entry,
137525
- getTransform: options.skipTypia ? void 0 : getTypiaTransform
137526
- };
137527
- if (options.getConfig) {
137528
- if (getLogLevel(config?.logLevel) >= LogLevel.INFO) {
137529
- writeInfo(config, "\u26A1 Running the Build process");
137530
- }
137531
- const getConfigFns = _isFunction(options.getConfig) ? [options.getConfig] : Object.keys(options.getConfig).map((key) => options.getConfig[key]);
137532
- const tsupConfig = (0, import_tsup.defineConfig)(
137533
- getConfigFns.map(
137534
- (getConfigFn) => getConfig(context.root, projectRoot, getConfigFn, getConfigOptions)
137535
- )
137536
- );
137537
- if (_isFunction(tsupConfig)) {
137538
- await build(await Promise.resolve(tsupConfig({})), config);
137539
- } else {
137540
- await build(tsupConfig, config);
137541
- }
137542
- } else if (getLogLevel(config?.logLevel) >= LogLevel.WARN) {
137543
- writeWarning(
137544
- config,
137545
- "The Build process did not run because no `getConfig` parameter was provided"
137546
- );
137547
- }
137548
- if (getLogLevel(config?.logLevel) >= LogLevel.INFO) {
137549
- writeSuccess(config, "\u26A1 The Build process has completed successfully");
137548
+ } : void 0,
137549
+ outputPath: options.outputPath,
137550
+ entry,
137551
+ getTransform: options.skipTypia ? void 0 : getTypiaTransform
137552
+ };
137553
+ if (options.getConfig) {
137554
+ writeInfo(config, "\u26A1 Running the Build process");
137555
+ const getConfigFns = _isFunction(options.getConfig) ? [options.getConfig] : Object.keys(options.getConfig).map((key) => options.getConfig[key]);
137556
+ const tsupConfig = (0, import_tsup.defineConfig)(
137557
+ getConfigFns.map(
137558
+ (getConfigFn) => getConfig(context.root, projectRoot, getConfigFn, getConfigOptions)
137559
+ )
137560
+ );
137561
+ if (_isFunction(tsupConfig)) {
137562
+ await build(await Promise.resolve(tsupConfig({})), config);
137563
+ } else {
137564
+ await build(tsupConfig, config);
137550
137565
  }
137551
- return {
137552
- success: true
137553
- };
137554
- } catch (e) {
137555
- console.error(e);
137556
- return {
137557
- success: false
137558
- };
137566
+ } else if (getLogLevel(config?.logLevel) >= LogLevel.WARN) {
137567
+ writeWarning(
137568
+ config,
137569
+ "The Build process did not run because no `getConfig` parameter was provided"
137570
+ );
137559
137571
  }
137572
+ writeSuccess(config, "\u26A1 The Build process has completed successfully");
137573
+ return {
137574
+ success: true
137575
+ };
137560
137576
  }
137561
137577
  function getNormalizedTsConfig(workspaceRoot, outputPath, options) {
137562
137578
  const config = ts.readConfigFile(options.tsConfig, ts.sys.readFile).config;
@@ -137576,11 +137592,11 @@ function getNormalizedTsConfig(workspaceRoot, outputPath, options) {
137576
137592
  emitDeclarationOnly: true,
137577
137593
  declaration: true,
137578
137594
  declarationMap: true,
137579
- declarationDir: (0, import_node_path.join)(workspaceRoot, "tmp", ".tsup", "declaration")
137595
+ declarationDir: (0, import_node_path3.join)(workspaceRoot, "tmp", ".tsup", "declaration")
137580
137596
  }
137581
137597
  },
137582
137598
  ts.sys,
137583
- (0, import_node_path.dirname)(options.tsConfig)
137599
+ (0, import_node_path3.dirname)(options.tsConfig)
137584
137600
  );
137585
137601
  tsConfig.options.pathsBasePath = workspaceRoot;
137586
137602
  if (tsConfig.options.incremental && !tsConfig.options.tsBuildInfoFile) {