@storm-software/workspace-tools 1.42.4 → 1.43.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/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(chalk2, 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 = chalk2;
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 = (chalk2, 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(chalk2, 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(chalk2, 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 chalk2 = {};
2053
+ applyOptions(chalk2, options);
2054
+ chalk2.template = function() {
2055
2055
  const args = [].slice.call(arguments);
2056
- return chalkTag.apply(null, [chalk3.template].concat(args));
2056
+ return chalkTag.apply(null, [chalk2.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(chalk2, Chalk.prototype);
2059
+ Object.setPrototypeOf(chalk2.template, chalk2);
2060
+ chalk2.template.constructor = Chalk;
2061
+ return chalk2.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(chalk2, 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(chalk2, 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(chalk2) {
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: chalk2.cyan,
2239
+ capitalized: chalk2.yellow,
2240
+ jsxIdentifier: chalk2.yellow,
2241
+ punctuator: chalk2.yellow,
2242
+ number: chalk2.magenta,
2243
+ string: chalk2.green,
2244
+ regex: chalk2.magenta,
2245
+ comment: chalk2.grey,
2246
+ invalid: chalk2.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(chalk2) {
2378
2378
  return {
2379
- gutter: chalk3.grey,
2380
- marker: chalk3.red.bold,
2381
- message: chalk3.red.bold
2379
+ gutter: chalk2.grey,
2380
+ marker: chalk2.red.bold,
2381
+ message: chalk2.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 chalk2 = getChalk(opts.forceColor);
2444
+ const defs = getDefs(chalk2);
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 chalk2.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(chalk2, 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 = chalk2;
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 = (chalk2, 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(chalk2, 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(chalk2, 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 chalk3 = {};
7881
+ applyOptions(chalk3, options);
7882
+ chalk3.template = (...arguments_) => chalkTag(chalk3.template, ...arguments_);
7883
+ Object.setPrototypeOf(chalk3, Chalk.prototype);
7884
+ Object.setPrototypeOf(chalk3.template, chalk3);
7885
+ chalk3.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
+ chalk3.template.Instance = ChalkClass;
7889
+ return chalk3.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 = (chalk3, ...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(chalk3, 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 chalk2 = Chalk();
8020
+ chalk2.supportsColor = stdoutColor;
8021
+ chalk2.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
8022
+ chalk2.stderr.supportsColor = stderrColor;
8023
+ module2.exports = chalk2;
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 chalk2 = require_source();
31287
31287
  var identifiers_1 = require_identifiers2();
31288
- function getDefs(chalk4) {
31288
+ function getDefs(chalk3) {
31289
31289
  return {
31290
- keyword: chalk4.cyan,
31291
- capitalized: chalk4.yellow,
31292
- jsx_tag: chalk4.yellow,
31293
- punctuator: chalk4.yellow,
31290
+ keyword: chalk3.cyan,
31291
+ capitalized: chalk3.yellow,
31292
+ jsx_tag: chalk3.yellow,
31293
+ punctuator: chalk3.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: chalk3.magenta,
31296
+ string: chalk3.green,
31297
+ regex: chalk3.magenta,
31298
+ comment: chalk3.grey,
31299
+ invalid: chalk3.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(chalk2);
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 chalk2 = 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 += `${chalk2.yellow.bold("warning")} ${chalk2.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 += `${chalk2.red.bold("error")} ${chalk2.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 += `${chalk2.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 = `${chalk2.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,71 +47374,100 @@ var getLogLevelLabel = (logLevel) => {
47368
47374
  return LogLevelLabel.INFO;
47369
47375
  };
47370
47376
 
47371
- // packages/config-tools/src/env/get-env.ts
47372
- var getExtensionEnv = (extensionName) => {
47373
- const prefix = `STORM_EXTENSION_${extensionName.toUpperCase()}_`;
47374
- return Object.keys(process.env).filter((key) => key.startsWith(prefix)).reduce((ret, key) => {
47375
- const name = key.replace(prefix, "").split("_").map((i) => i.length > 0 ? i.trim().charAt(0).toUpperCase() + i.trim().slice(1) : "").join("");
47376
- if (name) {
47377
- ret[name] = process.env[key];
47378
- }
47379
- return ret;
47380
- }, {});
47381
- };
47382
- var getConfigEnv = () => {
47383
- const prefix = "STORM_";
47384
- let config = {
47385
- name: process.env[`${prefix}NAME`],
47386
- namespace: process.env[`${prefix}NAMESPACE`],
47387
- owner: process.env[`${prefix}OWNER`],
47388
- worker: process.env[`${prefix}WORKER`],
47389
- organization: process.env[`${prefix}ORGANIZATION`],
47390
- packageManager: process.env[`${prefix}PACKAGE_MANAGER`],
47391
- license: process.env[`${prefix}LICENSE`],
47392
- homepage: process.env[`${prefix}HOMEPAGE`],
47393
- timezone: process.env[`${prefix}TIMEZONE`] ?? process.env.TZ,
47394
- locale: process.env[`${prefix}LOCALE`] ?? process.env.LOCALE,
47395
- configFile: process.env[`${prefix}CONFIG_FILE`],
47396
- workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`],
47397
- packageDirectory: process.env[`${prefix}PACKAGE_DIRECTORY`],
47398
- buildDirectory: process.env[`${prefix}BUILD_DIRECTORY`],
47399
- runtimeVersion: process.env[`${prefix}RUNTIME_VERSION`],
47400
- runtimeDirectory: process.env[`${prefix}RUNTIME_DIRECTORY`],
47401
- env: process.env[`${prefix}ENV`] ?? process.env.NODE_ENV ?? process.env.ENVIRONMENT,
47402
- ci: Boolean(process.env[`${prefix}CI`] ?? process.env.CI ?? process.env.CONTINUOUS_INTEGRATION),
47403
- colors: {
47404
- primary: process.env[`${prefix}COLOR_PRIMARY`],
47405
- background: process.env[`${prefix}COLOR_BACKGROUND`],
47406
- success: process.env[`${prefix}COLOR_SUCCESS`],
47407
- info: process.env[`${prefix}COLOR_INFO`],
47408
- warning: process.env[`${prefix}COLOR_WARNING`],
47409
- error: process.env[`${prefix}COLOR_ERROR`],
47410
- fatal: process.env[`${prefix}COLOR_FATAL`]
47411
- },
47412
- repository: process.env[`${prefix}REPOSITORY`],
47413
- branch: process.env[`${prefix}BRANCH`],
47414
- preMajor: Boolean(process.env[`${prefix}PRE_MAJOR`]),
47415
- logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? Number.isSafeInteger(Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) ? getLogLevelLabel(Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) : process.env[`${prefix}LOG_LEVEL`] : LogLevelLabel.INFO,
47416
- extensions: {}
47417
- };
47418
- const serializedConfig = process.env[`${prefix}CONFIG`];
47419
- if (serializedConfig) {
47420
- const parsed = JSON.parse(serializedConfig);
47421
- config = {
47422
- ...config,
47423
- ...parsed,
47424
- colors: { ...config.colors, ...parsed.colors },
47425
- extensions: { ...config.extensions, ...parsed.extensions }
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 (_) => {
47426
47382
  };
47427
47383
  }
47428
- const extensionPrefix = `${prefix}EXTENSION_`;
47429
- return Object.keys(process.env).filter((key) => key.startsWith(extensionPrefix)).reduce((ret, key) => {
47430
- const extensionName = key.substring(prefix.length, key.indexOf("_", prefix.length)).split("_").map((i) => i.length > 0 ? i.trim().charAt(0).toUpperCase() + i.trim().slice(1) : "").join("");
47431
- if (extensionName) {
47432
- ret.extensions[extensionName] = getExtensionEnv(extensionName);
47433
- }
47434
- return ret;
47435
- }, config);
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
+ var getStopwatch = (name) => {
47460
+ const start = process.hrtime();
47461
+ return () => {
47462
+ const end = process.hrtime(start);
47463
+ console.info(
47464
+ chalk.dim(
47465
+ `\u23F1\uFE0F The${name ? ` ${name}` : ""} process took ${Math.round(
47466
+ end[0] * 1e3 + end[1] / 1e6
47467
+ )}ms to complete`
47468
+ )
47469
+ );
47470
+ };
47436
47471
  };
47437
47472
 
47438
47473
  // packages/config-tools/src/env/set-env.ts
@@ -47569,8 +47604,82 @@ var setConfigEnv = (config) => {
47569
47604
  }
47570
47605
  };
47571
47606
 
47572
- // packages/workspace-tools/src/base/base-executor.ts
47573
- var chalk = __toESM(require_source());
47607
+ // packages/config-tools/src/utilities/prepare-workspace.ts
47608
+ var prepareWorkspace = async () => {
47609
+ const _STORM_CONFIG = getDefaultConfig({
47610
+ ...await getConfigFile(),
47611
+ ...getConfigEnv()
47612
+ });
47613
+ setConfigEnv(_STORM_CONFIG);
47614
+ return _STORM_CONFIG;
47615
+ };
47616
+
47617
+ // packages/config-tools/src/env/get-env.ts
47618
+ var getExtensionEnv = (extensionName) => {
47619
+ const prefix = `STORM_EXTENSION_${extensionName.toUpperCase()}_`;
47620
+ return Object.keys(process.env).filter((key) => key.startsWith(prefix)).reduce((ret, key) => {
47621
+ const name = key.replace(prefix, "").split("_").map((i) => i.length > 0 ? i.trim().charAt(0).toUpperCase() + i.trim().slice(1) : "").join("");
47622
+ if (name) {
47623
+ ret[name] = process.env[key];
47624
+ }
47625
+ return ret;
47626
+ }, {});
47627
+ };
47628
+ var getConfigEnv = () => {
47629
+ const prefix = "STORM_";
47630
+ let config = {
47631
+ name: process.env[`${prefix}NAME`],
47632
+ namespace: process.env[`${prefix}NAMESPACE`],
47633
+ owner: process.env[`${prefix}OWNER`],
47634
+ worker: process.env[`${prefix}WORKER`],
47635
+ organization: process.env[`${prefix}ORGANIZATION`],
47636
+ packageManager: process.env[`${prefix}PACKAGE_MANAGER`],
47637
+ license: process.env[`${prefix}LICENSE`],
47638
+ homepage: process.env[`${prefix}HOMEPAGE`],
47639
+ timezone: process.env[`${prefix}TIMEZONE`] ?? process.env.TZ,
47640
+ locale: process.env[`${prefix}LOCALE`] ?? process.env.LOCALE,
47641
+ configFile: process.env[`${prefix}CONFIG_FILE`],
47642
+ workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`],
47643
+ packageDirectory: process.env[`${prefix}PACKAGE_DIRECTORY`],
47644
+ buildDirectory: process.env[`${prefix}BUILD_DIRECTORY`],
47645
+ runtimeVersion: process.env[`${prefix}RUNTIME_VERSION`],
47646
+ runtimeDirectory: process.env[`${prefix}RUNTIME_DIRECTORY`],
47647
+ env: process.env[`${prefix}ENV`] ?? process.env.NODE_ENV ?? process.env.ENVIRONMENT,
47648
+ ci: Boolean(process.env[`${prefix}CI`] ?? process.env.CI ?? process.env.CONTINUOUS_INTEGRATION),
47649
+ colors: {
47650
+ primary: process.env[`${prefix}COLOR_PRIMARY`],
47651
+ background: process.env[`${prefix}COLOR_BACKGROUND`],
47652
+ success: process.env[`${prefix}COLOR_SUCCESS`],
47653
+ info: process.env[`${prefix}COLOR_INFO`],
47654
+ warning: process.env[`${prefix}COLOR_WARNING`],
47655
+ error: process.env[`${prefix}COLOR_ERROR`],
47656
+ fatal: process.env[`${prefix}COLOR_FATAL`]
47657
+ },
47658
+ repository: process.env[`${prefix}REPOSITORY`],
47659
+ branch: process.env[`${prefix}BRANCH`],
47660
+ preMajor: Boolean(process.env[`${prefix}PRE_MAJOR`]),
47661
+ logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? Number.isSafeInteger(Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) ? getLogLevelLabel(Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) : process.env[`${prefix}LOG_LEVEL`] : LogLevelLabel.INFO,
47662
+ extensions: {}
47663
+ };
47664
+ const serializedConfig = process.env[`${prefix}CONFIG`];
47665
+ if (serializedConfig) {
47666
+ const parsed = JSON.parse(serializedConfig);
47667
+ config = {
47668
+ ...config,
47669
+ ...parsed,
47670
+ colors: { ...config.colors, ...parsed.colors },
47671
+ extensions: { ...config.extensions, ...parsed.extensions }
47672
+ };
47673
+ }
47674
+ const extensionPrefix = `${prefix}EXTENSION_`;
47675
+ return Object.keys(process.env).filter((key) => key.startsWith(extensionPrefix)).reduce((ret, key) => {
47676
+ const extensionName = key.substring(prefix.length, key.indexOf("_", prefix.length)).split("_").map((i) => i.length > 0 ? i.trim().charAt(0).toUpperCase() + i.trim().slice(1) : "").join("");
47677
+ if (extensionName) {
47678
+ ret.extensions[extensionName] = getExtensionEnv(extensionName);
47679
+ }
47680
+ return ret;
47681
+ }, config);
47682
+ };
47574
47683
 
47575
47684
  // packages/workspace-tools/src/utils/get-workspace-root.ts
47576
47685
  var import_find_workspace_root2 = require("nx/src/utils/find-workspace-root.js");
@@ -47685,12 +47794,12 @@ var applyWorkspaceTokens = (options, config, tokenizerFn) => {
47685
47794
 
47686
47795
  // packages/workspace-tools/src/base/base-executor.ts
47687
47796
  var withRunExecutor = (name, executorFn, executorOptions) => async (_options, context) => {
47688
- const startTime = Date.now();
47797
+ const stopwatch = getStopwatch(name);
47689
47798
  let options = _options;
47799
+ let config;
47690
47800
  try {
47691
- console.info(chalk.bold.hex("#1fb2a6")(`\u26A1 Running the ${name} executor...
47692
-
47693
- `));
47801
+ writeInfo(config, `\u26A1 Running the ${name} executor...
47802
+ `);
47694
47803
  if (!context.projectsConfigurations?.projects || !context.projectName || !context.projectsConfigurations.projects[context.projectName]) {
47695
47804
  throw new Error(
47696
47805
  "The Build process failed because the context is not valid. Please run this command from a workspace."
@@ -47700,35 +47809,33 @@ var withRunExecutor = (name, executorFn, executorOptions) => async (_options, co
47700
47809
  const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
47701
47810
  const sourceRoot = context.projectsConfigurations.projects[context.projectName].sourceRoot;
47702
47811
  const projectName = context.projectsConfigurations.projects[context.projectName].name;
47703
- let config;
47704
47812
  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
- `)
47712
- );
47713
- config = getDefaultConfig({
47714
- ...await getConfigFile(),
47715
- ...getConfigEnv()
47716
- });
47717
- 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")}
47813
+ writeDebug(
47814
+ config,
47815
+ `Loading the Storm Config from environment variables and storm.config.js file...
47816
+ - workspaceRoot: ${workspaceRoot}
47817
+ - projectRoot: ${projectRoot}
47818
+ - sourceRoot: ${sourceRoot}
47819
+ - projectName: ${projectName}
47722
47820
  `
47723
- )
47821
+ );
47822
+ config = await prepareWorkspace();
47823
+ writeTrace(
47824
+ config,
47825
+ `Loaded Storm config into env:
47826
+ ${Object.keys(process.env).map((key) => ` - ${key}=${JSON.stringify(process.env[key])}`).join("\n")}`
47724
47827
  );
47725
47828
  }
47726
47829
  if (executorOptions?.hooks?.applyDefaultOptions) {
47727
- getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk.dim("Running the applyDefaultOptions hook..."));
47830
+ writeDebug(config, "Running the applyDefaultOptions hook...");
47728
47831
  options = await Promise.resolve(executorOptions.hooks.applyDefaultOptions(options, config));
47729
- getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk.dim("Completed the applyDefaultOptions hook..."));
47832
+ writeDebug(config, "Completed the applyDefaultOptions hook");
47730
47833
  }
47731
- getLogLevel(config.logLevel) >= LogLevel.INFO && console.info(chalk.hex("#0ea5e9").italic("\n\n \u2699\uFE0F Executor schema options: \n"), options);
47834
+ writeTrace(
47835
+ config,
47836
+ `Executor schema options \u2699\uFE0F
47837
+ ${Object.keys(options).map((key) => ` - ${key}=${JSON.stringify(options[key])}`).join("\n")}`
47838
+ );
47732
47839
  const tokenized = applyWorkspaceTokens(
47733
47840
  options,
47734
47841
  {
@@ -47743,9 +47850,9 @@ ${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\
47743
47850
  applyWorkspaceExecutorTokens
47744
47851
  );
47745
47852
  if (executorOptions?.hooks?.preProcess) {
47746
- getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk.dim("Running the preProcess hook..."));
47853
+ writeDebug(config, "Running the preProcess hook...");
47747
47854
  await Promise.resolve(executorOptions.hooks.preProcess(tokenized, config));
47748
- getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk.dim("Completed the preProcess hook..."));
47855
+ writeDebug(config, "Completed the preProcess hook");
47749
47856
  }
47750
47857
  const result = await Promise.resolve(executorFn(tokenized, context, config));
47751
47858
  if (result && (!result.success || result.error && result?.error?.message && typeof result?.error?.message === "string" && result?.error?.name && typeof result?.error?.name === "string")) {
@@ -47754,79 +47861,80 @@ ${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\
47754
47861
  });
47755
47862
  }
47756
47863
  if (executorOptions?.hooks?.postProcess) {
47757
- getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk.dim("Running the postProcess hook..."));
47864
+ writeDebug(config, "Running the postProcess hook...");
47758
47865
  await Promise.resolve(executorOptions.hooks.postProcess(config));
47759
- getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk.dim("Completed the postProcess hook..."));
47866
+ writeDebug(config, "Completed the postProcess hook");
47760
47867
  }
47761
- console.info(
47762
- chalk.bold.hex("#087f5b")(`
47763
-
47764
- \u{1F389} Successfully completed running the ${name} executor!
47765
-
47766
- `)
47767
- );
47868
+ writeSuccess(config, `Completed running the ${name} task executor!
47869
+ `);
47768
47870
  return {
47769
47871
  success: true
47770
47872
  };
47771
47873
  } catch (error) {
47772
- console.error(
47773
- chalk.bold.hex("#7d1a1a")("\u274C An error occurred while running the executor\n\n"),
47774
- error
47874
+ writeFatal(
47875
+ config,
47876
+ "A fatal error occurred while running the executor - the process was forced to terminate"
47877
+ );
47878
+ writeError(
47879
+ config,
47880
+ `An exception was thrown in the executor's process
47881
+ - Details: ${error.message}
47882
+ - Stacktrace: ${error.stack}`
47775
47883
  );
47776
47884
  return {
47777
47885
  success: false
47778
47886
  };
47779
47887
  } finally {
47780
- console.info(
47781
- chalk.dim(
47782
- `\u23F1\uFE0F The${name ? ` ${name}` : ""} generator took ${Date.now() - startTime}ms to complete`
47783
- )
47784
- );
47888
+ stopwatch();
47785
47889
  }
47786
47890
  };
47787
47891
 
47788
47892
  // packages/workspace-tools/src/base/base-generator.ts
47789
- var chalk2 = __toESM(require_source());
47790
47893
  var withRunGenerator = (name, generatorFn, generatorOptions = {
47791
47894
  skipReadingConfig: false
47792
47895
  }) => async (tree, _options) => {
47793
- const startTime = Date.now();
47896
+ const stopwatch = getStopwatch(name);
47794
47897
  let options = _options;
47898
+ let config;
47795
47899
  try {
47796
- console.info(chalk2.bold.hex("#1fb2a6")(`\u26A1 Running the ${name} generator...
47900
+ writeInfo(config, `\u26A1 Running the ${name} generator...
47797
47901
 
47798
- `));
47799
- let config;
47902
+ `);
47903
+ const workspaceRoot = getWorkspaceRoot();
47800
47904
  if (!generatorOptions.skipReadingConfig) {
47801
- config = getDefaultConfig({
47802
- ...await getConfigFile(),
47803
- ...getConfigEnv()
47804
- });
47805
- setConfigEnv(config);
47806
- getLogLevel(config.logLevel) >= LogLevel.DEBUG && console.debug(
47807
- chalk2.dim(
47808
- `Loaded Storm config into env:
47809
- ${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\n")}`
47810
- )
47905
+ writeDebug(
47906
+ config,
47907
+ `Loading the Storm Config from environment variables and storm.config.js file...
47908
+ - workspaceRoot: ${workspaceRoot}`
47909
+ );
47910
+ config = await prepareWorkspace();
47911
+ writeTrace(
47912
+ config,
47913
+ `Loaded Storm config into env:
47914
+ ${Object.keys(process.env).map((key) => ` - ${key}=${JSON.stringify(process.env[key])}`).join("\n")}`
47811
47915
  );
47812
47916
  }
47813
47917
  if (generatorOptions?.hooks?.applyDefaultOptions) {
47814
- getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk2.dim("Running the applyDefaultOptions hook..."));
47918
+ writeDebug(config, "Running the applyDefaultOptions hook...");
47815
47919
  options = await Promise.resolve(
47816
47920
  generatorOptions.hooks.applyDefaultOptions(options, config)
47817
47921
  );
47818
- getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk2.dim("Completed the applyDefaultOptions hook..."));
47922
+ writeDebug(config, "Completed the applyDefaultOptions hook");
47819
47923
  }
47820
- getLogLevel(config.logLevel) >= LogLevel.INFO && console.info(chalk2.hex("#0ea5e9").italic("\n\n \u2699\uFE0F Generator schema options: \n"), options);
47924
+ writeTrace(
47925
+ config,
47926
+ `Generator schema options \u2699\uFE0F
47927
+ ${Object.keys(options).map((key) => ` - ${key}=${JSON.stringify(options[key])}`).join("\n")}`
47928
+ );
47821
47929
  const tokenized = applyWorkspaceTokens(
47822
47930
  options,
47823
47931
  { workspaceRoot: tree.root, config },
47824
47932
  applyWorkspaceGeneratorTokens
47825
47933
  );
47826
47934
  if (generatorOptions?.hooks?.preProcess) {
47827
- getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk2.dim("Running the preProcess hook..."));
47828
- await Promise.resolve(generatorOptions.hooks.preProcess(options, config));
47829
- getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk2.dim("Completed the preProcess hook..."));
47935
+ writeDebug(config, "Running the preProcess hook...");
47936
+ await Promise.resolve(generatorOptions.hooks.preProcess(tokenized, config));
47937
+ writeDebug(config, "Completed the preProcess hook");
47830
47938
  }
47831
47939
  const result = await Promise.resolve(generatorFn(tree, tokenized, config));
47832
47940
  if (result && (!result.success || result.error && result?.error?.message && typeof result?.error?.message === "string" && result?.error?.name && typeof result?.error?.name === "string")) {
@@ -47835,33 +47943,31 @@ ${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\
47835
47943
  });
47836
47944
  }
47837
47945
  if (generatorOptions?.hooks?.postProcess) {
47838
- getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk2.dim("Running the postProcess hook..."));
47946
+ writeDebug(config, "Running the postProcess hook...");
47839
47947
  await Promise.resolve(generatorOptions.hooks.postProcess(config));
47840
- getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk2.dim("Completed the postProcess hook..."));
47948
+ writeDebug(config, "Completed the postProcess hook");
47841
47949
  }
47842
- console.info(
47843
- chalk2.bold.hex("#087f5b")(`
47844
-
47845
- \u{1F389} Successfully completed running the ${name} generator!`)
47846
- );
47950
+ writeSuccess(config, `Completed running the ${name} task executor!
47951
+ `);
47847
47952
  return {
47848
47953
  success: true
47849
47954
  };
47850
47955
  } catch (error) {
47851
- console.error(
47852
- chalk2.bold.hex("#7d1a1a")("\u274C An error occurred while running the generator\n\n"),
47853
- error
47956
+ writeFatal(
47957
+ config,
47958
+ "A fatal error occurred while running the generator - the process was forced to terminate"
47959
+ );
47960
+ writeError(
47961
+ config,
47962
+ `An exception was thrown in the generator's process
47963
+ - Details: ${error.message}
47964
+ - Stacktrace: ${error.stack}`
47854
47965
  );
47855
- console.error(error);
47856
47966
  return {
47857
47967
  success: false
47858
47968
  };
47859
47969
  } finally {
47860
- console.info(
47861
- chalk2.hex("#0ea5e9").italic(
47862
- `\u23F1\uFE0F The${name ? ` ${name}` : ""} generator took ${Date.now() - startTime}ms to complete`
47863
- )
47864
- );
47970
+ stopwatch();
47865
47971
  }
47866
47972
  };
47867
47973
 
@@ -47938,9 +48044,10 @@ function defaultConfig({
47938
48044
  outExtension
47939
48045
  };
47940
48046
  }
47941
- function getConfig(workspaceRoot, projectRoot, getConfigFn, { outputPath, tsConfig, additionalEntryPoints, platform, ...rest }) {
48047
+ function getConfig(workspaceRoot, projectRoot, getConfigFn, { outputPath, tsConfig, platform, ...rest }) {
47942
48048
  return getConfigFn({
47943
48049
  ...rest,
48050
+ additionalEntryPoints: [],
47944
48051
  outDir: outputPath,
47945
48052
  tsconfig: tsConfig,
47946
48053
  workspaceRoot,
@@ -48018,14 +48125,14 @@ async function typeScriptLibraryGeneratorFn(tree, schema) {
48018
48125
  defaultConfiguration: "production",
48019
48126
  assets: [
48020
48127
  {
48021
- "input": options.projectRoot,
48022
- "glob": "*.md",
48023
- "output": "/"
48128
+ input: options.projectRoot,
48129
+ glob: "*.md",
48130
+ output: "/"
48024
48131
  },
48025
48132
  {
48026
- "input": "",
48027
- "glob": "LICENSE",
48028
- "output": "/"
48133
+ input: "",
48134
+ glob: "LICENSE",
48135
+ output: "/"
48029
48136
  }
48030
48137
  ]
48031
48138
  },
@@ -48044,7 +48151,9 @@ async function typeScriptLibraryGeneratorFn(tree, schema) {
48044
48151
  test: {}
48045
48152
  }
48046
48153
  };
48047
- schema.platform && (projectConfig.targets.build.options.platform = schema.platform);
48154
+ if (schema.platform) {
48155
+ projectConfig.targets.build.options.platform = schema.platform;
48156
+ }
48048
48157
  createProjectTsConfigJson(tree, options);
48049
48158
  (0, import_devkit2.addProjectConfiguration)(tree, options.name, projectConfig);
48050
48159
  let repository = {
@@ -48054,19 +48163,20 @@ async function typeScriptLibraryGeneratorFn(tree, schema) {
48054
48163
  let description = schema.description ?? "\u26A1 A Storm package used to create modern, scalable web applications.";
48055
48164
  if (tree.exists("package.json")) {
48056
48165
  const packageJson = (0, import_devkit2.readJson)(tree, "package.json");
48057
- packageJson?.repository && (repository = packageJson.repository);
48058
- packageJson?.description && (description = packageJson.description);
48166
+ if (packageJson?.repository) {
48167
+ repository = packageJson.repository;
48168
+ }
48169
+ if (packageJson?.description) {
48170
+ description = packageJson.description;
48171
+ }
48059
48172
  }
48060
- const packageJsonPath = (0, import_devkit2.joinPathFragments)(
48061
- options.projectRoot,
48062
- "package.json"
48063
- );
48173
+ const packageJsonPath = (0, import_devkit2.joinPathFragments)(options.projectRoot, "package.json");
48064
48174
  if (tree.exists(packageJsonPath)) {
48065
48175
  (0, import_devkit2.updateJson)(tree, packageJsonPath, (json) => {
48066
48176
  json.name = options.importPath;
48067
48177
  json.version = "0.0.1";
48068
48178
  if (json.private && (options.publishable || options.rootProject)) {
48069
- delete json.private;
48179
+ json.private = void 0;
48070
48180
  }
48071
48181
  return {
48072
48182
  ...json,
@@ -48114,19 +48224,19 @@ async function typeScriptLibraryGeneratorFn(tree, schema) {
48114
48224
  }));
48115
48225
  }
48116
48226
  (0, import_js.addTsConfigPath)(tree, options.importPath, [
48117
- (0, import_devkit2.joinPathFragments)(
48118
- options.projectRoot,
48119
- "./src",
48120
- "index." + (options.js ? "js" : "ts")
48121
- )
48227
+ (0, import_devkit2.joinPathFragments)(options.projectRoot, "./src", `index.${options.js ? "js" : "ts"}`)
48122
48228
  ]);
48123
48229
  (0, import_js.addTsConfigPath)(tree, (0, import_devkit2.joinPathFragments)(options.importPath, "/*"), [
48124
48230
  (0, import_devkit2.joinPathFragments)(options.projectRoot, "./src", "/*")
48125
48231
  ]);
48126
48232
  if (tree.exists("package.json")) {
48127
48233
  const packageJson = (0, import_devkit2.readJson)(tree, "package.json");
48128
- packageJson?.repository && (repository = packageJson.repository);
48129
- packageJson?.description && (description = packageJson.description);
48234
+ if (packageJson?.repository) {
48235
+ repository = packageJson.repository;
48236
+ }
48237
+ if (packageJson?.description) {
48238
+ description = packageJson.description;
48239
+ }
48130
48240
  }
48131
48241
  const tsconfigPath = (0, import_devkit2.joinPathFragments)(options.projectRoot, "tsconfig.json");
48132
48242
  if (tree.exists(tsconfigPath)) {
@@ -48165,11 +48275,7 @@ async function addLint(tree, options) {
48165
48275
  tsConfigPaths: [(0, import_devkit2.joinPathFragments)(options.projectRoot, "tsconfig.json")],
48166
48276
  unitTestRunner: options.unitTestRunner,
48167
48277
  eslintFilePatterns: [
48168
- mapLintPattern(
48169
- options.projectRoot,
48170
- options.js ? "js" : "ts",
48171
- options.rootProject
48172
- )
48278
+ mapLintPattern(options.projectRoot, options.js ? "js" : "ts", options.rootProject)
48173
48279
  ],
48174
48280
  setParserOptionsProject: options.setParserOptionsProject,
48175
48281
  rootProject: options.rootProject
@@ -48215,9 +48321,7 @@ async function addLint(tree, options) {
48215
48321
  ruleOptions = {};
48216
48322
  }
48217
48323
  if (options.bundler === "esbuild") {
48218
- ruleOptions.ignoredFiles = [
48219
- "{projectRoot}/esbuild.config.{js,ts,mjs,mts}"
48220
- ];
48324
+ ruleOptions.ignoredFiles = ["{projectRoot}/esbuild.config.{js,ts,mjs,mts}"];
48221
48325
  o.rules["@nx/dependency-checks"] = [ruleSeverity, ruleOptions];
48222
48326
  }
48223
48327
  return o;
@@ -48241,10 +48345,7 @@ function createProjectTsConfigJson(tree, options) {
48241
48345
  ...options?.tsConfigOptions ?? {},
48242
48346
  compilerOptions: {
48243
48347
  ...options.rootProject ? import_js.tsConfigBaseOptions : {},
48244
- outDir: (0, import_devkit2.joinPathFragments)(
48245
- (0, import_devkit2.offsetFromRoot)(options.projectRoot),
48246
- "dist/out-tsc"
48247
- ),
48348
+ outDir: (0, import_devkit2.joinPathFragments)((0, import_devkit2.offsetFromRoot)(options.projectRoot), "dist/out-tsc"),
48248
48349
  noEmit: true,
48249
48350
  ...options?.tsConfigOptions?.compilerOptions ?? {}
48250
48351
  },
@@ -48262,11 +48363,7 @@ function createProjectTsConfigJson(tree, options) {
48262
48363
  "src/**/*.test.ts"
48263
48364
  ]
48264
48365
  };
48265
- (0, import_devkit2.writeJson)(
48266
- tree,
48267
- (0, import_devkit2.joinPathFragments)(options.projectRoot, "tsconfig.json"),
48268
- tsconfig
48269
- );
48366
+ (0, import_devkit2.writeJson)(tree, (0, import_devkit2.joinPathFragments)(options.projectRoot, "tsconfig.json"), tsconfig);
48270
48367
  }
48271
48368
  async function normalizeOptions(tree, options) {
48272
48369
  if (options.publishable) {