@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
|
@@ -26236,6 +26236,189 @@ var import_devkit = __toESM(require_devkit());
|
|
|
26236
26236
|
|
|
26237
26237
|
// packages/config-tools/src/config-file/get-config-file.ts
|
|
26238
26238
|
var import_cosmiconfig = __toESM(require_dist(), 1);
|
|
26239
|
+
|
|
26240
|
+
// packages/config-tools/src/utilities/logger.ts
|
|
26241
|
+
var chalk = __toESM(require_source(), 1);
|
|
26242
|
+
|
|
26243
|
+
// packages/config-tools/src/types.ts
|
|
26244
|
+
var LogLevel = {
|
|
26245
|
+
SILENT: 0,
|
|
26246
|
+
FATAL: 10,
|
|
26247
|
+
ERROR: 20,
|
|
26248
|
+
WARN: 30,
|
|
26249
|
+
INFO: 40,
|
|
26250
|
+
SUCCESS: 45,
|
|
26251
|
+
DEBUG: 60,
|
|
26252
|
+
TRACE: 70,
|
|
26253
|
+
ALL: 100
|
|
26254
|
+
};
|
|
26255
|
+
var LogLevelLabel = {
|
|
26256
|
+
SILENT: "silent",
|
|
26257
|
+
FATAL: "fatal",
|
|
26258
|
+
ERROR: "error",
|
|
26259
|
+
WARN: "warn",
|
|
26260
|
+
INFO: "info",
|
|
26261
|
+
DEBUG: "debug",
|
|
26262
|
+
TRACE: "trace",
|
|
26263
|
+
ALL: "all"
|
|
26264
|
+
};
|
|
26265
|
+
|
|
26266
|
+
// packages/config-tools/src/utilities/get-log-level.ts
|
|
26267
|
+
var getLogLevel = (label) => {
|
|
26268
|
+
switch (label) {
|
|
26269
|
+
case "all":
|
|
26270
|
+
return LogLevel.ALL;
|
|
26271
|
+
case "trace":
|
|
26272
|
+
return LogLevel.TRACE;
|
|
26273
|
+
case "debug":
|
|
26274
|
+
return LogLevel.DEBUG;
|
|
26275
|
+
case "info":
|
|
26276
|
+
return LogLevel.INFO;
|
|
26277
|
+
case "warn":
|
|
26278
|
+
return LogLevel.WARN;
|
|
26279
|
+
case "error":
|
|
26280
|
+
return LogLevel.ERROR;
|
|
26281
|
+
case "fatal":
|
|
26282
|
+
return LogLevel.FATAL;
|
|
26283
|
+
case "silent":
|
|
26284
|
+
return LogLevel.SILENT;
|
|
26285
|
+
default:
|
|
26286
|
+
return LogLevel.INFO;
|
|
26287
|
+
}
|
|
26288
|
+
};
|
|
26289
|
+
var getLogLevelLabel = (logLevel) => {
|
|
26290
|
+
if (logLevel >= LogLevel.ALL) {
|
|
26291
|
+
return LogLevelLabel.ALL;
|
|
26292
|
+
}
|
|
26293
|
+
if (logLevel >= LogLevel.TRACE) {
|
|
26294
|
+
return LogLevelLabel.TRACE;
|
|
26295
|
+
}
|
|
26296
|
+
if (logLevel >= LogLevel.DEBUG) {
|
|
26297
|
+
return LogLevelLabel.DEBUG;
|
|
26298
|
+
}
|
|
26299
|
+
if (logLevel >= LogLevel.INFO) {
|
|
26300
|
+
return LogLevelLabel.INFO;
|
|
26301
|
+
}
|
|
26302
|
+
if (logLevel >= LogLevel.WARN) {
|
|
26303
|
+
return LogLevelLabel.WARN;
|
|
26304
|
+
}
|
|
26305
|
+
if (logLevel >= LogLevel.ERROR) {
|
|
26306
|
+
return LogLevelLabel.ERROR;
|
|
26307
|
+
}
|
|
26308
|
+
if (logLevel >= LogLevel.FATAL) {
|
|
26309
|
+
return LogLevelLabel.FATAL;
|
|
26310
|
+
}
|
|
26311
|
+
if (logLevel <= LogLevel.SILENT) {
|
|
26312
|
+
return LogLevelLabel.SILENT;
|
|
26313
|
+
}
|
|
26314
|
+
return LogLevelLabel.INFO;
|
|
26315
|
+
};
|
|
26316
|
+
|
|
26317
|
+
// packages/config-tools/src/utilities/logger.ts
|
|
26318
|
+
var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
|
|
26319
|
+
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)) {
|
|
26320
|
+
return (_) => {
|
|
26321
|
+
};
|
|
26322
|
+
}
|
|
26323
|
+
if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel || typeof logLevel === "string" && LogLevel.FATAL >= getLogLevel(logLevel)) {
|
|
26324
|
+
return (message) => {
|
|
26325
|
+
console.error(
|
|
26326
|
+
`
|
|
26327
|
+
${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(
|
|
26328
|
+
config?.colors?.fatal ? config.colors.fatal : "#1fb2a6"
|
|
26329
|
+
)(message)}
|
|
26330
|
+
|
|
26331
|
+
`
|
|
26332
|
+
);
|
|
26333
|
+
};
|
|
26334
|
+
}
|
|
26335
|
+
if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel || typeof logLevel === "string" && LogLevel.ERROR >= getLogLevel(logLevel)) {
|
|
26336
|
+
return (message) => {
|
|
26337
|
+
console.error(
|
|
26338
|
+
`
|
|
26339
|
+
${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(
|
|
26340
|
+
config?.colors?.error ? config.colors.error : "#7d1a1a"
|
|
26341
|
+
)(message)}
|
|
26342
|
+
`
|
|
26343
|
+
);
|
|
26344
|
+
};
|
|
26345
|
+
}
|
|
26346
|
+
if (typeof logLevel === "number" && LogLevel.WARN >= logLevel || typeof logLevel === "string" && LogLevel.WARN >= getLogLevel(logLevel)) {
|
|
26347
|
+
return (message) => {
|
|
26348
|
+
console.warn(
|
|
26349
|
+
`
|
|
26350
|
+
${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(
|
|
26351
|
+
config?.colors?.warning ? config.colors.warning : "#fcc419"
|
|
26352
|
+
)(message)}
|
|
26353
|
+
`
|
|
26354
|
+
);
|
|
26355
|
+
};
|
|
26356
|
+
}
|
|
26357
|
+
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
|
|
26358
|
+
return (message) => {
|
|
26359
|
+
console.info(
|
|
26360
|
+
`
|
|
26361
|
+
${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(
|
|
26362
|
+
config?.colors?.info ? config.colors.info : "#0ea5e9"
|
|
26363
|
+
)(message)}
|
|
26364
|
+
`
|
|
26365
|
+
);
|
|
26366
|
+
};
|
|
26367
|
+
}
|
|
26368
|
+
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
|
|
26369
|
+
return (message) => {
|
|
26370
|
+
console.info(
|
|
26371
|
+
`
|
|
26372
|
+
${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(
|
|
26373
|
+
config?.colors?.success ? config.colors.success : "#087f5b"
|
|
26374
|
+
)(message)}
|
|
26375
|
+
`
|
|
26376
|
+
);
|
|
26377
|
+
};
|
|
26378
|
+
}
|
|
26379
|
+
if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel || typeof logLevel === "string" && LogLevel.DEBUG >= getLogLevel(logLevel)) {
|
|
26380
|
+
return (message) => {
|
|
26381
|
+
console.debug(
|
|
26382
|
+
`
|
|
26383
|
+
${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(
|
|
26384
|
+
config?.colors?.primary ? config.colors.primary : "#1fb2a6"
|
|
26385
|
+
)(message)}
|
|
26386
|
+
`
|
|
26387
|
+
);
|
|
26388
|
+
};
|
|
26389
|
+
}
|
|
26390
|
+
return (message) => {
|
|
26391
|
+
console.log(
|
|
26392
|
+
`
|
|
26393
|
+
${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(
|
|
26394
|
+
config?.colors?.primary ? config.colors.primary : "#1fb2a6"
|
|
26395
|
+
)(message)}
|
|
26396
|
+
`
|
|
26397
|
+
);
|
|
26398
|
+
};
|
|
26399
|
+
};
|
|
26400
|
+
var writeFatal = (config, message) => getLogFn(config, LogLevel.FATAL)(message);
|
|
26401
|
+
var writeError = (config, message) => getLogFn(config, LogLevel.ERROR)(message);
|
|
26402
|
+
var writeWarning = (config, message) => getLogFn(config, LogLevel.WARN)(message);
|
|
26403
|
+
var writeInfo = (config, message) => getLogFn(config, LogLevel.INFO)(message);
|
|
26404
|
+
var writeSuccess = (config, message) => getLogFn(config, LogLevel.SUCCESS)(message);
|
|
26405
|
+
var writeDebug = (config, message) => getLogFn(config, LogLevel.DEBUG)(message);
|
|
26406
|
+
var writeTrace = (config, message) => getLogFn(config, LogLevel.TRACE)(message);
|
|
26407
|
+
var getStopwatch = (name) => {
|
|
26408
|
+
const start = process.hrtime();
|
|
26409
|
+
return () => {
|
|
26410
|
+
const end = process.hrtime(start);
|
|
26411
|
+
console.info(
|
|
26412
|
+
chalk.dim(
|
|
26413
|
+
`\u23F1\uFE0F The${name ? ` ${name}` : ""} process took ${Math.round(
|
|
26414
|
+
end[0] * 1e3 + end[1] / 1e6
|
|
26415
|
+
)}ms to complete`
|
|
26416
|
+
)
|
|
26417
|
+
);
|
|
26418
|
+
};
|
|
26419
|
+
};
|
|
26420
|
+
|
|
26421
|
+
// packages/config-tools/src/config-file/get-config-file.ts
|
|
26239
26422
|
var _static_cache = void 0;
|
|
26240
26423
|
var getConfigFileName = async (fileName, filePath) => (0, import_cosmiconfig.cosmiconfig)(fileName, { cache: true }).search(filePath);
|
|
26241
26424
|
var getConfigFile = async (filePath) => {
|
|
@@ -26262,6 +26445,10 @@ var getConfigFile = async (filePath) => {
|
|
|
26262
26445
|
console.warn(
|
|
26263
26446
|
"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."
|
|
26264
26447
|
);
|
|
26448
|
+
writeWarning(
|
|
26449
|
+
{ logLevel: "error" },
|
|
26450
|
+
"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."
|
|
26451
|
+
);
|
|
26265
26452
|
return void 0;
|
|
26266
26453
|
}
|
|
26267
26454
|
const config = cosmiconfigResult.config ?? {};
|
|
@@ -26342,6 +26529,10 @@ Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
|
|
|
26342
26529
|
return result;
|
|
26343
26530
|
}
|
|
26344
26531
|
|
|
26532
|
+
// packages/config-tools/src/utilities/get-default-config.ts
|
|
26533
|
+
var import_node_fs2 = require("node:fs");
|
|
26534
|
+
var import_node_path2 = require("node:path");
|
|
26535
|
+
|
|
26345
26536
|
// node_modules/.pnpm/zod@3.22.4/node_modules/zod/lib/index.mjs
|
|
26346
26537
|
var util;
|
|
26347
26538
|
(function(util2) {
|
|
@@ -30002,183 +30193,50 @@ var DefaultStormConfig = {
|
|
|
30002
30193
|
colors: { ...DefaultColorConfig },
|
|
30003
30194
|
extensions: {}
|
|
30004
30195
|
};
|
|
30005
|
-
|
|
30006
|
-
|
|
30007
|
-
|
|
30008
|
-
|
|
30009
|
-
|
|
30010
|
-
|
|
30011
|
-
|
|
30012
|
-
|
|
30013
|
-
|
|
30014
|
-
|
|
30015
|
-
|
|
30016
|
-
|
|
30017
|
-
|
|
30018
|
-
|
|
30019
|
-
|
|
30020
|
-
|
|
30021
|
-
|
|
30022
|
-
|
|
30023
|
-
|
|
30024
|
-
|
|
30025
|
-
|
|
30026
|
-
|
|
30027
|
-
|
|
30028
|
-
|
|
30029
|
-
|
|
30030
|
-
|
|
30031
|
-
|
|
30032
|
-
|
|
30033
|
-
|
|
30034
|
-
case "trace":
|
|
30035
|
-
return LogLevel.TRACE;
|
|
30036
|
-
case "debug":
|
|
30037
|
-
return LogLevel.DEBUG;
|
|
30038
|
-
case "info":
|
|
30039
|
-
return LogLevel.INFO;
|
|
30040
|
-
case "warn":
|
|
30041
|
-
return LogLevel.WARN;
|
|
30042
|
-
case "error":
|
|
30043
|
-
return LogLevel.ERROR;
|
|
30044
|
-
case "fatal":
|
|
30045
|
-
return LogLevel.FATAL;
|
|
30046
|
-
case "silent":
|
|
30047
|
-
return LogLevel.SILENT;
|
|
30048
|
-
default:
|
|
30049
|
-
return LogLevel.INFO;
|
|
30050
|
-
}
|
|
30051
|
-
};
|
|
30052
|
-
var getLogLevelLabel = (logLevel) => {
|
|
30053
|
-
if (logLevel >= LogLevel.ALL) {
|
|
30054
|
-
return LogLevelLabel.ALL;
|
|
30055
|
-
}
|
|
30056
|
-
if (logLevel >= LogLevel.TRACE) {
|
|
30057
|
-
return LogLevelLabel.TRACE;
|
|
30058
|
-
}
|
|
30059
|
-
if (logLevel >= LogLevel.DEBUG) {
|
|
30060
|
-
return LogLevelLabel.DEBUG;
|
|
30061
|
-
}
|
|
30062
|
-
if (logLevel >= LogLevel.INFO) {
|
|
30063
|
-
return LogLevelLabel.INFO;
|
|
30064
|
-
}
|
|
30065
|
-
if (logLevel >= LogLevel.WARN) {
|
|
30066
|
-
return LogLevelLabel.WARN;
|
|
30067
|
-
}
|
|
30068
|
-
if (logLevel >= LogLevel.ERROR) {
|
|
30069
|
-
return LogLevelLabel.ERROR;
|
|
30070
|
-
}
|
|
30071
|
-
if (logLevel >= LogLevel.FATAL) {
|
|
30072
|
-
return LogLevelLabel.FATAL;
|
|
30073
|
-
}
|
|
30074
|
-
if (logLevel <= LogLevel.SILENT) {
|
|
30075
|
-
return LogLevelLabel.SILENT;
|
|
30076
|
-
}
|
|
30077
|
-
return LogLevelLabel.INFO;
|
|
30078
|
-
};
|
|
30079
|
-
|
|
30080
|
-
// packages/config-tools/src/utilities/logger.ts
|
|
30081
|
-
var chalk = __toESM(require_source(), 1);
|
|
30082
|
-
var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
|
|
30083
|
-
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)) {
|
|
30084
|
-
return (_) => {
|
|
30085
|
-
};
|
|
30086
|
-
}
|
|
30087
|
-
if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel || typeof logLevel === "string" && LogLevel.FATAL >= getLogLevel(logLevel)) {
|
|
30088
|
-
return (message) => {
|
|
30089
|
-
console.error(
|
|
30090
|
-
`
|
|
30091
|
-
${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(
|
|
30092
|
-
config?.colors?.fatal ? config.colors.fatal : "#1fb2a6"
|
|
30093
|
-
)(message)}
|
|
30094
|
-
|
|
30095
|
-
`
|
|
30096
|
-
);
|
|
30097
|
-
};
|
|
30098
|
-
}
|
|
30099
|
-
if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel || typeof logLevel === "string" && LogLevel.ERROR >= getLogLevel(logLevel)) {
|
|
30100
|
-
return (message) => {
|
|
30101
|
-
console.error(
|
|
30102
|
-
`
|
|
30103
|
-
${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(
|
|
30104
|
-
config?.colors?.error ? config.colors.error : "#7d1a1a"
|
|
30105
|
-
)(message)}
|
|
30106
|
-
`
|
|
30107
|
-
);
|
|
30108
|
-
};
|
|
30109
|
-
}
|
|
30110
|
-
if (typeof logLevel === "number" && LogLevel.WARN >= logLevel || typeof logLevel === "string" && LogLevel.WARN >= getLogLevel(logLevel)) {
|
|
30111
|
-
return (message) => {
|
|
30112
|
-
console.warn(
|
|
30113
|
-
`
|
|
30114
|
-
${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(
|
|
30115
|
-
config?.colors?.warning ? config.colors.warning : "#fcc419"
|
|
30116
|
-
)(message)}
|
|
30117
|
-
`
|
|
30118
|
-
);
|
|
30119
|
-
};
|
|
30120
|
-
}
|
|
30121
|
-
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
|
|
30122
|
-
return (message) => {
|
|
30123
|
-
console.info(
|
|
30124
|
-
`
|
|
30125
|
-
${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(
|
|
30126
|
-
config?.colors?.info ? config.colors.info : "#0ea5e9"
|
|
30127
|
-
)(message)}
|
|
30128
|
-
`
|
|
30129
|
-
);
|
|
30130
|
-
};
|
|
30131
|
-
}
|
|
30132
|
-
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
|
|
30133
|
-
return (message) => {
|
|
30134
|
-
console.info(
|
|
30135
|
-
`
|
|
30136
|
-
${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(
|
|
30137
|
-
config?.colors?.success ? config.colors.success : "#087f5b"
|
|
30138
|
-
)(message)}
|
|
30139
|
-
`
|
|
30140
|
-
);
|
|
30141
|
-
};
|
|
30142
|
-
}
|
|
30143
|
-
if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel || typeof logLevel === "string" && LogLevel.DEBUG >= getLogLevel(logLevel)) {
|
|
30144
|
-
return (message) => {
|
|
30145
|
-
console.debug(
|
|
30146
|
-
`
|
|
30147
|
-
${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(
|
|
30148
|
-
config?.colors?.primary ? config.colors.primary : "#1fb2a6"
|
|
30149
|
-
)(message)}
|
|
30150
|
-
`
|
|
30151
|
-
);
|
|
30152
|
-
};
|
|
30196
|
+
var getDefaultConfig = (config = {}, root) => {
|
|
30197
|
+
let name = "storm-workspace";
|
|
30198
|
+
let namespace = "storm-software";
|
|
30199
|
+
let repository = "https://github.com/storm-software/storm-ops";
|
|
30200
|
+
let license = DefaultStormConfig.license;
|
|
30201
|
+
let homepage = DefaultStormConfig.homepage;
|
|
30202
|
+
const workspaceRoot = findWorkspaceRoot(root);
|
|
30203
|
+
if ((0, import_node_fs2.existsSync)((0, import_node_path2.join)(workspaceRoot, "package.json"))) {
|
|
30204
|
+
const file = (0, import_node_fs2.readFileSync)((0, import_node_path2.join)(workspaceRoot, "package.json"), {
|
|
30205
|
+
encoding: "utf-8"
|
|
30206
|
+
});
|
|
30207
|
+
if (file) {
|
|
30208
|
+
const packageJson = JSON.parse(file);
|
|
30209
|
+
if (packageJson.name) {
|
|
30210
|
+
name = packageJson.name;
|
|
30211
|
+
}
|
|
30212
|
+
if (packageJson.namespace) {
|
|
30213
|
+
namespace = packageJson.namespace;
|
|
30214
|
+
}
|
|
30215
|
+
if (packageJson.repository?.url) {
|
|
30216
|
+
repository = packageJson.repository?.url;
|
|
30217
|
+
}
|
|
30218
|
+
if (packageJson.license) {
|
|
30219
|
+
license = packageJson.license;
|
|
30220
|
+
}
|
|
30221
|
+
if (packageJson.homepage) {
|
|
30222
|
+
homepage = packageJson.homepage;
|
|
30223
|
+
}
|
|
30224
|
+
}
|
|
30153
30225
|
}
|
|
30154
|
-
return (
|
|
30155
|
-
|
|
30156
|
-
|
|
30157
|
-
|
|
30158
|
-
|
|
30159
|
-
|
|
30160
|
-
|
|
30161
|
-
|
|
30162
|
-
|
|
30163
|
-
|
|
30164
|
-
|
|
30165
|
-
|
|
30166
|
-
|
|
30167
|
-
|
|
30168
|
-
var writeDebug = (config, message) => getLogFn(config, LogLevel.DEBUG)(message);
|
|
30169
|
-
var writeTrace = (config, message) => getLogFn(config, LogLevel.TRACE)(message);
|
|
30170
|
-
var getStopwatch = (name) => {
|
|
30171
|
-
const start = process.hrtime();
|
|
30172
|
-
return () => {
|
|
30173
|
-
const end = process.hrtime(start);
|
|
30174
|
-
console.info(
|
|
30175
|
-
chalk.dim(
|
|
30176
|
-
`\u23F1\uFE0F The${name ? ` ${name}` : ""} process took ${Math.round(
|
|
30177
|
-
end[0] * 1e3 + end[1] / 1e6
|
|
30178
|
-
)}ms to complete`
|
|
30179
|
-
)
|
|
30180
|
-
);
|
|
30181
|
-
};
|
|
30226
|
+
return StormConfigSchema.parse({
|
|
30227
|
+
...DefaultStormConfig,
|
|
30228
|
+
...config,
|
|
30229
|
+
colors: { ...DefaultColorConfig, ...config.colors },
|
|
30230
|
+
workspaceRoot,
|
|
30231
|
+
name,
|
|
30232
|
+
namespace,
|
|
30233
|
+
repository,
|
|
30234
|
+
license: license ?? DefaultStormConfig.license,
|
|
30235
|
+
homepage: homepage ?? DefaultStormConfig.homepage,
|
|
30236
|
+
extensions: {
|
|
30237
|
+
...config.extensions
|
|
30238
|
+
}
|
|
30239
|
+
});
|
|
30182
30240
|
};
|
|
30183
30241
|
|
|
30184
30242
|
// packages/config-tools/src/env/set-env.ts
|
|
@@ -30368,39 +30426,21 @@ var getConfigEnv = () => {
|
|
|
30368
30426
|
|
|
30369
30427
|
// packages/config-tools/src/create-storm-config.ts
|
|
30370
30428
|
var loadStormConfig = async (workspaceRoot) => {
|
|
30429
|
+
let config = {};
|
|
30371
30430
|
let _workspaceRoot = workspaceRoot;
|
|
30372
30431
|
if (!_workspaceRoot) {
|
|
30373
30432
|
_workspaceRoot = findWorkspaceRoot();
|
|
30374
30433
|
}
|
|
30375
|
-
|
|
30376
|
-
|
|
30377
|
-
|
|
30378
|
-
|
|
30379
|
-
|
|
30380
|
-
|
|
30381
|
-
|
|
30382
|
-
|
|
30383
|
-
|
|
30384
|
-
info: process.env.STORM_COLOR_INFO ?? configFile.colors?.info,
|
|
30385
|
-
warning: process.env.STORM_COLOR_WARNING ?? configFile.colors?.warning,
|
|
30386
|
-
error: process.env.STORM_COLOR_ERROR ?? configFile.colors?.error,
|
|
30387
|
-
fatal: process.env.STORM_COLOR_FATAL ?? configFile.colors?.fatal
|
|
30388
|
-
};
|
|
30389
|
-
} else {
|
|
30390
|
-
configFile[key] = configEnv[key];
|
|
30391
|
-
}
|
|
30392
|
-
}
|
|
30393
|
-
}
|
|
30394
|
-
const config = StormConfigSchema.parse(configFile);
|
|
30434
|
+
config = StormConfigSchema.parse(
|
|
30435
|
+
await getDefaultConfig(
|
|
30436
|
+
{
|
|
30437
|
+
...await getConfigFile(_workspaceRoot),
|
|
30438
|
+
...getConfigEnv()
|
|
30439
|
+
},
|
|
30440
|
+
_workspaceRoot
|
|
30441
|
+
)
|
|
30442
|
+
);
|
|
30395
30443
|
setConfigEnv(config);
|
|
30396
|
-
console.debug("\r\n\r\n");
|
|
30397
|
-
console.debug(`Loaded Storm config from ${config.configFile}`);
|
|
30398
|
-
for (const key of Object.keys(configFile)) {
|
|
30399
|
-
console.debug(`
|
|
30400
|
-
----- ${key} ----- `);
|
|
30401
|
-
console.debug(configFile[key]);
|
|
30402
|
-
}
|
|
30403
|
-
console.debug("\r\n\r\n");
|
|
30404
30444
|
return config;
|
|
30405
30445
|
};
|
|
30406
30446
|
|