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