@storm-software/workspace-tools 1.10.19 → 1.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -240,9 +240,9 @@ var require_brace_expansion = __commonJS({
240
240
  }
241
241
  });
242
242
 
243
- // node_modules/.pnpm/tsup@8.0.0_patch_hash=sovf4wcq6cvnvtn6wbjff6lsjq_@microsoft+api-extractor@7.38.3_@swc+core@1._v2msqrtjolw7pyjg7qka3b4pee/node_modules/tsup/dist/chunk-EPAEWGCP.js
243
+ // node_modules/.pnpm/tsup@8.0.0_patch_hash=5tqqjclwmacdlcpsbwlaqptbpe_@microsoft+api-extractor@7.38.3_@swc+core@1._uwnm353vjxd2qwlawie2fmt4ku/node_modules/tsup/dist/chunk-EPAEWGCP.js
244
244
  var require_chunk_EPAEWGCP = __commonJS({
245
- "node_modules/.pnpm/tsup@8.0.0_patch_hash=sovf4wcq6cvnvtn6wbjff6lsjq_@microsoft+api-extractor@7.38.3_@swc+core@1._v2msqrtjolw7pyjg7qka3b4pee/node_modules/tsup/dist/chunk-EPAEWGCP.js"(exports) {
245
+ "node_modules/.pnpm/tsup@8.0.0_patch_hash=5tqqjclwmacdlcpsbwlaqptbpe_@microsoft+api-extractor@7.38.3_@swc+core@1._uwnm353vjxd2qwlawie2fmt4ku/node_modules/tsup/dist/chunk-EPAEWGCP.js"(exports) {
246
246
  "use strict";
247
247
  Object.defineProperty(exports, "__esModule", { value: true });
248
248
  var version = "8.0.0";
@@ -6549,9 +6549,9 @@ var require_resolve_from = __commonJS({
6549
6549
  }
6550
6550
  });
6551
6551
 
6552
- // node_modules/.pnpm/tsup@8.0.0_patch_hash=sovf4wcq6cvnvtn6wbjff6lsjq_@microsoft+api-extractor@7.38.3_@swc+core@1._v2msqrtjolw7pyjg7qka3b4pee/node_modules/tsup/dist/chunk-GQ77QZBO.js
6552
+ // node_modules/.pnpm/tsup@8.0.0_patch_hash=5tqqjclwmacdlcpsbwlaqptbpe_@microsoft+api-extractor@7.38.3_@swc+core@1._uwnm353vjxd2qwlawie2fmt4ku/node_modules/tsup/dist/chunk-GQ77QZBO.js
6553
6553
  var require_chunk_GQ77QZBO = __commonJS({
6554
- "node_modules/.pnpm/tsup@8.0.0_patch_hash=sovf4wcq6cvnvtn6wbjff6lsjq_@microsoft+api-extractor@7.38.3_@swc+core@1._v2msqrtjolw7pyjg7qka3b4pee/node_modules/tsup/dist/chunk-GQ77QZBO.js"(exports) {
6554
+ "node_modules/.pnpm/tsup@8.0.0_patch_hash=5tqqjclwmacdlcpsbwlaqptbpe_@microsoft+api-extractor@7.38.3_@swc+core@1._uwnm353vjxd2qwlawie2fmt4ku/node_modules/tsup/dist/chunk-GQ77QZBO.js"(exports) {
6555
6555
  "use strict";
6556
6556
  Object.defineProperty(exports, "__esModule", { value: true });
6557
6557
  function _interopRequireDefault(obj) {
@@ -6749,13 +6749,12 @@ var require_chunk_GQ77QZBO = __commonJS({
6749
6749
  };
6750
6750
  }
6751
6751
  function ensureTempDeclarationDir(options) {
6752
- const cwd = process.cwd();
6753
- const dirPath = _path2.default.join(cwd, "tmp", ".tsup", "declaration");
6752
+ const dirPath = _path2.default.join(options.workspaceRoot, "tmp", ".tsup", "declaration");
6754
6753
  if (_fs2.default.existsSync(dirPath)) {
6755
6754
  return dirPath;
6756
6755
  }
6757
6756
  _fs2.default.mkdirSync(dirPath, { recursive: true });
6758
- const gitIgnorePath = _path2.default.join(cwd, "tmp", ".tsup", ".gitignore");
6757
+ const gitIgnorePath = _path2.default.join(options.workspaceRoot, "tmp", ".tsup", ".gitignore");
6759
6758
  writeFileSync(gitIgnorePath, "**/*\n");
6760
6759
  return dirPath;
6761
6760
  }
@@ -6830,9 +6829,9 @@ var require_chunk_GQ77QZBO = __commonJS({
6830
6829
  }
6831
6830
  });
6832
6831
 
6833
- // node_modules/.pnpm/tsup@8.0.0_patch_hash=sovf4wcq6cvnvtn6wbjff6lsjq_@microsoft+api-extractor@7.38.3_@swc+core@1._v2msqrtjolw7pyjg7qka3b4pee/node_modules/tsup/dist/chunk-UIX4URMV.js
6832
+ // node_modules/.pnpm/tsup@8.0.0_patch_hash=5tqqjclwmacdlcpsbwlaqptbpe_@microsoft+api-extractor@7.38.3_@swc+core@1._uwnm353vjxd2qwlawie2fmt4ku/node_modules/tsup/dist/chunk-UIX4URMV.js
6834
6833
  var require_chunk_UIX4URMV = __commonJS({
6835
- "node_modules/.pnpm/tsup@8.0.0_patch_hash=sovf4wcq6cvnvtn6wbjff6lsjq_@microsoft+api-extractor@7.38.3_@swc+core@1._v2msqrtjolw7pyjg7qka3b4pee/node_modules/tsup/dist/chunk-UIX4URMV.js"(exports) {
6834
+ "node_modules/.pnpm/tsup@8.0.0_patch_hash=5tqqjclwmacdlcpsbwlaqptbpe_@microsoft+api-extractor@7.38.3_@swc+core@1._uwnm353vjxd2qwlawie2fmt4ku/node_modules/tsup/dist/chunk-UIX4URMV.js"(exports) {
6836
6835
  "use strict";
6837
6836
  Object.defineProperty(exports, "__esModule", { value: true });
6838
6837
  function _interopRequireWildcard(obj) {
@@ -7766,9 +7765,9 @@ var require_dist2 = __commonJS({
7766
7765
  }
7767
7766
  });
7768
7767
 
7769
- // node_modules/.pnpm/tsup@8.0.0_patch_hash=sovf4wcq6cvnvtn6wbjff6lsjq_@microsoft+api-extractor@7.38.3_@swc+core@1._v2msqrtjolw7pyjg7qka3b4pee/node_modules/tsup/dist/chunk-7G76EW2R.js
7768
+ // node_modules/.pnpm/tsup@8.0.0_patch_hash=5tqqjclwmacdlcpsbwlaqptbpe_@microsoft+api-extractor@7.38.3_@swc+core@1._uwnm353vjxd2qwlawie2fmt4ku/node_modules/tsup/dist/chunk-7G76EW2R.js
7770
7769
  var require_chunk_7G76EW2R = __commonJS({
7771
- "node_modules/.pnpm/tsup@8.0.0_patch_hash=sovf4wcq6cvnvtn6wbjff6lsjq_@microsoft+api-extractor@7.38.3_@swc+core@1._v2msqrtjolw7pyjg7qka3b4pee/node_modules/tsup/dist/chunk-7G76EW2R.js"(exports) {
7770
+ "node_modules/.pnpm/tsup@8.0.0_patch_hash=5tqqjclwmacdlcpsbwlaqptbpe_@microsoft+api-extractor@7.38.3_@swc+core@1._uwnm353vjxd2qwlawie2fmt4ku/node_modules/tsup/dist/chunk-7G76EW2R.js"(exports) {
7772
7771
  "use strict";
7773
7772
  Object.defineProperty(exports, "__esModule", { value: true });
7774
7773
  function _interopRequireDefault(obj) {
@@ -249451,9 +249450,9 @@ var require_chokidar = __commonJS({
249451
249450
  }
249452
249451
  });
249453
249452
 
249454
- // node_modules/.pnpm/tsup@8.0.0_patch_hash=sovf4wcq6cvnvtn6wbjff6lsjq_@microsoft+api-extractor@7.38.3_@swc+core@1._v2msqrtjolw7pyjg7qka3b4pee/node_modules/tsup/dist/index.js
249453
+ // node_modules/.pnpm/tsup@8.0.0_patch_hash=5tqqjclwmacdlcpsbwlaqptbpe_@microsoft+api-extractor@7.38.3_@swc+core@1._uwnm353vjxd2qwlawie2fmt4ku/node_modules/tsup/dist/index.js
249455
249454
  var require_dist5 = __commonJS({
249456
- "node_modules/.pnpm/tsup@8.0.0_patch_hash=sovf4wcq6cvnvtn6wbjff6lsjq_@microsoft+api-extractor@7.38.3_@swc+core@1._v2msqrtjolw7pyjg7qka3b4pee/node_modules/tsup/dist/index.js"(exports) {
249455
+ "node_modules/.pnpm/tsup@8.0.0_patch_hash=5tqqjclwmacdlcpsbwlaqptbpe_@microsoft+api-extractor@7.38.3_@swc+core@1._uwnm353vjxd2qwlawie2fmt4ku/node_modules/tsup/dist/index.js"(exports) {
249457
249456
  "use strict";
249458
249457
  Object.defineProperty(exports, "__esModule", { value: true });
249459
249458
  function _interopRequireDefault(obj) {
@@ -251020,14 +251019,15 @@ var require_dist5 = __commonJS({
251020
251019
  ".js": extension.js || defaultExtension.js
251021
251020
  };
251022
251021
  };
251023
- var generateExternal = async (external) => {
251022
+ var generateExternal = async (external, options, logger3) => {
251024
251023
  const result = [];
251024
+ const pkgJsonPath = packageJsonSearch(options.outDir, options.silent, "CLI", logger3);
251025
251025
  for (const item of external) {
251026
251026
  if (typeof item !== "string" || !item.endsWith("package.json")) {
251027
251027
  result.push(item);
251028
251028
  continue;
251029
251029
  }
251030
- let pkgPath = _path2.default.isAbsolute(item) ? _path2.default.dirname(item) : _path2.default.dirname(_path2.default.resolve(process.cwd(), item));
251030
+ let pkgPath = _path2.default.isAbsolute(item) ? _path2.default.dirname(item) : _path2.default.dirname(_path2.default.resolve(pkgJsonPath ?? process.cwd(), item));
251031
251031
  const deps = await _chunk7G76EW2Rjs.getProductionDeps.call(void 0, pkgPath);
251032
251032
  result.push(...deps);
251033
251033
  }
@@ -251035,7 +251035,7 @@ var require_dist5 = __commonJS({
251035
251035
  };
251036
251036
  var packageJsonSearch = (outDir, silent, format, logger3) => {
251037
251037
  let pkgPath = outDir ? outDir : process.cwd();
251038
- !silent && logger3.info(format, `\u26A1 Beginning search for package.json file: ${pkgPath}`);
251038
+ !silent && logger3 && logger3.info(format, `\u26A1 Beginning search for package.json file: ${pkgPath}`);
251039
251039
  if (pkgPath) {
251040
251040
  const splits = pkgPath.split("/");
251041
251041
  if (splits.length > 0) {
@@ -251047,12 +251047,12 @@ var require_dist5 = __commonJS({
251047
251047
  ).join("/"),
251048
251048
  "package.json"
251049
251049
  );
251050
- !silent && logger3.info(
251050
+ !silent && logger3 && logger3.info(
251051
251051
  format,
251052
251052
  `\u26A1 Searching for package.json file in ${packageJsonPath} (index: ${i})`
251053
251053
  );
251054
251054
  if (_fs2.default.existsSync(packageJsonPath)) {
251055
- !silent && logger3.info(
251055
+ !silent && logger3 && logger3.info(
251056
251056
  format,
251057
251057
  `\u26A1 Found the package.json file in ${packageJsonPath} (index: ${i})`
251058
251058
  );
@@ -251078,7 +251078,7 @@ var require_dist5 = __commonJS({
251078
251078
  const external = [
251079
251079
  // Exclude dependencies, e.g. `lodash`, `lodash/get`
251080
251080
  ...deps.map((dep) => new RegExp(`^${dep}($|\\/|\\\\)`)),
251081
- ...await generateExternal(options.external || [])
251081
+ ...await generateExternal(options.external || [], options, logger3)
251082
251082
  ];
251083
251083
  const outDir = options.outDir;
251084
251084
  const outExtension2 = getOutputExtensionMap(options, format, pkg.type);
@@ -251753,7 +251753,7 @@ var require_dist5 = __commonJS({
251753
251753
  rawTsconfig.data.compilerOptions = {};
251754
251754
  }
251755
251755
  logger.info("tsc", "Getting temporary declaration directory");
251756
- let declarationDir = _chunkGQ77QZBOjs.ensureTempDeclarationDir.call(void 0);
251756
+ let declarationDir = _chunkGQ77QZBOjs.ensureTempDeclarationDir.call(void 0, options);
251757
251757
  logger.info("tsc", declarationDir);
251758
251758
  logger.info("tsc", "Parsing tsconfig.json");
251759
251759
  let parsedTsconfig = _typescript2.default.parseJsonConfigFileContent(
@@ -251763,19 +251763,16 @@ var require_dist5 = __commonJS({
251763
251763
  ...rawTsconfig.data.compilerOptions,
251764
251764
  ...compilerOptions,
251765
251765
  // Enable declaration emit and disable javascript emit
251766
+ outDir: options.outDir,
251766
251767
  noEmit: false,
251767
251768
  declaration: true,
251768
251769
  declarationMap: true,
251769
251770
  declarationDir,
251770
251771
  emitDeclarationOnly: true
251771
251772
  },
251772
- files: [
251773
- ...rawTsconfig.data.files ?? {},
251774
- `${options.projectRoot}/**/*`
251775
- ],
251776
251773
  include: [
251777
251774
  ...rawTsconfig.data.files ?? {},
251778
- `${options.projectRoot}/**/*`
251775
+ _path.join(options.projectRoot, "**", "*")
251779
251776
  ]
251780
251777
  },
251781
251778
  _typescript2.default.sys,
@@ -252129,11 +252126,12 @@ var require_dist5 = __commonJS({
252129
252126
  options.entry = entry;
252130
252127
  logger3.info("CLI", `Building entry: ${JSON.stringify(entry)}`);
252131
252128
  }
252132
- const tsconfig = _bundlerequire.loadTsConfig.call(void 0, process.cwd(), options.tsconfig);
252129
+ !options.silent && logger2.info("CLI", `\u26A1 Normalizing options: ${options.tsconfig}`);
252130
+ const tsconfig = _bundlerequire.loadTsConfig.call(void 0, options.workspaceRoot, options.tsconfig);
252133
252131
  if (tsconfig) {
252134
252132
  logger3.info(
252135
252133
  "CLI",
252136
- `Using tsconfig: ${_path2.default.relative(process.cwd(), tsconfig.path)}`
252134
+ `Using tsconfig: ${_path2.default.relative(options.workspaceRoot, tsconfig.path)}`
252137
252135
  );
252138
252136
  options.tsconfig = tsconfig.path;
252139
252137
  options.tsconfigResolvePaths = _optionalChain([tsconfig, "access", (_20) => _20.data, "optionalAccess", (_21) => _21.compilerOptions, "optionalAccess", (_22) => _22.paths]) || {};
@@ -252147,7 +252145,8 @@ var require_dist5 = __commonJS({
252147
252145
  if (options.experimentalDts) {
252148
252146
  options.experimentalDts.compilerOptions = {
252149
252147
  ...tsconfig.data.compilerOptions || {},
252150
- ...options.experimentalDts.compilerOptions || {}
252148
+ ...options.experimentalDts.compilerOptions || {},
252149
+ outDir: options.outDir
252151
252150
  };
252152
252151
  options.experimentalDts.entry = _chunkGQ77QZBOjs.toObjectEntry.call(
252153
252152
  void 0,
@@ -252168,7 +252167,7 @@ var require_dist5 = __commonJS({
252168
252167
  async function build(_options) {
252169
252168
  const config = _options.config === false ? {} : await _chunk7G76EW2Rjs.loadTsupConfig.call(
252170
252169
  void 0,
252171
- process.cwd(),
252170
+ _options.workspaceRoot ?? process.cwd(),
252172
252171
  _options.config === true ? void 0 : _options.config
252173
252172
  );
252174
252173
  const configData = typeof config.data === "function" ? await config.data(_options) : config.data;
@@ -252234,7 +252233,7 @@ var require_dist5 = __commonJS({
252234
252233
  let onSuccessProcess;
252235
252234
  let onSuccessCleanup;
252236
252235
  const buildDependencies = /* @__PURE__ */ new Set();
252237
- let depsHash = await _chunk7G76EW2Rjs.getAllDepsHash.call(void 0, process.cwd());
252236
+ let depsHash = await _chunk7G76EW2Rjs.getAllDepsHash.call(void 0, options.workspaceRoot ?? process.cwd());
252238
252237
  const doOnSuccessCleanup = async () => {
252239
252238
  if (onSuccessProcess) {
252240
252239
  await killProcess({
@@ -252356,7 +252355,7 @@ var require_dist5 = __commonJS({
252356
252355
  let shouldSkipChange = false;
252357
252356
  if (options.watch === true) {
252358
252357
  if (file === "package.json" && !buildDependencies.has(file)) {
252359
- const currentHash = await _chunk7G76EW2Rjs.getAllDepsHash.call(void 0, process.cwd());
252358
+ const currentHash = await _chunk7G76EW2Rjs.getAllDepsHash.call(void 0, options.workspaceRoot ?? process.cwd());
252360
252359
  shouldSkipChange = currentHash === depsHash;
252361
252360
  depsHash = currentHash;
252362
252361
  } else if (!buildDependencies.has(file)) {
@@ -252391,7 +252390,8 @@ var get_config_exports = {};
252391
252390
  __export(get_config_exports, {
252392
252391
  getConfig: () => getConfig,
252393
252392
  legacyConfig: () => legacyConfig,
252394
- modernConfig: () => modernConfig
252393
+ modernConfig: () => modernConfig,
252394
+ workerConfig: () => workerConfig
252395
252395
  });
252396
252396
  module.exports = __toCommonJS(get_config_exports);
252397
252397
 
@@ -258686,6 +258686,56 @@ function legacyConfig({
258686
258686
  outExtension
258687
258687
  };
258688
258688
  }
258689
+ function workerConfig({
258690
+ entry,
258691
+ outDir,
258692
+ projectRoot,
258693
+ workspaceRoot,
258694
+ tsconfig = "tsconfig.json",
258695
+ debug = false,
258696
+ external,
258697
+ banner = {},
258698
+ verbose = false,
258699
+ apiReport = true,
258700
+ docModel = true,
258701
+ tsdocMetadata = true,
258702
+ define: define2,
258703
+ env,
258704
+ options
258705
+ }) {
258706
+ return {
258707
+ name: "worker",
258708
+ entry,
258709
+ format: ["esm"],
258710
+ target: ["chrome95"],
258711
+ tsconfig,
258712
+ projectRoot,
258713
+ workspaceRoot,
258714
+ outDir: (0, import_path2.join)(outDir, "dist", "worker"),
258715
+ silent: !verbose,
258716
+ metafile: true,
258717
+ shims: true,
258718
+ minify: false,
258719
+ external,
258720
+ platform: "browser",
258721
+ banner,
258722
+ define: define2,
258723
+ env,
258724
+ dts: false,
258725
+ experimentalDts: {
258726
+ entry,
258727
+ compilerOptions: {
258728
+ noEmit: false
258729
+ }
258730
+ },
258731
+ apiReport,
258732
+ docModel,
258733
+ tsdocMetadata,
258734
+ sourcemap: debug,
258735
+ clean: false,
258736
+ outExtension
258737
+ };
258738
+ }
258689
258739
  function getConfig(workspaceRoot, projectRoot, sourceRoot, {
258690
258740
  outputPath,
258691
258741
  tsConfig,
@@ -258713,49 +258763,39 @@ function getConfig(workspaceRoot, projectRoot, sourceRoot, {
258713
258763
  }
258714
258764
  ).reduce((ret, filePath) => {
258715
258765
  let propertyKey = (0, import_path2.join)(filePath.path, removeExtension(filePath.name)).replaceAll(workspaceRoot, "").replaceAll("\\", "/").replaceAll(sourceRoot, "").replaceAll(projectRoot, "");
258716
- if (propertyKey.startsWith("/")) {
258717
- propertyKey = propertyKey.substring(1);
258718
- }
258719
- if (!(propertyKey in ret)) {
258720
- ret[propertyKey] = (0, import_path2.join)(filePath.path, filePath.name);
258766
+ if (propertyKey) {
258767
+ while (propertyKey.startsWith("/")) {
258768
+ propertyKey = propertyKey.substring(1);
258769
+ }
258770
+ if (!(propertyKey in ret)) {
258771
+ ret[propertyKey] = (0, import_path2.join)(filePath.path, filePath.name);
258772
+ }
258721
258773
  }
258722
258774
  return ret;
258723
258775
  }, {});
258724
- return (0, import_tsup.defineConfig)([
258725
- modernConfig({
258726
- entry,
258727
- outDir: outputPath,
258728
- projectRoot,
258729
- workspaceRoot,
258730
- tsconfig: tsConfig,
258731
- debug,
258732
- banner,
258733
- platform,
258734
- external,
258735
- verbose,
258736
- apiReport,
258737
- docModel,
258738
- tsdocMetadata,
258739
- define: define2,
258740
- env,
258741
- options
258742
- }),
258743
- legacyConfig({
258744
- entry,
258745
- outDir: outputPath,
258746
- projectRoot,
258747
- workspaceRoot,
258748
- tsconfig: tsConfig,
258749
- debug,
258750
- banner,
258751
- platform,
258752
- external,
258753
- verbose,
258754
- define: define2,
258755
- env,
258756
- options
258757
- })
258758
- ]);
258776
+ const params = {
258777
+ entry,
258778
+ outDir: outputPath,
258779
+ projectRoot,
258780
+ workspaceRoot,
258781
+ tsconfig: tsConfig,
258782
+ debug,
258783
+ banner,
258784
+ platform,
258785
+ external,
258786
+ verbose,
258787
+ apiReport,
258788
+ docModel,
258789
+ tsdocMetadata,
258790
+ define: define2,
258791
+ env,
258792
+ options
258793
+ };
258794
+ const config = [modernConfig(params), legacyConfig(params)];
258795
+ if (platform === "node") {
258796
+ config.push(workerConfig(params));
258797
+ }
258798
+ return (0, import_tsup.defineConfig)(config);
258759
258799
  }
258760
258800
  var outExtension = ({ options, format, pkgType }) => {
258761
258801
  console.log(options);
@@ -258783,7 +258823,8 @@ var outExtension = ({ options, format, pkgType }) => {
258783
258823
  0 && (module.exports = {
258784
258824
  getConfig,
258785
258825
  legacyConfig,
258786
- modernConfig
258826
+ modernConfig,
258827
+ workerConfig
258787
258828
  });
258788
258829
  /*! Bundled license information:
258789
258830