@storm-software/workspace-tools 1.45.1 → 1.45.3
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 +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
|
@@ -28048,7 +28048,7 @@ var require_jsonfile = __commonJS({
|
|
|
28048
28048
|
return obj;
|
|
28049
28049
|
}
|
|
28050
28050
|
var readFile = universalify.fromPromise(_readFile);
|
|
28051
|
-
function
|
|
28051
|
+
function readFileSync2(file, options = {}) {
|
|
28052
28052
|
if (typeof options === "string") {
|
|
28053
28053
|
options = { encoding: options };
|
|
28054
28054
|
}
|
|
@@ -28080,7 +28080,7 @@ var require_jsonfile = __commonJS({
|
|
|
28080
28080
|
}
|
|
28081
28081
|
var jsonfile = {
|
|
28082
28082
|
readFile,
|
|
28083
|
-
readFileSync,
|
|
28083
|
+
readFileSync: readFileSync2,
|
|
28084
28084
|
writeFile,
|
|
28085
28085
|
writeFileSync
|
|
28086
28086
|
};
|
|
@@ -47936,7 +47936,7 @@ var require_base = __commonJS({
|
|
|
47936
47936
|
},
|
|
47937
47937
|
/*istanbul ignore start*/
|
|
47938
47938
|
/*istanbul ignore end*/
|
|
47939
|
-
join: function
|
|
47939
|
+
join: function join3(chars) {
|
|
47940
47940
|
return chars.join("");
|
|
47941
47941
|
}
|
|
47942
47942
|
};
|
|
@@ -53921,19 +53921,19 @@ var require_tsconfig_loader = __commonJS({
|
|
|
53921
53921
|
return walkForTsConfig(parentDirectory, readdirSync);
|
|
53922
53922
|
}
|
|
53923
53923
|
exports.walkForTsConfig = walkForTsConfig;
|
|
53924
|
-
function loadTsconfig(configFilePath,
|
|
53925
|
-
if (
|
|
53926
|
-
|
|
53924
|
+
function loadTsconfig(configFilePath, existsSync3, readFileSync2) {
|
|
53925
|
+
if (existsSync3 === void 0) {
|
|
53926
|
+
existsSync3 = fs.existsSync;
|
|
53927
53927
|
}
|
|
53928
|
-
if (
|
|
53929
|
-
|
|
53928
|
+
if (readFileSync2 === void 0) {
|
|
53929
|
+
readFileSync2 = function(filename) {
|
|
53930
53930
|
return fs.readFileSync(filename, "utf8");
|
|
53931
53931
|
};
|
|
53932
53932
|
}
|
|
53933
|
-
if (!
|
|
53933
|
+
if (!existsSync3(configFilePath)) {
|
|
53934
53934
|
return void 0;
|
|
53935
53935
|
}
|
|
53936
|
-
var configString =
|
|
53936
|
+
var configString = readFileSync2(configFilePath);
|
|
53937
53937
|
var cleanedJson = StripBom(configString);
|
|
53938
53938
|
var config;
|
|
53939
53939
|
try {
|
|
@@ -53946,27 +53946,27 @@ var require_tsconfig_loader = __commonJS({
|
|
|
53946
53946
|
var base = void 0;
|
|
53947
53947
|
if (Array.isArray(extendedConfig)) {
|
|
53948
53948
|
base = extendedConfig.reduce(function(currBase, extendedConfigElement) {
|
|
53949
|
-
return mergeTsconfigs(currBase, loadTsconfigFromExtends(configFilePath, extendedConfigElement,
|
|
53949
|
+
return mergeTsconfigs(currBase, loadTsconfigFromExtends(configFilePath, extendedConfigElement, existsSync3, readFileSync2));
|
|
53950
53950
|
}, {});
|
|
53951
53951
|
} else {
|
|
53952
|
-
base = loadTsconfigFromExtends(configFilePath, extendedConfig,
|
|
53952
|
+
base = loadTsconfigFromExtends(configFilePath, extendedConfig, existsSync3, readFileSync2);
|
|
53953
53953
|
}
|
|
53954
53954
|
return mergeTsconfigs(base, config);
|
|
53955
53955
|
}
|
|
53956
53956
|
return config;
|
|
53957
53957
|
}
|
|
53958
53958
|
exports.loadTsconfig = loadTsconfig;
|
|
53959
|
-
function loadTsconfigFromExtends(configFilePath, extendedConfigValue,
|
|
53959
|
+
function loadTsconfigFromExtends(configFilePath, extendedConfigValue, existsSync3, readFileSync2) {
|
|
53960
53960
|
var _a;
|
|
53961
53961
|
if (typeof extendedConfigValue === "string" && extendedConfigValue.indexOf(".json") === -1) {
|
|
53962
53962
|
extendedConfigValue += ".json";
|
|
53963
53963
|
}
|
|
53964
53964
|
var currentDir = path.dirname(configFilePath);
|
|
53965
53965
|
var extendedConfigPath = path.join(currentDir, extendedConfigValue);
|
|
53966
|
-
if (extendedConfigValue.indexOf("/") !== -1 && extendedConfigValue.indexOf(".") !== -1 && !
|
|
53966
|
+
if (extendedConfigValue.indexOf("/") !== -1 && extendedConfigValue.indexOf(".") !== -1 && !existsSync3(extendedConfigPath)) {
|
|
53967
53967
|
extendedConfigPath = path.join(currentDir, "node_modules", extendedConfigValue);
|
|
53968
53968
|
}
|
|
53969
|
-
var config = loadTsconfig(extendedConfigPath,
|
|
53969
|
+
var config = loadTsconfig(extendedConfigPath, existsSync3, readFileSync2) || {};
|
|
53970
53970
|
if ((_a = config.compilerOptions) === null || _a === void 0 ? void 0 : _a.baseUrl) {
|
|
53971
53971
|
var extendsDir = path.dirname(extendedConfigValue);
|
|
53972
53972
|
config.compilerOptions.baseUrl = path.join(extendsDir, config.compilerOptions.baseUrl);
|
|
@@ -61400,6 +61400,189 @@ var createTailwindConfig = ({ inputPath }) => {
|
|
|
61400
61400
|
|
|
61401
61401
|
// packages/config-tools/src/config-file/get-config-file.ts
|
|
61402
61402
|
var import_cosmiconfig = __toESM(require_dist17(), 1);
|
|
61403
|
+
|
|
61404
|
+
// packages/config-tools/src/utilities/logger.ts
|
|
61405
|
+
var chalk = __toESM(require_source(), 1);
|
|
61406
|
+
|
|
61407
|
+
// packages/config-tools/src/types.ts
|
|
61408
|
+
var LogLevel = {
|
|
61409
|
+
SILENT: 0,
|
|
61410
|
+
FATAL: 10,
|
|
61411
|
+
ERROR: 20,
|
|
61412
|
+
WARN: 30,
|
|
61413
|
+
INFO: 40,
|
|
61414
|
+
SUCCESS: 45,
|
|
61415
|
+
DEBUG: 60,
|
|
61416
|
+
TRACE: 70,
|
|
61417
|
+
ALL: 100
|
|
61418
|
+
};
|
|
61419
|
+
var LogLevelLabel = {
|
|
61420
|
+
SILENT: "silent",
|
|
61421
|
+
FATAL: "fatal",
|
|
61422
|
+
ERROR: "error",
|
|
61423
|
+
WARN: "warn",
|
|
61424
|
+
INFO: "info",
|
|
61425
|
+
DEBUG: "debug",
|
|
61426
|
+
TRACE: "trace",
|
|
61427
|
+
ALL: "all"
|
|
61428
|
+
};
|
|
61429
|
+
|
|
61430
|
+
// packages/config-tools/src/utilities/get-log-level.ts
|
|
61431
|
+
var getLogLevel = (label) => {
|
|
61432
|
+
switch (label) {
|
|
61433
|
+
case "all":
|
|
61434
|
+
return LogLevel.ALL;
|
|
61435
|
+
case "trace":
|
|
61436
|
+
return LogLevel.TRACE;
|
|
61437
|
+
case "debug":
|
|
61438
|
+
return LogLevel.DEBUG;
|
|
61439
|
+
case "info":
|
|
61440
|
+
return LogLevel.INFO;
|
|
61441
|
+
case "warn":
|
|
61442
|
+
return LogLevel.WARN;
|
|
61443
|
+
case "error":
|
|
61444
|
+
return LogLevel.ERROR;
|
|
61445
|
+
case "fatal":
|
|
61446
|
+
return LogLevel.FATAL;
|
|
61447
|
+
case "silent":
|
|
61448
|
+
return LogLevel.SILENT;
|
|
61449
|
+
default:
|
|
61450
|
+
return LogLevel.INFO;
|
|
61451
|
+
}
|
|
61452
|
+
};
|
|
61453
|
+
var getLogLevelLabel = (logLevel) => {
|
|
61454
|
+
if (logLevel >= LogLevel.ALL) {
|
|
61455
|
+
return LogLevelLabel.ALL;
|
|
61456
|
+
}
|
|
61457
|
+
if (logLevel >= LogLevel.TRACE) {
|
|
61458
|
+
return LogLevelLabel.TRACE;
|
|
61459
|
+
}
|
|
61460
|
+
if (logLevel >= LogLevel.DEBUG) {
|
|
61461
|
+
return LogLevelLabel.DEBUG;
|
|
61462
|
+
}
|
|
61463
|
+
if (logLevel >= LogLevel.INFO) {
|
|
61464
|
+
return LogLevelLabel.INFO;
|
|
61465
|
+
}
|
|
61466
|
+
if (logLevel >= LogLevel.WARN) {
|
|
61467
|
+
return LogLevelLabel.WARN;
|
|
61468
|
+
}
|
|
61469
|
+
if (logLevel >= LogLevel.ERROR) {
|
|
61470
|
+
return LogLevelLabel.ERROR;
|
|
61471
|
+
}
|
|
61472
|
+
if (logLevel >= LogLevel.FATAL) {
|
|
61473
|
+
return LogLevelLabel.FATAL;
|
|
61474
|
+
}
|
|
61475
|
+
if (logLevel <= LogLevel.SILENT) {
|
|
61476
|
+
return LogLevelLabel.SILENT;
|
|
61477
|
+
}
|
|
61478
|
+
return LogLevelLabel.INFO;
|
|
61479
|
+
};
|
|
61480
|
+
|
|
61481
|
+
// packages/config-tools/src/utilities/logger.ts
|
|
61482
|
+
var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
|
|
61483
|
+
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)) {
|
|
61484
|
+
return (_) => {
|
|
61485
|
+
};
|
|
61486
|
+
}
|
|
61487
|
+
if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel || typeof logLevel === "string" && LogLevel.FATAL >= getLogLevel(logLevel)) {
|
|
61488
|
+
return (message) => {
|
|
61489
|
+
console.error(
|
|
61490
|
+
`
|
|
61491
|
+
${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(
|
|
61492
|
+
config?.colors?.fatal ? config.colors.fatal : "#1fb2a6"
|
|
61493
|
+
)(message)}
|
|
61494
|
+
|
|
61495
|
+
`
|
|
61496
|
+
);
|
|
61497
|
+
};
|
|
61498
|
+
}
|
|
61499
|
+
if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel || typeof logLevel === "string" && LogLevel.ERROR >= getLogLevel(logLevel)) {
|
|
61500
|
+
return (message) => {
|
|
61501
|
+
console.error(
|
|
61502
|
+
`
|
|
61503
|
+
${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(
|
|
61504
|
+
config?.colors?.error ? config.colors.error : "#7d1a1a"
|
|
61505
|
+
)(message)}
|
|
61506
|
+
`
|
|
61507
|
+
);
|
|
61508
|
+
};
|
|
61509
|
+
}
|
|
61510
|
+
if (typeof logLevel === "number" && LogLevel.WARN >= logLevel || typeof logLevel === "string" && LogLevel.WARN >= getLogLevel(logLevel)) {
|
|
61511
|
+
return (message) => {
|
|
61512
|
+
console.warn(
|
|
61513
|
+
`
|
|
61514
|
+
${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(
|
|
61515
|
+
config?.colors?.warning ? config.colors.warning : "#fcc419"
|
|
61516
|
+
)(message)}
|
|
61517
|
+
`
|
|
61518
|
+
);
|
|
61519
|
+
};
|
|
61520
|
+
}
|
|
61521
|
+
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
|
|
61522
|
+
return (message) => {
|
|
61523
|
+
console.info(
|
|
61524
|
+
`
|
|
61525
|
+
${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(
|
|
61526
|
+
config?.colors?.info ? config.colors.info : "#0ea5e9"
|
|
61527
|
+
)(message)}
|
|
61528
|
+
`
|
|
61529
|
+
);
|
|
61530
|
+
};
|
|
61531
|
+
}
|
|
61532
|
+
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
|
|
61533
|
+
return (message) => {
|
|
61534
|
+
console.info(
|
|
61535
|
+
`
|
|
61536
|
+
${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(
|
|
61537
|
+
config?.colors?.success ? config.colors.success : "#087f5b"
|
|
61538
|
+
)(message)}
|
|
61539
|
+
`
|
|
61540
|
+
);
|
|
61541
|
+
};
|
|
61542
|
+
}
|
|
61543
|
+
if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel || typeof logLevel === "string" && LogLevel.DEBUG >= getLogLevel(logLevel)) {
|
|
61544
|
+
return (message) => {
|
|
61545
|
+
console.debug(
|
|
61546
|
+
`
|
|
61547
|
+
${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(
|
|
61548
|
+
config?.colors?.primary ? config.colors.primary : "#1fb2a6"
|
|
61549
|
+
)(message)}
|
|
61550
|
+
`
|
|
61551
|
+
);
|
|
61552
|
+
};
|
|
61553
|
+
}
|
|
61554
|
+
return (message) => {
|
|
61555
|
+
console.log(
|
|
61556
|
+
`
|
|
61557
|
+
${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(
|
|
61558
|
+
config?.colors?.primary ? config.colors.primary : "#1fb2a6"
|
|
61559
|
+
)(message)}
|
|
61560
|
+
`
|
|
61561
|
+
);
|
|
61562
|
+
};
|
|
61563
|
+
};
|
|
61564
|
+
var writeFatal = (config, message) => getLogFn(config, LogLevel.FATAL)(message);
|
|
61565
|
+
var writeError = (config, message) => getLogFn(config, LogLevel.ERROR)(message);
|
|
61566
|
+
var writeWarning = (config, message) => getLogFn(config, LogLevel.WARN)(message);
|
|
61567
|
+
var writeInfo = (config, message) => getLogFn(config, LogLevel.INFO)(message);
|
|
61568
|
+
var writeSuccess = (config, message) => getLogFn(config, LogLevel.SUCCESS)(message);
|
|
61569
|
+
var writeDebug = (config, message) => getLogFn(config, LogLevel.DEBUG)(message);
|
|
61570
|
+
var writeTrace = (config, message) => getLogFn(config, LogLevel.TRACE)(message);
|
|
61571
|
+
var getStopwatch = (name) => {
|
|
61572
|
+
const start = process.hrtime();
|
|
61573
|
+
return () => {
|
|
61574
|
+
const end = process.hrtime(start);
|
|
61575
|
+
console.info(
|
|
61576
|
+
chalk.dim(
|
|
61577
|
+
`\u23F1\uFE0F The${name ? ` ${name}` : ""} process took ${Math.round(
|
|
61578
|
+
end[0] * 1e3 + end[1] / 1e6
|
|
61579
|
+
)}ms to complete`
|
|
61580
|
+
)
|
|
61581
|
+
);
|
|
61582
|
+
};
|
|
61583
|
+
};
|
|
61584
|
+
|
|
61585
|
+
// packages/config-tools/src/config-file/get-config-file.ts
|
|
61403
61586
|
var _static_cache = void 0;
|
|
61404
61587
|
var getConfigFileName = async (fileName, filePath) => (0, import_cosmiconfig.cosmiconfig)(fileName, { cache: true }).search(filePath);
|
|
61405
61588
|
var getConfigFile = async (filePath) => {
|
|
@@ -61426,6 +61609,10 @@ var getConfigFile = async (filePath) => {
|
|
|
61426
61609
|
console.warn(
|
|
61427
61610
|
"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."
|
|
61428
61611
|
);
|
|
61612
|
+
writeWarning(
|
|
61613
|
+
{ logLevel: "error" },
|
|
61614
|
+
"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."
|
|
61615
|
+
);
|
|
61429
61616
|
return void 0;
|
|
61430
61617
|
}
|
|
61431
61618
|
const config = cosmiconfigResult.config ?? {};
|
|
@@ -61506,6 +61693,10 @@ Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
|
|
|
61506
61693
|
return result;
|
|
61507
61694
|
}
|
|
61508
61695
|
|
|
61696
|
+
// packages/config-tools/src/utilities/get-default-config.ts
|
|
61697
|
+
var import_node_fs2 = require("node:fs");
|
|
61698
|
+
var import_node_path2 = require("node:path");
|
|
61699
|
+
|
|
61509
61700
|
// node_modules/.pnpm/zod@3.22.4/node_modules/zod/lib/index.mjs
|
|
61510
61701
|
var util;
|
|
61511
61702
|
(function(util2) {
|
|
@@ -65166,183 +65357,50 @@ var DefaultStormConfig = {
|
|
|
65166
65357
|
colors: { ...DefaultColorConfig },
|
|
65167
65358
|
extensions: {}
|
|
65168
65359
|
};
|
|
65169
|
-
|
|
65170
|
-
|
|
65171
|
-
|
|
65172
|
-
|
|
65173
|
-
|
|
65174
|
-
|
|
65175
|
-
|
|
65176
|
-
|
|
65177
|
-
|
|
65178
|
-
|
|
65179
|
-
|
|
65180
|
-
|
|
65181
|
-
|
|
65182
|
-
|
|
65183
|
-
|
|
65184
|
-
|
|
65185
|
-
|
|
65186
|
-
|
|
65187
|
-
|
|
65188
|
-
|
|
65189
|
-
|
|
65190
|
-
|
|
65191
|
-
|
|
65192
|
-
|
|
65193
|
-
|
|
65194
|
-
|
|
65195
|
-
|
|
65196
|
-
|
|
65197
|
-
|
|
65198
|
-
case "trace":
|
|
65199
|
-
return LogLevel.TRACE;
|
|
65200
|
-
case "debug":
|
|
65201
|
-
return LogLevel.DEBUG;
|
|
65202
|
-
case "info":
|
|
65203
|
-
return LogLevel.INFO;
|
|
65204
|
-
case "warn":
|
|
65205
|
-
return LogLevel.WARN;
|
|
65206
|
-
case "error":
|
|
65207
|
-
return LogLevel.ERROR;
|
|
65208
|
-
case "fatal":
|
|
65209
|
-
return LogLevel.FATAL;
|
|
65210
|
-
case "silent":
|
|
65211
|
-
return LogLevel.SILENT;
|
|
65212
|
-
default:
|
|
65213
|
-
return LogLevel.INFO;
|
|
65214
|
-
}
|
|
65215
|
-
};
|
|
65216
|
-
var getLogLevelLabel = (logLevel) => {
|
|
65217
|
-
if (logLevel >= LogLevel.ALL) {
|
|
65218
|
-
return LogLevelLabel.ALL;
|
|
65219
|
-
}
|
|
65220
|
-
if (logLevel >= LogLevel.TRACE) {
|
|
65221
|
-
return LogLevelLabel.TRACE;
|
|
65222
|
-
}
|
|
65223
|
-
if (logLevel >= LogLevel.DEBUG) {
|
|
65224
|
-
return LogLevelLabel.DEBUG;
|
|
65225
|
-
}
|
|
65226
|
-
if (logLevel >= LogLevel.INFO) {
|
|
65227
|
-
return LogLevelLabel.INFO;
|
|
65228
|
-
}
|
|
65229
|
-
if (logLevel >= LogLevel.WARN) {
|
|
65230
|
-
return LogLevelLabel.WARN;
|
|
65231
|
-
}
|
|
65232
|
-
if (logLevel >= LogLevel.ERROR) {
|
|
65233
|
-
return LogLevelLabel.ERROR;
|
|
65234
|
-
}
|
|
65235
|
-
if (logLevel >= LogLevel.FATAL) {
|
|
65236
|
-
return LogLevelLabel.FATAL;
|
|
65237
|
-
}
|
|
65238
|
-
if (logLevel <= LogLevel.SILENT) {
|
|
65239
|
-
return LogLevelLabel.SILENT;
|
|
65240
|
-
}
|
|
65241
|
-
return LogLevelLabel.INFO;
|
|
65242
|
-
};
|
|
65243
|
-
|
|
65244
|
-
// packages/config-tools/src/utilities/logger.ts
|
|
65245
|
-
var chalk = __toESM(require_source(), 1);
|
|
65246
|
-
var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
|
|
65247
|
-
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)) {
|
|
65248
|
-
return (_) => {
|
|
65249
|
-
};
|
|
65250
|
-
}
|
|
65251
|
-
if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel || typeof logLevel === "string" && LogLevel.FATAL >= getLogLevel(logLevel)) {
|
|
65252
|
-
return (message) => {
|
|
65253
|
-
console.error(
|
|
65254
|
-
`
|
|
65255
|
-
${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(
|
|
65256
|
-
config?.colors?.fatal ? config.colors.fatal : "#1fb2a6"
|
|
65257
|
-
)(message)}
|
|
65258
|
-
|
|
65259
|
-
`
|
|
65260
|
-
);
|
|
65261
|
-
};
|
|
65262
|
-
}
|
|
65263
|
-
if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel || typeof logLevel === "string" && LogLevel.ERROR >= getLogLevel(logLevel)) {
|
|
65264
|
-
return (message) => {
|
|
65265
|
-
console.error(
|
|
65266
|
-
`
|
|
65267
|
-
${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(
|
|
65268
|
-
config?.colors?.error ? config.colors.error : "#7d1a1a"
|
|
65269
|
-
)(message)}
|
|
65270
|
-
`
|
|
65271
|
-
);
|
|
65272
|
-
};
|
|
65273
|
-
}
|
|
65274
|
-
if (typeof logLevel === "number" && LogLevel.WARN >= logLevel || typeof logLevel === "string" && LogLevel.WARN >= getLogLevel(logLevel)) {
|
|
65275
|
-
return (message) => {
|
|
65276
|
-
console.warn(
|
|
65277
|
-
`
|
|
65278
|
-
${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(
|
|
65279
|
-
config?.colors?.warning ? config.colors.warning : "#fcc419"
|
|
65280
|
-
)(message)}
|
|
65281
|
-
`
|
|
65282
|
-
);
|
|
65283
|
-
};
|
|
65284
|
-
}
|
|
65285
|
-
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
|
|
65286
|
-
return (message) => {
|
|
65287
|
-
console.info(
|
|
65288
|
-
`
|
|
65289
|
-
${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(
|
|
65290
|
-
config?.colors?.info ? config.colors.info : "#0ea5e9"
|
|
65291
|
-
)(message)}
|
|
65292
|
-
`
|
|
65293
|
-
);
|
|
65294
|
-
};
|
|
65295
|
-
}
|
|
65296
|
-
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
|
|
65297
|
-
return (message) => {
|
|
65298
|
-
console.info(
|
|
65299
|
-
`
|
|
65300
|
-
${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(
|
|
65301
|
-
config?.colors?.success ? config.colors.success : "#087f5b"
|
|
65302
|
-
)(message)}
|
|
65303
|
-
`
|
|
65304
|
-
);
|
|
65305
|
-
};
|
|
65306
|
-
}
|
|
65307
|
-
if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel || typeof logLevel === "string" && LogLevel.DEBUG >= getLogLevel(logLevel)) {
|
|
65308
|
-
return (message) => {
|
|
65309
|
-
console.debug(
|
|
65310
|
-
`
|
|
65311
|
-
${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(
|
|
65312
|
-
config?.colors?.primary ? config.colors.primary : "#1fb2a6"
|
|
65313
|
-
)(message)}
|
|
65314
|
-
`
|
|
65315
|
-
);
|
|
65316
|
-
};
|
|
65360
|
+
var getDefaultConfig = (config = {}, root) => {
|
|
65361
|
+
let name = "storm-workspace";
|
|
65362
|
+
let namespace = "storm-software";
|
|
65363
|
+
let repository = "https://github.com/storm-software/storm-ops";
|
|
65364
|
+
let license = DefaultStormConfig.license;
|
|
65365
|
+
let homepage = DefaultStormConfig.homepage;
|
|
65366
|
+
const workspaceRoot = findWorkspaceRoot(root);
|
|
65367
|
+
if ((0, import_node_fs2.existsSync)((0, import_node_path2.join)(workspaceRoot, "package.json"))) {
|
|
65368
|
+
const file = (0, import_node_fs2.readFileSync)((0, import_node_path2.join)(workspaceRoot, "package.json"), {
|
|
65369
|
+
encoding: "utf-8"
|
|
65370
|
+
});
|
|
65371
|
+
if (file) {
|
|
65372
|
+
const packageJson = JSON.parse(file);
|
|
65373
|
+
if (packageJson.name) {
|
|
65374
|
+
name = packageJson.name;
|
|
65375
|
+
}
|
|
65376
|
+
if (packageJson.namespace) {
|
|
65377
|
+
namespace = packageJson.namespace;
|
|
65378
|
+
}
|
|
65379
|
+
if (packageJson.repository?.url) {
|
|
65380
|
+
repository = packageJson.repository?.url;
|
|
65381
|
+
}
|
|
65382
|
+
if (packageJson.license) {
|
|
65383
|
+
license = packageJson.license;
|
|
65384
|
+
}
|
|
65385
|
+
if (packageJson.homepage) {
|
|
65386
|
+
homepage = packageJson.homepage;
|
|
65387
|
+
}
|
|
65388
|
+
}
|
|
65317
65389
|
}
|
|
65318
|
-
return (
|
|
65319
|
-
|
|
65320
|
-
|
|
65321
|
-
|
|
65322
|
-
|
|
65323
|
-
|
|
65324
|
-
|
|
65325
|
-
|
|
65326
|
-
|
|
65327
|
-
|
|
65328
|
-
|
|
65329
|
-
|
|
65330
|
-
|
|
65331
|
-
|
|
65332
|
-
var writeDebug = (config, message) => getLogFn(config, LogLevel.DEBUG)(message);
|
|
65333
|
-
var writeTrace = (config, message) => getLogFn(config, LogLevel.TRACE)(message);
|
|
65334
|
-
var getStopwatch = (name) => {
|
|
65335
|
-
const start = process.hrtime();
|
|
65336
|
-
return () => {
|
|
65337
|
-
const end = process.hrtime(start);
|
|
65338
|
-
console.info(
|
|
65339
|
-
chalk.dim(
|
|
65340
|
-
`\u23F1\uFE0F The${name ? ` ${name}` : ""} process took ${Math.round(
|
|
65341
|
-
end[0] * 1e3 + end[1] / 1e6
|
|
65342
|
-
)}ms to complete`
|
|
65343
|
-
)
|
|
65344
|
-
);
|
|
65345
|
-
};
|
|
65390
|
+
return StormConfigSchema.parse({
|
|
65391
|
+
...DefaultStormConfig,
|
|
65392
|
+
...config,
|
|
65393
|
+
colors: { ...DefaultColorConfig, ...config.colors },
|
|
65394
|
+
workspaceRoot,
|
|
65395
|
+
name,
|
|
65396
|
+
namespace,
|
|
65397
|
+
repository,
|
|
65398
|
+
license: license ?? DefaultStormConfig.license,
|
|
65399
|
+
homepage: homepage ?? DefaultStormConfig.homepage,
|
|
65400
|
+
extensions: {
|
|
65401
|
+
...config.extensions
|
|
65402
|
+
}
|
|
65403
|
+
});
|
|
65346
65404
|
};
|
|
65347
65405
|
|
|
65348
65406
|
// packages/config-tools/src/env/set-env.ts
|
|
@@ -65532,39 +65590,21 @@ var getConfigEnv = () => {
|
|
|
65532
65590
|
|
|
65533
65591
|
// packages/config-tools/src/create-storm-config.ts
|
|
65534
65592
|
var loadStormConfig = async (workspaceRoot) => {
|
|
65593
|
+
let config = {};
|
|
65535
65594
|
let _workspaceRoot = workspaceRoot;
|
|
65536
65595
|
if (!_workspaceRoot) {
|
|
65537
65596
|
_workspaceRoot = findWorkspaceRoot();
|
|
65538
65597
|
}
|
|
65539
|
-
|
|
65540
|
-
|
|
65541
|
-
|
|
65542
|
-
|
|
65543
|
-
|
|
65544
|
-
|
|
65545
|
-
|
|
65546
|
-
|
|
65547
|
-
|
|
65548
|
-
info: process.env.STORM_COLOR_INFO ?? configFile.colors?.info,
|
|
65549
|
-
warning: process.env.STORM_COLOR_WARNING ?? configFile.colors?.warning,
|
|
65550
|
-
error: process.env.STORM_COLOR_ERROR ?? configFile.colors?.error,
|
|
65551
|
-
fatal: process.env.STORM_COLOR_FATAL ?? configFile.colors?.fatal
|
|
65552
|
-
};
|
|
65553
|
-
} else {
|
|
65554
|
-
configFile[key] = configEnv[key];
|
|
65555
|
-
}
|
|
65556
|
-
}
|
|
65557
|
-
}
|
|
65558
|
-
const config = StormConfigSchema.parse(configFile);
|
|
65598
|
+
config = StormConfigSchema.parse(
|
|
65599
|
+
await getDefaultConfig(
|
|
65600
|
+
{
|
|
65601
|
+
...await getConfigFile(_workspaceRoot),
|
|
65602
|
+
...getConfigEnv()
|
|
65603
|
+
},
|
|
65604
|
+
_workspaceRoot
|
|
65605
|
+
)
|
|
65606
|
+
);
|
|
65559
65607
|
setConfigEnv(config);
|
|
65560
|
-
console.debug("\r\n\r\n");
|
|
65561
|
-
console.debug(`Loaded Storm config from ${config.configFile}`);
|
|
65562
|
-
for (const key of Object.keys(configFile)) {
|
|
65563
|
-
console.debug(`
|
|
65564
|
-
----- ${key} ----- `);
|
|
65565
|
-
console.debug(configFile[key]);
|
|
65566
|
-
}
|
|
65567
|
-
console.debug("\r\n\r\n");
|
|
65568
65608
|
return config;
|
|
65569
65609
|
};
|
|
65570
65610
|
|