@storm-software/workspace-tools 1.72.3 → 1.73.1
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 +24 -0
- package/index.js +374 -156
- package/meta.json +1 -1
- package/package.json +2 -2
- package/src/base/index.js +366 -148
- package/src/executors/rolldown/executor.js +362 -144
- package/src/executors/tsup/executor.js +362 -144
- package/src/executors/tsup-browser/executor.js +362 -144
- package/src/executors/tsup-neutral/executor.js +362 -144
- package/src/executors/tsup-node/executor.js +362 -144
- package/src/executors/typia/executor.js +362 -144
- package/src/executors/unbuild/executor.js +362 -144
- package/src/generators/browser-library/generator.js +362 -144
- package/src/generators/config-schema/generator.js +356 -138
- package/src/generators/neutral-library/generator.js +362 -144
- package/src/generators/node-library/generator.js +362 -144
- package/src/generators/preset/files/.github/workflows/build-release.yml.template +1 -1
- package/src/generators/preset/generator.js +356 -138
- package/src/generators/release-version/generator.js +358 -140
- package/src/utils/index.js +358 -140
|
@@ -3766,23 +3766,71 @@ var init_lib = __esm({
|
|
|
3766
3766
|
});
|
|
3767
3767
|
|
|
3768
3768
|
// packages/config/src/schema.ts
|
|
3769
|
-
var ColorConfigSchema, StormConfigSchema;
|
|
3769
|
+
var DarkColorSchema, LightColorSchema, PrimaryColorSchema, SecondaryColorSchema, TertiaryColorSchema, AccentColorSchema, SuccessColorSchema, InfoColorSchema, WarningColorSchema, ErrorColorSchema, FatalColorSchema, DarkThemeColorConfigSchema, LightThemeColorConfigSchema, MultiThemeColorConfigSchema, SingleThemeColorConfigSchema, ColorConfigSchema, ColorConfigMapSchema, StormConfigSchema;
|
|
3770
3770
|
var init_schema = __esm({
|
|
3771
3771
|
"packages/config/src/schema.ts"() {
|
|
3772
3772
|
init_lib();
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3773
|
+
DarkColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#1d232a").describe("The dark background color of the workspace");
|
|
3774
|
+
LightColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#f4f4f5").describe("The light background color of the workspace");
|
|
3775
|
+
PrimaryColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#1fb2a6").describe("The primary color of the workspace");
|
|
3776
|
+
SecondaryColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#0ea5e9").describe("The secondary color of the workspace");
|
|
3777
|
+
TertiaryColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#ec5990").describe("The tertiary color of the workspace");
|
|
3778
|
+
AccentColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#6366f1").describe("The accent color of the workspace");
|
|
3779
|
+
SuccessColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#087f5b").describe("The success color of the workspace");
|
|
3780
|
+
InfoColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#0ea5e9").describe("The informational color of the workspace");
|
|
3781
|
+
WarningColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#fcc419").describe("The warning color of the workspace");
|
|
3782
|
+
ErrorColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#990000").describe("The error color of the workspace");
|
|
3783
|
+
FatalColorSchema = z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#7d1a1a").describe("The fatal color of the workspace");
|
|
3784
|
+
DarkThemeColorConfigSchema = z.object({
|
|
3785
|
+
foreground: LightColorSchema,
|
|
3786
|
+
background: DarkColorSchema,
|
|
3787
|
+
primary: PrimaryColorSchema,
|
|
3788
|
+
secondary: SecondaryColorSchema,
|
|
3789
|
+
tertiary: TertiaryColorSchema,
|
|
3790
|
+
accent: AccentColorSchema,
|
|
3791
|
+
success: SuccessColorSchema,
|
|
3792
|
+
info: InfoColorSchema,
|
|
3793
|
+
warning: WarningColorSchema,
|
|
3794
|
+
error: ErrorColorSchema,
|
|
3795
|
+
fatal: FatalColorSchema
|
|
3796
|
+
});
|
|
3797
|
+
LightThemeColorConfigSchema = z.object({
|
|
3798
|
+
foreground: DarkColorSchema,
|
|
3799
|
+
background: LightColorSchema,
|
|
3800
|
+
primary: PrimaryColorSchema,
|
|
3801
|
+
secondary: SecondaryColorSchema,
|
|
3802
|
+
tertiary: TertiaryColorSchema,
|
|
3803
|
+
accent: AccentColorSchema,
|
|
3804
|
+
success: SuccessColorSchema,
|
|
3805
|
+
info: InfoColorSchema,
|
|
3806
|
+
warning: WarningColorSchema,
|
|
3807
|
+
error: ErrorColorSchema,
|
|
3808
|
+
fatal: FatalColorSchema
|
|
3809
|
+
});
|
|
3810
|
+
MultiThemeColorConfigSchema = z.object({
|
|
3811
|
+
dark: DarkThemeColorConfigSchema,
|
|
3812
|
+
light: LightThemeColorConfigSchema
|
|
3813
|
+
});
|
|
3814
|
+
SingleThemeColorConfigSchema = z.object({
|
|
3815
|
+
dark: DarkColorSchema,
|
|
3816
|
+
light: LightColorSchema,
|
|
3817
|
+
primary: PrimaryColorSchema,
|
|
3818
|
+
secondary: SecondaryColorSchema,
|
|
3819
|
+
tertiary: TertiaryColorSchema,
|
|
3820
|
+
accent: AccentColorSchema,
|
|
3821
|
+
success: SuccessColorSchema,
|
|
3822
|
+
info: InfoColorSchema,
|
|
3823
|
+
warning: WarningColorSchema,
|
|
3824
|
+
error: ErrorColorSchema,
|
|
3825
|
+
fatal: FatalColorSchema
|
|
3826
|
+
});
|
|
3827
|
+
ColorConfigSchema = SingleThemeColorConfigSchema.or(
|
|
3828
|
+
MultiThemeColorConfigSchema
|
|
3829
|
+
).describe("Colors used for various workspace elements");
|
|
3830
|
+
ColorConfigMapSchema = z.union([
|
|
3831
|
+
z.object({ "base": ColorConfigSchema }),
|
|
3832
|
+
z.record(z.string(), ColorConfigSchema)
|
|
3833
|
+
]);
|
|
3786
3834
|
StormConfigSchema = z.object({
|
|
3787
3835
|
extends: z.string().trim().optional().describe(
|
|
3788
3836
|
"The path to a base JSON file to use as a configuration preset file"
|
|
@@ -3833,7 +3881,7 @@ var init_schema = __esm({
|
|
|
3833
3881
|
configFile: z.string().trim().nullable().default(null).describe(
|
|
3834
3882
|
"The filepath of the Storm config. When this field is null, no config file was found in the current workspace."
|
|
3835
3883
|
),
|
|
3836
|
-
colors: ColorConfigSchema.describe(
|
|
3884
|
+
colors: ColorConfigSchema.or(ColorConfigMapSchema).describe(
|
|
3837
3885
|
"Storm theme config values used for styling various package elements"
|
|
3838
3886
|
),
|
|
3839
3887
|
extensions: z.record(z.any()).optional().default({}).describe("Configuration of each used extension")
|
|
@@ -3844,8 +3892,22 @@ var init_schema = __esm({
|
|
|
3844
3892
|
});
|
|
3845
3893
|
|
|
3846
3894
|
// packages/config/src/types.ts
|
|
3895
|
+
var COLOR_KEYS;
|
|
3847
3896
|
var init_types = __esm({
|
|
3848
3897
|
"packages/config/src/types.ts"() {
|
|
3898
|
+
COLOR_KEYS = [
|
|
3899
|
+
"dark",
|
|
3900
|
+
"light",
|
|
3901
|
+
"primary",
|
|
3902
|
+
"secondary",
|
|
3903
|
+
"tertiary",
|
|
3904
|
+
"accent",
|
|
3905
|
+
"success",
|
|
3906
|
+
"info",
|
|
3907
|
+
"warning",
|
|
3908
|
+
"error",
|
|
3909
|
+
"fatal"
|
|
3910
|
+
];
|
|
3849
3911
|
}
|
|
3850
3912
|
});
|
|
3851
3913
|
|
|
@@ -50420,8 +50482,8 @@ var require_pax = __commonJS({
|
|
|
50420
50482
|
return len + s2;
|
|
50421
50483
|
}
|
|
50422
50484
|
};
|
|
50423
|
-
Pax.parse = (string, ex, g4) => new Pax(
|
|
50424
|
-
var
|
|
50485
|
+
Pax.parse = (string, ex, g4) => new Pax(merge3(parseKV(string), ex), g4);
|
|
50486
|
+
var merge3 = (a2, b6) => b6 ? Object.keys(a2).reduce((s2, k4) => (s2[k4] = a2[k4], s2), b6) : a2;
|
|
50425
50487
|
var parseKV = (string) => string.replace(/\n$/, "").split("\n").reduce(parseKVLine, /* @__PURE__ */ Object.create(null));
|
|
50426
50488
|
var parseKVLine = (set, line) => {
|
|
50427
50489
|
const n = parseInt(line, 10);
|
|
@@ -70640,64 +70702,6 @@ var require_cjs = __commonJS({
|
|
|
70640
70702
|
}
|
|
70641
70703
|
});
|
|
70642
70704
|
|
|
70643
|
-
// packages/config-tools/src/config-file/get-config-file.ts
|
|
70644
|
-
var import_deepmerge, getConfigFileByName, getConfigFile;
|
|
70645
|
-
var init_get_config_file = __esm({
|
|
70646
|
-
"packages/config-tools/src/config-file/get-config-file.ts"() {
|
|
70647
|
-
init_find_workspace_root();
|
|
70648
|
-
init_dist10();
|
|
70649
|
-
import_deepmerge = __toESM(require_cjs());
|
|
70650
|
-
getConfigFileByName = async (fileName, filePath) => {
|
|
70651
|
-
const workspacePath = filePath ? filePath : findWorkspaceRoot(filePath);
|
|
70652
|
-
return loadConfig({
|
|
70653
|
-
cwd: workspacePath,
|
|
70654
|
-
packageJson: true,
|
|
70655
|
-
name: fileName,
|
|
70656
|
-
envName: fileName?.toUpperCase(),
|
|
70657
|
-
jitiOptions: {
|
|
70658
|
-
debug: true,
|
|
70659
|
-
cache: process.env.STORM_CACHE ? process.env.STORM_CACHE_DIRECTORY : false
|
|
70660
|
-
}
|
|
70661
|
-
});
|
|
70662
|
-
};
|
|
70663
|
-
getConfigFile = async (filePath, additionalFileNames = []) => {
|
|
70664
|
-
const workspacePath = filePath ? filePath : findWorkspaceRoot(filePath);
|
|
70665
|
-
let { config, configFile } = await loadConfig({
|
|
70666
|
-
cwd: workspacePath,
|
|
70667
|
-
name: "storm"
|
|
70668
|
-
});
|
|
70669
|
-
if (additionalFileNames && additionalFileNames.length > 0) {
|
|
70670
|
-
const results = await Promise.all(
|
|
70671
|
-
additionalFileNames.map(
|
|
70672
|
-
(fileName) => loadConfig({
|
|
70673
|
-
cwd: workspacePath,
|
|
70674
|
-
name: fileName
|
|
70675
|
-
})
|
|
70676
|
-
)
|
|
70677
|
-
);
|
|
70678
|
-
for (const result of results) {
|
|
70679
|
-
if (result) {
|
|
70680
|
-
config = (0, import_deepmerge.default)(config ?? {}, result.config ?? {});
|
|
70681
|
-
}
|
|
70682
|
-
}
|
|
70683
|
-
}
|
|
70684
|
-
if (!config) {
|
|
70685
|
-
return void 0;
|
|
70686
|
-
}
|
|
70687
|
-
config.configFile = configFile;
|
|
70688
|
-
config.runtimeVersion = "0.0.1";
|
|
70689
|
-
return config;
|
|
70690
|
-
};
|
|
70691
|
-
}
|
|
70692
|
-
});
|
|
70693
|
-
|
|
70694
|
-
// packages/config-tools/src/config-file/index.ts
|
|
70695
|
-
var init_config_file = __esm({
|
|
70696
|
-
"packages/config-tools/src/config-file/index.ts"() {
|
|
70697
|
-
init_get_config_file();
|
|
70698
|
-
}
|
|
70699
|
-
});
|
|
70700
|
-
|
|
70701
70705
|
// packages/config-tools/src/utilities/get-default-config.ts
|
|
70702
70706
|
var import_node_fs10, import_node_path6, DEFAULT_COLOR_CONFIG, DEFAULT_STORM_CONFIG, getDefaultConfig;
|
|
70703
70707
|
var init_get_default_config = __esm({
|
|
@@ -72451,14 +72455,16 @@ var init_chalk = __esm({
|
|
|
72451
72455
|
});
|
|
72452
72456
|
|
|
72453
72457
|
// packages/config-tools/src/utilities/logger.ts
|
|
72454
|
-
var getLogFn, writeFatal, writeError, writeWarning, writeInfo, writeSuccess, writeDebug, writeTrace, writeSystem, getStopwatch;
|
|
72458
|
+
var getLogFn, writeFatal, writeError, writeWarning, writeInfo, writeSuccess, writeDebug, writeTrace, writeSystem, getStopwatch, formatLogMessage, _isFunction;
|
|
72455
72459
|
var init_logger = __esm({
|
|
72456
72460
|
"packages/config-tools/src/utilities/logger.ts"() {
|
|
72457
72461
|
init_types2();
|
|
72458
72462
|
init_get_log_level();
|
|
72459
72463
|
init_chalk();
|
|
72464
|
+
init_get_default_config();
|
|
72460
72465
|
getLogFn = (logLevel = LogLevel.INFO, config = {}) => {
|
|
72461
72466
|
let _chalk = getChalk();
|
|
72467
|
+
const colors = !config.colors?.dark && !config.colors?.["base"] && !config.colors?.["base"]?.dark ? DEFAULT_COLOR_CONFIG : config.colors?.dark && typeof config.colors.dark === "string" ? config.colors : config.colors?.["base"]?.dark && typeof config.colors["base"].dark === "string" ? config.colors["base"].dark : config.colors?.["base"] ? config.colors?.["base"] : DEFAULT_COLOR_CONFIG;
|
|
72462
72468
|
const configLogLevel = config.logLevel ?? process.env?.STORM_LOG_LEVEL ?? LogLevelLabel.INFO;
|
|
72463
72469
|
if (typeof logLevel === "number" && (logLevel >= getLogLevel(configLogLevel) || logLevel <= LogLevel.SILENT) || typeof logLevel === "string" && getLogLevel(logLevel) >= getLogLevel(configLogLevel)) {
|
|
72464
72470
|
return (_6) => {
|
|
@@ -72468,9 +72474,9 @@ var init_logger = __esm({
|
|
|
72468
72474
|
return (message) => {
|
|
72469
72475
|
console.error(
|
|
72470
72476
|
`
|
|
72471
|
-
${_chalk.bold.hex(
|
|
72472
|
-
|
|
72473
|
-
)(message)}
|
|
72477
|
+
${_chalk.bold.hex(colors.error ?? "#f85149")(">")} ${_chalk.bold.bgHex(colors.fatal ?? "#b62324").whiteBright(
|
|
72478
|
+
" \u{1F480} Fatal "
|
|
72479
|
+
)} ${_chalk.hex(colors.error ?? "#f85149")(formatLogMessage(message))}
|
|
72474
72480
|
|
|
72475
72481
|
`
|
|
72476
72482
|
);
|
|
@@ -72480,9 +72486,9 @@ ${_chalk.bold.hex(config?.colors?.error ? config.colors.error : "#7d1a1a")(">")}
|
|
|
72480
72486
|
return (message) => {
|
|
72481
72487
|
console.error(
|
|
72482
72488
|
`
|
|
72483
|
-
${_chalk.bold.hex(
|
|
72484
|
-
|
|
72485
|
-
)(message)}
|
|
72489
|
+
${_chalk.bold.hex(colors.error ?? "#f85149")(">")} ${_chalk.bold.bgHex(colors.error ?? "#f85149").whiteBright(
|
|
72490
|
+
" \u2718 Error "
|
|
72491
|
+
)} ${_chalk.hex(colors.error ?? "#f85149")(formatLogMessage(message))}
|
|
72486
72492
|
`
|
|
72487
72493
|
);
|
|
72488
72494
|
};
|
|
@@ -72491,9 +72497,9 @@ ${_chalk.bold.hex(config?.colors?.error ? config.colors.error : "#7d1a1a")(">")}
|
|
|
72491
72497
|
return (message) => {
|
|
72492
72498
|
console.warn(
|
|
72493
72499
|
`
|
|
72494
|
-
${_chalk.bold.hex(
|
|
72495
|
-
|
|
72496
|
-
)(message)}
|
|
72500
|
+
${_chalk.bold.hex(colors.warning ?? "#e3b341")("> ")} ${_chalk.bold.bgHex(colors.warning ?? "#e3b341").whiteBright(
|
|
72501
|
+
" \u26A0 Warn "
|
|
72502
|
+
)} ${_chalk.hex(colors.warning ?? "#e3b341")(formatLogMessage(message))}
|
|
72497
72503
|
`
|
|
72498
72504
|
);
|
|
72499
72505
|
};
|
|
@@ -72502,9 +72508,9 @@ ${_chalk.bold.hex(config?.colors?.warning ? config.colors.warning : "#fcc419")("
|
|
|
72502
72508
|
return (message) => {
|
|
72503
72509
|
console.info(
|
|
72504
72510
|
`
|
|
72505
|
-
${_chalk.bold.hex(
|
|
72506
|
-
|
|
72507
|
-
)(message)}
|
|
72511
|
+
${_chalk.bold.hex(colors.success ?? "#56d364")(">")} ${_chalk.bold.bgHex(colors.success ?? "#56d364").whiteBright(
|
|
72512
|
+
" \u2713 Success "
|
|
72513
|
+
)} ${_chalk.hex(colors.success ?? "#56d364")(formatLogMessage(message))}
|
|
72508
72514
|
`
|
|
72509
72515
|
);
|
|
72510
72516
|
};
|
|
@@ -72513,9 +72519,9 @@ ${_chalk.bold.hex(config?.colors?.success ? config.colors.success : "#087f5b")("
|
|
|
72513
72519
|
return (message) => {
|
|
72514
72520
|
console.info(
|
|
72515
72521
|
`
|
|
72516
|
-
${_chalk.bold.hex(
|
|
72517
|
-
|
|
72518
|
-
)(message)}
|
|
72522
|
+
${_chalk.bold.hex(colors.info ?? "#58a6ff")(">")} ${_chalk.bold.bgHex(colors.info ?? "#58a6ff").whiteBright(
|
|
72523
|
+
" \u2139 Info "
|
|
72524
|
+
)} ${_chalk.hex(colors.info ?? "#58a6ff")(formatLogMessage(message))}
|
|
72519
72525
|
`
|
|
72520
72526
|
);
|
|
72521
72527
|
};
|
|
@@ -72524,9 +72530,9 @@ ${_chalk.bold.hex(config?.colors?.info ? config.colors.info : "#0ea5e9")(">")} $
|
|
|
72524
72530
|
return (message) => {
|
|
72525
72531
|
console.debug(
|
|
72526
72532
|
`
|
|
72527
|
-
${_chalk.bold.hex(
|
|
72528
|
-
|
|
72529
|
-
)(message)}
|
|
72533
|
+
${_chalk.bold.hex(colors.primary ?? "#1fb2a6")(">")} ${_chalk.bold.bgHex(colors.primary ?? "#1fb2a6").whiteBright(
|
|
72534
|
+
" \u{1F6E0} Debug "
|
|
72535
|
+
)} ${_chalk.hex(colors.primary ?? "#1fb2a6")(formatLogMessage(message))}
|
|
72530
72536
|
`
|
|
72531
72537
|
);
|
|
72532
72538
|
};
|
|
@@ -72534,9 +72540,9 @@ ${_chalk.bold.hex(config?.colors?.primary ? config.colors.primary : "#1fb2a6")("
|
|
|
72534
72540
|
return (message) => {
|
|
72535
72541
|
console.log(
|
|
72536
72542
|
`
|
|
72537
|
-
${_chalk.bold.hex(
|
|
72538
|
-
|
|
72539
|
-
)(message)}
|
|
72543
|
+
${_chalk.bold.hex(colors.primary ?? "#1fb2a6")(">")} ${_chalk.bold.bgHex(colors.primary ?? "#1fb2a6").whiteBright(
|
|
72544
|
+
" \u2709 System "
|
|
72545
|
+
)} ${_chalk.hex(colors.primary ?? "#1fb2a6")(formatLogMessage(message))}
|
|
72540
72546
|
`
|
|
72541
72547
|
);
|
|
72542
72548
|
};
|
|
@@ -72563,6 +72569,19 @@ ${_chalk.bold.hex(config?.colors?.primary ? config.colors.primary : "#1fb2a6")("
|
|
|
72563
72569
|
);
|
|
72564
72570
|
};
|
|
72565
72571
|
};
|
|
72572
|
+
formatLogMessage = (message, prefix = "-") => {
|
|
72573
|
+
return typeof message === "string" ? message : typeof message === "object" ? Object.keys(message).map(
|
|
72574
|
+
(key) => ` ${prefix} ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" ? `
|
|
72575
|
+
${formatLogMessage(message[key], `${prefix}-`)}` : message[key]}`
|
|
72576
|
+
).join("\n") : message;
|
|
72577
|
+
};
|
|
72578
|
+
_isFunction = (value2) => {
|
|
72579
|
+
try {
|
|
72580
|
+
return value2 instanceof Function || typeof value2 === "function" || !!(value2?.constructor && value2?.call && value2?.apply);
|
|
72581
|
+
} catch (e2) {
|
|
72582
|
+
return false;
|
|
72583
|
+
}
|
|
72584
|
+
};
|
|
72566
72585
|
}
|
|
72567
72586
|
});
|
|
72568
72587
|
|
|
@@ -72739,10 +72758,99 @@ var init_utilities = __esm({
|
|
|
72739
72758
|
}
|
|
72740
72759
|
});
|
|
72741
72760
|
|
|
72761
|
+
// packages/config-tools/src/config-file/get-config-file.ts
|
|
72762
|
+
var import_deepmerge, getConfigFileByName, getConfigFile;
|
|
72763
|
+
var init_get_config_file = __esm({
|
|
72764
|
+
"packages/config-tools/src/config-file/get-config-file.ts"() {
|
|
72765
|
+
init_find_workspace_root();
|
|
72766
|
+
init_dist10();
|
|
72767
|
+
import_deepmerge = __toESM(require_cjs());
|
|
72768
|
+
init_utilities();
|
|
72769
|
+
getConfigFileByName = async (fileName, filePath, options = {}) => {
|
|
72770
|
+
const workspacePath = filePath ? filePath : findWorkspaceRoot(filePath);
|
|
72771
|
+
let config = loadConfig({
|
|
72772
|
+
cwd: workspacePath,
|
|
72773
|
+
packageJson: true,
|
|
72774
|
+
name: fileName,
|
|
72775
|
+
envName: fileName?.toUpperCase(),
|
|
72776
|
+
jitiOptions: {
|
|
72777
|
+
debug: true,
|
|
72778
|
+
cache: process.env.STORM_CACHE ? process.env.STORM_CACHE_DIRECTORY : false
|
|
72779
|
+
},
|
|
72780
|
+
...options
|
|
72781
|
+
});
|
|
72782
|
+
if (!config || Object.keys(config).length === 0) {
|
|
72783
|
+
config = loadConfig({
|
|
72784
|
+
cwd: workspacePath,
|
|
72785
|
+
packageJson: true,
|
|
72786
|
+
name: fileName,
|
|
72787
|
+
envName: fileName?.toUpperCase(),
|
|
72788
|
+
jitiOptions: {
|
|
72789
|
+
debug: true,
|
|
72790
|
+
cache: process.env.STORM_CACHE ? process.env.STORM_CACHE_DIRECTORY : false
|
|
72791
|
+
},
|
|
72792
|
+
configFile: fileName,
|
|
72793
|
+
...options
|
|
72794
|
+
});
|
|
72795
|
+
}
|
|
72796
|
+
return config;
|
|
72797
|
+
};
|
|
72798
|
+
getConfigFile = async (filePath, additionalFileNames = []) => {
|
|
72799
|
+
const workspacePath = filePath ? filePath : findWorkspaceRoot(filePath);
|
|
72800
|
+
let { config, configFile } = await getConfigFileByName(
|
|
72801
|
+
"storm",
|
|
72802
|
+
workspacePath
|
|
72803
|
+
);
|
|
72804
|
+
if (config && Object.keys(config).length > 0) {
|
|
72805
|
+
writeTrace(
|
|
72806
|
+
`Found Storm configuration file "${configFile}" at "${workspacePath}"`,
|
|
72807
|
+
{
|
|
72808
|
+
logLevel: "all"
|
|
72809
|
+
}
|
|
72810
|
+
);
|
|
72811
|
+
writeTrace(config, { logLevel: "all" });
|
|
72812
|
+
}
|
|
72813
|
+
if (additionalFileNames && additionalFileNames.length > 0) {
|
|
72814
|
+
const results = await Promise.all(
|
|
72815
|
+
additionalFileNames.map(
|
|
72816
|
+
(fileName) => getConfigFileByName(fileName, workspacePath)
|
|
72817
|
+
)
|
|
72818
|
+
);
|
|
72819
|
+
for (const result of results) {
|
|
72820
|
+
if (result?.config && Object.keys(result.config).length > 0) {
|
|
72821
|
+
writeTrace(
|
|
72822
|
+
`Found additional configuration file "${result.configFile}" at "${workspacePath}"`,
|
|
72823
|
+
{
|
|
72824
|
+
logLevel: "all"
|
|
72825
|
+
}
|
|
72826
|
+
);
|
|
72827
|
+
writeTrace(result.config, { logLevel: "all" });
|
|
72828
|
+
config = (0, import_deepmerge.default)(config ?? {}, result.config ?? {});
|
|
72829
|
+
}
|
|
72830
|
+
}
|
|
72831
|
+
}
|
|
72832
|
+
if (!config) {
|
|
72833
|
+
return void 0;
|
|
72834
|
+
}
|
|
72835
|
+
config.configFile = configFile;
|
|
72836
|
+
config.runtimeVersion = "0.0.1";
|
|
72837
|
+
return config;
|
|
72838
|
+
};
|
|
72839
|
+
}
|
|
72840
|
+
});
|
|
72841
|
+
|
|
72842
|
+
// packages/config-tools/src/config-file/index.ts
|
|
72843
|
+
var init_config_file = __esm({
|
|
72844
|
+
"packages/config-tools/src/config-file/index.ts"() {
|
|
72845
|
+
init_get_config_file();
|
|
72846
|
+
}
|
|
72847
|
+
});
|
|
72848
|
+
|
|
72742
72849
|
// packages/config-tools/src/env/get-env.ts
|
|
72743
|
-
var getExtensionEnv, getConfigEnv;
|
|
72850
|
+
var getExtensionEnv, getConfigEnv, getThemeColorConfigEnv, getSingleThemeColorConfigEnv, getMultiThemeColorConfigEnv, getBaseThemeColorConfigEnv;
|
|
72744
72851
|
var init_get_env = __esm({
|
|
72745
72852
|
"packages/config-tools/src/env/get-env.ts"() {
|
|
72853
|
+
init_src();
|
|
72746
72854
|
init_utilities();
|
|
72747
72855
|
init_correct_paths();
|
|
72748
72856
|
getExtensionEnv = (extensionName) => {
|
|
@@ -72783,16 +72891,6 @@ var init_get_env = __esm({
|
|
|
72783
72891
|
ci: process.env[`${prefix}CI`] !== void 0 ? Boolean(
|
|
72784
72892
|
process.env[`${prefix}CI`] ?? process.env.CI ?? process.env.CONTINUOUS_INTEGRATION
|
|
72785
72893
|
) : void 0,
|
|
72786
|
-
colors: {
|
|
72787
|
-
primary: process.env[`${prefix}COLOR_PRIMARY`],
|
|
72788
|
-
dark: process.env[`${prefix}COLOR_DARK`],
|
|
72789
|
-
light: process.env[`${prefix}COLOR_LIGHT`],
|
|
72790
|
-
success: process.env[`${prefix}COLOR_SUCCESS`],
|
|
72791
|
-
info: process.env[`${prefix}COLOR_INFO`],
|
|
72792
|
-
warning: process.env[`${prefix}COLOR_WARNING`],
|
|
72793
|
-
error: process.env[`${prefix}COLOR_ERROR`],
|
|
72794
|
-
fatal: process.env[`${prefix}COLOR_FATAL`]
|
|
72795
|
-
},
|
|
72796
72894
|
repository: process.env[`${prefix}REPOSITORY`],
|
|
72797
72895
|
branch: process.env[`${prefix}BRANCH`],
|
|
72798
72896
|
preid: process.env[`${prefix}PRE_ID`],
|
|
@@ -72803,6 +72901,18 @@ var init_get_env = __esm({
|
|
|
72803
72901
|
Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
|
|
72804
72902
|
) : process.env[`${prefix}LOG_LEVEL`] : void 0
|
|
72805
72903
|
};
|
|
72904
|
+
const themeNames = Object.keys(process.env).filter(
|
|
72905
|
+
(envKey) => envKey.startsWith(`${prefix}COLOR_`) && COLOR_KEYS.every(
|
|
72906
|
+
(colorKey) => !envKey.startsWith(`${prefix}COLOR_LIGHT_${colorKey}`) && !envKey.startsWith(`${prefix}COLOR_DARK_${colorKey}`)
|
|
72907
|
+
)
|
|
72908
|
+
);
|
|
72909
|
+
config.colors = themeNames.length > 0 ? themeNames.reduce(
|
|
72910
|
+
(ret, themeName) => {
|
|
72911
|
+
ret[themeName] = getThemeColorConfigEnv(prefix, themeName);
|
|
72912
|
+
return ret;
|
|
72913
|
+
},
|
|
72914
|
+
{}
|
|
72915
|
+
) : getThemeColorConfigEnv(prefix);
|
|
72806
72916
|
const serializedConfig = process.env[`${prefix}CONFIG`];
|
|
72807
72917
|
if (serializedConfig) {
|
|
72808
72918
|
const parsed = JSON.parse(serializedConfig);
|
|
@@ -72815,11 +72925,53 @@ var init_get_env = __esm({
|
|
|
72815
72925
|
}
|
|
72816
72926
|
return config;
|
|
72817
72927
|
};
|
|
72928
|
+
getThemeColorConfigEnv = (prefix, theme) => {
|
|
72929
|
+
const themeName = `COLOR_${theme && theme !== "base" ? `${theme}_` : ""}`.toUpperCase();
|
|
72930
|
+
return process.env[`${prefix}${themeName}LIGHT_PRIMARY`] || process.env[`${prefix}${themeName}DARK_PRIMARY`] ? getMultiThemeColorConfigEnv(prefix + themeName) : getSingleThemeColorConfigEnv(prefix + themeName);
|
|
72931
|
+
};
|
|
72932
|
+
getSingleThemeColorConfigEnv = (prefix) => {
|
|
72933
|
+
return {
|
|
72934
|
+
dark: process.env[`${prefix}DARK`],
|
|
72935
|
+
light: process.env[`${prefix}LIGHT`],
|
|
72936
|
+
primary: process.env[`${prefix}PRIMARY`],
|
|
72937
|
+
secondary: process.env[`${prefix}SECONDARY`],
|
|
72938
|
+
tertiary: process.env[`${prefix}TERTIARY`],
|
|
72939
|
+
accent: process.env[`${prefix}ACCENT`],
|
|
72940
|
+
success: process.env[`${prefix}SUCCESS`],
|
|
72941
|
+
info: process.env[`${prefix}INFO`],
|
|
72942
|
+
warning: process.env[`${prefix}WARNING`],
|
|
72943
|
+
error: process.env[`${prefix}ERROR`],
|
|
72944
|
+
fatal: process.env[`${prefix}FATAL`]
|
|
72945
|
+
};
|
|
72946
|
+
};
|
|
72947
|
+
getMultiThemeColorConfigEnv = (prefix) => {
|
|
72948
|
+
return {
|
|
72949
|
+
light: getBaseThemeColorConfigEnv(
|
|
72950
|
+
`${prefix}_LIGHT_`
|
|
72951
|
+
),
|
|
72952
|
+
dark: getBaseThemeColorConfigEnv(`${prefix}_DARK_`)
|
|
72953
|
+
};
|
|
72954
|
+
};
|
|
72955
|
+
getBaseThemeColorConfigEnv = (prefix) => {
|
|
72956
|
+
return {
|
|
72957
|
+
foreground: process.env[`${prefix}FOREGROUND`],
|
|
72958
|
+
background: process.env[`${prefix}BACKGROUND`],
|
|
72959
|
+
primary: process.env[`${prefix}PRIMARY`],
|
|
72960
|
+
secondary: process.env[`${prefix}SECONDARY`],
|
|
72961
|
+
tertiary: process.env[`${prefix}TERTIARY`],
|
|
72962
|
+
accent: process.env[`${prefix}ACCENT`],
|
|
72963
|
+
success: process.env[`${prefix}SUCCESS`],
|
|
72964
|
+
info: process.env[`${prefix}INFO`],
|
|
72965
|
+
warning: process.env[`${prefix}WARNING`],
|
|
72966
|
+
error: process.env[`${prefix}ERROR`],
|
|
72967
|
+
fatal: process.env[`${prefix}FATAL`]
|
|
72968
|
+
};
|
|
72969
|
+
};
|
|
72818
72970
|
}
|
|
72819
72971
|
});
|
|
72820
72972
|
|
|
72821
72973
|
// packages/config-tools/src/env/set-env.ts
|
|
72822
|
-
var setExtensionEnv, setConfigEnv;
|
|
72974
|
+
var setExtensionEnv, setConfigEnv, setThemeColorConfigEnv, setSingleThemeColorConfigEnv, setMultiThemeColorConfigEnv, setBaseThemeColorConfigEnv;
|
|
72823
72975
|
var init_set_env = __esm({
|
|
72824
72976
|
"packages/config-tools/src/env/set-env.ts"() {
|
|
72825
72977
|
init_types2();
|
|
@@ -72935,29 +73087,15 @@ var init_set_env = __esm({
|
|
|
72935
73087
|
process.env.CI = String(config.ci);
|
|
72936
73088
|
process.env.CONTINUOUS_INTEGRATION = String(config.ci);
|
|
72937
73089
|
}
|
|
72938
|
-
if (config.colors.
|
|
72939
|
-
|
|
72940
|
-
|
|
72941
|
-
|
|
72942
|
-
|
|
72943
|
-
|
|
72944
|
-
|
|
72945
|
-
|
|
72946
|
-
|
|
72947
|
-
if (config.colors.success) {
|
|
72948
|
-
process.env[`${prefix}COLOR_SUCCESS`] = config.colors.success;
|
|
72949
|
-
}
|
|
72950
|
-
if (config.colors.info) {
|
|
72951
|
-
process.env[`${prefix}COLOR_INFO`] = config.colors.info;
|
|
72952
|
-
}
|
|
72953
|
-
if (config.colors.warning) {
|
|
72954
|
-
process.env[`${prefix}COLOR_WARNING`] = config.colors.warning;
|
|
72955
|
-
}
|
|
72956
|
-
if (config.colors.error) {
|
|
72957
|
-
process.env[`${prefix}COLOR_ERROR`] = config.colors.error;
|
|
72958
|
-
}
|
|
72959
|
-
if (config.colors.fatal) {
|
|
72960
|
-
process.env[`${prefix}COLOR_FATAL`] = config.colors.fatal;
|
|
73090
|
+
if (config.colors?.base?.light || config.colors?.base?.dark) {
|
|
73091
|
+
for (const key of Object.keys(config.colors)) {
|
|
73092
|
+
setThemeColorConfigEnv(`${prefix}COLOR_${key}_`, config.colors[key]);
|
|
73093
|
+
}
|
|
73094
|
+
} else {
|
|
73095
|
+
setThemeColorConfigEnv(
|
|
73096
|
+
`${prefix}COLOR_`,
|
|
73097
|
+
config.colors
|
|
73098
|
+
);
|
|
72961
73099
|
}
|
|
72962
73100
|
if (config.repository) {
|
|
72963
73101
|
process.env[`${prefix}REPOSITORY`] = config.repository;
|
|
@@ -72986,11 +73124,90 @@ var init_set_env = __esm({
|
|
|
72986
73124
|
config.extensions[key] && Object.keys(config.extensions[key]) && setExtensionEnv(key, config.extensions[key]);
|
|
72987
73125
|
}
|
|
72988
73126
|
};
|
|
73127
|
+
setThemeColorConfigEnv = (prefix, config) => {
|
|
73128
|
+
return config?.light?.primary || config?.dark?.primary ? setMultiThemeColorConfigEnv(prefix, config) : setSingleThemeColorConfigEnv(prefix, config);
|
|
73129
|
+
};
|
|
73130
|
+
setSingleThemeColorConfigEnv = (prefix, config) => {
|
|
73131
|
+
if (config.dark) {
|
|
73132
|
+
process.env[`${prefix}DARK`] = config.dark;
|
|
73133
|
+
}
|
|
73134
|
+
if (config.light) {
|
|
73135
|
+
process.env[`${prefix}LIGHT`] = config.light;
|
|
73136
|
+
}
|
|
73137
|
+
if (config.primary) {
|
|
73138
|
+
process.env[`${prefix}PRIMARY`] = config.primary;
|
|
73139
|
+
}
|
|
73140
|
+
if (config.secondary) {
|
|
73141
|
+
process.env[`${prefix}SECONDARY`] = config.secondary;
|
|
73142
|
+
}
|
|
73143
|
+
if (config.tertiary) {
|
|
73144
|
+
process.env[`${prefix}TERTIARY`] = config.tertiary;
|
|
73145
|
+
}
|
|
73146
|
+
if (config.accent) {
|
|
73147
|
+
process.env[`${prefix}ACCENT`] = config.accent;
|
|
73148
|
+
}
|
|
73149
|
+
if (config.success) {
|
|
73150
|
+
process.env[`${prefix}SUCCESS`] = config.success;
|
|
73151
|
+
}
|
|
73152
|
+
if (config.info) {
|
|
73153
|
+
process.env[`${prefix}INFO`] = config.info;
|
|
73154
|
+
}
|
|
73155
|
+
if (config.warning) {
|
|
73156
|
+
process.env[`${prefix}WARNING`] = config.warning;
|
|
73157
|
+
}
|
|
73158
|
+
if (config.error) {
|
|
73159
|
+
process.env[`${prefix}ERROR`] = config.error;
|
|
73160
|
+
}
|
|
73161
|
+
if (config.fatal) {
|
|
73162
|
+
process.env[`${prefix}FATAL`] = config.fatal;
|
|
73163
|
+
}
|
|
73164
|
+
};
|
|
73165
|
+
setMultiThemeColorConfigEnv = (prefix, config) => {
|
|
73166
|
+
return {
|
|
73167
|
+
light: setBaseThemeColorConfigEnv(`${prefix}_LIGHT_`, config.light),
|
|
73168
|
+
dark: setBaseThemeColorConfigEnv(`${prefix}_DARK_`, config.dark)
|
|
73169
|
+
};
|
|
73170
|
+
};
|
|
73171
|
+
setBaseThemeColorConfigEnv = (prefix, config) => {
|
|
73172
|
+
if (config.foreground) {
|
|
73173
|
+
process.env[`${prefix}FOREGROUND`] = config.foreground;
|
|
73174
|
+
}
|
|
73175
|
+
if (config.background) {
|
|
73176
|
+
process.env[`${prefix}BACKGROUND`] = config.background;
|
|
73177
|
+
}
|
|
73178
|
+
if (config.primary) {
|
|
73179
|
+
process.env[`${prefix}PRIMARY`] = config.primary;
|
|
73180
|
+
}
|
|
73181
|
+
if (config.secondary) {
|
|
73182
|
+
process.env[`${prefix}SECONDARY`] = config.secondary;
|
|
73183
|
+
}
|
|
73184
|
+
if (config.tertiary) {
|
|
73185
|
+
process.env[`${prefix}TERTIARY`] = config.tertiary;
|
|
73186
|
+
}
|
|
73187
|
+
if (config.accent) {
|
|
73188
|
+
process.env[`${prefix}ACCENT`] = config.accent;
|
|
73189
|
+
}
|
|
73190
|
+
if (config.success) {
|
|
73191
|
+
process.env[`${prefix}SUCCESS`] = config.success;
|
|
73192
|
+
}
|
|
73193
|
+
if (config.info) {
|
|
73194
|
+
process.env[`${prefix}INFO`] = config.info;
|
|
73195
|
+
}
|
|
73196
|
+
if (config.warning) {
|
|
73197
|
+
process.env[`${prefix}WARNING`] = config.warning;
|
|
73198
|
+
}
|
|
73199
|
+
if (config.error) {
|
|
73200
|
+
process.env[`${prefix}ERROR`] = config.error;
|
|
73201
|
+
}
|
|
73202
|
+
if (config.fatal) {
|
|
73203
|
+
process.env[`${prefix}FATAL`] = config.fatal;
|
|
73204
|
+
}
|
|
73205
|
+
};
|
|
72989
73206
|
}
|
|
72990
73207
|
});
|
|
72991
73208
|
|
|
72992
73209
|
// packages/config-tools/src/create-storm-config.ts
|
|
72993
|
-
var _extension_cache, _static_cache, createConfig, createStormConfig, createConfigExtension, loadStormConfig;
|
|
73210
|
+
var import_deepmerge2, _extension_cache, _static_cache, createConfig, createStormConfig, createConfigExtension, loadStormConfig;
|
|
72994
73211
|
var init_create_storm_config = __esm({
|
|
72995
73212
|
"packages/config-tools/src/create-storm-config.ts"() {
|
|
72996
73213
|
init_get_config_file();
|
|
@@ -72999,6 +73216,7 @@ var init_create_storm_config = __esm({
|
|
|
72999
73216
|
init_schema();
|
|
73000
73217
|
init_utilities();
|
|
73001
73218
|
init_get_default_config();
|
|
73219
|
+
import_deepmerge2 = __toESM(require_cjs());
|
|
73002
73220
|
_extension_cache = /* @__PURE__ */ new WeakMap();
|
|
73003
73221
|
_static_cache = void 0;
|
|
73004
73222
|
createConfig = (workspaceRoot) => {
|
|
@@ -73047,7 +73265,9 @@ var init_create_storm_config = __esm({
|
|
|
73047
73265
|
if (!_workspaceRoot) {
|
|
73048
73266
|
_workspaceRoot = findWorkspaceRoot();
|
|
73049
73267
|
}
|
|
73050
|
-
|
|
73268
|
+
let configFile = await getConfigFile(
|
|
73269
|
+
_workspaceRoot
|
|
73270
|
+
);
|
|
73051
73271
|
if (!configFile) {
|
|
73052
73272
|
writeWarning(
|
|
73053
73273
|
"No Storm config file found in the current workspace. Please ensure this is the expected behavior - you can add a `storm.json` file to the root of your workspace if it is not.\n",
|
|
@@ -73056,10 +73276,7 @@ var init_create_storm_config = __esm({
|
|
|
73056
73276
|
}
|
|
73057
73277
|
config = StormConfigSchema.parse(
|
|
73058
73278
|
await getDefaultConfig(
|
|
73059
|
-
{
|
|
73060
|
-
...getConfigEnv(),
|
|
73061
|
-
...configFile
|
|
73062
|
-
},
|
|
73279
|
+
(0, import_deepmerge2.default)(getConfigEnv(), configFile, {}),
|
|
73063
73280
|
_workspaceRoot
|
|
73064
73281
|
)
|
|
73065
73282
|
);
|
|
@@ -73097,6 +73314,7 @@ __export(src_exports, {
|
|
|
73097
73314
|
findFileName: () => findFileName,
|
|
73098
73315
|
findWorkspaceRoot: () => findWorkspaceRoot,
|
|
73099
73316
|
findWorkspaceRootSafe: () => findWorkspaceRootSafe,
|
|
73317
|
+
formatLogMessage: () => formatLogMessage,
|
|
73100
73318
|
getChalk: () => getChalk,
|
|
73101
73319
|
getConfigEnv: () => getConfigEnv,
|
|
73102
73320
|
getConfigFile: () => getConfigFile,
|