@storm-software/workspace-tools 1.45.1 → 1.45.2

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.
@@ -23339,7 +23339,7 @@ var require_jsonfile = __commonJS({
23339
23339
  return obj;
23340
23340
  }
23341
23341
  var readFile = universalify.fromPromise(_readFile);
23342
- function readFileSync2(file, options = {}) {
23342
+ function readFileSync3(file, options = {}) {
23343
23343
  if (typeof options === "string") {
23344
23344
  options = { encoding: options };
23345
23345
  }
@@ -23371,7 +23371,7 @@ var require_jsonfile = __commonJS({
23371
23371
  }
23372
23372
  var jsonfile = {
23373
23373
  readFile,
23374
- readFileSync: readFileSync2,
23374
+ readFileSync: readFileSync3,
23375
23375
  writeFile: writeFile2,
23376
23376
  writeFileSync: writeFileSync2
23377
23377
  };
@@ -46989,7 +46989,7 @@ var require_lib6 = __commonJS({
46989
46989
  function _interopRequireDefault(obj) {
46990
46990
  return obj && obj.__esModule ? obj : { default: obj };
46991
46991
  }
46992
- var readFileSync2 = (fp) => {
46992
+ var readFileSync3 = (fp) => {
46993
46993
  return _fs.default.readFileSync(fp, "utf8");
46994
46994
  };
46995
46995
  var pathExists = (fp) => new Promise((resolve) => {
@@ -47113,7 +47113,7 @@ var require_lib6 = __commonJS({
47113
47113
  if (this.packageJsonCache.has(filepath2)) {
47114
47114
  return this.packageJsonCache.get(filepath2)[options.packageKey];
47115
47115
  }
47116
- const data2 = this.options.parseJSON(readFileSync2(filepath2));
47116
+ const data2 = this.options.parseJSON(readFileSync3(filepath2));
47117
47117
  return data2;
47118
47118
  }
47119
47119
  };
@@ -47147,7 +47147,7 @@ var require_lib6 = __commonJS({
47147
47147
  if (this.packageJsonCache.has(filepath2)) {
47148
47148
  return this.packageJsonCache.get(filepath2)[options.packageKey];
47149
47149
  }
47150
- const data2 = this.options.parseJSON(readFileSync2(filepath2));
47150
+ const data2 = this.options.parseJSON(readFileSync3(filepath2));
47151
47151
  return data2;
47152
47152
  }
47153
47153
  };
@@ -73213,7 +73213,7 @@ var require_util5 = __commonJS({
73213
73213
  var normalize2 = createSafeHandler((url) => {
73214
73214
  });
73215
73215
  exports.normalize = normalize2;
73216
- function join2(aRoot, aPath) {
73216
+ function join3(aRoot, aPath) {
73217
73217
  const pathType = getURLType(aPath);
73218
73218
  const rootType = getURLType(aRoot);
73219
73219
  aRoot = ensureDirectory(aRoot);
@@ -73239,7 +73239,7 @@ var require_util5 = __commonJS({
73239
73239
  const newPath = withBase(aPath, withBase(aRoot, base));
73240
73240
  return computeRelativeURL(base, newPath);
73241
73241
  }
73242
- exports.join = join2;
73242
+ exports.join = join3;
73243
73243
  function relative(rootURL, targetURL) {
73244
73244
  const result = relativeIfPossible(rootURL, targetURL);
73245
73245
  return typeof result === "string" ? result : normalize2(targetURL);
@@ -73269,9 +73269,9 @@ var require_util5 = __commonJS({
73269
73269
  }
73270
73270
  let url = normalize2(sourceURL || "");
73271
73271
  if (sourceRoot)
73272
- url = join2(sourceRoot, url);
73272
+ url = join3(sourceRoot, url);
73273
73273
  if (sourceMapURL)
73274
- url = join2(trimFilename(sourceMapURL), url);
73274
+ url = join3(trimFilename(sourceMapURL), url);
73275
73275
  return url;
73276
73276
  }
73277
73277
  exports.computeSourceURL = computeSourceURL;
@@ -75036,8 +75036,8 @@ var require_source_map = __commonJS({
75036
75036
  // node_modules/.pnpm/rollup@4.5.0/node_modules/rollup/dist/native.js
75037
75037
  var require_native = __commonJS({
75038
75038
  "node_modules/.pnpm/rollup@4.5.0/node_modules/rollup/dist/native.js"(exports, module2) {
75039
- var { existsSync: existsSync2 } = require("node:fs");
75040
- var { join: join2 } = require("node:path");
75039
+ var { existsSync: existsSync3 } = require("node:fs");
75040
+ var { join: join3 } = require("node:path");
75041
75041
  var { platform, arch, report } = require("node:process");
75042
75042
  var isMusl = () => !report.getReport().header.glibcVersionRuntime;
75043
75043
  var bindingsByPlatformAndArch = {
@@ -75087,7 +75087,7 @@ If this is important to you, please consider supporting Rollup to make a native
75087
75087
  return imported.base;
75088
75088
  }
75089
75089
  var localName = `./rollup.${packageBase}.node`;
75090
- var { parse, parseAsync, xxhashBase64Url } = existsSync2(join2(__dirname, localName)) ? require(localName) : require(`@rollup/rollup-${packageBase}`);
75090
+ var { parse, parseAsync, xxhashBase64Url } = existsSync3(join3(__dirname, localName)) ? require(localName) : require(`@rollup/rollup-${packageBase}`);
75091
75091
  module2.exports.parse = parse;
75092
75092
  module2.exports.parseAsync = parseAsync;
75093
75093
  module2.exports.xxhashBase64Url = xxhashBase64Url;
@@ -104305,9 +104305,9 @@ __export(executor_exports, {
104305
104305
  tsupExecutorFn: () => tsupExecutorFn
104306
104306
  });
104307
104307
  module.exports = __toCommonJS(executor_exports);
104308
- var import_node_fs2 = require("node:fs");
104308
+ var import_node_fs3 = require("node:fs");
104309
104309
  var import_promises2 = require("node:fs/promises");
104310
- var import_node_path2 = require("node:path");
104310
+ var import_node_path3 = require("node:path");
104311
104311
  var import_esbuild_decorators = __toESM(require_src());
104312
104312
  var import_devkit2 = __toESM(require_devkit());
104313
104313
  var import_js = __toESM(require_src2());
@@ -104316,6 +104316,189 @@ var import_tsc = __toESM(require_tsc_impl());
104316
104316
 
104317
104317
  // packages/config-tools/src/config-file/get-config-file.ts
104318
104318
  var import_cosmiconfig = __toESM(require_dist(), 1);
104319
+
104320
+ // packages/config-tools/src/utilities/logger.ts
104321
+ var chalk = __toESM(require_source(), 1);
104322
+
104323
+ // packages/config-tools/src/types.ts
104324
+ var LogLevel = {
104325
+ SILENT: 0,
104326
+ FATAL: 10,
104327
+ ERROR: 20,
104328
+ WARN: 30,
104329
+ INFO: 40,
104330
+ SUCCESS: 45,
104331
+ DEBUG: 60,
104332
+ TRACE: 70,
104333
+ ALL: 100
104334
+ };
104335
+ var LogLevelLabel = {
104336
+ SILENT: "silent",
104337
+ FATAL: "fatal",
104338
+ ERROR: "error",
104339
+ WARN: "warn",
104340
+ INFO: "info",
104341
+ DEBUG: "debug",
104342
+ TRACE: "trace",
104343
+ ALL: "all"
104344
+ };
104345
+
104346
+ // packages/config-tools/src/utilities/get-log-level.ts
104347
+ var getLogLevel = (label) => {
104348
+ switch (label) {
104349
+ case "all":
104350
+ return LogLevel.ALL;
104351
+ case "trace":
104352
+ return LogLevel.TRACE;
104353
+ case "debug":
104354
+ return LogLevel.DEBUG;
104355
+ case "info":
104356
+ return LogLevel.INFO;
104357
+ case "warn":
104358
+ return LogLevel.WARN;
104359
+ case "error":
104360
+ return LogLevel.ERROR;
104361
+ case "fatal":
104362
+ return LogLevel.FATAL;
104363
+ case "silent":
104364
+ return LogLevel.SILENT;
104365
+ default:
104366
+ return LogLevel.INFO;
104367
+ }
104368
+ };
104369
+ var getLogLevelLabel = (logLevel) => {
104370
+ if (logLevel >= LogLevel.ALL) {
104371
+ return LogLevelLabel.ALL;
104372
+ }
104373
+ if (logLevel >= LogLevel.TRACE) {
104374
+ return LogLevelLabel.TRACE;
104375
+ }
104376
+ if (logLevel >= LogLevel.DEBUG) {
104377
+ return LogLevelLabel.DEBUG;
104378
+ }
104379
+ if (logLevel >= LogLevel.INFO) {
104380
+ return LogLevelLabel.INFO;
104381
+ }
104382
+ if (logLevel >= LogLevel.WARN) {
104383
+ return LogLevelLabel.WARN;
104384
+ }
104385
+ if (logLevel >= LogLevel.ERROR) {
104386
+ return LogLevelLabel.ERROR;
104387
+ }
104388
+ if (logLevel >= LogLevel.FATAL) {
104389
+ return LogLevelLabel.FATAL;
104390
+ }
104391
+ if (logLevel <= LogLevel.SILENT) {
104392
+ return LogLevelLabel.SILENT;
104393
+ }
104394
+ return LogLevelLabel.INFO;
104395
+ };
104396
+
104397
+ // packages/config-tools/src/utilities/logger.ts
104398
+ var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
104399
+ 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)) {
104400
+ return (_) => {
104401
+ };
104402
+ }
104403
+ if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel || typeof logLevel === "string" && LogLevel.FATAL >= getLogLevel(logLevel)) {
104404
+ return (message) => {
104405
+ console.error(
104406
+ `
104407
+ ${chalk.bold.hex(config?.colors?.fatal ? config.colors.fatal : "#1fb2a6")(">")} ${chalk.bold.bgHex(config?.colors?.fatal ? config.colors.fatal : "#1fb2a6").white(" \u{1F480} Fatal ")} ${chalk.hex(
104408
+ config?.colors?.fatal ? config.colors.fatal : "#1fb2a6"
104409
+ )(message)}
104410
+
104411
+ `
104412
+ );
104413
+ };
104414
+ }
104415
+ if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel || typeof logLevel === "string" && LogLevel.ERROR >= getLogLevel(logLevel)) {
104416
+ return (message) => {
104417
+ console.error(
104418
+ `
104419
+ ${chalk.bold.hex(config?.colors?.error ? config.colors.error : "#7d1a1a")(">")} ${chalk.bold.bgHex(config?.colors?.error ? config.colors.error : "#7d1a1a").white(" \u{1F6D1} Error ")} ${chalk.hex(
104420
+ config?.colors?.error ? config.colors.error : "#7d1a1a"
104421
+ )(message)}
104422
+ `
104423
+ );
104424
+ };
104425
+ }
104426
+ if (typeof logLevel === "number" && LogLevel.WARN >= logLevel || typeof logLevel === "string" && LogLevel.WARN >= getLogLevel(logLevel)) {
104427
+ return (message) => {
104428
+ console.warn(
104429
+ `
104430
+ ${chalk.bold.hex(config?.colors?.warning ? config.colors.warning : "#fcc419")(">")} ${chalk.bold.bgHex(config?.colors?.warning ? config.colors.warning : "#fcc419").white(" \u26A0\uFE0F Warn ")} ${chalk.hex(
104431
+ config?.colors?.warning ? config.colors.warning : "#fcc419"
104432
+ )(message)}
104433
+ `
104434
+ );
104435
+ };
104436
+ }
104437
+ if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
104438
+ return (message) => {
104439
+ console.info(
104440
+ `
104441
+ ${chalk.bold.hex(config?.colors?.info ? config.colors.info : "#0ea5e9")(">")} ${chalk.bold.bgHex(config?.colors?.info ? config.colors.info : "#0ea5e9").white(" \u{1F4EC} Info ")} ${chalk.hex(
104442
+ config?.colors?.info ? config.colors.info : "#0ea5e9"
104443
+ )(message)}
104444
+ `
104445
+ );
104446
+ };
104447
+ }
104448
+ if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
104449
+ return (message) => {
104450
+ console.info(
104451
+ `
104452
+ ${chalk.bold.hex(config?.colors?.success ? config.colors.success : "#087f5b")(">")} ${chalk.bold.bgHex(config?.colors?.success ? config.colors.success : "#087f5b").white(" \u{1F389} Success ")} ${chalk.hex(
104453
+ config?.colors?.success ? config.colors.success : "#087f5b"
104454
+ )(message)}
104455
+ `
104456
+ );
104457
+ };
104458
+ }
104459
+ if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel || typeof logLevel === "string" && LogLevel.DEBUG >= getLogLevel(logLevel)) {
104460
+ return (message) => {
104461
+ console.debug(
104462
+ `
104463
+ ${chalk.bold.hex(config?.colors?.primary ? config.colors.primary : "#1fb2a6")(">")} ${chalk.bold.bgHex(config?.colors?.primary ? config.colors.primary : "#1fb2a6").white(" \u{1F9EA} Debug ")} ${chalk.hex(
104464
+ config?.colors?.primary ? config.colors.primary : "#1fb2a6"
104465
+ )(message)}
104466
+ `
104467
+ );
104468
+ };
104469
+ }
104470
+ return (message) => {
104471
+ console.log(
104472
+ `
104473
+ ${chalk.bold.hex(config?.colors?.primary ? config.colors.primary : "#1fb2a6")(">")} ${chalk.bold.bgHex(config?.colors?.primary ? config.colors.primary : "#1fb2a6").white(" \u{1F4E2} System ")} ${chalk.hex(
104474
+ config?.colors?.primary ? config.colors.primary : "#1fb2a6"
104475
+ )(message)}
104476
+ `
104477
+ );
104478
+ };
104479
+ };
104480
+ var writeFatal = (config, message) => getLogFn(config, LogLevel.FATAL)(message);
104481
+ var writeError = (config, message) => getLogFn(config, LogLevel.ERROR)(message);
104482
+ var writeWarning = (config, message) => getLogFn(config, LogLevel.WARN)(message);
104483
+ var writeInfo = (config, message) => getLogFn(config, LogLevel.INFO)(message);
104484
+ var writeSuccess = (config, message) => getLogFn(config, LogLevel.SUCCESS)(message);
104485
+ var writeDebug = (config, message) => getLogFn(config, LogLevel.DEBUG)(message);
104486
+ var writeTrace = (config, message) => getLogFn(config, LogLevel.TRACE)(message);
104487
+ var getStopwatch = (name) => {
104488
+ const start = process.hrtime();
104489
+ return () => {
104490
+ const end = process.hrtime(start);
104491
+ console.info(
104492
+ chalk.dim(
104493
+ `\u23F1\uFE0F The${name ? ` ${name}` : ""} process took ${Math.round(
104494
+ end[0] * 1e3 + end[1] / 1e6
104495
+ )}ms to complete`
104496
+ )
104497
+ );
104498
+ };
104499
+ };
104500
+
104501
+ // packages/config-tools/src/config-file/get-config-file.ts
104319
104502
  var _static_cache = void 0;
104320
104503
  var getConfigFileName = async (fileName, filePath) => (0, import_cosmiconfig.cosmiconfig)(fileName, { cache: true }).search(filePath);
104321
104504
  var getConfigFile = async (filePath) => {
@@ -104342,6 +104525,10 @@ var getConfigFile = async (filePath) => {
104342
104525
  console.warn(
104343
104526
  "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."
104344
104527
  );
104528
+ writeWarning(
104529
+ { logLevel: "error" },
104530
+ "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."
104531
+ );
104345
104532
  return void 0;
104346
104533
  }
104347
104534
  const config = cosmiconfigResult.config ?? {};
@@ -104422,6 +104609,10 @@ Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
104422
104609
  return result;
104423
104610
  }
104424
104611
 
104612
+ // packages/config-tools/src/utilities/get-default-config.ts
104613
+ var import_node_fs2 = require("node:fs");
104614
+ var import_node_path2 = require("node:path");
104615
+
104425
104616
  // node_modules/.pnpm/zod@3.22.4/node_modules/zod/lib/index.mjs
104426
104617
  var util;
104427
104618
  (function(util2) {
@@ -108082,184 +108273,50 @@ var DefaultStormConfig = {
108082
108273
  colors: { ...DefaultColorConfig },
108083
108274
  extensions: {}
108084
108275
  };
108085
-
108086
- // packages/config-tools/src/types.ts
108087
- var LogLevel = {
108088
- SILENT: 0,
108089
- FATAL: 10,
108090
- ERROR: 20,
108091
- WARN: 30,
108092
- INFO: 40,
108093
- SUCCESS: 45,
108094
- DEBUG: 60,
108095
- TRACE: 70,
108096
- ALL: 100
108097
- };
108098
- var LogLevelLabel = {
108099
- SILENT: "silent",
108100
- FATAL: "fatal",
108101
- ERROR: "error",
108102
- WARN: "warn",
108103
- INFO: "info",
108104
- DEBUG: "debug",
108105
- TRACE: "trace",
108106
- ALL: "all"
108107
- };
108108
-
108109
- // packages/config-tools/src/utilities/get-log-level.ts
108110
- var getLogLevel = (label) => {
108111
- switch (label) {
108112
- case "all":
108113
- return LogLevel.ALL;
108114
- case "trace":
108115
- return LogLevel.TRACE;
108116
- case "debug":
108117
- return LogLevel.DEBUG;
108118
- case "info":
108119
- return LogLevel.INFO;
108120
- case "warn":
108121
- return LogLevel.WARN;
108122
- case "error":
108123
- return LogLevel.ERROR;
108124
- case "fatal":
108125
- return LogLevel.FATAL;
108126
- case "silent":
108127
- return LogLevel.SILENT;
108128
- default:
108129
- return LogLevel.INFO;
108130
- }
108131
- };
108132
- var getLogLevelLabel = (logLevel) => {
108133
- if (logLevel >= LogLevel.ALL) {
108134
- return LogLevelLabel.ALL;
108135
- }
108136
- if (logLevel >= LogLevel.TRACE) {
108137
- return LogLevelLabel.TRACE;
108138
- }
108139
- if (logLevel >= LogLevel.DEBUG) {
108140
- return LogLevelLabel.DEBUG;
108141
- }
108142
- if (logLevel >= LogLevel.INFO) {
108143
- return LogLevelLabel.INFO;
108144
- }
108145
- if (logLevel >= LogLevel.WARN) {
108146
- return LogLevelLabel.WARN;
108147
- }
108148
- if (logLevel >= LogLevel.ERROR) {
108149
- return LogLevelLabel.ERROR;
108150
- }
108151
- if (logLevel >= LogLevel.FATAL) {
108152
- return LogLevelLabel.FATAL;
108153
- }
108154
- if (logLevel <= LogLevel.SILENT) {
108155
- return LogLevelLabel.SILENT;
108156
- }
108157
- return LogLevelLabel.INFO;
108158
- };
108159
-
108160
- // packages/config-tools/src/utilities/logger.ts
108161
- var chalk = __toESM(require_source(), 1);
108162
- var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
108163
- 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)) {
108164
- return (_) => {
108165
- };
108166
- }
108167
- if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel || typeof logLevel === "string" && LogLevel.FATAL >= getLogLevel(logLevel)) {
108168
- return (message) => {
108169
- console.error(
108170
- `
108171
- ${chalk.bold.hex(config?.colors?.fatal ? config.colors.fatal : "#1fb2a6")(">")} ${chalk.bold.bgHex(config?.colors?.fatal ? config.colors.fatal : "#1fb2a6").white(" \u{1F480} Fatal ")} ${chalk.hex(
108172
- config?.colors?.fatal ? config.colors.fatal : "#1fb2a6"
108173
- )(message)}
108174
-
108175
- `
108176
- );
108177
- };
108178
- }
108179
- if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel || typeof logLevel === "string" && LogLevel.ERROR >= getLogLevel(logLevel)) {
108180
- return (message) => {
108181
- console.error(
108182
- `
108183
- ${chalk.bold.hex(config?.colors?.error ? config.colors.error : "#7d1a1a")(">")} ${chalk.bold.bgHex(config?.colors?.error ? config.colors.error : "#7d1a1a").white(" \u{1F6D1} Error ")} ${chalk.hex(
108184
- config?.colors?.error ? config.colors.error : "#7d1a1a"
108185
- )(message)}
108186
- `
108187
- );
108188
- };
108189
- }
108190
- if (typeof logLevel === "number" && LogLevel.WARN >= logLevel || typeof logLevel === "string" && LogLevel.WARN >= getLogLevel(logLevel)) {
108191
- return (message) => {
108192
- console.warn(
108193
- `
108194
- ${chalk.bold.hex(config?.colors?.warning ? config.colors.warning : "#fcc419")(">")} ${chalk.bold.bgHex(config?.colors?.warning ? config.colors.warning : "#fcc419").white(" \u26A0\uFE0F Warn ")} ${chalk.hex(
108195
- config?.colors?.warning ? config.colors.warning : "#fcc419"
108196
- )(message)}
108197
- `
108198
- );
108199
- };
108200
- }
108201
- if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
108202
- return (message) => {
108203
- console.info(
108204
- `
108205
- ${chalk.bold.hex(config?.colors?.info ? config.colors.info : "#0ea5e9")(">")} ${chalk.bold.bgHex(config?.colors?.info ? config.colors.info : "#0ea5e9").white(" \u{1F4EC} Info ")} ${chalk.hex(
108206
- config?.colors?.info ? config.colors.info : "#0ea5e9"
108207
- )(message)}
108208
- `
108209
- );
108210
- };
108211
- }
108212
- if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
108213
- return (message) => {
108214
- console.info(
108215
- `
108216
- ${chalk.bold.hex(config?.colors?.success ? config.colors.success : "#087f5b")(">")} ${chalk.bold.bgHex(config?.colors?.success ? config.colors.success : "#087f5b").white(" \u{1F389} Success ")} ${chalk.hex(
108217
- config?.colors?.success ? config.colors.success : "#087f5b"
108218
- )(message)}
108219
- `
108220
- );
108221
- };
108222
- }
108223
- if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel || typeof logLevel === "string" && LogLevel.DEBUG >= getLogLevel(logLevel)) {
108224
- return (message) => {
108225
- console.debug(
108226
- `
108227
- ${chalk.bold.hex(config?.colors?.primary ? config.colors.primary : "#1fb2a6")(">")} ${chalk.bold.bgHex(config?.colors?.primary ? config.colors.primary : "#1fb2a6").white(" \u{1F9EA} Debug ")} ${chalk.hex(
108228
- config?.colors?.primary ? config.colors.primary : "#1fb2a6"
108229
- )(message)}
108230
- `
108231
- );
108232
- };
108276
+ var getDefaultConfig = (config = {}, root) => {
108277
+ let name = "storm-workspace";
108278
+ let namespace = "storm-software";
108279
+ let repository = "https://github.com/storm-software/storm-ops";
108280
+ let license = DefaultStormConfig.license;
108281
+ let homepage = DefaultStormConfig.homepage;
108282
+ const workspaceRoot = findWorkspaceRoot(root);
108283
+ if ((0, import_node_fs2.existsSync)((0, import_node_path2.join)(workspaceRoot, "package.json"))) {
108284
+ const file = (0, import_node_fs2.readFileSync)((0, import_node_path2.join)(workspaceRoot, "package.json"), {
108285
+ encoding: "utf-8"
108286
+ });
108287
+ if (file) {
108288
+ const packageJson = JSON.parse(file);
108289
+ if (packageJson.name) {
108290
+ name = packageJson.name;
108291
+ }
108292
+ if (packageJson.namespace) {
108293
+ namespace = packageJson.namespace;
108294
+ }
108295
+ if (packageJson.repository?.url) {
108296
+ repository = packageJson.repository?.url;
108297
+ }
108298
+ if (packageJson.license) {
108299
+ license = packageJson.license;
108300
+ }
108301
+ if (packageJson.homepage) {
108302
+ homepage = packageJson.homepage;
108303
+ }
108304
+ }
108233
108305
  }
108234
- return (message) => {
108235
- console.log(
108236
- `
108237
- ${chalk.bold.hex(config?.colors?.primary ? config.colors.primary : "#1fb2a6")(">")} ${chalk.bold.bgHex(config?.colors?.primary ? config.colors.primary : "#1fb2a6").white(" \u{1F4E2} System ")} ${chalk.hex(
108238
- config?.colors?.primary ? config.colors.primary : "#1fb2a6"
108239
- )(message)}
108240
- `
108241
- );
108242
- };
108243
- };
108244
- var writeFatal = (config, message) => getLogFn(config, LogLevel.FATAL)(message);
108245
- var writeError = (config, message) => getLogFn(config, LogLevel.ERROR)(message);
108246
- var writeWarning = (config, message) => getLogFn(config, LogLevel.WARN)(message);
108247
- var writeInfo = (config, message) => getLogFn(config, LogLevel.INFO)(message);
108248
- var writeSuccess = (config, message) => getLogFn(config, LogLevel.SUCCESS)(message);
108249
- var writeDebug = (config, message) => getLogFn(config, LogLevel.DEBUG)(message);
108250
- var writeTrace = (config, message) => getLogFn(config, LogLevel.TRACE)(message);
108251
- var getStopwatch = (name) => {
108252
- const start = process.hrtime();
108253
- return () => {
108254
- const end = process.hrtime(start);
108255
- console.info(
108256
- chalk.dim(
108257
- `\u23F1\uFE0F The${name ? ` ${name}` : ""} process took ${Math.round(
108258
- end[0] * 1e3 + end[1] / 1e6
108259
- )}ms to complete`
108260
- )
108261
- );
108262
- };
108306
+ return StormConfigSchema.parse({
108307
+ ...DefaultStormConfig,
108308
+ ...config,
108309
+ colors: { ...DefaultColorConfig, ...config.colors },
108310
+ workspaceRoot,
108311
+ name,
108312
+ namespace,
108313
+ repository,
108314
+ license: license ?? DefaultStormConfig.license,
108315
+ homepage: homepage ?? DefaultStormConfig.homepage,
108316
+ extensions: {
108317
+ ...config.extensions
108318
+ }
108319
+ });
108263
108320
  };
108264
108321
 
108265
108322
  // packages/config-tools/src/env/set-env.ts
@@ -108449,39 +108506,21 @@ var getConfigEnv = () => {
108449
108506
 
108450
108507
  // packages/config-tools/src/create-storm-config.ts
108451
108508
  var loadStormConfig = async (workspaceRoot) => {
108509
+ let config = {};
108452
108510
  let _workspaceRoot = workspaceRoot;
108453
108511
  if (!_workspaceRoot) {
108454
108512
  _workspaceRoot = findWorkspaceRoot();
108455
108513
  }
108456
- const configFile = await getConfigFile(_workspaceRoot);
108457
- const configEnv = getConfigEnv();
108458
- for (const key of Object.keys(configEnv)) {
108459
- if (configEnv[key] !== void 0 && configEnv[key] !== null) {
108460
- if (key === "colors") {
108461
- configFile.colors = {
108462
- primary: process.env.STORM_COLOR_PRIMARY ?? configFile.colors?.primary,
108463
- background: process.env.STORM_COLOR_BACKGROUND ?? configFile.colors?.background,
108464
- success: process.env.STORM_COLOR_SUCCESS ?? configFile.colors?.success,
108465
- info: process.env.STORM_COLOR_INFO ?? configFile.colors?.info,
108466
- warning: process.env.STORM_COLOR_WARNING ?? configFile.colors?.warning,
108467
- error: process.env.STORM_COLOR_ERROR ?? configFile.colors?.error,
108468
- fatal: process.env.STORM_COLOR_FATAL ?? configFile.colors?.fatal
108469
- };
108470
- } else {
108471
- configFile[key] = configEnv[key];
108472
- }
108473
- }
108474
- }
108475
- const config = StormConfigSchema.parse(configFile);
108514
+ config = StormConfigSchema.parse(
108515
+ await getDefaultConfig(
108516
+ {
108517
+ ...await getConfigFile(_workspaceRoot),
108518
+ ...getConfigEnv()
108519
+ },
108520
+ _workspaceRoot
108521
+ )
108522
+ );
108476
108523
  setConfigEnv(config);
108477
- console.debug("\r\n\r\n");
108478
- console.debug(`Loaded Storm config from ${config.configFile}`);
108479
- for (const key of Object.keys(configFile)) {
108480
- console.debug(`
108481
- ----- ${key} ----- `);
108482
- console.debug(configFile[key]);
108483
- }
108484
- console.debug("\r\n\r\n");
108485
108524
  return config;
108486
108525
  };
108487
108526
 
@@ -115306,7 +115345,7 @@ ${externalDependencies.map((dep) => {
115306
115345
  packageJson.repository.directory ??= projectRoot ? projectRoot : (0, import_devkit2.joinPathFragments)("packages", context.projectName);
115307
115346
  const packageJsonPath = (0, import_devkit2.joinPathFragments)(context.root, options.outputPath, "package.json");
115308
115347
  writeDebug(config, `\u26A1 Writing package.json file to: ${packageJsonPath}`);
115309
- (0, import_node_fs2.writeFileSync)(
115348
+ (0, import_node_fs3.writeFileSync)(
115310
115349
  packageJsonPath,
115311
115350
  await (0, import_prettier.format)(JSON.stringify(packageJson), {
115312
115351
  ...prettierOptions,
@@ -115330,7 +115369,7 @@ ${externalDependencies.map((dep) => {
115330
115369
  await (0, import_prettier.format)(
115331
115370
  `${options.banner ? options.banner.startsWith("//") ? options.banner : `// ${options.banner}` : ""}
115332
115371
 
115333
- ${(0, import_node_fs2.readFileSync)(file, "utf-8")}`,
115372
+ ${(0, import_node_fs3.readFileSync)(file, "utf-8")}`,
115334
115373
  {
115335
115374
  ...prettierOptions,
115336
115375
  parser: "typescript"
@@ -115439,7 +115478,7 @@ function getNormalizedTsConfig(workspaceRoot, outputPath, options) {
115439
115478
  }
115440
115479
  },
115441
115480
  ts.sys,
115442
- (0, import_node_path2.dirname)(options.tsConfig)
115481
+ (0, import_node_path3.dirname)(options.tsConfig)
115443
115482
  );
115444
115483
  tsConfig.options.pathsBasePath = workspaceRoot;
115445
115484
  if (tsConfig.options.incremental && !tsConfig.options.tsBuildInfoFile) {