@storm-software/workspace-tools 1.73.0 → 1.73.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storm-software/workspace-tools",
3
- "version": "1.73.0",
3
+ "version": "1.73.1",
4
4
  "private": false,
5
5
  "description": "⚡ A Nx plugin package that contains various executors and generators used in a Storm workspaces.",
6
6
  "keywords": [
@@ -51,7 +51,7 @@
51
51
  "@ltd/j-toml": "1.38.0",
52
52
  "@microsoft/api-extractor": "7.43.1",
53
53
  "@nx/devkit": "18.2.4",
54
- "@nx/esbuild": "18.2.3",
54
+ "@nx/esbuild": "18.3.3",
55
55
  "@rollup/plugin-json": "6.1.0",
56
56
  "bundle-require": "4.0.2",
57
57
  "decky": "1.1.1",
package/src/base/index.js CHANGED
@@ -46588,8 +46588,8 @@ var require_pax = __commonJS({
46588
46588
  return len + s2;
46589
46589
  }
46590
46590
  };
46591
- Pax.parse = (string, ex, g4) => new Pax(merge2(parseKV(string), ex), g4);
46592
- var merge2 = (a2, b6) => b6 ? Object.keys(a2).reduce((s2, k4) => (s2[k4] = a2[k4], s2), b6) : a2;
46591
+ Pax.parse = (string, ex, g4) => new Pax(merge3(parseKV(string), ex), g4);
46592
+ var merge3 = (a2, b6) => b6 ? Object.keys(a2).reduce((s2, k4) => (s2[k4] = a2[k4], s2), b6) : a2;
46593
46593
  var parseKV = (string) => string.replace(/\n$/, "").split("\n").reduce(parseKVLine, /* @__PURE__ */ Object.create(null));
46594
46594
  var parseKVLine = (set, line) => {
46595
46595
  const n = parseInt(line, 10);
@@ -66808,64 +66808,6 @@ var require_cjs = __commonJS({
66808
66808
  }
66809
66809
  });
66810
66810
 
66811
- // packages/config-tools/src/config-file/get-config-file.ts
66812
- var import_deepmerge, getConfigFileByName, getConfigFile;
66813
- var init_get_config_file = __esm({
66814
- "packages/config-tools/src/config-file/get-config-file.ts"() {
66815
- init_find_workspace_root();
66816
- init_dist10();
66817
- import_deepmerge = __toESM(require_cjs());
66818
- getConfigFileByName = async (fileName, filePath) => {
66819
- const workspacePath = filePath ? filePath : findWorkspaceRoot(filePath);
66820
- return loadConfig({
66821
- cwd: workspacePath,
66822
- packageJson: true,
66823
- name: fileName,
66824
- envName: fileName?.toUpperCase(),
66825
- jitiOptions: {
66826
- debug: true,
66827
- cache: process.env.STORM_CACHE ? process.env.STORM_CACHE_DIRECTORY : false
66828
- }
66829
- });
66830
- };
66831
- getConfigFile = async (filePath, additionalFileNames = []) => {
66832
- const workspacePath = filePath ? filePath : findWorkspaceRoot(filePath);
66833
- let { config, configFile } = await loadConfig({
66834
- cwd: workspacePath,
66835
- name: "storm"
66836
- });
66837
- if (additionalFileNames && additionalFileNames.length > 0) {
66838
- const results = await Promise.all(
66839
- additionalFileNames.map(
66840
- (fileName) => loadConfig({
66841
- cwd: workspacePath,
66842
- name: fileName
66843
- })
66844
- )
66845
- );
66846
- for (const result of results) {
66847
- if (result) {
66848
- config = (0, import_deepmerge.default)(config ?? {}, result.config ?? {});
66849
- }
66850
- }
66851
- }
66852
- if (!config) {
66853
- return void 0;
66854
- }
66855
- config.configFile = configFile;
66856
- config.runtimeVersion = "0.0.1";
66857
- return config;
66858
- };
66859
- }
66860
- });
66861
-
66862
- // packages/config-tools/src/config-file/index.ts
66863
- var init_config_file = __esm({
66864
- "packages/config-tools/src/config-file/index.ts"() {
66865
- init_get_config_file();
66866
- }
66867
- });
66868
-
66869
66811
  // node_modules/.pnpm/zod@3.22.4/node_modules/zod/lib/index.mjs
66870
66812
  function setErrorMap(map) {
66871
66813
  overrideErrorMap = map;
@@ -72513,7 +72455,7 @@ var init_chalk = __esm({
72513
72455
  });
72514
72456
 
72515
72457
  // packages/config-tools/src/utilities/logger.ts
72516
- var getLogFn, writeFatal, writeError, writeWarning, writeInfo, writeSuccess, writeDebug, writeTrace, writeSystem, getStopwatch;
72458
+ var getLogFn, writeFatal, writeError, writeWarning, writeInfo, writeSuccess, writeDebug, writeTrace, writeSystem, getStopwatch, formatLogMessage, _isFunction;
72517
72459
  var init_logger = __esm({
72518
72460
  "packages/config-tools/src/utilities/logger.ts"() {
72519
72461
  init_types2();
@@ -72532,7 +72474,9 @@ var init_logger = __esm({
72532
72474
  return (message) => {
72533
72475
  console.error(
72534
72476
  `
72535
- ${_chalk.bold.hex(colors.error)(">")} ${_chalk.bold.bgHex(colors.fatal).whiteBright(" \u{1F480} Fatal ")} ${_chalk.hex(colors.error)(message)}
72477
+ ${_chalk.bold.hex(colors.error ?? "#f85149")(">")} ${_chalk.bold.bgHex(colors.fatal ?? "#b62324").whiteBright(
72478
+ " \u{1F480} Fatal "
72479
+ )} ${_chalk.hex(colors.error ?? "#f85149")(formatLogMessage(message))}
72536
72480
 
72537
72481
  `
72538
72482
  );
@@ -72542,7 +72486,9 @@ ${_chalk.bold.hex(colors.error)(">")} ${_chalk.bold.bgHex(colors.fatal).whiteBri
72542
72486
  return (message) => {
72543
72487
  console.error(
72544
72488
  `
72545
- ${_chalk.bold.hex(colors.error)(">")} ${_chalk.bold.bgHex(colors.error).whiteBright(" \u2718 Error ")} ${_chalk.hex(colors.error)(message)}
72489
+ ${_chalk.bold.hex(colors.error ?? "#f85149")(">")} ${_chalk.bold.bgHex(colors.error ?? "#f85149").whiteBright(
72490
+ " \u2718 Error "
72491
+ )} ${_chalk.hex(colors.error ?? "#f85149")(formatLogMessage(message))}
72546
72492
  `
72547
72493
  );
72548
72494
  };
@@ -72551,7 +72497,9 @@ ${_chalk.bold.hex(colors.error)(">")} ${_chalk.bold.bgHex(colors.error).whiteBri
72551
72497
  return (message) => {
72552
72498
  console.warn(
72553
72499
  `
72554
- ${_chalk.bold.hex(colors.warning)("> ")} ${_chalk.bold.bgHex(colors.warning).whiteBright(" \u26A0 Warn ")} ${_chalk.hex(colors.warning)(message)}
72500
+ ${_chalk.bold.hex(colors.warning ?? "#e3b341")("> ")} ${_chalk.bold.bgHex(colors.warning ?? "#e3b341").whiteBright(
72501
+ " \u26A0 Warn "
72502
+ )} ${_chalk.hex(colors.warning ?? "#e3b341")(formatLogMessage(message))}
72555
72503
  `
72556
72504
  );
72557
72505
  };
@@ -72560,7 +72508,9 @@ ${_chalk.bold.hex(colors.warning)("> ")} ${_chalk.bold.bgHex(colors.warning).whi
72560
72508
  return (message) => {
72561
72509
  console.info(
72562
72510
  `
72563
- ${_chalk.bold.hex(colors.success)(">")} ${_chalk.bold.bgHex(colors.success).whiteBright(" \u2713 Success ")} ${_chalk.hex(colors.success)(message)}
72511
+ ${_chalk.bold.hex(colors.success ?? "#56d364")(">")} ${_chalk.bold.bgHex(colors.success ?? "#56d364").whiteBright(
72512
+ " \u2713 Success "
72513
+ )} ${_chalk.hex(colors.success ?? "#56d364")(formatLogMessage(message))}
72564
72514
  `
72565
72515
  );
72566
72516
  };
@@ -72569,7 +72519,9 @@ ${_chalk.bold.hex(colors.success)(">")} ${_chalk.bold.bgHex(colors.success).whit
72569
72519
  return (message) => {
72570
72520
  console.info(
72571
72521
  `
72572
- ${_chalk.bold.hex(colors.info)(">")} ${_chalk.bold.bgHex(colors.info).whiteBright(" \u2139 Info ")} ${_chalk.hex(colors.info)(message)}
72522
+ ${_chalk.bold.hex(colors.info ?? "#58a6ff")(">")} ${_chalk.bold.bgHex(colors.info ?? "#58a6ff").whiteBright(
72523
+ " \u2139 Info "
72524
+ )} ${_chalk.hex(colors.info ?? "#58a6ff")(formatLogMessage(message))}
72573
72525
  `
72574
72526
  );
72575
72527
  };
@@ -72578,7 +72530,9 @@ ${_chalk.bold.hex(colors.info)(">")} ${_chalk.bold.bgHex(colors.info).whiteBrigh
72578
72530
  return (message) => {
72579
72531
  console.debug(
72580
72532
  `
72581
- ${_chalk.bold.hex(colors.primary)(">")} ${_chalk.bold.bgHex(colors.primary).whiteBright(" \u{1F6E0} Debug ")} ${_chalk.hex(colors.primary)(message)}
72533
+ ${_chalk.bold.hex(colors.primary ?? "#1fb2a6")(">")} ${_chalk.bold.bgHex(colors.primary ?? "#1fb2a6").whiteBright(
72534
+ " \u{1F6E0} Debug "
72535
+ )} ${_chalk.hex(colors.primary ?? "#1fb2a6")(formatLogMessage(message))}
72582
72536
  `
72583
72537
  );
72584
72538
  };
@@ -72586,7 +72540,9 @@ ${_chalk.bold.hex(colors.primary)(">")} ${_chalk.bold.bgHex(colors.primary).whit
72586
72540
  return (message) => {
72587
72541
  console.log(
72588
72542
  `
72589
- ${_chalk.bold.hex(colors.primary)(">")} ${_chalk.bold.bgHex(colors.primary).whiteBright(" \u2709 System ")} ${_chalk.hex(colors.primary)(message)}
72543
+ ${_chalk.bold.hex(colors.primary ?? "#1fb2a6")(">")} ${_chalk.bold.bgHex(colors.primary ?? "#1fb2a6").whiteBright(
72544
+ " \u2709 System "
72545
+ )} ${_chalk.hex(colors.primary ?? "#1fb2a6")(formatLogMessage(message))}
72590
72546
  `
72591
72547
  );
72592
72548
  };
@@ -72613,6 +72569,19 @@ ${_chalk.bold.hex(colors.primary)(">")} ${_chalk.bold.bgHex(colors.primary).whit
72613
72569
  );
72614
72570
  };
72615
72571
  };
72572
+ formatLogMessage = (message, prefix = "-") => {
72573
+ return typeof message === "string" ? message : typeof message === "object" ? Object.keys(message).map(
72574
+ (key) => ` ${prefix} ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" ? `
72575
+ ${formatLogMessage(message[key], `${prefix}-`)}` : message[key]}`
72576
+ ).join("\n") : message;
72577
+ };
72578
+ _isFunction = (value2) => {
72579
+ try {
72580
+ return value2 instanceof Function || typeof value2 === "function" || !!(value2?.constructor && value2?.call && value2?.apply);
72581
+ } catch (e2) {
72582
+ return false;
72583
+ }
72584
+ };
72616
72585
  }
72617
72586
  });
72618
72587
 
@@ -72789,6 +72758,94 @@ var init_utilities = __esm({
72789
72758
  }
72790
72759
  });
72791
72760
 
72761
+ // packages/config-tools/src/config-file/get-config-file.ts
72762
+ var import_deepmerge, getConfigFileByName, getConfigFile;
72763
+ var init_get_config_file = __esm({
72764
+ "packages/config-tools/src/config-file/get-config-file.ts"() {
72765
+ init_find_workspace_root();
72766
+ init_dist10();
72767
+ import_deepmerge = __toESM(require_cjs());
72768
+ init_utilities();
72769
+ getConfigFileByName = async (fileName, filePath, options = {}) => {
72770
+ const workspacePath = filePath ? filePath : findWorkspaceRoot(filePath);
72771
+ let config = loadConfig({
72772
+ cwd: workspacePath,
72773
+ packageJson: true,
72774
+ name: fileName,
72775
+ envName: fileName?.toUpperCase(),
72776
+ jitiOptions: {
72777
+ debug: true,
72778
+ cache: process.env.STORM_CACHE ? process.env.STORM_CACHE_DIRECTORY : false
72779
+ },
72780
+ ...options
72781
+ });
72782
+ if (!config || Object.keys(config).length === 0) {
72783
+ config = loadConfig({
72784
+ cwd: workspacePath,
72785
+ packageJson: true,
72786
+ name: fileName,
72787
+ envName: fileName?.toUpperCase(),
72788
+ jitiOptions: {
72789
+ debug: true,
72790
+ cache: process.env.STORM_CACHE ? process.env.STORM_CACHE_DIRECTORY : false
72791
+ },
72792
+ configFile: fileName,
72793
+ ...options
72794
+ });
72795
+ }
72796
+ return config;
72797
+ };
72798
+ getConfigFile = async (filePath, additionalFileNames = []) => {
72799
+ const workspacePath = filePath ? filePath : findWorkspaceRoot(filePath);
72800
+ let { config, configFile } = await getConfigFileByName(
72801
+ "storm",
72802
+ workspacePath
72803
+ );
72804
+ if (config && Object.keys(config).length > 0) {
72805
+ writeTrace(
72806
+ `Found Storm configuration file "${configFile}" at "${workspacePath}"`,
72807
+ {
72808
+ logLevel: "all"
72809
+ }
72810
+ );
72811
+ writeTrace(config, { logLevel: "all" });
72812
+ }
72813
+ if (additionalFileNames && additionalFileNames.length > 0) {
72814
+ const results = await Promise.all(
72815
+ additionalFileNames.map(
72816
+ (fileName) => getConfigFileByName(fileName, workspacePath)
72817
+ )
72818
+ );
72819
+ for (const result of results) {
72820
+ if (result?.config && Object.keys(result.config).length > 0) {
72821
+ writeTrace(
72822
+ `Found additional configuration file "${result.configFile}" at "${workspacePath}"`,
72823
+ {
72824
+ logLevel: "all"
72825
+ }
72826
+ );
72827
+ writeTrace(result.config, { logLevel: "all" });
72828
+ config = (0, import_deepmerge.default)(config ?? {}, result.config ?? {});
72829
+ }
72830
+ }
72831
+ }
72832
+ if (!config) {
72833
+ return void 0;
72834
+ }
72835
+ config.configFile = configFile;
72836
+ config.runtimeVersion = "0.0.1";
72837
+ return config;
72838
+ };
72839
+ }
72840
+ });
72841
+
72842
+ // packages/config-tools/src/config-file/index.ts
72843
+ var init_config_file = __esm({
72844
+ "packages/config-tools/src/config-file/index.ts"() {
72845
+ init_get_config_file();
72846
+ }
72847
+ });
72848
+
72792
72849
  // packages/config-tools/src/env/get-env.ts
72793
72850
  var getExtensionEnv, getConfigEnv, getThemeColorConfigEnv, getSingleThemeColorConfigEnv, getMultiThemeColorConfigEnv, getBaseThemeColorConfigEnv;
72794
72851
  var init_get_env = __esm({
@@ -73150,7 +73207,7 @@ var init_set_env = __esm({
73150
73207
  });
73151
73208
 
73152
73209
  // packages/config-tools/src/create-storm-config.ts
73153
- var _extension_cache, _static_cache, createConfig, createStormConfig, createConfigExtension, loadStormConfig;
73210
+ var import_deepmerge2, _extension_cache, _static_cache, createConfig, createStormConfig, createConfigExtension, loadStormConfig;
73154
73211
  var init_create_storm_config = __esm({
73155
73212
  "packages/config-tools/src/create-storm-config.ts"() {
73156
73213
  init_get_config_file();
@@ -73159,6 +73216,7 @@ var init_create_storm_config = __esm({
73159
73216
  init_schema();
73160
73217
  init_utilities();
73161
73218
  init_get_default_config();
73219
+ import_deepmerge2 = __toESM(require_cjs());
73162
73220
  _extension_cache = /* @__PURE__ */ new WeakMap();
73163
73221
  _static_cache = void 0;
73164
73222
  createConfig = (workspaceRoot) => {
@@ -73207,7 +73265,9 @@ var init_create_storm_config = __esm({
73207
73265
  if (!_workspaceRoot) {
73208
73266
  _workspaceRoot = findWorkspaceRoot();
73209
73267
  }
73210
- const configFile = await getConfigFile(_workspaceRoot);
73268
+ let configFile = await getConfigFile(
73269
+ _workspaceRoot
73270
+ );
73211
73271
  if (!configFile) {
73212
73272
  writeWarning(
73213
73273
  "No Storm config file found in the current workspace. Please ensure this is the expected behavior - you can add a `storm.json` file to the root of your workspace if it is not.\n",
@@ -73216,10 +73276,7 @@ var init_create_storm_config = __esm({
73216
73276
  }
73217
73277
  config = StormConfigSchema.parse(
73218
73278
  await getDefaultConfig(
73219
- {
73220
- ...getConfigEnv(),
73221
- ...configFile
73222
- },
73279
+ (0, import_deepmerge2.default)(getConfigEnv(), configFile, {}),
73223
73280
  _workspaceRoot
73224
73281
  )
73225
73282
  );
@@ -73257,6 +73314,7 @@ __export(src_exports, {
73257
73314
  findFileName: () => findFileName,
73258
73315
  findWorkspaceRoot: () => findWorkspaceRoot,
73259
73316
  findWorkspaceRootSafe: () => findWorkspaceRootSafe,
73317
+ formatLogMessage: () => formatLogMessage,
73260
73318
  getChalk: () => getChalk,
73261
73319
  getConfigEnv: () => getConfigEnv,
73262
73320
  getConfigFile: () => getConfigFile,
@@ -223499,7 +223557,7 @@ ${lanes.join("\n")}
223499
223557
  return true;
223500
223558
  }
223501
223559
  if (shouldReallyMerge(a2.node, b6.node, parent2)) {
223502
- merge2(a2, b6);
223560
+ merge3(a2, b6);
223503
223561
  return true;
223504
223562
  }
223505
223563
  return false;
@@ -223533,7 +223591,7 @@ ${lanes.join("\n")}
223533
223591
  }
223534
223592
  return a2.body.kind === b6.body.kind && (a2.body.kind !== 267 || areSameModule(a2.body, b6.body));
223535
223593
  }
223536
- function merge2(target, source) {
223594
+ function merge3(target, source) {
223537
223595
  target.additionalNodes = target.additionalNodes || [];
223538
223596
  target.additionalNodes.push(source.node);
223539
223597
  if (source.additionalNodes) {
@@ -288035,8 +288093,8 @@ var require_merge2 = __commonJS({
288035
288093
  var Stream = require("stream");
288036
288094
  var PassThrough = Stream.PassThrough;
288037
288095
  var slice = Array.prototype.slice;
288038
- module2.exports = merge2;
288039
- function merge2() {
288096
+ module2.exports = merge22;
288097
+ function merge22() {
288040
288098
  const streamsQueue = [];
288041
288099
  const args = slice.call(arguments);
288042
288100
  let merging = false;
@@ -288153,9 +288211,9 @@ var require_stream = __commonJS({
288153
288211
  "use strict";
288154
288212
  Object.defineProperty(exports2, "__esModule", { value: true });
288155
288213
  exports2.merge = void 0;
288156
- var merge2 = require_merge2();
288214
+ var merge22 = require_merge2();
288157
288215
  function merge3(streams) {
288158
- const mergedStream = merge2(streams);
288216
+ const mergedStream = merge22(streams);
288159
288217
  streams.forEach((stream) => {
288160
288218
  stream.once("error", (error) => mergedStream.emit("error", error));
288161
288219
  });
@@ -295071,7 +295129,7 @@ var withRunExecutor = (name, executorFn, executorOptions) => async (_options, co
295071
295129
  writeTrace2(
295072
295130
  `Loaded Storm config into env:
295073
295131
  ${Object.keys(process.env).filter((key) => key.startsWith("STORM_")).map(
295074
- (key) => ` - ${key}=${_isFunction(process.env[key]) ? "<function>" : JSON.stringify(process.env[key])}`
295132
+ (key) => ` - ${key}=${_isFunction2(process.env[key]) ? "<function>" : JSON.stringify(process.env[key])}`
295075
295133
  ).join("\n")}`,
295076
295134
  config
295077
295135
  );
@@ -295086,7 +295144,7 @@ ${Object.keys(process.env).filter((key) => key.startsWith("STORM_")).map(
295086
295144
  writeTrace2(
295087
295145
  `Executor schema options \u2699\uFE0F
295088
295146
  ${Object.keys(options).map(
295089
- (key) => ` - ${key}=${_isFunction(options[key]) ? "<function>" : JSON.stringify(options[key])}`
295147
+ (key) => ` - ${key}=${_isFunction2(options[key]) ? "<function>" : JSON.stringify(options[key])}`
295090
295148
  ).join("\n")}`,
295091
295149
  config
295092
295150
  );
@@ -295111,7 +295169,7 @@ ${Object.keys(options).map(
295111
295169
  writeDebug2("Completed the preProcess hook", config);
295112
295170
  }
295113
295171
  const ret = executorFn(tokenized, context, config);
295114
- if (_isFunction(ret?.next)) {
295172
+ if (_isFunction2(ret?.next)) {
295115
295173
  const asyncGen = ret;
295116
295174
  for await (const iter of asyncGen) {
295117
295175
  }
@@ -295152,7 +295210,7 @@ ${Object.keys(options).map(
295152
295210
  stopwatch();
295153
295211
  }
295154
295212
  };
295155
- var _isFunction = (value2) => {
295213
+ var _isFunction2 = (value2) => {
295156
295214
  try {
295157
295215
  return value2 instanceof Function || typeof value2 === "function" || !!(value2?.constructor && value2?.call && value2?.apply);
295158
295216
  } catch (e2) {