@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.
@@ -48787,8 +48787,8 @@ var require_pax = __commonJS({
48787
48787
  return len + s2;
48788
48788
  }
48789
48789
  };
48790
- Pax.parse = (string, ex, g4) => new Pax(merge2(parseKV(string), ex), g4);
48791
- var merge2 = (a2, b6) => b6 ? Object.keys(a2).reduce((s2, k4) => (s2[k4] = a2[k4], s2), b6) : a2;
48790
+ Pax.parse = (string, ex, g4) => new Pax(merge3(parseKV(string), ex), g4);
48791
+ var merge3 = (a2, b6) => b6 ? Object.keys(a2).reduce((s2, k4) => (s2[k4] = a2[k4], s2), b6) : a2;
48792
48792
  var parseKV = (string) => string.replace(/\n$/, "").split("\n").reduce(parseKVLine, /* @__PURE__ */ Object.create(null));
48793
48793
  var parseKVLine = (set, line) => {
48794
48794
  const n = parseInt(line, 10);
@@ -69007,64 +69007,6 @@ var require_cjs = __commonJS({
69007
69007
  }
69008
69008
  });
69009
69009
 
69010
- // packages/config-tools/src/config-file/get-config-file.ts
69011
- var import_deepmerge, getConfigFileByName, getConfigFile;
69012
- var init_get_config_file = __esm({
69013
- "packages/config-tools/src/config-file/get-config-file.ts"() {
69014
- init_find_workspace_root();
69015
- init_dist10();
69016
- import_deepmerge = __toESM(require_cjs());
69017
- getConfigFileByName = async (fileName, filePath) => {
69018
- const workspacePath = filePath ? filePath : findWorkspaceRoot(filePath);
69019
- return loadConfig({
69020
- cwd: workspacePath,
69021
- packageJson: true,
69022
- name: fileName,
69023
- envName: fileName?.toUpperCase(),
69024
- jitiOptions: {
69025
- debug: true,
69026
- cache: process.env.STORM_CACHE ? process.env.STORM_CACHE_DIRECTORY : false
69027
- }
69028
- });
69029
- };
69030
- getConfigFile = async (filePath, additionalFileNames = []) => {
69031
- const workspacePath = filePath ? filePath : findWorkspaceRoot(filePath);
69032
- let { config, configFile } = await loadConfig({
69033
- cwd: workspacePath,
69034
- name: "storm"
69035
- });
69036
- if (additionalFileNames && additionalFileNames.length > 0) {
69037
- const results = await Promise.all(
69038
- additionalFileNames.map(
69039
- (fileName) => loadConfig({
69040
- cwd: workspacePath,
69041
- name: fileName
69042
- })
69043
- )
69044
- );
69045
- for (const result of results) {
69046
- if (result) {
69047
- config = (0, import_deepmerge.default)(config ?? {}, result.config ?? {});
69048
- }
69049
- }
69050
- }
69051
- if (!config) {
69052
- return void 0;
69053
- }
69054
- config.configFile = configFile;
69055
- config.runtimeVersion = "0.0.1";
69056
- return config;
69057
- };
69058
- }
69059
- });
69060
-
69061
- // packages/config-tools/src/config-file/index.ts
69062
- var init_config_file = __esm({
69063
- "packages/config-tools/src/config-file/index.ts"() {
69064
- init_get_config_file();
69065
- }
69066
- });
69067
-
69068
69010
  // node_modules/.pnpm/zod@3.22.4/node_modules/zod/lib/index.mjs
69069
69011
  function setErrorMap(map) {
69070
69012
  overrideErrorMap = map;
@@ -74712,7 +74654,7 @@ var init_chalk = __esm({
74712
74654
  });
74713
74655
 
74714
74656
  // packages/config-tools/src/utilities/logger.ts
74715
- var getLogFn, writeFatal, writeError, writeWarning, writeInfo, writeSuccess, writeDebug, writeTrace, writeSystem, getStopwatch;
74657
+ var getLogFn, writeFatal, writeError, writeWarning, writeInfo, writeSuccess, writeDebug, writeTrace, writeSystem, getStopwatch, formatLogMessage, _isFunction;
74716
74658
  var init_logger = __esm({
74717
74659
  "packages/config-tools/src/utilities/logger.ts"() {
74718
74660
  init_types2();
@@ -74731,7 +74673,9 @@ var init_logger = __esm({
74731
74673
  return (message) => {
74732
74674
  console.error(
74733
74675
  `
74734
- ${_chalk.bold.hex(colors.error)(">")} ${_chalk.bold.bgHex(colors.fatal).whiteBright(" \u{1F480} Fatal ")} ${_chalk.hex(colors.error)(message)}
74676
+ ${_chalk.bold.hex(colors.error ?? "#f85149")(">")} ${_chalk.bold.bgHex(colors.fatal ?? "#b62324").whiteBright(
74677
+ " \u{1F480} Fatal "
74678
+ )} ${_chalk.hex(colors.error ?? "#f85149")(formatLogMessage(message))}
74735
74679
 
74736
74680
  `
74737
74681
  );
@@ -74741,7 +74685,9 @@ ${_chalk.bold.hex(colors.error)(">")} ${_chalk.bold.bgHex(colors.fatal).whiteBri
74741
74685
  return (message) => {
74742
74686
  console.error(
74743
74687
  `
74744
- ${_chalk.bold.hex(colors.error)(">")} ${_chalk.bold.bgHex(colors.error).whiteBright(" \u2718 Error ")} ${_chalk.hex(colors.error)(message)}
74688
+ ${_chalk.bold.hex(colors.error ?? "#f85149")(">")} ${_chalk.bold.bgHex(colors.error ?? "#f85149").whiteBright(
74689
+ " \u2718 Error "
74690
+ )} ${_chalk.hex(colors.error ?? "#f85149")(formatLogMessage(message))}
74745
74691
  `
74746
74692
  );
74747
74693
  };
@@ -74750,7 +74696,9 @@ ${_chalk.bold.hex(colors.error)(">")} ${_chalk.bold.bgHex(colors.error).whiteBri
74750
74696
  return (message) => {
74751
74697
  console.warn(
74752
74698
  `
74753
- ${_chalk.bold.hex(colors.warning)("> ")} ${_chalk.bold.bgHex(colors.warning).whiteBright(" \u26A0 Warn ")} ${_chalk.hex(colors.warning)(message)}
74699
+ ${_chalk.bold.hex(colors.warning ?? "#e3b341")("> ")} ${_chalk.bold.bgHex(colors.warning ?? "#e3b341").whiteBright(
74700
+ " \u26A0 Warn "
74701
+ )} ${_chalk.hex(colors.warning ?? "#e3b341")(formatLogMessage(message))}
74754
74702
  `
74755
74703
  );
74756
74704
  };
@@ -74759,7 +74707,9 @@ ${_chalk.bold.hex(colors.warning)("> ")} ${_chalk.bold.bgHex(colors.warning).whi
74759
74707
  return (message) => {
74760
74708
  console.info(
74761
74709
  `
74762
- ${_chalk.bold.hex(colors.success)(">")} ${_chalk.bold.bgHex(colors.success).whiteBright(" \u2713 Success ")} ${_chalk.hex(colors.success)(message)}
74710
+ ${_chalk.bold.hex(colors.success ?? "#56d364")(">")} ${_chalk.bold.bgHex(colors.success ?? "#56d364").whiteBright(
74711
+ " \u2713 Success "
74712
+ )} ${_chalk.hex(colors.success ?? "#56d364")(formatLogMessage(message))}
74763
74713
  `
74764
74714
  );
74765
74715
  };
@@ -74768,7 +74718,9 @@ ${_chalk.bold.hex(colors.success)(">")} ${_chalk.bold.bgHex(colors.success).whit
74768
74718
  return (message) => {
74769
74719
  console.info(
74770
74720
  `
74771
- ${_chalk.bold.hex(colors.info)(">")} ${_chalk.bold.bgHex(colors.info).whiteBright(" \u2139 Info ")} ${_chalk.hex(colors.info)(message)}
74721
+ ${_chalk.bold.hex(colors.info ?? "#58a6ff")(">")} ${_chalk.bold.bgHex(colors.info ?? "#58a6ff").whiteBright(
74722
+ " \u2139 Info "
74723
+ )} ${_chalk.hex(colors.info ?? "#58a6ff")(formatLogMessage(message))}
74772
74724
  `
74773
74725
  );
74774
74726
  };
@@ -74777,7 +74729,9 @@ ${_chalk.bold.hex(colors.info)(">")} ${_chalk.bold.bgHex(colors.info).whiteBrigh
74777
74729
  return (message) => {
74778
74730
  console.debug(
74779
74731
  `
74780
- ${_chalk.bold.hex(colors.primary)(">")} ${_chalk.bold.bgHex(colors.primary).whiteBright(" \u{1F6E0} Debug ")} ${_chalk.hex(colors.primary)(message)}
74732
+ ${_chalk.bold.hex(colors.primary ?? "#1fb2a6")(">")} ${_chalk.bold.bgHex(colors.primary ?? "#1fb2a6").whiteBright(
74733
+ " \u{1F6E0} Debug "
74734
+ )} ${_chalk.hex(colors.primary ?? "#1fb2a6")(formatLogMessage(message))}
74781
74735
  `
74782
74736
  );
74783
74737
  };
@@ -74785,7 +74739,9 @@ ${_chalk.bold.hex(colors.primary)(">")} ${_chalk.bold.bgHex(colors.primary).whit
74785
74739
  return (message) => {
74786
74740
  console.log(
74787
74741
  `
74788
- ${_chalk.bold.hex(colors.primary)(">")} ${_chalk.bold.bgHex(colors.primary).whiteBright(" \u2709 System ")} ${_chalk.hex(colors.primary)(message)}
74742
+ ${_chalk.bold.hex(colors.primary ?? "#1fb2a6")(">")} ${_chalk.bold.bgHex(colors.primary ?? "#1fb2a6").whiteBright(
74743
+ " \u2709 System "
74744
+ )} ${_chalk.hex(colors.primary ?? "#1fb2a6")(formatLogMessage(message))}
74789
74745
  `
74790
74746
  );
74791
74747
  };
@@ -74812,6 +74768,19 @@ ${_chalk.bold.hex(colors.primary)(">")} ${_chalk.bold.bgHex(colors.primary).whit
74812
74768
  );
74813
74769
  };
74814
74770
  };
74771
+ formatLogMessage = (message, prefix = "-") => {
74772
+ return typeof message === "string" ? message : typeof message === "object" ? Object.keys(message).map(
74773
+ (key) => ` ${prefix} ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" ? `
74774
+ ${formatLogMessage(message[key], `${prefix}-`)}` : message[key]}`
74775
+ ).join("\n") : message;
74776
+ };
74777
+ _isFunction = (value2) => {
74778
+ try {
74779
+ return value2 instanceof Function || typeof value2 === "function" || !!(value2?.constructor && value2?.call && value2?.apply);
74780
+ } catch (e2) {
74781
+ return false;
74782
+ }
74783
+ };
74815
74784
  }
74816
74785
  });
74817
74786
 
@@ -74988,6 +74957,94 @@ var init_utilities = __esm({
74988
74957
  }
74989
74958
  });
74990
74959
 
74960
+ // packages/config-tools/src/config-file/get-config-file.ts
74961
+ var import_deepmerge, getConfigFileByName, getConfigFile;
74962
+ var init_get_config_file = __esm({
74963
+ "packages/config-tools/src/config-file/get-config-file.ts"() {
74964
+ init_find_workspace_root();
74965
+ init_dist10();
74966
+ import_deepmerge = __toESM(require_cjs());
74967
+ init_utilities();
74968
+ getConfigFileByName = async (fileName, filePath, options = {}) => {
74969
+ const workspacePath = filePath ? filePath : findWorkspaceRoot(filePath);
74970
+ let config = loadConfig({
74971
+ cwd: workspacePath,
74972
+ packageJson: true,
74973
+ name: fileName,
74974
+ envName: fileName?.toUpperCase(),
74975
+ jitiOptions: {
74976
+ debug: true,
74977
+ cache: process.env.STORM_CACHE ? process.env.STORM_CACHE_DIRECTORY : false
74978
+ },
74979
+ ...options
74980
+ });
74981
+ if (!config || Object.keys(config).length === 0) {
74982
+ config = loadConfig({
74983
+ cwd: workspacePath,
74984
+ packageJson: true,
74985
+ name: fileName,
74986
+ envName: fileName?.toUpperCase(),
74987
+ jitiOptions: {
74988
+ debug: true,
74989
+ cache: process.env.STORM_CACHE ? process.env.STORM_CACHE_DIRECTORY : false
74990
+ },
74991
+ configFile: fileName,
74992
+ ...options
74993
+ });
74994
+ }
74995
+ return config;
74996
+ };
74997
+ getConfigFile = async (filePath, additionalFileNames = []) => {
74998
+ const workspacePath = filePath ? filePath : findWorkspaceRoot(filePath);
74999
+ let { config, configFile } = await getConfigFileByName(
75000
+ "storm",
75001
+ workspacePath
75002
+ );
75003
+ if (config && Object.keys(config).length > 0) {
75004
+ writeTrace(
75005
+ `Found Storm configuration file "${configFile}" at "${workspacePath}"`,
75006
+ {
75007
+ logLevel: "all"
75008
+ }
75009
+ );
75010
+ writeTrace(config, { logLevel: "all" });
75011
+ }
75012
+ if (additionalFileNames && additionalFileNames.length > 0) {
75013
+ const results = await Promise.all(
75014
+ additionalFileNames.map(
75015
+ (fileName) => getConfigFileByName(fileName, workspacePath)
75016
+ )
75017
+ );
75018
+ for (const result of results) {
75019
+ if (result?.config && Object.keys(result.config).length > 0) {
75020
+ writeTrace(
75021
+ `Found additional configuration file "${result.configFile}" at "${workspacePath}"`,
75022
+ {
75023
+ logLevel: "all"
75024
+ }
75025
+ );
75026
+ writeTrace(result.config, { logLevel: "all" });
75027
+ config = (0, import_deepmerge.default)(config ?? {}, result.config ?? {});
75028
+ }
75029
+ }
75030
+ }
75031
+ if (!config) {
75032
+ return void 0;
75033
+ }
75034
+ config.configFile = configFile;
75035
+ config.runtimeVersion = "0.0.1";
75036
+ return config;
75037
+ };
75038
+ }
75039
+ });
75040
+
75041
+ // packages/config-tools/src/config-file/index.ts
75042
+ var init_config_file = __esm({
75043
+ "packages/config-tools/src/config-file/index.ts"() {
75044
+ init_get_config_file();
75045
+ }
75046
+ });
75047
+
74991
75048
  // packages/config-tools/src/env/get-env.ts
74992
75049
  var getExtensionEnv, getConfigEnv, getThemeColorConfigEnv, getSingleThemeColorConfigEnv, getMultiThemeColorConfigEnv, getBaseThemeColorConfigEnv;
74993
75050
  var init_get_env = __esm({
@@ -75349,7 +75406,7 @@ var init_set_env = __esm({
75349
75406
  });
75350
75407
 
75351
75408
  // packages/config-tools/src/create-storm-config.ts
75352
- var _extension_cache, _static_cache, createConfig, createStormConfig, createConfigExtension, loadStormConfig;
75409
+ var import_deepmerge2, _extension_cache, _static_cache, createConfig, createStormConfig, createConfigExtension, loadStormConfig;
75353
75410
  var init_create_storm_config = __esm({
75354
75411
  "packages/config-tools/src/create-storm-config.ts"() {
75355
75412
  init_get_config_file();
@@ -75358,6 +75415,7 @@ var init_create_storm_config = __esm({
75358
75415
  init_schema();
75359
75416
  init_utilities();
75360
75417
  init_get_default_config();
75418
+ import_deepmerge2 = __toESM(require_cjs());
75361
75419
  _extension_cache = /* @__PURE__ */ new WeakMap();
75362
75420
  _static_cache = void 0;
75363
75421
  createConfig = (workspaceRoot) => {
@@ -75406,7 +75464,9 @@ var init_create_storm_config = __esm({
75406
75464
  if (!_workspaceRoot) {
75407
75465
  _workspaceRoot = findWorkspaceRoot();
75408
75466
  }
75409
- const configFile = await getConfigFile(_workspaceRoot);
75467
+ let configFile = await getConfigFile(
75468
+ _workspaceRoot
75469
+ );
75410
75470
  if (!configFile) {
75411
75471
  writeWarning(
75412
75472
  "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",
@@ -75415,10 +75475,7 @@ var init_create_storm_config = __esm({
75415
75475
  }
75416
75476
  config = StormConfigSchema.parse(
75417
75477
  await getDefaultConfig(
75418
- {
75419
- ...getConfigEnv(),
75420
- ...configFile
75421
- },
75478
+ (0, import_deepmerge2.default)(getConfigEnv(), configFile, {}),
75422
75479
  _workspaceRoot
75423
75480
  )
75424
75481
  );
@@ -75456,6 +75513,7 @@ __export(src_exports, {
75456
75513
  findFileName: () => findFileName,
75457
75514
  findWorkspaceRoot: () => findWorkspaceRoot,
75458
75515
  findWorkspaceRootSafe: () => findWorkspaceRootSafe,
75516
+ formatLogMessage: () => formatLogMessage,
75459
75517
  getChalk: () => getChalk,
75460
75518
  getConfigEnv: () => getConfigEnv,
75461
75519
  getConfigFile: () => getConfigFile,
@@ -224774,7 +224832,7 @@ ${lanes.join("\n")}
224774
224832
  return true;
224775
224833
  }
224776
224834
  if (shouldReallyMerge(a2.node, b6.node, parent2)) {
224777
- merge2(a2, b6);
224835
+ merge3(a2, b6);
224778
224836
  return true;
224779
224837
  }
224780
224838
  return false;
@@ -224808,7 +224866,7 @@ ${lanes.join("\n")}
224808
224866
  }
224809
224867
  return a2.body.kind === b6.body.kind && (a2.body.kind !== 267 || areSameModule(a2.body, b6.body));
224810
224868
  }
224811
- function merge2(target, source) {
224869
+ function merge3(target, source) {
224812
224870
  target.additionalNodes = target.additionalNodes || [];
224813
224871
  target.additionalNodes.push(source.node);
224814
224872
  if (source.additionalNodes) {
@@ -305553,7 +305611,7 @@ var withRunExecutor = (name, executorFn, executorOptions) => async (_options, co
305553
305611
  writeTrace2(
305554
305612
  `Loaded Storm config into env:
305555
305613
  ${Object.keys(process.env).filter((key) => key.startsWith("STORM_")).map(
305556
- (key) => ` - ${key}=${_isFunction(process.env[key]) ? "<function>" : JSON.stringify(process.env[key])}`
305614
+ (key) => ` - ${key}=${_isFunction2(process.env[key]) ? "<function>" : JSON.stringify(process.env[key])}`
305557
305615
  ).join("\n")}`,
305558
305616
  config
305559
305617
  );
@@ -305568,7 +305626,7 @@ ${Object.keys(process.env).filter((key) => key.startsWith("STORM_")).map(
305568
305626
  writeTrace2(
305569
305627
  `Executor schema options \u2699\uFE0F
305570
305628
  ${Object.keys(options).map(
305571
- (key) => ` - ${key}=${_isFunction(options[key]) ? "<function>" : JSON.stringify(options[key])}`
305629
+ (key) => ` - ${key}=${_isFunction2(options[key]) ? "<function>" : JSON.stringify(options[key])}`
305572
305630
  ).join("\n")}`,
305573
305631
  config
305574
305632
  );
@@ -305593,7 +305651,7 @@ ${Object.keys(options).map(
305593
305651
  writeDebug2("Completed the preProcess hook", config);
305594
305652
  }
305595
305653
  const ret = executorFn(tokenized, context, config);
305596
- if (_isFunction(ret?.next)) {
305654
+ if (_isFunction2(ret?.next)) {
305597
305655
  const asyncGen = ret;
305598
305656
  for await (const iter of asyncGen) {
305599
305657
  }
@@ -305634,7 +305692,7 @@ ${Object.keys(options).map(
305634
305692
  stopwatch();
305635
305693
  }
305636
305694
  };
305637
- var _isFunction = (value2) => {
305695
+ var _isFunction2 = (value2) => {
305638
305696
  try {
305639
305697
  return value2 instanceof Function || typeof value2 === "function" || !!(value2?.constructor && value2?.call && value2?.apply);
305640
305698
  } catch (e2) {