@storm-software/workspace-tools 1.45.0 → 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.
- package/CHANGELOG.md +14 -0
- package/index.js +358 -321
- package/meta.json +1 -1
- package/package.json +1 -1
- package/src/base/index.js +246 -206
- package/src/executors/design-tokens/executor.js +259 -219
- package/src/executors/tsup/executor.js +313 -22304
- package/src/executors/tsup/schema.d.ts +0 -1
- package/src/executors/tsup/schema.json +0 -5
- package/src/executors/tsup-browser/executor.js +269 -22260
- package/src/executors/tsup-neutral/executor.js +269 -22260
- package/src/executors/tsup-node/executor.js +269 -22260
- package/src/executors/typia/executor.js +250 -210
- package/src/generators/browser-library/generator.js +246 -206
- package/src/generators/config-schema/generator.js +244 -204
- package/src/generators/neutral-library/generator.js +246 -206
- package/src/generators/node-library/generator.js +246 -206
- package/src/generators/preset/generator.js +244 -204
|
@@ -34308,7 +34308,7 @@ var require_jsonfile = __commonJS({
|
|
|
34308
34308
|
return obj;
|
|
34309
34309
|
}
|
|
34310
34310
|
var readFile = universalify.fromPromise(_readFile);
|
|
34311
|
-
function
|
|
34311
|
+
function readFileSync2(file, options = {}) {
|
|
34312
34312
|
if (typeof options === "string") {
|
|
34313
34313
|
options = { encoding: options };
|
|
34314
34314
|
}
|
|
@@ -34340,7 +34340,7 @@ var require_jsonfile = __commonJS({
|
|
|
34340
34340
|
}
|
|
34341
34341
|
var jsonfile = {
|
|
34342
34342
|
readFile,
|
|
34343
|
-
readFileSync,
|
|
34343
|
+
readFileSync: readFileSync2,
|
|
34344
34344
|
writeFile,
|
|
34345
34345
|
writeFileSync
|
|
34346
34346
|
};
|
|
@@ -43477,6 +43477,189 @@ var import_devkit2 = __toESM(require_devkit());
|
|
|
43477
43477
|
|
|
43478
43478
|
// packages/config-tools/src/config-file/get-config-file.ts
|
|
43479
43479
|
var import_cosmiconfig = __toESM(require_dist(), 1);
|
|
43480
|
+
|
|
43481
|
+
// packages/config-tools/src/utilities/logger.ts
|
|
43482
|
+
var chalk = __toESM(require_source(), 1);
|
|
43483
|
+
|
|
43484
|
+
// packages/config-tools/src/types.ts
|
|
43485
|
+
var LogLevel = {
|
|
43486
|
+
SILENT: 0,
|
|
43487
|
+
FATAL: 10,
|
|
43488
|
+
ERROR: 20,
|
|
43489
|
+
WARN: 30,
|
|
43490
|
+
INFO: 40,
|
|
43491
|
+
SUCCESS: 45,
|
|
43492
|
+
DEBUG: 60,
|
|
43493
|
+
TRACE: 70,
|
|
43494
|
+
ALL: 100
|
|
43495
|
+
};
|
|
43496
|
+
var LogLevelLabel = {
|
|
43497
|
+
SILENT: "silent",
|
|
43498
|
+
FATAL: "fatal",
|
|
43499
|
+
ERROR: "error",
|
|
43500
|
+
WARN: "warn",
|
|
43501
|
+
INFO: "info",
|
|
43502
|
+
DEBUG: "debug",
|
|
43503
|
+
TRACE: "trace",
|
|
43504
|
+
ALL: "all"
|
|
43505
|
+
};
|
|
43506
|
+
|
|
43507
|
+
// packages/config-tools/src/utilities/get-log-level.ts
|
|
43508
|
+
var getLogLevel = (label) => {
|
|
43509
|
+
switch (label) {
|
|
43510
|
+
case "all":
|
|
43511
|
+
return LogLevel.ALL;
|
|
43512
|
+
case "trace":
|
|
43513
|
+
return LogLevel.TRACE;
|
|
43514
|
+
case "debug":
|
|
43515
|
+
return LogLevel.DEBUG;
|
|
43516
|
+
case "info":
|
|
43517
|
+
return LogLevel.INFO;
|
|
43518
|
+
case "warn":
|
|
43519
|
+
return LogLevel.WARN;
|
|
43520
|
+
case "error":
|
|
43521
|
+
return LogLevel.ERROR;
|
|
43522
|
+
case "fatal":
|
|
43523
|
+
return LogLevel.FATAL;
|
|
43524
|
+
case "silent":
|
|
43525
|
+
return LogLevel.SILENT;
|
|
43526
|
+
default:
|
|
43527
|
+
return LogLevel.INFO;
|
|
43528
|
+
}
|
|
43529
|
+
};
|
|
43530
|
+
var getLogLevelLabel = (logLevel) => {
|
|
43531
|
+
if (logLevel >= LogLevel.ALL) {
|
|
43532
|
+
return LogLevelLabel.ALL;
|
|
43533
|
+
}
|
|
43534
|
+
if (logLevel >= LogLevel.TRACE) {
|
|
43535
|
+
return LogLevelLabel.TRACE;
|
|
43536
|
+
}
|
|
43537
|
+
if (logLevel >= LogLevel.DEBUG) {
|
|
43538
|
+
return LogLevelLabel.DEBUG;
|
|
43539
|
+
}
|
|
43540
|
+
if (logLevel >= LogLevel.INFO) {
|
|
43541
|
+
return LogLevelLabel.INFO;
|
|
43542
|
+
}
|
|
43543
|
+
if (logLevel >= LogLevel.WARN) {
|
|
43544
|
+
return LogLevelLabel.WARN;
|
|
43545
|
+
}
|
|
43546
|
+
if (logLevel >= LogLevel.ERROR) {
|
|
43547
|
+
return LogLevelLabel.ERROR;
|
|
43548
|
+
}
|
|
43549
|
+
if (logLevel >= LogLevel.FATAL) {
|
|
43550
|
+
return LogLevelLabel.FATAL;
|
|
43551
|
+
}
|
|
43552
|
+
if (logLevel <= LogLevel.SILENT) {
|
|
43553
|
+
return LogLevelLabel.SILENT;
|
|
43554
|
+
}
|
|
43555
|
+
return LogLevelLabel.INFO;
|
|
43556
|
+
};
|
|
43557
|
+
|
|
43558
|
+
// packages/config-tools/src/utilities/logger.ts
|
|
43559
|
+
var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
|
|
43560
|
+
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)) {
|
|
43561
|
+
return (_) => {
|
|
43562
|
+
};
|
|
43563
|
+
}
|
|
43564
|
+
if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel || typeof logLevel === "string" && LogLevel.FATAL >= getLogLevel(logLevel)) {
|
|
43565
|
+
return (message) => {
|
|
43566
|
+
console.error(
|
|
43567
|
+
`
|
|
43568
|
+
${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(
|
|
43569
|
+
config?.colors?.fatal ? config.colors.fatal : "#1fb2a6"
|
|
43570
|
+
)(message)}
|
|
43571
|
+
|
|
43572
|
+
`
|
|
43573
|
+
);
|
|
43574
|
+
};
|
|
43575
|
+
}
|
|
43576
|
+
if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel || typeof logLevel === "string" && LogLevel.ERROR >= getLogLevel(logLevel)) {
|
|
43577
|
+
return (message) => {
|
|
43578
|
+
console.error(
|
|
43579
|
+
`
|
|
43580
|
+
${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(
|
|
43581
|
+
config?.colors?.error ? config.colors.error : "#7d1a1a"
|
|
43582
|
+
)(message)}
|
|
43583
|
+
`
|
|
43584
|
+
);
|
|
43585
|
+
};
|
|
43586
|
+
}
|
|
43587
|
+
if (typeof logLevel === "number" && LogLevel.WARN >= logLevel || typeof logLevel === "string" && LogLevel.WARN >= getLogLevel(logLevel)) {
|
|
43588
|
+
return (message) => {
|
|
43589
|
+
console.warn(
|
|
43590
|
+
`
|
|
43591
|
+
${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(
|
|
43592
|
+
config?.colors?.warning ? config.colors.warning : "#fcc419"
|
|
43593
|
+
)(message)}
|
|
43594
|
+
`
|
|
43595
|
+
);
|
|
43596
|
+
};
|
|
43597
|
+
}
|
|
43598
|
+
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
|
|
43599
|
+
return (message) => {
|
|
43600
|
+
console.info(
|
|
43601
|
+
`
|
|
43602
|
+
${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(
|
|
43603
|
+
config?.colors?.info ? config.colors.info : "#0ea5e9"
|
|
43604
|
+
)(message)}
|
|
43605
|
+
`
|
|
43606
|
+
);
|
|
43607
|
+
};
|
|
43608
|
+
}
|
|
43609
|
+
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
|
|
43610
|
+
return (message) => {
|
|
43611
|
+
console.info(
|
|
43612
|
+
`
|
|
43613
|
+
${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(
|
|
43614
|
+
config?.colors?.success ? config.colors.success : "#087f5b"
|
|
43615
|
+
)(message)}
|
|
43616
|
+
`
|
|
43617
|
+
);
|
|
43618
|
+
};
|
|
43619
|
+
}
|
|
43620
|
+
if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel || typeof logLevel === "string" && LogLevel.DEBUG >= getLogLevel(logLevel)) {
|
|
43621
|
+
return (message) => {
|
|
43622
|
+
console.debug(
|
|
43623
|
+
`
|
|
43624
|
+
${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(
|
|
43625
|
+
config?.colors?.primary ? config.colors.primary : "#1fb2a6"
|
|
43626
|
+
)(message)}
|
|
43627
|
+
`
|
|
43628
|
+
);
|
|
43629
|
+
};
|
|
43630
|
+
}
|
|
43631
|
+
return (message) => {
|
|
43632
|
+
console.log(
|
|
43633
|
+
`
|
|
43634
|
+
${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(
|
|
43635
|
+
config?.colors?.primary ? config.colors.primary : "#1fb2a6"
|
|
43636
|
+
)(message)}
|
|
43637
|
+
`
|
|
43638
|
+
);
|
|
43639
|
+
};
|
|
43640
|
+
};
|
|
43641
|
+
var writeFatal = (config, message) => getLogFn(config, LogLevel.FATAL)(message);
|
|
43642
|
+
var writeError = (config, message) => getLogFn(config, LogLevel.ERROR)(message);
|
|
43643
|
+
var writeWarning = (config, message) => getLogFn(config, LogLevel.WARN)(message);
|
|
43644
|
+
var writeInfo = (config, message) => getLogFn(config, LogLevel.INFO)(message);
|
|
43645
|
+
var writeSuccess = (config, message) => getLogFn(config, LogLevel.SUCCESS)(message);
|
|
43646
|
+
var writeDebug = (config, message) => getLogFn(config, LogLevel.DEBUG)(message);
|
|
43647
|
+
var writeTrace = (config, message) => getLogFn(config, LogLevel.TRACE)(message);
|
|
43648
|
+
var getStopwatch = (name) => {
|
|
43649
|
+
const start = process.hrtime();
|
|
43650
|
+
return () => {
|
|
43651
|
+
const end = process.hrtime(start);
|
|
43652
|
+
console.info(
|
|
43653
|
+
chalk.dim(
|
|
43654
|
+
`\u23F1\uFE0F The${name ? ` ${name}` : ""} process took ${Math.round(
|
|
43655
|
+
end[0] * 1e3 + end[1] / 1e6
|
|
43656
|
+
)}ms to complete`
|
|
43657
|
+
)
|
|
43658
|
+
);
|
|
43659
|
+
};
|
|
43660
|
+
};
|
|
43661
|
+
|
|
43662
|
+
// packages/config-tools/src/config-file/get-config-file.ts
|
|
43480
43663
|
var _static_cache = void 0;
|
|
43481
43664
|
var getConfigFileName = async (fileName, filePath) => (0, import_cosmiconfig.cosmiconfig)(fileName, { cache: true }).search(filePath);
|
|
43482
43665
|
var getConfigFile = async (filePath) => {
|
|
@@ -43503,6 +43686,10 @@ var getConfigFile = async (filePath) => {
|
|
|
43503
43686
|
console.warn(
|
|
43504
43687
|
"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."
|
|
43505
43688
|
);
|
|
43689
|
+
writeWarning(
|
|
43690
|
+
{ logLevel: "error" },
|
|
43691
|
+
"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."
|
|
43692
|
+
);
|
|
43506
43693
|
return void 0;
|
|
43507
43694
|
}
|
|
43508
43695
|
const config = cosmiconfigResult.config ?? {};
|
|
@@ -43583,6 +43770,10 @@ Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
|
|
|
43583
43770
|
return result;
|
|
43584
43771
|
}
|
|
43585
43772
|
|
|
43773
|
+
// packages/config-tools/src/utilities/get-default-config.ts
|
|
43774
|
+
var import_node_fs2 = require("node:fs");
|
|
43775
|
+
var import_node_path2 = require("node:path");
|
|
43776
|
+
|
|
43586
43777
|
// node_modules/.pnpm/zod@3.22.4/node_modules/zod/lib/index.mjs
|
|
43587
43778
|
var util;
|
|
43588
43779
|
(function(util2) {
|
|
@@ -47243,183 +47434,50 @@ var DefaultStormConfig = {
|
|
|
47243
47434
|
colors: { ...DefaultColorConfig },
|
|
47244
47435
|
extensions: {}
|
|
47245
47436
|
};
|
|
47246
|
-
|
|
47247
|
-
|
|
47248
|
-
|
|
47249
|
-
|
|
47250
|
-
|
|
47251
|
-
|
|
47252
|
-
|
|
47253
|
-
|
|
47254
|
-
|
|
47255
|
-
|
|
47256
|
-
|
|
47257
|
-
|
|
47258
|
-
|
|
47259
|
-
|
|
47260
|
-
|
|
47261
|
-
|
|
47262
|
-
|
|
47263
|
-
|
|
47264
|
-
|
|
47265
|
-
|
|
47266
|
-
|
|
47267
|
-
|
|
47268
|
-
|
|
47269
|
-
|
|
47270
|
-
|
|
47271
|
-
|
|
47272
|
-
|
|
47273
|
-
|
|
47274
|
-
|
|
47275
|
-
case "trace":
|
|
47276
|
-
return LogLevel.TRACE;
|
|
47277
|
-
case "debug":
|
|
47278
|
-
return LogLevel.DEBUG;
|
|
47279
|
-
case "info":
|
|
47280
|
-
return LogLevel.INFO;
|
|
47281
|
-
case "warn":
|
|
47282
|
-
return LogLevel.WARN;
|
|
47283
|
-
case "error":
|
|
47284
|
-
return LogLevel.ERROR;
|
|
47285
|
-
case "fatal":
|
|
47286
|
-
return LogLevel.FATAL;
|
|
47287
|
-
case "silent":
|
|
47288
|
-
return LogLevel.SILENT;
|
|
47289
|
-
default:
|
|
47290
|
-
return LogLevel.INFO;
|
|
47291
|
-
}
|
|
47292
|
-
};
|
|
47293
|
-
var getLogLevelLabel = (logLevel) => {
|
|
47294
|
-
if (logLevel >= LogLevel.ALL) {
|
|
47295
|
-
return LogLevelLabel.ALL;
|
|
47296
|
-
}
|
|
47297
|
-
if (logLevel >= LogLevel.TRACE) {
|
|
47298
|
-
return LogLevelLabel.TRACE;
|
|
47299
|
-
}
|
|
47300
|
-
if (logLevel >= LogLevel.DEBUG) {
|
|
47301
|
-
return LogLevelLabel.DEBUG;
|
|
47302
|
-
}
|
|
47303
|
-
if (logLevel >= LogLevel.INFO) {
|
|
47304
|
-
return LogLevelLabel.INFO;
|
|
47305
|
-
}
|
|
47306
|
-
if (logLevel >= LogLevel.WARN) {
|
|
47307
|
-
return LogLevelLabel.WARN;
|
|
47308
|
-
}
|
|
47309
|
-
if (logLevel >= LogLevel.ERROR) {
|
|
47310
|
-
return LogLevelLabel.ERROR;
|
|
47311
|
-
}
|
|
47312
|
-
if (logLevel >= LogLevel.FATAL) {
|
|
47313
|
-
return LogLevelLabel.FATAL;
|
|
47314
|
-
}
|
|
47315
|
-
if (logLevel <= LogLevel.SILENT) {
|
|
47316
|
-
return LogLevelLabel.SILENT;
|
|
47317
|
-
}
|
|
47318
|
-
return LogLevelLabel.INFO;
|
|
47319
|
-
};
|
|
47320
|
-
|
|
47321
|
-
// packages/config-tools/src/utilities/logger.ts
|
|
47322
|
-
var chalk = __toESM(require_source(), 1);
|
|
47323
|
-
var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
|
|
47324
|
-
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)) {
|
|
47325
|
-
return (_) => {
|
|
47326
|
-
};
|
|
47327
|
-
}
|
|
47328
|
-
if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel || typeof logLevel === "string" && LogLevel.FATAL >= getLogLevel(logLevel)) {
|
|
47329
|
-
return (message) => {
|
|
47330
|
-
console.error(
|
|
47331
|
-
`
|
|
47332
|
-
${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(
|
|
47333
|
-
config?.colors?.fatal ? config.colors.fatal : "#1fb2a6"
|
|
47334
|
-
)(message)}
|
|
47335
|
-
|
|
47336
|
-
`
|
|
47337
|
-
);
|
|
47338
|
-
};
|
|
47339
|
-
}
|
|
47340
|
-
if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel || typeof logLevel === "string" && LogLevel.ERROR >= getLogLevel(logLevel)) {
|
|
47341
|
-
return (message) => {
|
|
47342
|
-
console.error(
|
|
47343
|
-
`
|
|
47344
|
-
${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(
|
|
47345
|
-
config?.colors?.error ? config.colors.error : "#7d1a1a"
|
|
47346
|
-
)(message)}
|
|
47347
|
-
`
|
|
47348
|
-
);
|
|
47349
|
-
};
|
|
47350
|
-
}
|
|
47351
|
-
if (typeof logLevel === "number" && LogLevel.WARN >= logLevel || typeof logLevel === "string" && LogLevel.WARN >= getLogLevel(logLevel)) {
|
|
47352
|
-
return (message) => {
|
|
47353
|
-
console.warn(
|
|
47354
|
-
`
|
|
47355
|
-
${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(
|
|
47356
|
-
config?.colors?.warning ? config.colors.warning : "#fcc419"
|
|
47357
|
-
)(message)}
|
|
47358
|
-
`
|
|
47359
|
-
);
|
|
47360
|
-
};
|
|
47361
|
-
}
|
|
47362
|
-
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
|
|
47363
|
-
return (message) => {
|
|
47364
|
-
console.info(
|
|
47365
|
-
`
|
|
47366
|
-
${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(
|
|
47367
|
-
config?.colors?.info ? config.colors.info : "#0ea5e9"
|
|
47368
|
-
)(message)}
|
|
47369
|
-
`
|
|
47370
|
-
);
|
|
47371
|
-
};
|
|
47372
|
-
}
|
|
47373
|
-
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
|
|
47374
|
-
return (message) => {
|
|
47375
|
-
console.info(
|
|
47376
|
-
`
|
|
47377
|
-
${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(
|
|
47378
|
-
config?.colors?.success ? config.colors.success : "#087f5b"
|
|
47379
|
-
)(message)}
|
|
47380
|
-
`
|
|
47381
|
-
);
|
|
47382
|
-
};
|
|
47383
|
-
}
|
|
47384
|
-
if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel || typeof logLevel === "string" && LogLevel.DEBUG >= getLogLevel(logLevel)) {
|
|
47385
|
-
return (message) => {
|
|
47386
|
-
console.debug(
|
|
47387
|
-
`
|
|
47388
|
-
${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(
|
|
47389
|
-
config?.colors?.primary ? config.colors.primary : "#1fb2a6"
|
|
47390
|
-
)(message)}
|
|
47391
|
-
`
|
|
47392
|
-
);
|
|
47393
|
-
};
|
|
47437
|
+
var getDefaultConfig = (config = {}, root) => {
|
|
47438
|
+
let name = "storm-workspace";
|
|
47439
|
+
let namespace = "storm-software";
|
|
47440
|
+
let repository = "https://github.com/storm-software/storm-ops";
|
|
47441
|
+
let license = DefaultStormConfig.license;
|
|
47442
|
+
let homepage = DefaultStormConfig.homepage;
|
|
47443
|
+
const workspaceRoot = findWorkspaceRoot(root);
|
|
47444
|
+
if ((0, import_node_fs2.existsSync)((0, import_node_path2.join)(workspaceRoot, "package.json"))) {
|
|
47445
|
+
const file = (0, import_node_fs2.readFileSync)((0, import_node_path2.join)(workspaceRoot, "package.json"), {
|
|
47446
|
+
encoding: "utf-8"
|
|
47447
|
+
});
|
|
47448
|
+
if (file) {
|
|
47449
|
+
const packageJson = JSON.parse(file);
|
|
47450
|
+
if (packageJson.name) {
|
|
47451
|
+
name = packageJson.name;
|
|
47452
|
+
}
|
|
47453
|
+
if (packageJson.namespace) {
|
|
47454
|
+
namespace = packageJson.namespace;
|
|
47455
|
+
}
|
|
47456
|
+
if (packageJson.repository?.url) {
|
|
47457
|
+
repository = packageJson.repository?.url;
|
|
47458
|
+
}
|
|
47459
|
+
if (packageJson.license) {
|
|
47460
|
+
license = packageJson.license;
|
|
47461
|
+
}
|
|
47462
|
+
if (packageJson.homepage) {
|
|
47463
|
+
homepage = packageJson.homepage;
|
|
47464
|
+
}
|
|
47465
|
+
}
|
|
47394
47466
|
}
|
|
47395
|
-
return (
|
|
47396
|
-
|
|
47397
|
-
|
|
47398
|
-
|
|
47399
|
-
|
|
47400
|
-
|
|
47401
|
-
|
|
47402
|
-
|
|
47403
|
-
|
|
47404
|
-
|
|
47405
|
-
|
|
47406
|
-
|
|
47407
|
-
|
|
47408
|
-
|
|
47409
|
-
var writeDebug = (config, message) => getLogFn(config, LogLevel.DEBUG)(message);
|
|
47410
|
-
var writeTrace = (config, message) => getLogFn(config, LogLevel.TRACE)(message);
|
|
47411
|
-
var getStopwatch = (name) => {
|
|
47412
|
-
const start = process.hrtime();
|
|
47413
|
-
return () => {
|
|
47414
|
-
const end = process.hrtime(start);
|
|
47415
|
-
console.info(
|
|
47416
|
-
chalk.dim(
|
|
47417
|
-
`\u23F1\uFE0F The${name ? ` ${name}` : ""} process took ${Math.round(
|
|
47418
|
-
end[0] * 1e3 + end[1] / 1e6
|
|
47419
|
-
)}ms to complete`
|
|
47420
|
-
)
|
|
47421
|
-
);
|
|
47422
|
-
};
|
|
47467
|
+
return StormConfigSchema.parse({
|
|
47468
|
+
...DefaultStormConfig,
|
|
47469
|
+
...config,
|
|
47470
|
+
colors: { ...DefaultColorConfig, ...config.colors },
|
|
47471
|
+
workspaceRoot,
|
|
47472
|
+
name,
|
|
47473
|
+
namespace,
|
|
47474
|
+
repository,
|
|
47475
|
+
license: license ?? DefaultStormConfig.license,
|
|
47476
|
+
homepage: homepage ?? DefaultStormConfig.homepage,
|
|
47477
|
+
extensions: {
|
|
47478
|
+
...config.extensions
|
|
47479
|
+
}
|
|
47480
|
+
});
|
|
47423
47481
|
};
|
|
47424
47482
|
|
|
47425
47483
|
// packages/config-tools/src/env/set-env.ts
|
|
@@ -47609,39 +47667,21 @@ var getConfigEnv = () => {
|
|
|
47609
47667
|
|
|
47610
47668
|
// packages/config-tools/src/create-storm-config.ts
|
|
47611
47669
|
var loadStormConfig = async (workspaceRoot) => {
|
|
47670
|
+
let config = {};
|
|
47612
47671
|
let _workspaceRoot = workspaceRoot;
|
|
47613
47672
|
if (!_workspaceRoot) {
|
|
47614
47673
|
_workspaceRoot = findWorkspaceRoot();
|
|
47615
47674
|
}
|
|
47616
|
-
|
|
47617
|
-
|
|
47618
|
-
|
|
47619
|
-
|
|
47620
|
-
|
|
47621
|
-
|
|
47622
|
-
|
|
47623
|
-
|
|
47624
|
-
|
|
47625
|
-
info: process.env.STORM_COLOR_INFO ?? configFile.colors?.info,
|
|
47626
|
-
warning: process.env.STORM_COLOR_WARNING ?? configFile.colors?.warning,
|
|
47627
|
-
error: process.env.STORM_COLOR_ERROR ?? configFile.colors?.error,
|
|
47628
|
-
fatal: process.env.STORM_COLOR_FATAL ?? configFile.colors?.fatal
|
|
47629
|
-
};
|
|
47630
|
-
} else {
|
|
47631
|
-
configFile[key] = configEnv[key];
|
|
47632
|
-
}
|
|
47633
|
-
}
|
|
47634
|
-
}
|
|
47635
|
-
const config = StormConfigSchema.parse(configFile);
|
|
47675
|
+
config = StormConfigSchema.parse(
|
|
47676
|
+
await getDefaultConfig(
|
|
47677
|
+
{
|
|
47678
|
+
...await getConfigFile(_workspaceRoot),
|
|
47679
|
+
...getConfigEnv()
|
|
47680
|
+
},
|
|
47681
|
+
_workspaceRoot
|
|
47682
|
+
)
|
|
47683
|
+
);
|
|
47636
47684
|
setConfigEnv(config);
|
|
47637
|
-
console.debug("\r\n\r\n");
|
|
47638
|
-
console.debug(`Loaded Storm config from ${config.configFile}`);
|
|
47639
|
-
for (const key of Object.keys(configFile)) {
|
|
47640
|
-
console.debug(`
|
|
47641
|
-
----- ${key} ----- `);
|
|
47642
|
-
console.debug(configFile[key]);
|
|
47643
|
-
}
|
|
47644
|
-
console.debug("\r\n\r\n");
|
|
47645
47685
|
return config;
|
|
47646
47686
|
};
|
|
47647
47687
|
|