@storm-software/workspace-tools 1.42.4 → 1.43.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.
package/src/base/index.js CHANGED
@@ -1974,14 +1974,14 @@ var require_templates = __commonJS({
1974
1974
  }
1975
1975
  return results;
1976
1976
  }
1977
- function buildStyle(chalk3, styles) {
1977
+ function buildStyle(chalk4, styles) {
1978
1978
  const enabled = {};
1979
1979
  for (const layer of styles) {
1980
1980
  for (const style of layer.styles) {
1981
1981
  enabled[style[0]] = layer.inverse ? null : style.slice(1);
1982
1982
  }
1983
1983
  }
1984
- let current = chalk3;
1984
+ let current = chalk4;
1985
1985
  for (const styleName of Object.keys(enabled)) {
1986
1986
  if (Array.isArray(enabled[styleName])) {
1987
1987
  if (!(styleName in current)) {
@@ -1996,7 +1996,7 @@ var require_templates = __commonJS({
1996
1996
  }
1997
1997
  return current;
1998
1998
  }
1999
- module2.exports = (chalk3, tmp) => {
1999
+ module2.exports = (chalk4, tmp) => {
2000
2000
  const styles = [];
2001
2001
  const chunks = [];
2002
2002
  let chunk = [];
@@ -2006,13 +2006,13 @@ var require_templates = __commonJS({
2006
2006
  } else if (style) {
2007
2007
  const str = chunk.join("");
2008
2008
  chunk = [];
2009
- chunks.push(styles.length === 0 ? str : buildStyle(chalk3, styles)(str));
2009
+ chunks.push(styles.length === 0 ? str : buildStyle(chalk4, styles)(str));
2010
2010
  styles.push({ inverse, styles: parseStyle(style) });
2011
2011
  } else if (close) {
2012
2012
  if (styles.length === 0) {
2013
2013
  throw new Error("Found extraneous } in Chalk template literal");
2014
2014
  }
2015
- chunks.push(buildStyle(chalk3, styles)(chunk.join("")));
2015
+ chunks.push(buildStyle(chalk4, styles)(chunk.join("")));
2016
2016
  chunk = [];
2017
2017
  styles.pop();
2018
2018
  } else {
@@ -2049,16 +2049,16 @@ var require_chalk = __commonJS({
2049
2049
  }
2050
2050
  function Chalk(options) {
2051
2051
  if (!this || !(this instanceof Chalk) || this.template) {
2052
- const chalk3 = {};
2053
- applyOptions(chalk3, options);
2054
- chalk3.template = function() {
2052
+ const chalk4 = {};
2053
+ applyOptions(chalk4, options);
2054
+ chalk4.template = function() {
2055
2055
  const args = [].slice.call(arguments);
2056
- return chalkTag.apply(null, [chalk3.template].concat(args));
2056
+ return chalkTag.apply(null, [chalk4.template].concat(args));
2057
2057
  };
2058
- Object.setPrototypeOf(chalk3, Chalk.prototype);
2059
- Object.setPrototypeOf(chalk3.template, chalk3);
2060
- chalk3.template.constructor = Chalk;
2061
- return chalk3.template;
2058
+ Object.setPrototypeOf(chalk4, Chalk.prototype);
2059
+ Object.setPrototypeOf(chalk4.template, chalk4);
2060
+ chalk4.template.constructor = Chalk;
2061
+ return chalk4.template;
2062
2062
  }
2063
2063
  applyOptions(this, options);
2064
2064
  }
@@ -2177,7 +2177,7 @@ var require_chalk = __commonJS({
2177
2177
  ansiStyles.dim.open = originalDim;
2178
2178
  return str;
2179
2179
  }
2180
- function chalkTag(chalk3, strings) {
2180
+ function chalkTag(chalk4, strings) {
2181
2181
  if (!Array.isArray(strings)) {
2182
2182
  return [].slice.call(arguments, 1).join(" ");
2183
2183
  }
@@ -2187,7 +2187,7 @@ var require_chalk = __commonJS({
2187
2187
  parts.push(String(args[i - 1]).replace(/[{}\\]/g, "\\$&"));
2188
2188
  parts.push(String(strings.raw[i]));
2189
2189
  }
2190
- return template(chalk3, parts.join(""));
2190
+ return template(chalk4, parts.join(""));
2191
2191
  }
2192
2192
  Object.defineProperties(Chalk.prototype, styles);
2193
2193
  module2.exports = Chalk();
@@ -2233,17 +2233,17 @@ var require_lib2 = __commonJS({
2233
2233
  return n.default = e, t && t.set(e, n), n;
2234
2234
  }
2235
2235
  var sometimesKeywords = /* @__PURE__ */ new Set(["as", "async", "from", "get", "of", "set"]);
2236
- function getDefs(chalk3) {
2236
+ function getDefs(chalk4) {
2237
2237
  return {
2238
- keyword: chalk3.cyan,
2239
- capitalized: chalk3.yellow,
2240
- jsxIdentifier: chalk3.yellow,
2241
- punctuator: chalk3.yellow,
2242
- number: chalk3.magenta,
2243
- string: chalk3.green,
2244
- regex: chalk3.magenta,
2245
- comment: chalk3.grey,
2246
- invalid: chalk3.white.bgRed.bold
2238
+ keyword: chalk4.cyan,
2239
+ capitalized: chalk4.yellow,
2240
+ jsxIdentifier: chalk4.yellow,
2241
+ punctuator: chalk4.yellow,
2242
+ number: chalk4.magenta,
2243
+ string: chalk4.green,
2244
+ regex: chalk4.magenta,
2245
+ comment: chalk4.grey,
2246
+ invalid: chalk4.white.bgRed.bold
2247
2247
  };
2248
2248
  }
2249
2249
  var NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
@@ -2374,11 +2374,11 @@ var require_lib3 = __commonJS({
2374
2374
  return _chalk.default;
2375
2375
  }
2376
2376
  var deprecationWarningShown = false;
2377
- function getDefs(chalk3) {
2377
+ function getDefs(chalk4) {
2378
2378
  return {
2379
- gutter: chalk3.grey,
2380
- marker: chalk3.red.bold,
2381
- message: chalk3.red.bold
2379
+ gutter: chalk4.grey,
2380
+ marker: chalk4.red.bold,
2381
+ message: chalk4.red.bold
2382
2382
  };
2383
2383
  }
2384
2384
  var NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
@@ -2440,8 +2440,8 @@ var require_lib3 = __commonJS({
2440
2440
  }
2441
2441
  function codeFrameColumns(rawLines, loc, opts = {}) {
2442
2442
  const highlighted = (opts.highlightCode || opts.forceColor) && (0, _highlight.shouldHighlight)(opts);
2443
- const chalk3 = getChalk(opts.forceColor);
2444
- const defs = getDefs(chalk3);
2443
+ const chalk4 = getChalk(opts.forceColor);
2444
+ const defs = getDefs(chalk4);
2445
2445
  const maybeHighlight = (chalkFn, string) => {
2446
2446
  return highlighted ? chalkFn(string) : string;
2447
2447
  };
@@ -2480,7 +2480,7 @@ var require_lib3 = __commonJS({
2480
2480
  ${frame}`;
2481
2481
  }
2482
2482
  if (highlighted) {
2483
- return chalk3.reset(frame);
2483
+ return chalk4.reset(frame);
2484
2484
  } else {
2485
2485
  return frame;
2486
2486
  }
@@ -7794,14 +7794,14 @@ var require_templates2 = __commonJS({
7794
7794
  }
7795
7795
  return results;
7796
7796
  }
7797
- function buildStyle(chalk3, styles) {
7797
+ function buildStyle(chalk4, styles) {
7798
7798
  const enabled = {};
7799
7799
  for (const layer of styles) {
7800
7800
  for (const style of layer.styles) {
7801
7801
  enabled[style[0]] = layer.inverse ? null : style.slice(1);
7802
7802
  }
7803
7803
  }
7804
- let current = chalk3;
7804
+ let current = chalk4;
7805
7805
  for (const [styleName, styles2] of Object.entries(enabled)) {
7806
7806
  if (!Array.isArray(styles2)) {
7807
7807
  continue;
@@ -7813,7 +7813,7 @@ var require_templates2 = __commonJS({
7813
7813
  }
7814
7814
  return current;
7815
7815
  }
7816
- module2.exports = (chalk3, temporary) => {
7816
+ module2.exports = (chalk4, temporary) => {
7817
7817
  const styles = [];
7818
7818
  const chunks = [];
7819
7819
  let chunk = [];
@@ -7823,13 +7823,13 @@ var require_templates2 = __commonJS({
7823
7823
  } else if (style) {
7824
7824
  const string = chunk.join("");
7825
7825
  chunk = [];
7826
- chunks.push(styles.length === 0 ? string : buildStyle(chalk3, styles)(string));
7826
+ chunks.push(styles.length === 0 ? string : buildStyle(chalk4, styles)(string));
7827
7827
  styles.push({ inverse, styles: parseStyle(style) });
7828
7828
  } else if (close) {
7829
7829
  if (styles.length === 0) {
7830
7830
  throw new Error("Found extraneous } in Chalk template literal");
7831
7831
  }
7832
- chunks.push(buildStyle(chalk3, styles)(chunk.join("")));
7832
+ chunks.push(buildStyle(chalk4, styles)(chunk.join("")));
7833
7833
  chunk = [];
7834
7834
  styles.pop();
7835
7835
  } else {
@@ -7877,16 +7877,16 @@ var require_source = __commonJS({
7877
7877
  }
7878
7878
  };
7879
7879
  var chalkFactory = (options) => {
7880
- const chalk4 = {};
7881
- applyOptions(chalk4, options);
7882
- chalk4.template = (...arguments_) => chalkTag(chalk4.template, ...arguments_);
7883
- Object.setPrototypeOf(chalk4, Chalk.prototype);
7884
- Object.setPrototypeOf(chalk4.template, chalk4);
7885
- chalk4.template.constructor = () => {
7880
+ const chalk5 = {};
7881
+ applyOptions(chalk5, options);
7882
+ chalk5.template = (...arguments_) => chalkTag(chalk5.template, ...arguments_);
7883
+ Object.setPrototypeOf(chalk5, Chalk.prototype);
7884
+ Object.setPrototypeOf(chalk5.template, chalk5);
7885
+ chalk5.template.constructor = () => {
7886
7886
  throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
7887
7887
  };
7888
- chalk4.template.Instance = ChalkClass;
7889
- return chalk4.template;
7888
+ chalk5.template.Instance = ChalkClass;
7889
+ return chalk5.template;
7890
7890
  };
7891
7891
  function Chalk(options) {
7892
7892
  return chalkFactory(options);
@@ -7997,7 +7997,7 @@ var require_source = __commonJS({
7997
7997
  return openAll + string + closeAll;
7998
7998
  };
7999
7999
  var template;
8000
- var chalkTag = (chalk4, ...strings) => {
8000
+ var chalkTag = (chalk5, ...strings) => {
8001
8001
  const [firstString] = strings;
8002
8002
  if (!isArray(firstString) || !isArray(firstString.raw)) {
8003
8003
  return strings.join(" ");
@@ -8013,14 +8013,14 @@ var require_source = __commonJS({
8013
8013
  if (template === void 0) {
8014
8014
  template = require_templates2();
8015
8015
  }
8016
- return template(chalk4, parts.join(""));
8016
+ return template(chalk5, parts.join(""));
8017
8017
  };
8018
8018
  Object.defineProperties(Chalk.prototype, styles);
8019
- var chalk3 = Chalk();
8020
- chalk3.supportsColor = stdoutColor;
8021
- chalk3.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
8022
- chalk3.stderr.supportsColor = stderrColor;
8023
- module2.exports = chalk3;
8019
+ var chalk4 = Chalk();
8020
+ chalk4.supportsColor = stdoutColor;
8021
+ chalk4.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
8022
+ chalk4.stderr.supportsColor = stderrColor;
8023
+ module2.exports = chalk4;
8024
8024
  }
8025
8025
  });
8026
8026
 
@@ -24150,14 +24150,14 @@ var require_share = __commonJS({
24150
24150
  resetConnection === null || resetConnection === void 0 ? void 0 : resetConnection.unsubscribe();
24151
24151
  resetConnection = void 0;
24152
24152
  };
24153
- var reset = function() {
24153
+ var reset2 = function() {
24154
24154
  cancelReset();
24155
24155
  connection = subject = void 0;
24156
24156
  hasCompleted = hasErrored = false;
24157
24157
  };
24158
24158
  var resetAndUnsubscribe = function() {
24159
24159
  var conn = connection;
24160
- reset();
24160
+ reset2();
24161
24161
  conn === null || conn === void 0 ? void 0 : conn.unsubscribe();
24162
24162
  };
24163
24163
  return lift_1.operate(function(source, subscriber) {
@@ -24181,13 +24181,13 @@ var require_share = __commonJS({
24181
24181
  error: function(err) {
24182
24182
  hasErrored = true;
24183
24183
  cancelReset();
24184
- resetConnection = handleReset(reset, resetOnError, err);
24184
+ resetConnection = handleReset(reset2, resetOnError, err);
24185
24185
  dest.error(err);
24186
24186
  },
24187
24187
  complete: function() {
24188
24188
  hasCompleted = true;
24189
24189
  cancelReset();
24190
- resetConnection = handleReset(reset, resetOnComplete);
24190
+ resetConnection = handleReset(reset2, resetOnComplete);
24191
24191
  dest.complete();
24192
24192
  }
24193
24193
  });
@@ -24197,13 +24197,13 @@ var require_share = __commonJS({
24197
24197
  };
24198
24198
  }
24199
24199
  exports.share = share;
24200
- function handleReset(reset, on) {
24200
+ function handleReset(reset2, on) {
24201
24201
  var args = [];
24202
24202
  for (var _i = 2; _i < arguments.length; _i++) {
24203
24203
  args[_i - 2] = arguments[_i];
24204
24204
  }
24205
24205
  if (on === true) {
24206
- reset();
24206
+ reset2();
24207
24207
  return;
24208
24208
  }
24209
24209
  if (on === false) {
@@ -24212,7 +24212,7 @@ var require_share = __commonJS({
24212
24212
  var onSubscriber = new Subscriber_1.SafeSubscriber({
24213
24213
  next: function() {
24214
24214
  onSubscriber.unsubscribe();
24215
- reset();
24215
+ reset2();
24216
24216
  }
24217
24217
  });
24218
24218
  return innerFrom_1.innerFrom(on.apply(void 0, __spreadArray2([], __read2(args)))).subscribe(onSubscriber);
@@ -28102,7 +28102,7 @@ var require_array = __commonJS({
28102
28102
  parent.enabled = choices.every((ch) => ch.enabled === true);
28103
28103
  parent = parent.parent;
28104
28104
  }
28105
- reset(this, this.choices);
28105
+ reset2(this, this.choices);
28106
28106
  this.emit("toggle", choice, this);
28107
28107
  return choice;
28108
28108
  }
@@ -28400,7 +28400,7 @@ var require_array = __commonJS({
28400
28400
  }
28401
28401
  }
28402
28402
  get choices() {
28403
- return reset(this, this.state.choices || []);
28403
+ return reset2(this, this.state.choices || []);
28404
28404
  }
28405
28405
  set visible(visible) {
28406
28406
  this.state.visible = visible;
@@ -28448,7 +28448,7 @@ var require_array = __commonJS({
28448
28448
  return this.multiple ? this.enabled : this.focused;
28449
28449
  }
28450
28450
  };
28451
- function reset(prompt, choices) {
28451
+ function reset2(prompt, choices) {
28452
28452
  if (choices instanceof Promise)
28453
28453
  return choices;
28454
28454
  if (typeof choices === "function") {
@@ -31283,20 +31283,20 @@ var require_highlight = __commonJS({
31283
31283
  Object.defineProperty(exports, "__esModule", { value: true });
31284
31284
  exports.highlight = void 0;
31285
31285
  var jsTokens = require_js_tokens();
31286
- var chalk3 = require_source();
31286
+ var chalk4 = require_source();
31287
31287
  var identifiers_1 = require_identifiers2();
31288
- function getDefs(chalk4) {
31288
+ function getDefs(chalk5) {
31289
31289
  return {
31290
- keyword: chalk4.cyan,
31291
- capitalized: chalk4.yellow,
31292
- jsx_tag: chalk4.yellow,
31293
- punctuator: chalk4.yellow,
31290
+ keyword: chalk5.cyan,
31291
+ capitalized: chalk5.yellow,
31292
+ jsx_tag: chalk5.yellow,
31293
+ punctuator: chalk5.yellow,
31294
31294
  // bracket: intentionally omitted.
31295
- number: chalk4.magenta,
31296
- string: chalk4.green,
31297
- regex: chalk4.magenta,
31298
- comment: chalk4.grey,
31299
- invalid: chalk4.white.bgRed.bold
31295
+ number: chalk5.magenta,
31296
+ string: chalk5.green,
31297
+ regex: chalk5.magenta,
31298
+ comment: chalk5.grey,
31299
+ invalid: chalk5.white.bgRed.bold
31300
31300
  };
31301
31301
  }
31302
31302
  var NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
@@ -31336,7 +31336,7 @@ var require_highlight = __commonJS({
31336
31336
  });
31337
31337
  }
31338
31338
  function highlight(code) {
31339
- const defs = getDefs(chalk3);
31339
+ const defs = getDefs(chalk4);
31340
31340
  return highlightTokens(defs, code);
31341
31341
  }
31342
31342
  exports.highlight = highlight;
@@ -31449,7 +31449,7 @@ var require_run_type_check = __commonJS({
31449
31449
  "use strict";
31450
31450
  Object.defineProperty(exports, "__esModule", { value: true });
31451
31451
  exports.getFormattedDiagnostic = exports.runTypeCheck = exports.runTypeCheckWatch = void 0;
31452
- var chalk3 = require_source();
31452
+ var chalk4 = require_source();
31453
31453
  var path = require("path");
31454
31454
  var code_frames_1 = require("nx/src/utils/code-frames");
31455
31455
  var highlight_1 = require_highlight();
@@ -31529,17 +31529,17 @@ var require_run_type_check = __commonJS({
31529
31529
  const category = diagnostic.category;
31530
31530
  switch (category) {
31531
31531
  case ts.DiagnosticCategory.Warning: {
31532
- message += `${chalk3.yellow.bold("warning")} ${chalk3.gray(`TS${diagnostic.code}`)}: `;
31532
+ message += `${chalk4.yellow.bold("warning")} ${chalk4.gray(`TS${diagnostic.code}`)}: `;
31533
31533
  break;
31534
31534
  }
31535
31535
  case ts.DiagnosticCategory.Error: {
31536
- message += `${chalk3.red.bold("error")} ${chalk3.gray(`TS${diagnostic.code}`)}: `;
31536
+ message += `${chalk4.red.bold("error")} ${chalk4.gray(`TS${diagnostic.code}`)}: `;
31537
31537
  break;
31538
31538
  }
31539
31539
  case ts.DiagnosticCategory.Suggestion:
31540
31540
  case ts.DiagnosticCategory.Message:
31541
31541
  default: {
31542
- message += `${chalk3.cyan.bold(category === 2 ? "suggestion" : "info")}: `;
31542
+ message += `${chalk4.cyan.bold(category === 2 ? "suggestion" : "info")}: `;
31543
31543
  break;
31544
31544
  }
31545
31545
  }
@@ -31549,7 +31549,7 @@ var require_run_type_check = __commonJS({
31549
31549
  const line = pos.line + 1;
31550
31550
  const column = pos.character + 1;
31551
31551
  const fileName = path.relative(workspaceRoot, diagnostic.file.fileName);
31552
- message = `${chalk3.underline.blue(`${fileName}:${line}:${column}`)} - ` + message;
31552
+ message = `${chalk4.underline.blue(`${fileName}:${line}:${column}`)} - ` + message;
31553
31553
  const code = diagnostic.file.getFullText(diagnostic.file.getSourceFile());
31554
31554
  message += "\n" + (0, code_frames_1.codeFrameColumns)(code, {
31555
31555
  start: { line, column }
@@ -43528,6 +43528,7 @@ var LogLevel = {
43528
43528
  ERROR: 20,
43529
43529
  WARN: 30,
43530
43530
  INFO: 40,
43531
+ SUCCESS: 45,
43531
43532
  DEBUG: 60,
43532
43533
  TRACE: 70,
43533
43534
  ALL: 100
@@ -47325,6 +47326,8 @@ var getDefaultConfig = (config = {}, root) => {
47325
47326
  // packages/config-tools/src/utilities/get-log-level.ts
47326
47327
  var getLogLevel = (label) => {
47327
47328
  switch (label) {
47329
+ case "all":
47330
+ return LogLevel.ALL;
47328
47331
  case "trace":
47329
47332
  return LogLevel.TRACE;
47330
47333
  case "debug":
@@ -47344,6 +47347,9 @@ var getLogLevel = (label) => {
47344
47347
  }
47345
47348
  };
47346
47349
  var getLogLevelLabel = (logLevel) => {
47350
+ if (logLevel >= LogLevel.ALL) {
47351
+ return LogLevelLabel.ALL;
47352
+ }
47347
47353
  if (logLevel >= LogLevel.TRACE) {
47348
47354
  return LogLevelLabel.TRACE;
47349
47355
  }
@@ -47368,6 +47374,89 @@ var getLogLevelLabel = (logLevel) => {
47368
47374
  return LogLevelLabel.INFO;
47369
47375
  };
47370
47376
 
47377
+ // packages/config-tools/src/utilities/logger.ts
47378
+ var chalk = __toESM(require_source(), 1);
47379
+ var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
47380
+ if (typeof logLevel === "number" && (logLevel >= getLogLevel(config.logLevel ?? process.env?.STORM_LOG_LEVEL) || logLevel <= LogLevel.SILENT) || typeof logLevel === "string" && getLogLevel(logLevel) >= getLogLevel(config.logLevel ?? process.env?.STORM_LOG_LEVEL)) {
47381
+ return (message) => {
47382
+ };
47383
+ }
47384
+ if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel || typeof logLevel === "string" && LogLevel.FATAL >= getLogLevel(logLevel)) {
47385
+ return (message) => {
47386
+ console.error(
47387
+ ` ${chalk.bold.bgHex(config?.colors?.fatal ? config.colors.fatal : "#1fb2a6").inverse("\n\n \u{1F480} Fatal ")} ${chalk.reset.hex(
47388
+ config?.colors?.fatal ? config.colors.fatal : "#1fb2a6"
47389
+ )(message)}
47390
+ `
47391
+ );
47392
+ };
47393
+ }
47394
+ if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel || typeof logLevel === "string" && LogLevel.ERROR >= getLogLevel(logLevel)) {
47395
+ return (message) => {
47396
+ console.error(
47397
+ ` ${chalk.bold.bgHex(config?.colors?.error ? config.colors.error : "#7d1a1a").inverse("\n\n \u{1F6D1} Error ")} ${chalk.reset.hex(
47398
+ config?.colors?.error ? config.colors.error : "#7d1a1a"
47399
+ )(message)}
47400
+ `
47401
+ );
47402
+ };
47403
+ }
47404
+ if (typeof logLevel === "number" && LogLevel.WARN >= logLevel || typeof logLevel === "string" && LogLevel.WARN >= getLogLevel(logLevel)) {
47405
+ return (message) => {
47406
+ console.warn(
47407
+ ` ${chalk.bold.bgHex(config?.colors?.warning ? config.colors.warning : "#fcc419").inverse("\n\n \u26A0\uFE0F Warn ")} ${chalk.reset.hex(
47408
+ config?.colors?.warning ? config.colors.warning : "#fcc419"
47409
+ )(message)}
47410
+ `
47411
+ );
47412
+ };
47413
+ }
47414
+ if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
47415
+ return (message) => {
47416
+ console.info(
47417
+ ` ${chalk.bold.bgHex(config?.colors?.info ? config.colors.info : "#0ea5e9").inverse("\n\n \u{1F4EC} Info ")} ${chalk.reset.hex(
47418
+ config?.colors?.info ? config.colors.info : "#0ea5e9"
47419
+ )(message)}
47420
+ `
47421
+ );
47422
+ };
47423
+ }
47424
+ if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
47425
+ return (message) => {
47426
+ console.info(
47427
+ ` ${chalk.bold.bgHex(config?.colors?.success ? config.colors.success : "#087f5b").inverse("\n\n \u{1F389} Success ")} ${chalk.reset.hex(
47428
+ config?.colors?.success ? config.colors.success : "#087f5b"
47429
+ )(message)}
47430
+ `
47431
+ );
47432
+ };
47433
+ }
47434
+ if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel || typeof logLevel === "string" && LogLevel.DEBUG >= getLogLevel(logLevel)) {
47435
+ return (message) => {
47436
+ console.debug(
47437
+ ` ${chalk.bold.bgHex(config?.colors?.primary ? config.colors.primary : "#1fb2a6").inverse("\n\n \u{1F9EA} Debug ")} ${chalk.reset.hex(
47438
+ config?.colors?.primary ? config.colors.primary : "#1fb2a6"
47439
+ )(message)}
47440
+ `
47441
+ );
47442
+ };
47443
+ }
47444
+ return (message) => {
47445
+ console.log(
47446
+ ` ${chalk.bold.bgHex(config?.colors?.primary ? config.colors.primary : "#1fb2a6").inverse("\n\n \u{1F4E2} System ")} ${chalk.bold.hex(
47447
+ config?.colors?.primary ? config.colors.primary : "#1fb2a6"
47448
+ )(message)}
47449
+ `
47450
+ );
47451
+ };
47452
+ };
47453
+ var writeFatal = (config, message) => getLogFn(config, LogLevel.FATAL)(message);
47454
+ var writeError = (config, message) => getLogFn(config, LogLevel.ERROR)(message);
47455
+ var writeInfo = (config, message) => getLogFn(config, LogLevel.INFO)(message);
47456
+ var writeSuccess = (config, message) => getLogFn(config, LogLevel.SUCCESS)(message);
47457
+ var writeDebug = (config, message) => getLogFn(config, LogLevel.DEBUG)(message);
47458
+ var writeTrace = (config, message) => getLogFn(config, LogLevel.TRACE)(message);
47459
+
47371
47460
  // packages/config-tools/src/env/get-env.ts
47372
47461
  var getExtensionEnv = (extensionName) => {
47373
47462
  const prefix = `STORM_EXTENSION_${extensionName.toUpperCase()}_`;
@@ -47570,7 +47659,7 @@ var setConfigEnv = (config) => {
47570
47659
  };
47571
47660
 
47572
47661
  // packages/workspace-tools/src/base/base-executor.ts
47573
- var chalk = __toESM(require_source());
47662
+ var chalk2 = __toESM(require_source());
47574
47663
 
47575
47664
  // packages/workspace-tools/src/utils/get-workspace-root.ts
47576
47665
  var import_find_workspace_root2 = require("nx/src/utils/find-workspace-root.js");
@@ -47687,10 +47776,10 @@ var applyWorkspaceTokens = (options, config, tokenizerFn) => {
47687
47776
  var withRunExecutor = (name, executorFn, executorOptions) => async (_options, context) => {
47688
47777
  const startTime = Date.now();
47689
47778
  let options = _options;
47779
+ let config;
47690
47780
  try {
47691
- console.info(chalk.bold.hex("#1fb2a6")(`\u26A1 Running the ${name} executor...
47692
-
47693
- `));
47781
+ writeInfo(config, `\u26A1 Running the ${name} executor...
47782
+ `);
47694
47783
  if (!context.projectsConfigurations?.projects || !context.projectName || !context.projectsConfigurations.projects[context.projectName]) {
47695
47784
  throw new Error(
47696
47785
  "The Build process failed because the context is not valid. Please run this command from a workspace."
@@ -47700,35 +47789,37 @@ var withRunExecutor = (name, executorFn, executorOptions) => async (_options, co
47700
47789
  const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
47701
47790
  const sourceRoot = context.projectsConfigurations.projects[context.projectName].sourceRoot;
47702
47791
  const projectName = context.projectsConfigurations.projects[context.projectName].name;
47703
- let config;
47704
47792
  if (!executorOptions.skipReadingConfig) {
47705
- getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.info(
47706
- chalk.dim(`Loading the Storm config...
47707
- - workspaceRoot: ${workspaceRoot}
47708
- - projectRoot: ${projectRoot}
47709
- - sourceRoot: ${sourceRoot}
47710
- - projectName: ${projectName}
47711
- `)
47793
+ writeDebug(
47794
+ config,
47795
+ `Loading the Storm Config from environment variables and storm.config.js file...
47796
+ - workspaceRoot: ${workspaceRoot}
47797
+ - projectRoot: ${projectRoot}
47798
+ - sourceRoot: ${sourceRoot}
47799
+ - projectName: ${projectName}
47800
+ `
47712
47801
  );
47713
47802
  config = getDefaultConfig({
47714
47803
  ...await getConfigFile(),
47715
47804
  ...getConfigEnv()
47716
47805
  });
47717
47806
  setConfigEnv(config);
47718
- getLogLevel(config.logLevel) >= LogLevel.DEBUG && console.info(
47719
- chalk.dim(
47720
- `Loaded Storm config into env:
47721
- ${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\n")}
47722
- `
47723
- )
47807
+ writeTrace(
47808
+ config,
47809
+ `Loaded Storm config into env:
47810
+ ${Object.keys(process.env).map((key) => ` - ${key}=${JSON.stringify(process.env[key])}`).join("\n")}`
47724
47811
  );
47725
47812
  }
47726
47813
  if (executorOptions?.hooks?.applyDefaultOptions) {
47727
- getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk.dim("Running the applyDefaultOptions hook..."));
47814
+ writeDebug(config, "Running the applyDefaultOptions hook...");
47728
47815
  options = await Promise.resolve(executorOptions.hooks.applyDefaultOptions(options, config));
47729
- getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk.dim("Completed the applyDefaultOptions hook..."));
47816
+ writeDebug(config, "Completed the applyDefaultOptions hook");
47730
47817
  }
47731
- getLogLevel(config.logLevel) >= LogLevel.INFO && console.info(chalk.hex("#0ea5e9").italic("\n\n \u2699\uFE0F Executor schema options: \n"), options);
47818
+ writeTrace(
47819
+ config,
47820
+ `Executor schema options \u2699\uFE0F
47821
+ ${Object.keys(options).map((key) => ` - ${key}=${JSON.stringify(options[key])}`).join("\n")}`
47822
+ );
47732
47823
  const tokenized = applyWorkspaceTokens(
47733
47824
  options,
47734
47825
  {
@@ -47743,9 +47834,9 @@ ${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\
47743
47834
  applyWorkspaceExecutorTokens
47744
47835
  );
47745
47836
  if (executorOptions?.hooks?.preProcess) {
47746
- getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk.dim("Running the preProcess hook..."));
47837
+ writeDebug(config, "Running the preProcess hook...");
47747
47838
  await Promise.resolve(executorOptions.hooks.preProcess(tokenized, config));
47748
- getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk.dim("Completed the preProcess hook..."));
47839
+ writeDebug(config, "Completed the preProcess hook");
47749
47840
  }
47750
47841
  const result = await Promise.resolve(executorFn(tokenized, context, config));
47751
47842
  if (result && (!result.success || result.error && result?.error?.message && typeof result?.error?.message === "string" && result?.error?.name && typeof result?.error?.name === "string")) {
@@ -47754,31 +47845,32 @@ ${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\
47754
47845
  });
47755
47846
  }
47756
47847
  if (executorOptions?.hooks?.postProcess) {
47757
- getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk.dim("Running the postProcess hook..."));
47848
+ writeDebug(config, "Running the postProcess hook...");
47758
47849
  await Promise.resolve(executorOptions.hooks.postProcess(config));
47759
- getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk.dim("Completed the postProcess hook..."));
47850
+ writeDebug(config, "Completed the postProcess hook");
47760
47851
  }
47761
- console.info(
47762
- chalk.bold.hex("#087f5b")(`
47763
-
47764
- \u{1F389} Successfully completed running the ${name} executor!
47765
-
47766
- `)
47767
- );
47852
+ writeSuccess(config, `Completed running the ${name} task executor!
47853
+ `);
47768
47854
  return {
47769
47855
  success: true
47770
47856
  };
47771
47857
  } catch (error) {
47772
- console.error(
47773
- chalk.bold.hex("#7d1a1a")("\u274C An error occurred while running the executor\n\n"),
47774
- error
47858
+ writeFatal(
47859
+ config,
47860
+ "A fatal error occurred while running the executor - the process was forced to terminate"
47861
+ );
47862
+ writeError(
47863
+ config,
47864
+ `An exception was thrown in the executor's process
47865
+ - Details: ${error.message}
47866
+ - Stacktrace: ${error.stack}`
47775
47867
  );
47776
47868
  return {
47777
47869
  success: false
47778
47870
  };
47779
47871
  } finally {
47780
47872
  console.info(
47781
- chalk.dim(
47873
+ chalk2.dim(
47782
47874
  `\u23F1\uFE0F The${name ? ` ${name}` : ""} generator took ${Date.now() - startTime}ms to complete`
47783
47875
  )
47784
47876
  );
@@ -47786,14 +47878,14 @@ ${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\
47786
47878
  };
47787
47879
 
47788
47880
  // packages/workspace-tools/src/base/base-generator.ts
47789
- var chalk2 = __toESM(require_source());
47881
+ var chalk3 = __toESM(require_source());
47790
47882
  var withRunGenerator = (name, generatorFn, generatorOptions = {
47791
47883
  skipReadingConfig: false
47792
47884
  }) => async (tree, _options) => {
47793
47885
  const startTime = Date.now();
47794
47886
  let options = _options;
47795
47887
  try {
47796
- console.info(chalk2.bold.hex("#1fb2a6")(`\u26A1 Running the ${name} generator...
47888
+ console.info(chalk3.bold.hex("#1fb2a6")(`\u26A1 Running the ${name} generator...
47797
47889
 
47798
47890
  `));
47799
47891
  let config;
@@ -47804,29 +47896,29 @@ var withRunGenerator = (name, generatorFn, generatorOptions = {
47804
47896
  });
47805
47897
  setConfigEnv(config);
47806
47898
  getLogLevel(config.logLevel) >= LogLevel.DEBUG && console.debug(
47807
- chalk2.dim(
47899
+ chalk3.dim(
47808
47900
  `Loaded Storm config into env:
47809
47901
  ${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\n")}`
47810
47902
  )
47811
47903
  );
47812
47904
  }
47813
47905
  if (generatorOptions?.hooks?.applyDefaultOptions) {
47814
- getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk2.dim("Running the applyDefaultOptions hook..."));
47906
+ getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk3.dim("Running the applyDefaultOptions hook..."));
47815
47907
  options = await Promise.resolve(
47816
47908
  generatorOptions.hooks.applyDefaultOptions(options, config)
47817
47909
  );
47818
- getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk2.dim("Completed the applyDefaultOptions hook..."));
47910
+ getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk3.dim("Completed the applyDefaultOptions hook..."));
47819
47911
  }
47820
- getLogLevel(config.logLevel) >= LogLevel.INFO && console.info(chalk2.hex("#0ea5e9").italic("\n\n \u2699\uFE0F Generator schema options: \n"), options);
47912
+ getLogLevel(config.logLevel) >= LogLevel.INFO && console.info(chalk3.hex("#0ea5e9").italic("\n\n \u2699\uFE0F Generator schema options: \n"), options);
47821
47913
  const tokenized = applyWorkspaceTokens(
47822
47914
  options,
47823
47915
  { workspaceRoot: tree.root, config },
47824
47916
  applyWorkspaceGeneratorTokens
47825
47917
  );
47826
47918
  if (generatorOptions?.hooks?.preProcess) {
47827
- getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk2.dim("Running the preProcess hook..."));
47919
+ getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk3.dim("Running the preProcess hook..."));
47828
47920
  await Promise.resolve(generatorOptions.hooks.preProcess(options, config));
47829
- getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk2.dim("Completed the preProcess hook..."));
47921
+ getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk3.dim("Completed the preProcess hook..."));
47830
47922
  }
47831
47923
  const result = await Promise.resolve(generatorFn(tree, tokenized, config));
47832
47924
  if (result && (!result.success || result.error && result?.error?.message && typeof result?.error?.message === "string" && result?.error?.name && typeof result?.error?.name === "string")) {
@@ -47835,12 +47927,12 @@ ${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\
47835
47927
  });
47836
47928
  }
47837
47929
  if (generatorOptions?.hooks?.postProcess) {
47838
- getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk2.dim("Running the postProcess hook..."));
47930
+ getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk3.dim("Running the postProcess hook..."));
47839
47931
  await Promise.resolve(generatorOptions.hooks.postProcess(config));
47840
- getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk2.dim("Completed the postProcess hook..."));
47932
+ getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk3.dim("Completed the postProcess hook..."));
47841
47933
  }
47842
47934
  console.info(
47843
- chalk2.bold.hex("#087f5b")(`
47935
+ chalk3.bold.hex("#087f5b")(`
47844
47936
 
47845
47937
  \u{1F389} Successfully completed running the ${name} generator!`)
47846
47938
  );
@@ -47849,7 +47941,7 @@ ${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\
47849
47941
  };
47850
47942
  } catch (error) {
47851
47943
  console.error(
47852
- chalk2.bold.hex("#7d1a1a")("\u274C An error occurred while running the generator\n\n"),
47944
+ chalk3.bold.hex("#7d1a1a")("\u274C An error occurred while running the generator\n\n"),
47853
47945
  error
47854
47946
  );
47855
47947
  console.error(error);
@@ -47858,7 +47950,7 @@ ${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\
47858
47950
  };
47859
47951
  } finally {
47860
47952
  console.info(
47861
- chalk2.hex("#0ea5e9").italic(
47953
+ chalk3.hex("#0ea5e9").italic(
47862
47954
  `\u23F1\uFE0F The${name ? ` ${name}` : ""} generator took ${Date.now() - startTime}ms to complete`
47863
47955
  )
47864
47956
  );