@storm-software/workspace-tools 1.71.0 → 1.72.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.
@@ -72462,8 +72462,9 @@ var init_schema = __esm({
72462
72462
  "packages/config/src/schema.ts"() {
72463
72463
  init_lib();
72464
72464
  ColorConfigSchema = z4.object({
72465
+ dark: z4.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#1d232a").describe("The dark background color of the workspace"),
72466
+ light: z4.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#f4f4f5").describe("The light background color of the workspace"),
72465
72467
  primary: z4.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#0ea5e9").describe("The primary color of the workspace"),
72466
- background: z4.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#1d232a").describe("The background color of the workspace"),
72467
72468
  success: z4.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#087f5b").describe("The success color of the workspace"),
72468
72469
  info: z4.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#0ea5e9").describe("The informational color of the workspace"),
72469
72470
  warning: z4.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#fcc419").describe("The warning color of the workspace"),
@@ -72498,7 +72499,7 @@ var init_schema = __esm({
72498
72499
  skipCache: z4.boolean().default(false).describe("Should all known types of workspace caching be skipped?"),
72499
72500
  cacheDirectory: z4.string().trim().default("node_modules/.cache/storm").describe("The directory used to store the workspace's cached file data"),
72500
72501
  buildDirectory: z4.string().trim().default("dist").describe("The build directory for the workspace"),
72501
- runtimeDirectory: z4.string().trim().default("node_modules/.storm").describe("The runtime directory of Storm"),
72502
+ outputDirectory: z4.string().trim().default("node_modules/.storm").describe("The runtime directory of Storm"),
72502
72503
  runtimeVersion: z4.string().trim().regex(
72503
72504
  /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/
72504
72505
  ).default("1.0.0").describe("The global version of the Storm runtime"),
@@ -72561,7 +72562,8 @@ var init_get_default_config = __esm({
72561
72562
  init_find_workspace_root();
72562
72563
  DEFAULT_COLOR_CONFIG = {
72563
72564
  primary: "#1fb2a6",
72564
- background: "#1d232a",
72565
+ dark: "#1d232a",
72566
+ light: "#f4f4f5",
72565
72567
  success: "#087f5b",
72566
72568
  info: "#0ea5e9",
72567
72569
  warning: "#fcc419",
@@ -74306,7 +74308,7 @@ var init_logger = __esm({
74306
74308
  init_types2();
74307
74309
  init_get_log_level();
74308
74310
  init_chalk();
74309
- getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
74311
+ getLogFn = (logLevel = LogLevel.INFO, config = {}) => {
74310
74312
  let _chalk = getChalk();
74311
74313
  const configLogLevel = config.logLevel ?? process.env?.STORM_LOG_LEVEL ?? LogLevelLabel.INFO;
74312
74314
  if (typeof logLevel === "number" && (logLevel >= getLogLevel(configLogLevel) || logLevel <= LogLevel.SILENT) || typeof logLevel === "string" && getLogLevel(logLevel) >= getLogLevel(configLogLevel)) {
@@ -74340,7 +74342,7 @@ ${_chalk.bold.hex(config?.colors?.error ? config.colors.error : "#7d1a1a")(">")}
74340
74342
  return (message) => {
74341
74343
  console.warn(
74342
74344
  `
74343
- ${_chalk.bold.hex(config?.colors?.warning ? config.colors.warning : "#fcc419")("> ")} ${_chalk.bold.bgHex(config?.colors?.warning ? config.colors.warning : "#fcc419").whiteBright(" \u26A0 Warn ")} ${_chalk.hex(
74345
+ ${_chalk.bold.hex(config?.colors?.warning ? config.colors.warning : "#fcc419")("> ")} ${_chalk.bold.bgHex(config?.colors?.warning ? config.colors.warning : "#fcc419").whiteBright(" \u26A0 Warn ")} ${_chalk.hex(
74344
74346
  config?.colors?.warning ? config.colors.warning : "#fcc419"
74345
74347
  )(message)}
74346
74348
  `
@@ -74390,14 +74392,14 @@ ${_chalk.bold.hex(config?.colors?.primary ? config.colors.primary : "#1fb2a6")("
74390
74392
  );
74391
74393
  };
74392
74394
  };
74393
- writeFatal = (config, message) => getLogFn(config, LogLevel.FATAL)(message);
74394
- writeError = (config, message) => getLogFn(config, LogLevel.ERROR)(message);
74395
- writeWarning = (config, message) => getLogFn(config, LogLevel.WARN)(message);
74396
- writeInfo = (config, message) => getLogFn(config, LogLevel.INFO)(message);
74397
- writeSuccess = (config, message) => getLogFn(config, LogLevel.SUCCESS)(message);
74398
- writeDebug = (config, message) => getLogFn(config, LogLevel.DEBUG)(message);
74399
- writeTrace = (config, message) => getLogFn(config, LogLevel.TRACE)(message);
74400
- writeSystem = (config, message) => getLogFn(config, LogLevel.ALL)(message);
74395
+ writeFatal = (message, config) => getLogFn(LogLevel.FATAL, config)(message);
74396
+ writeError = (message, config) => getLogFn(LogLevel.ERROR, config)(message);
74397
+ writeWarning = (message, config) => getLogFn(LogLevel.WARN, config)(message);
74398
+ writeInfo = (message, config) => getLogFn(LogLevel.INFO, config)(message);
74399
+ writeSuccess = (message, config) => getLogFn(LogLevel.SUCCESS, config)(message);
74400
+ writeDebug = (message, config) => getLogFn(LogLevel.DEBUG, config)(message);
74401
+ writeTrace = (message, config) => getLogFn(LogLevel.TRACE, config)(message);
74402
+ writeSystem = (message, config) => getLogFn(LogLevel.ALL, config)(message);
74401
74403
  getStopwatch = (name) => {
74402
74404
  const start = process.hrtime();
74403
74405
  return () => {
@@ -74421,40 +74423,43 @@ var init_process_handler = __esm({
74421
74423
  "packages/config-tools/src/utilities/process-handler.ts"() {
74422
74424
  init_logger();
74423
74425
  exitWithError = (config) => {
74424
- writeFatal(config, "Exiting script with an error status...");
74426
+ writeFatal("Exiting script with an error status...", config);
74425
74427
  process.exit(1);
74426
74428
  };
74427
74429
  exitWithSuccess = (config) => {
74428
- writeSuccess(config, "Script completed successfully. Exiting...");
74430
+ writeSuccess("Script completed successfully. Exiting...", config);
74429
74431
  process.exit(0);
74430
74432
  };
74431
74433
  handleProcess = (config) => {
74432
74434
  writeTrace(
74433
- config,
74434
- `Using the following arguments to process the script: ${process.argv.join(", ")}`
74435
+ `Using the following arguments to process the script: ${process.argv.join(", ")}`,
74436
+ config
74435
74437
  );
74436
74438
  process.on("unhandledRejection", (error) => {
74437
- writeError(config, `An Unhandled Rejection occurred while running the program: ${error}`);
74439
+ writeError(
74440
+ `An Unhandled Rejection occurred while running the program: ${error}`,
74441
+ config
74442
+ );
74438
74443
  exitWithError(config);
74439
74444
  });
74440
74445
  process.on("uncaughtException", (error) => {
74441
74446
  writeError(
74442
- config,
74443
74447
  `An Uncaught Exception occurred while running the program: ${error.message}
74444
- Stacktrace: ${error.stack}`
74448
+ Stacktrace: ${error.stack}`,
74449
+ config
74445
74450
  );
74446
74451
  exitWithError(config);
74447
74452
  });
74448
74453
  process.on("SIGTERM", (signal) => {
74449
- writeError(config, `The program terminated with signal code: ${signal}`);
74454
+ writeError(`The program terminated with signal code: ${signal}`, config);
74450
74455
  exitWithError(config);
74451
74456
  });
74452
74457
  process.on("SIGINT", (signal) => {
74453
- writeError(config, `The program terminated with signal code: ${signal}`);
74458
+ writeError(`The program terminated with signal code: ${signal}`, config);
74454
74459
  exitWithError(config);
74455
74460
  });
74456
74461
  process.on("SIGHUP", (signal) => {
74457
- writeError(config, `The program terminated with signal code: ${signal}`);
74462
+ writeError(`The program terminated with signal code: ${signal}`, config);
74458
74463
  exitWithError(config);
74459
74464
  });
74460
74465
  };
@@ -74594,7 +74599,9 @@ var init_get_env = __esm({
74594
74599
  getExtensionEnv = (extensionName) => {
74595
74600
  const prefix = `STORM_EXTENSION_${extensionName.toUpperCase()}_`;
74596
74601
  return Object.keys(process.env).filter((key) => key.startsWith(prefix)).reduce((ret, key) => {
74597
- const name = key.replace(prefix, "").split("_").map((i) => i.length > 0 ? i.trim().charAt(0).toUpperCase() + i.trim().slice(1) : "").join("");
74602
+ const name = key.replace(prefix, "").split("_").map(
74603
+ (i) => i.length > 0 ? i.trim().charAt(0).toUpperCase() + i.trim().slice(1) : ""
74604
+ ).join("");
74598
74605
  if (name) {
74599
74606
  ret[name] = process.env[key];
74600
74607
  }
@@ -74622,14 +74629,15 @@ var init_get_env = __esm({
74622
74629
  skipCache: process.env[`${prefix}SKIP_CACHE`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CACHE`]) : void 0,
74623
74630
  cacheDirectory: correctPaths(process.env[`${prefix}CACHE_DIRECTORY`]),
74624
74631
  runtimeVersion: process.env[`${prefix}RUNTIME_VERSION`],
74625
- runtimeDirectory: correctPaths(process.env[`${prefix}RUNTIME_DIRECTORY`]),
74632
+ outputDirectory: correctPaths(process.env[`${prefix}OUTPUT_DIRECTORY`]),
74626
74633
  env: process.env[`${prefix}ENV`] ?? process.env.NODE_ENV ?? process.env.ENVIRONMENT,
74627
74634
  ci: process.env[`${prefix}CI`] !== void 0 ? Boolean(
74628
74635
  process.env[`${prefix}CI`] ?? process.env.CI ?? process.env.CONTINUOUS_INTEGRATION
74629
74636
  ) : void 0,
74630
74637
  colors: {
74631
74638
  primary: process.env[`${prefix}COLOR_PRIMARY`],
74632
- background: process.env[`${prefix}COLOR_BACKGROUND`],
74639
+ dark: process.env[`${prefix}COLOR_DARK`],
74640
+ light: process.env[`${prefix}COLOR_LIGHT`],
74633
74641
  success: process.env[`${prefix}COLOR_SUCCESS`],
74634
74642
  info: process.env[`${prefix}COLOR_INFO`],
74635
74643
  warning: process.env[`${prefix}COLOR_WARNING`],
@@ -74640,7 +74648,11 @@ var init_get_env = __esm({
74640
74648
  branch: process.env[`${prefix}BRANCH`],
74641
74649
  preid: process.env[`${prefix}PRE_ID`],
74642
74650
  externalPackagePatterns: process.env[`${prefix}EXTERNAL_PACKAGE_PATTERNS`] ? JSON.parse(process.env[`${prefix}EXTERNAL_PACKAGE_PATTERNS`]) : [],
74643
- logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) ? getLogLevelLabel(Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) : process.env[`${prefix}LOG_LEVEL`] : void 0
74651
+ logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(
74652
+ Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
74653
+ ) ? getLogLevelLabel(
74654
+ Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
74655
+ ) : process.env[`${prefix}LOG_LEVEL`] : void 0
74644
74656
  };
74645
74657
  const serializedConfig = process.env[`${prefix}CONFIG`];
74646
74658
  if (serializedConfig) {
@@ -74735,10 +74747,14 @@ var init_set_env = __esm({
74735
74747
  process.env.NX_WORKSPACE_ROOT_PATH = correctPaths(config.workspaceRoot);
74736
74748
  }
74737
74749
  if (config.packageDirectory) {
74738
- process.env[`${prefix}PACKAGE_DIRECTORY`] = correctPaths(config.packageDirectory);
74750
+ process.env[`${prefix}PACKAGE_DIRECTORY`] = correctPaths(
74751
+ config.packageDirectory
74752
+ );
74739
74753
  }
74740
74754
  if (config.buildDirectory) {
74741
- process.env[`${prefix}BUILD_DIRECTORY`] = correctPaths(config.buildDirectory);
74755
+ process.env[`${prefix}BUILD_DIRECTORY`] = correctPaths(
74756
+ config.buildDirectory
74757
+ );
74742
74758
  }
74743
74759
  if (config.skipCache !== void 0) {
74744
74760
  process.env[`${prefix}SKIP_CACHE`] = String(config.skipCache);
@@ -74748,13 +74764,17 @@ var init_set_env = __esm({
74748
74764
  }
74749
74765
  }
74750
74766
  if (!config.skipCache && config.cacheDirectory) {
74751
- process.env[`${prefix}CACHE_DIRECTORY`] = correctPaths(config.cacheDirectory);
74767
+ process.env[`${prefix}CACHE_DIRECTORY`] = correctPaths(
74768
+ config.cacheDirectory
74769
+ );
74752
74770
  }
74753
74771
  if (config.runtimeVersion) {
74754
74772
  process.env[`${prefix}RUNTIME_VERSION`] = config.runtimeVersion;
74755
74773
  }
74756
- if (config.runtimeDirectory) {
74757
- process.env[`${prefix}RUNTIME_DIRECTORY`] = correctPaths(config.runtimeDirectory);
74774
+ if (config.outputDirectory) {
74775
+ process.env[`${prefix}OUTPUT_DIRECTORY`] = correctPaths(
74776
+ config.outputDirectory
74777
+ );
74758
74778
  }
74759
74779
  if (config.env) {
74760
74780
  process.env[`${prefix}ENV`] = config.env;
@@ -74769,8 +74789,11 @@ var init_set_env = __esm({
74769
74789
  if (config.colors.primary) {
74770
74790
  process.env[`${prefix}COLOR_PRIMARY`] = config.colors.primary;
74771
74791
  }
74772
- if (config.colors.background) {
74773
- process.env[`${prefix}COLOR_BACKGROUND`] = config.colors.background;
74792
+ if (config.colors.dark) {
74793
+ process.env[`${prefix}COLOR_DARK`] = config.colors.dark;
74794
+ }
74795
+ if (config.colors.light) {
74796
+ process.env[`${prefix}COLOR_LIGHT`] = config.colors.light;
74774
74797
  }
74775
74798
  if (config.colors.success) {
74776
74799
  process.env[`${prefix}COLOR_SUCCESS`] = config.colors.success;
@@ -74851,10 +74874,7 @@ var init_create_storm_config = __esm({
74851
74874
  if (schema && extensionName) {
74852
74875
  result.extensions = {
74853
74876
  ...result.extensions,
74854
- [extensionName]: createConfigExtension(
74855
- extensionName,
74856
- schema
74857
- )
74877
+ [extensionName]: createConfigExtension(extensionName, schema)
74858
74878
  };
74859
74879
  }
74860
74880
  _static_cache = result;
@@ -74881,8 +74901,8 @@ var init_create_storm_config = __esm({
74881
74901
  const configFile = await getConfigFile(_workspaceRoot);
74882
74902
  if (!configFile) {
74883
74903
  writeWarning(
74884
- { logLevel: "all" },
74885
- "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.\n"
74904
+ "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.\n",
74905
+ { logLevel: "all" }
74886
74906
  );
74887
74907
  }
74888
74908
  config = StormConfigSchema.parse(
@@ -305001,8 +305021,8 @@ var withRunExecutor = (name, executorFn, executorOptions) => async (_options, co
305001
305021
  let options = _options;
305002
305022
  let config;
305003
305023
  try {
305004
- writeInfo2(config, `\u26A1 Running the ${name} executor...
305005
- `);
305024
+ writeInfo2(`\u26A1 Running the ${name} executor...
305025
+ `, config);
305006
305026
  if (!context.projectsConfigurations?.projects || !context.projectName || !context.projectsConfigurations.projects[context.projectName]) {
305007
305027
  throw new Error(
305008
305028
  "The Build process failed because the context is not valid. Please run this command from a workspace."
@@ -305014,34 +305034,36 @@ var withRunExecutor = (name, executorFn, executorOptions) => async (_options, co
305014
305034
  const projectName = context.projectsConfigurations.projects[context.projectName]?.name ?? context.projectName;
305015
305035
  if (!executorOptions.skipReadingConfig) {
305016
305036
  writeDebug2(
305017
- config,
305018
305037
  `Loading the Storm Config from environment variables and storm.config.js file...
305019
305038
  - workspaceRoot: ${workspaceRoot}
305020
305039
  - projectRoot: ${projectRoot}
305021
305040
  - sourceRoot: ${sourceRoot}
305022
305041
  - projectName: ${projectName}
305023
- `
305042
+ `,
305043
+ config
305024
305044
  );
305025
305045
  config = await loadStormConfig2(workspaceRoot);
305026
305046
  writeTrace2(
305027
- config,
305028
305047
  `Loaded Storm config into env:
305029
305048
  ${Object.keys(process.env).filter((key) => key.startsWith("STORM_")).map(
305030
305049
  (key) => ` - ${key}=${_isFunction(process.env[key]) ? "<function>" : JSON.stringify(process.env[key])}`
305031
- ).join("\n")}`
305050
+ ).join("\n")}`,
305051
+ config
305032
305052
  );
305033
305053
  }
305034
305054
  if (executorOptions?.hooks?.applyDefaultOptions) {
305035
- writeDebug2(config, "Running the applyDefaultOptions hook...");
305036
- options = await Promise.resolve(executorOptions.hooks.applyDefaultOptions(options, config));
305037
- writeDebug2(config, "Completed the applyDefaultOptions hook");
305055
+ writeDebug2("Running the applyDefaultOptions hook...", config);
305056
+ options = await Promise.resolve(
305057
+ executorOptions.hooks.applyDefaultOptions(options, config)
305058
+ );
305059
+ writeDebug2("Completed the applyDefaultOptions hook", config);
305038
305060
  }
305039
305061
  writeTrace2(
305040
- config,
305041
305062
  `Executor schema options \u2699\uFE0F
305042
305063
  ${Object.keys(options).map(
305043
305064
  (key) => ` - ${key}=${_isFunction(options[key]) ? "<function>" : JSON.stringify(options[key])}`
305044
- ).join("\n")}`
305065
+ ).join("\n")}`,
305066
+ config
305045
305067
  );
305046
305068
  const tokenized = await applyWorkspaceTokens(
305047
305069
  options,
@@ -305057,36 +305079,40 @@ ${Object.keys(options).map(
305057
305079
  applyWorkspaceExecutorTokens
305058
305080
  );
305059
305081
  if (executorOptions?.hooks?.preProcess) {
305060
- writeDebug2(config, "Running the preProcess hook...");
305061
- await Promise.resolve(executorOptions.hooks.preProcess(tokenized, config));
305062
- writeDebug2(config, "Completed the preProcess hook");
305082
+ writeDebug2("Running the preProcess hook...", config);
305083
+ await Promise.resolve(
305084
+ executorOptions.hooks.preProcess(tokenized, config)
305085
+ );
305086
+ writeDebug2("Completed the preProcess hook", config);
305063
305087
  }
305064
- const result = await Promise.resolve(executorFn(tokenized, context, config));
305088
+ const result = await Promise.resolve(
305089
+ executorFn(tokenized, context, config)
305090
+ );
305065
305091
  if (result && (!result.success || result.error && result?.error?.message && typeof result?.error?.message === "string" && result?.error?.name && typeof result?.error?.name === "string")) {
305066
305092
  throw new Error(`The ${name} executor failed to run`, {
305067
305093
  cause: result?.error
305068
305094
  });
305069
305095
  }
305070
305096
  if (executorOptions?.hooks?.postProcess) {
305071
- writeDebug2(config, "Running the postProcess hook...");
305097
+ writeDebug2("Running the postProcess hook...", config);
305072
305098
  await Promise.resolve(executorOptions.hooks.postProcess(config));
305073
- writeDebug2(config, "Completed the postProcess hook");
305099
+ writeDebug2("Completed the postProcess hook", config);
305074
305100
  }
305075
- writeSuccess2(config, `Completed running the ${name} task executor!
305076
- `);
305101
+ writeSuccess2(`Completed running the ${name} task executor!
305102
+ `, config);
305077
305103
  return {
305078
305104
  success: true
305079
305105
  };
305080
305106
  } catch (error) {
305081
305107
  writeFatal2(
305082
- config,
305083
- "A fatal error occurred while running the executor - the process was forced to terminate"
305108
+ "A fatal error occurred while running the executor - the process was forced to terminate",
305109
+ config
305084
305110
  );
305085
305111
  writeError2(
305086
- config,
305087
305112
  `An exception was thrown in the executor's process
305088
305113
  - Details: ${error.message}
305089
- - Stacktrace: ${error.stack}`
305114
+ - Stacktrace: ${error.stack}`,
305115
+ config
305090
305116
  );
305091
305117
  return {
305092
305118
  success: false
@@ -305108,7 +305134,7 @@ var import_TypiaProgrammer = __toESM(require_TypiaProgrammer());
305108
305134
  async function typiaExecutorFn(options, _4, config) {
305109
305135
  const { writeInfo: writeInfo2 } = await Promise.resolve().then(() => (init_src2(), src_exports));
305110
305136
  if (options.clean !== false) {
305111
- writeInfo2(config, `\u{1F9F9} Cleaning output path: ${options.outputPath}`);
305137
+ writeInfo2(`\u{1F9F9} Cleaning output path: ${options.outputPath}`, config);
305112
305138
  (0, import_fs_extra.removeSync)(options.outputPath);
305113
305139
  }
305114
305140
  await import_TypiaProgrammer.TypiaProgrammer.build({