@storm-software/config-tools 1.39.3 → 1.40.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/README.md +10 -6
- package/index.cjs +240 -76
- package/index.js +240 -76
- package/meta.cjs.json +1 -1
- package/meta.esm.json +1 -1
- package/package.json +1 -1
- package/utilities/find-workspace-root.cjs +11 -4
- package/utilities/find-workspace-root.js +11 -4
- package/utilities/logger.cjs +3918 -41
- package/utilities/logger.js +3918 -41
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
## 1.40.1 (2024-04-22)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### 🩹 Fixes
|
|
5
|
+
|
|
6
|
+
- **config:** Added updates to repository logging ([2b871dc3](https://github.com/storm-software/storm-ops/commit/2b871dc3))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### ❤️ Thank You
|
|
10
|
+
|
|
11
|
+
- Patrick Sullivan
|
|
12
|
+
|
|
13
|
+
## 1.40.0 (2024-04-22)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### 🚀 Features
|
|
17
|
+
|
|
18
|
+
- **cloudflare-tools:** Added the `worker`, `init`, and `serve` tools ([b4b92c2c](https://github.com/storm-software/storm-ops/commit/b4b92c2c))
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### ❤️ Thank You
|
|
22
|
+
|
|
23
|
+
- Patrick Sullivan
|
|
24
|
+
|
|
1
25
|
## 1.39.3 (2024-04-15)
|
|
2
26
|
|
|
3
27
|
|
package/README.md
CHANGED
|
@@ -8,7 +8,10 @@
|
|
|
8
8
|
|
|
9
9
|
<div align="center">
|
|
10
10
|
<b>
|
|
11
|
-
<a href="https://stormsoftware.com" target="_blank">Website</a>
|
|
11
|
+
<a href="https://stormsoftware.com" target="_blank">Website</a> •
|
|
12
|
+
<a href="https://github.com/storm-software/storm-ops" target="_blank">GitHub</a> •
|
|
13
|
+
<a href="https://discord.gg/MQ6YVzakM5">Discord</a> • <a href="https://stormstack.github.io/stormstack/" target="_blank">Docs</a> • <a href="https://stormsoftware.com/contact" target="_blank">Contact</a> •
|
|
14
|
+
<a href="https://github.com/storm-software/storm-ops/issues/new?assignees=&labels=bug&template=bug-report.yml&title=Bug Report%3A+">Report a Bug</a>
|
|
12
15
|
</b>
|
|
13
16
|
</div>
|
|
14
17
|
|
|
@@ -16,11 +19,9 @@
|
|
|
16
19
|
This package is part of the <b>⚡Storm-Ops</b> monorepo. The Storm-Ops packages include CLI utility applications, tools, and various libraries used to create modern, scalable web applications.
|
|
17
20
|
<br />
|
|
18
21
|
|
|
19
|
-
<h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3
|
|
20
|
-
|
|
21
|
-
<br />
|
|
22
|
+
<h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
|
|
22
23
|
|
|
23
|
-
[](https://prettier.io/)
|
|
24
25
|
[](http://nx.dev/) [](https://nextjs.org/) [](http://commitizen.github.io/cz-cli/)  [](https://docusaurus.io/) 
|
|
25
26
|
|
|
26
27
|
> [!IMPORTANT]
|
|
@@ -28,6 +29,7 @@ This package is part of the <b>⚡Storm-Ops</b> monorepo. The Storm-Ops packages
|
|
|
28
29
|
|
|
29
30
|
<br />
|
|
30
31
|
|
|
32
|
+
|
|
31
33
|
<!-- markdownlint-restore -->
|
|
32
34
|
<!-- prettier-ignore-end -->
|
|
33
35
|
|
|
@@ -219,7 +221,9 @@ This project follows the [all-contributors](https://github.com/all-contributors/
|
|
|
219
221
|
<br />
|
|
220
222
|
|
|
221
223
|
<div align="center">
|
|
222
|
-
<
|
|
224
|
+
<b>
|
|
225
|
+
<a href="https://stormsoftware.com" target="_blank">Website</a> • <a href="https://stormsoftware.com/contact" target="_blank">Contact</a> • <a href="https://discord.gg/MQ6YVzakM5">Discord</a> • <a href="https://linkedin.com/in/pat-sullivan-dev" target="_blank">LinkedIn</a> • <a href="https://medium.com/@pat.joseph.sullivan" target="_blank">Medium</a> • <a href="https://github.com/storm-software" target="_blank">GitHub</a> • <a href="https://keybase.io/sullivanp" target="_blank">OpenPGP Key</a>
|
|
226
|
+
</b>
|
|
223
227
|
</div>
|
|
224
228
|
|
|
225
229
|
<div align="center">
|
package/index.cjs
CHANGED
|
@@ -60266,8 +60266,11 @@ function findFolderUp(startPath, endFileNames) {
|
|
|
60266
60266
|
// packages/config-tools/src/utilities/find-workspace-root.ts
|
|
60267
60267
|
var rootFiles = [
|
|
60268
60268
|
"storm.json",
|
|
60269
|
-
"storm.
|
|
60270
|
-
"storm.
|
|
60269
|
+
"storm.json",
|
|
60270
|
+
"storm.yaml",
|
|
60271
|
+
"storm.yml",
|
|
60272
|
+
"storm.js",
|
|
60273
|
+
"storm.ts",
|
|
60271
60274
|
".storm.json",
|
|
60272
60275
|
".storm.yaml",
|
|
60273
60276
|
".storm.yml",
|
|
@@ -60298,9 +60301,13 @@ var rootFiles = [
|
|
|
60298
60301
|
];
|
|
60299
60302
|
function findWorkspaceRootSafe(pathInsideMonorepo) {
|
|
60300
60303
|
if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) {
|
|
60301
|
-
return correctPaths(
|
|
60304
|
+
return correctPaths(
|
|
60305
|
+
process.env.STORM_WORKSPACE_ROOT ?? process.env.NX_WORKSPACE_ROOT_PATH
|
|
60306
|
+
);
|
|
60302
60307
|
}
|
|
60303
|
-
return correctPaths(
|
|
60308
|
+
return correctPaths(
|
|
60309
|
+
findFolderUp(pathInsideMonorepo ?? process.cwd(), rootFiles)
|
|
60310
|
+
);
|
|
60304
60311
|
}
|
|
60305
60312
|
function findWorkspaceRoot(pathInsideMonorepo) {
|
|
60306
60313
|
const result = findWorkspaceRootSafe(pathInsideMonorepo);
|
|
@@ -68393,10 +68400,6 @@ var getConfigFile = async (filePath, additionalFileNames = []) => {
|
|
|
68393
68400
|
return config;
|
|
68394
68401
|
};
|
|
68395
68402
|
|
|
68396
|
-
// packages/config-tools/src/utilities/get-default-config.ts
|
|
68397
|
-
var import_node_fs10 = require("node:fs");
|
|
68398
|
-
var import_node_path6 = require("node:path");
|
|
68399
|
-
|
|
68400
68403
|
// node_modules/.pnpm/zod@3.22.4/node_modules/zod/lib/index.mjs
|
|
68401
68404
|
var util;
|
|
68402
68405
|
(function(util2) {
|
|
@@ -72131,19 +72134,67 @@ var z2 = /* @__PURE__ */ Object.freeze({
|
|
|
72131
72134
|
});
|
|
72132
72135
|
|
|
72133
72136
|
// packages/config/src/schema.ts
|
|
72134
|
-
var
|
|
72135
|
-
|
|
72136
|
-
|
|
72137
|
-
|
|
72138
|
-
|
|
72139
|
-
|
|
72140
|
-
|
|
72141
|
-
|
|
72142
|
-
|
|
72143
|
-
|
|
72144
|
-
|
|
72145
|
-
|
|
72146
|
-
|
|
72137
|
+
var DarkColorSchema = z2.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#1d232a").describe("The dark background color of the workspace");
|
|
72138
|
+
var LightColorSchema = z2.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#f4f4f5").describe("The light background color of the workspace");
|
|
72139
|
+
var PrimaryColorSchema = z2.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#1fb2a6").describe("The primary color of the workspace");
|
|
72140
|
+
var SecondaryColorSchema = z2.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#0ea5e9").describe("The secondary color of the workspace");
|
|
72141
|
+
var TertiaryColorSchema = z2.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#ec5990").describe("The tertiary color of the workspace");
|
|
72142
|
+
var AccentColorSchema = z2.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#6366f1").describe("The accent color of the workspace");
|
|
72143
|
+
var SuccessColorSchema = z2.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#087f5b").describe("The success color of the workspace");
|
|
72144
|
+
var InfoColorSchema = z2.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#0ea5e9").describe("The informational color of the workspace");
|
|
72145
|
+
var WarningColorSchema = z2.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#fcc419").describe("The warning color of the workspace");
|
|
72146
|
+
var ErrorColorSchema = z2.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#990000").describe("The error color of the workspace");
|
|
72147
|
+
var FatalColorSchema = z2.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#7d1a1a").describe("The fatal color of the workspace");
|
|
72148
|
+
var DarkThemeColorConfigSchema = z2.object({
|
|
72149
|
+
foreground: LightColorSchema,
|
|
72150
|
+
background: DarkColorSchema,
|
|
72151
|
+
primary: PrimaryColorSchema,
|
|
72152
|
+
secondary: SecondaryColorSchema,
|
|
72153
|
+
tertiary: TertiaryColorSchema,
|
|
72154
|
+
accent: AccentColorSchema,
|
|
72155
|
+
success: SuccessColorSchema,
|
|
72156
|
+
info: InfoColorSchema,
|
|
72157
|
+
warning: WarningColorSchema,
|
|
72158
|
+
error: ErrorColorSchema,
|
|
72159
|
+
fatal: FatalColorSchema
|
|
72160
|
+
});
|
|
72161
|
+
var LightThemeColorConfigSchema = z2.object({
|
|
72162
|
+
foreground: DarkColorSchema,
|
|
72163
|
+
background: LightColorSchema,
|
|
72164
|
+
primary: PrimaryColorSchema,
|
|
72165
|
+
secondary: SecondaryColorSchema,
|
|
72166
|
+
tertiary: TertiaryColorSchema,
|
|
72167
|
+
accent: AccentColorSchema,
|
|
72168
|
+
success: SuccessColorSchema,
|
|
72169
|
+
info: InfoColorSchema,
|
|
72170
|
+
warning: WarningColorSchema,
|
|
72171
|
+
error: ErrorColorSchema,
|
|
72172
|
+
fatal: FatalColorSchema
|
|
72173
|
+
});
|
|
72174
|
+
var MultiThemeColorConfigSchema = z2.object({
|
|
72175
|
+
dark: DarkThemeColorConfigSchema,
|
|
72176
|
+
light: LightThemeColorConfigSchema
|
|
72177
|
+
});
|
|
72178
|
+
var SingleThemeColorConfigSchema = z2.object({
|
|
72179
|
+
dark: DarkColorSchema,
|
|
72180
|
+
light: LightColorSchema,
|
|
72181
|
+
primary: PrimaryColorSchema,
|
|
72182
|
+
secondary: SecondaryColorSchema,
|
|
72183
|
+
tertiary: TertiaryColorSchema,
|
|
72184
|
+
accent: AccentColorSchema,
|
|
72185
|
+
success: SuccessColorSchema,
|
|
72186
|
+
info: InfoColorSchema,
|
|
72187
|
+
warning: WarningColorSchema,
|
|
72188
|
+
error: ErrorColorSchema,
|
|
72189
|
+
fatal: FatalColorSchema
|
|
72190
|
+
});
|
|
72191
|
+
var ColorConfigSchema = SingleThemeColorConfigSchema.or(
|
|
72192
|
+
MultiThemeColorConfigSchema
|
|
72193
|
+
).describe("Colors used for various workspace elements");
|
|
72194
|
+
var ColorConfigMapSchema = z2.union([
|
|
72195
|
+
z2.object({ "base": ColorConfigSchema }),
|
|
72196
|
+
z2.record(z2.string(), ColorConfigSchema)
|
|
72197
|
+
]);
|
|
72147
72198
|
var StormConfigSchema = z2.object({
|
|
72148
72199
|
extends: z2.string().trim().optional().describe(
|
|
72149
72200
|
"The path to a base JSON file to use as a configuration preset file"
|
|
@@ -72194,7 +72245,7 @@ var StormConfigSchema = z2.object({
|
|
|
72194
72245
|
configFile: z2.string().trim().nullable().default(null).describe(
|
|
72195
72246
|
"The filepath of the Storm config. When this field is null, no config file was found in the current workspace."
|
|
72196
72247
|
),
|
|
72197
|
-
colors: ColorConfigSchema.describe(
|
|
72248
|
+
colors: ColorConfigSchema.or(ColorConfigMapSchema).describe(
|
|
72198
72249
|
"Storm theme config values used for styling various package elements"
|
|
72199
72250
|
),
|
|
72200
72251
|
extensions: z2.record(z2.any()).optional().default({}).describe("Configuration of each used extension")
|
|
@@ -72202,7 +72253,24 @@ var StormConfigSchema = z2.object({
|
|
|
72202
72253
|
"Storm Workspace config values used during various dev-ops processes. This type is a combination of the StormPackageConfig and StormProject types. It represents the config of the entire monorepo."
|
|
72203
72254
|
);
|
|
72204
72255
|
|
|
72256
|
+
// packages/config/src/types.ts
|
|
72257
|
+
var COLOR_KEYS = [
|
|
72258
|
+
"dark",
|
|
72259
|
+
"light",
|
|
72260
|
+
"primary",
|
|
72261
|
+
"secondary",
|
|
72262
|
+
"tertiary",
|
|
72263
|
+
"accent",
|
|
72264
|
+
"success",
|
|
72265
|
+
"info",
|
|
72266
|
+
"warning",
|
|
72267
|
+
"error",
|
|
72268
|
+
"fatal"
|
|
72269
|
+
];
|
|
72270
|
+
|
|
72205
72271
|
// packages/config-tools/src/utilities/get-default-config.ts
|
|
72272
|
+
var import_node_fs10 = require("node:fs");
|
|
72273
|
+
var import_node_path6 = require("node:path");
|
|
72206
72274
|
var DEFAULT_COLOR_CONFIG = {
|
|
72207
72275
|
dark: "#1d232a",
|
|
72208
72276
|
light: "#f4f4f5",
|
|
@@ -72385,6 +72453,7 @@ var getChalk = () => {
|
|
|
72385
72453
|
// packages/config-tools/src/utilities/logger.ts
|
|
72386
72454
|
var getLogFn = (logLevel = LogLevel.INFO, config = {}) => {
|
|
72387
72455
|
let _chalk = getChalk();
|
|
72456
|
+
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;
|
|
72388
72457
|
const configLogLevel = config.logLevel ?? process.env?.STORM_LOG_LEVEL ?? LogLevelLabel.INFO;
|
|
72389
72458
|
if (typeof logLevel === "number" && (logLevel >= getLogLevel(configLogLevel) || logLevel <= LogLevel.SILENT) || typeof logLevel === "string" && getLogLevel(logLevel) >= getLogLevel(configLogLevel)) {
|
|
72390
72459
|
return (_6) => {
|
|
@@ -72394,9 +72463,7 @@ var getLogFn = (logLevel = LogLevel.INFO, config = {}) => {
|
|
|
72394
72463
|
return (message) => {
|
|
72395
72464
|
console.error(
|
|
72396
72465
|
`
|
|
72397
|
-
${_chalk.bold.hex(
|
|
72398
|
-
config?.colors?.error ? config.colors.error : "#1fb2a6"
|
|
72399
|
-
)(message)}
|
|
72466
|
+
${_chalk.bold.hex(colors.error)(">")} ${_chalk.bold.bgHex(colors.fatal).whiteBright(" \u{1F480} Fatal ")} ${_chalk.hex(colors.error)(message)}
|
|
72400
72467
|
|
|
72401
72468
|
`
|
|
72402
72469
|
);
|
|
@@ -72406,9 +72473,7 @@ ${_chalk.bold.hex(config?.colors?.error ? config.colors.error : "#7d1a1a")(">")}
|
|
|
72406
72473
|
return (message) => {
|
|
72407
72474
|
console.error(
|
|
72408
72475
|
`
|
|
72409
|
-
${_chalk.bold.hex(
|
|
72410
|
-
config?.colors?.error ? config.colors.error : "#7d1a1a"
|
|
72411
|
-
)(message)}
|
|
72476
|
+
${_chalk.bold.hex(colors.error)(">")} ${_chalk.bold.bgHex(colors.error).whiteBright(" \u2718 Error ")} ${_chalk.hex(colors.error)(message)}
|
|
72412
72477
|
`
|
|
72413
72478
|
);
|
|
72414
72479
|
};
|
|
@@ -72417,9 +72482,7 @@ ${_chalk.bold.hex(config?.colors?.error ? config.colors.error : "#7d1a1a")(">")}
|
|
|
72417
72482
|
return (message) => {
|
|
72418
72483
|
console.warn(
|
|
72419
72484
|
`
|
|
72420
|
-
${_chalk.bold.hex(
|
|
72421
|
-
config?.colors?.warning ? config.colors.warning : "#fcc419"
|
|
72422
|
-
)(message)}
|
|
72485
|
+
${_chalk.bold.hex(colors.warning)("> ")} ${_chalk.bold.bgHex(colors.warning).whiteBright(" \u26A0 Warn ")} ${_chalk.hex(colors.warning)(message)}
|
|
72423
72486
|
`
|
|
72424
72487
|
);
|
|
72425
72488
|
};
|
|
@@ -72428,9 +72491,7 @@ ${_chalk.bold.hex(config?.colors?.warning ? config.colors.warning : "#fcc419")("
|
|
|
72428
72491
|
return (message) => {
|
|
72429
72492
|
console.info(
|
|
72430
72493
|
`
|
|
72431
|
-
${_chalk.bold.hex(
|
|
72432
|
-
config?.colors?.success ? config.colors.success : "#087f5b"
|
|
72433
|
-
)(message)}
|
|
72494
|
+
${_chalk.bold.hex(colors.success)(">")} ${_chalk.bold.bgHex(colors.success).whiteBright(" \u2713 Success ")} ${_chalk.hex(colors.success)(message)}
|
|
72434
72495
|
`
|
|
72435
72496
|
);
|
|
72436
72497
|
};
|
|
@@ -72439,9 +72500,7 @@ ${_chalk.bold.hex(config?.colors?.success ? config.colors.success : "#087f5b")("
|
|
|
72439
72500
|
return (message) => {
|
|
72440
72501
|
console.info(
|
|
72441
72502
|
`
|
|
72442
|
-
${_chalk.bold.hex(
|
|
72443
|
-
config?.colors?.info ? config.colors.info : "#0ea5e9"
|
|
72444
|
-
)(message)}
|
|
72503
|
+
${_chalk.bold.hex(colors.info)(">")} ${_chalk.bold.bgHex(colors.info).whiteBright(" \u2139 Info ")} ${_chalk.hex(colors.info)(message)}
|
|
72445
72504
|
`
|
|
72446
72505
|
);
|
|
72447
72506
|
};
|
|
@@ -72450,9 +72509,7 @@ ${_chalk.bold.hex(config?.colors?.info ? config.colors.info : "#0ea5e9")(">")} $
|
|
|
72450
72509
|
return (message) => {
|
|
72451
72510
|
console.debug(
|
|
72452
72511
|
`
|
|
72453
|
-
${_chalk.bold.hex(
|
|
72454
|
-
config?.colors?.primary ? config.colors.primary : "#1fb2a6"
|
|
72455
|
-
)(message)}
|
|
72512
|
+
${_chalk.bold.hex(colors.primary)(">")} ${_chalk.bold.bgHex(colors.primary).whiteBright(" \u{1F6E0} Debug ")} ${_chalk.hex(colors.primary)(message)}
|
|
72456
72513
|
`
|
|
72457
72514
|
);
|
|
72458
72515
|
};
|
|
@@ -72460,9 +72517,7 @@ ${_chalk.bold.hex(config?.colors?.primary ? config.colors.primary : "#1fb2a6")("
|
|
|
72460
72517
|
return (message) => {
|
|
72461
72518
|
console.log(
|
|
72462
72519
|
`
|
|
72463
|
-
${_chalk.bold.hex(
|
|
72464
|
-
config?.colors?.primary ? config.colors.primary : "#1fb2a6"
|
|
72465
|
-
)(message)}
|
|
72520
|
+
${_chalk.bold.hex(colors.primary)(">")} ${_chalk.bold.bgHex(colors.primary).whiteBright(" \u2709 System ")} ${_chalk.hex(colors.primary)(message)}
|
|
72466
72521
|
`
|
|
72467
72522
|
);
|
|
72468
72523
|
};
|
|
@@ -72664,16 +72719,6 @@ var getConfigEnv = () => {
|
|
|
72664
72719
|
ci: process.env[`${prefix}CI`] !== void 0 ? Boolean(
|
|
72665
72720
|
process.env[`${prefix}CI`] ?? process.env.CI ?? process.env.CONTINUOUS_INTEGRATION
|
|
72666
72721
|
) : void 0,
|
|
72667
|
-
colors: {
|
|
72668
|
-
primary: process.env[`${prefix}COLOR_PRIMARY`],
|
|
72669
|
-
dark: process.env[`${prefix}COLOR_DARK`],
|
|
72670
|
-
light: process.env[`${prefix}COLOR_LIGHT`],
|
|
72671
|
-
success: process.env[`${prefix}COLOR_SUCCESS`],
|
|
72672
|
-
info: process.env[`${prefix}COLOR_INFO`],
|
|
72673
|
-
warning: process.env[`${prefix}COLOR_WARNING`],
|
|
72674
|
-
error: process.env[`${prefix}COLOR_ERROR`],
|
|
72675
|
-
fatal: process.env[`${prefix}COLOR_FATAL`]
|
|
72676
|
-
},
|
|
72677
72722
|
repository: process.env[`${prefix}REPOSITORY`],
|
|
72678
72723
|
branch: process.env[`${prefix}BRANCH`],
|
|
72679
72724
|
preid: process.env[`${prefix}PRE_ID`],
|
|
@@ -72684,6 +72729,18 @@ var getConfigEnv = () => {
|
|
|
72684
72729
|
Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
|
|
72685
72730
|
) : process.env[`${prefix}LOG_LEVEL`] : void 0
|
|
72686
72731
|
};
|
|
72732
|
+
const themeNames = Object.keys(process.env).filter(
|
|
72733
|
+
(envKey) => envKey.startsWith(`${prefix}COLOR_`) && COLOR_KEYS.every(
|
|
72734
|
+
(colorKey) => !envKey.startsWith(`${prefix}COLOR_LIGHT_${colorKey}`) && !envKey.startsWith(`${prefix}COLOR_DARK_${colorKey}`)
|
|
72735
|
+
)
|
|
72736
|
+
);
|
|
72737
|
+
config.colors = themeNames.length > 0 ? themeNames.reduce(
|
|
72738
|
+
(ret, themeName) => {
|
|
72739
|
+
ret[themeName] = getThemeColorConfigEnv(prefix, themeName);
|
|
72740
|
+
return ret;
|
|
72741
|
+
},
|
|
72742
|
+
{}
|
|
72743
|
+
) : getThemeColorConfigEnv(prefix);
|
|
72687
72744
|
const serializedConfig = process.env[`${prefix}CONFIG`];
|
|
72688
72745
|
if (serializedConfig) {
|
|
72689
72746
|
const parsed = JSON.parse(serializedConfig);
|
|
@@ -72696,6 +72753,48 @@ var getConfigEnv = () => {
|
|
|
72696
72753
|
}
|
|
72697
72754
|
return config;
|
|
72698
72755
|
};
|
|
72756
|
+
var getThemeColorConfigEnv = (prefix, theme) => {
|
|
72757
|
+
const themeName = `COLOR_${theme && theme !== "base" ? `${theme}_` : ""}`.toUpperCase();
|
|
72758
|
+
return process.env[`${prefix}${themeName}LIGHT_PRIMARY`] || process.env[`${prefix}${themeName}DARK_PRIMARY`] ? getMultiThemeColorConfigEnv(prefix + themeName) : getSingleThemeColorConfigEnv(prefix + themeName);
|
|
72759
|
+
};
|
|
72760
|
+
var getSingleThemeColorConfigEnv = (prefix) => {
|
|
72761
|
+
return {
|
|
72762
|
+
dark: process.env[`${prefix}DARK`],
|
|
72763
|
+
light: process.env[`${prefix}LIGHT`],
|
|
72764
|
+
primary: process.env[`${prefix}PRIMARY`],
|
|
72765
|
+
secondary: process.env[`${prefix}SECONDARY`],
|
|
72766
|
+
tertiary: process.env[`${prefix}TERTIARY`],
|
|
72767
|
+
accent: process.env[`${prefix}ACCENT`],
|
|
72768
|
+
success: process.env[`${prefix}SUCCESS`],
|
|
72769
|
+
info: process.env[`${prefix}INFO`],
|
|
72770
|
+
warning: process.env[`${prefix}WARNING`],
|
|
72771
|
+
error: process.env[`${prefix}ERROR`],
|
|
72772
|
+
fatal: process.env[`${prefix}FATAL`]
|
|
72773
|
+
};
|
|
72774
|
+
};
|
|
72775
|
+
var getMultiThemeColorConfigEnv = (prefix) => {
|
|
72776
|
+
return {
|
|
72777
|
+
light: getBaseThemeColorConfigEnv(
|
|
72778
|
+
`${prefix}_LIGHT_`
|
|
72779
|
+
),
|
|
72780
|
+
dark: getBaseThemeColorConfigEnv(`${prefix}_DARK_`)
|
|
72781
|
+
};
|
|
72782
|
+
};
|
|
72783
|
+
var getBaseThemeColorConfigEnv = (prefix) => {
|
|
72784
|
+
return {
|
|
72785
|
+
foreground: process.env[`${prefix}FOREGROUND`],
|
|
72786
|
+
background: process.env[`${prefix}BACKGROUND`],
|
|
72787
|
+
primary: process.env[`${prefix}PRIMARY`],
|
|
72788
|
+
secondary: process.env[`${prefix}SECONDARY`],
|
|
72789
|
+
tertiary: process.env[`${prefix}TERTIARY`],
|
|
72790
|
+
accent: process.env[`${prefix}ACCENT`],
|
|
72791
|
+
success: process.env[`${prefix}SUCCESS`],
|
|
72792
|
+
info: process.env[`${prefix}INFO`],
|
|
72793
|
+
warning: process.env[`${prefix}WARNING`],
|
|
72794
|
+
error: process.env[`${prefix}ERROR`],
|
|
72795
|
+
fatal: process.env[`${prefix}FATAL`]
|
|
72796
|
+
};
|
|
72797
|
+
};
|
|
72699
72798
|
|
|
72700
72799
|
// packages/config-tools/src/env/set-env.ts
|
|
72701
72800
|
var setExtensionEnv = (extensionName, extension) => {
|
|
@@ -72808,29 +72907,15 @@ var setConfigEnv = (config) => {
|
|
|
72808
72907
|
process.env.CI = String(config.ci);
|
|
72809
72908
|
process.env.CONTINUOUS_INTEGRATION = String(config.ci);
|
|
72810
72909
|
}
|
|
72811
|
-
if (config.colors.
|
|
72812
|
-
|
|
72813
|
-
|
|
72814
|
-
|
|
72815
|
-
|
|
72816
|
-
|
|
72817
|
-
|
|
72818
|
-
|
|
72819
|
-
|
|
72820
|
-
if (config.colors.success) {
|
|
72821
|
-
process.env[`${prefix}COLOR_SUCCESS`] = config.colors.success;
|
|
72822
|
-
}
|
|
72823
|
-
if (config.colors.info) {
|
|
72824
|
-
process.env[`${prefix}COLOR_INFO`] = config.colors.info;
|
|
72825
|
-
}
|
|
72826
|
-
if (config.colors.warning) {
|
|
72827
|
-
process.env[`${prefix}COLOR_WARNING`] = config.colors.warning;
|
|
72828
|
-
}
|
|
72829
|
-
if (config.colors.error) {
|
|
72830
|
-
process.env[`${prefix}COLOR_ERROR`] = config.colors.error;
|
|
72831
|
-
}
|
|
72832
|
-
if (config.colors.fatal) {
|
|
72833
|
-
process.env[`${prefix}COLOR_FATAL`] = config.colors.fatal;
|
|
72910
|
+
if (config.colors?.base?.light || config.colors?.base?.dark) {
|
|
72911
|
+
for (const key of Object.keys(config.colors)) {
|
|
72912
|
+
setThemeColorConfigEnv(`${prefix}COLOR_${key}_`, config.colors[key]);
|
|
72913
|
+
}
|
|
72914
|
+
} else {
|
|
72915
|
+
setThemeColorConfigEnv(
|
|
72916
|
+
`${prefix}COLOR_`,
|
|
72917
|
+
config.colors
|
|
72918
|
+
);
|
|
72834
72919
|
}
|
|
72835
72920
|
if (config.repository) {
|
|
72836
72921
|
process.env[`${prefix}REPOSITORY`] = config.repository;
|
|
@@ -72859,6 +72944,85 @@ var setConfigEnv = (config) => {
|
|
|
72859
72944
|
config.extensions[key] && Object.keys(config.extensions[key]) && setExtensionEnv(key, config.extensions[key]);
|
|
72860
72945
|
}
|
|
72861
72946
|
};
|
|
72947
|
+
var setThemeColorConfigEnv = (prefix, config) => {
|
|
72948
|
+
return config?.light?.primary || config?.dark?.primary ? setMultiThemeColorConfigEnv(prefix, config) : setSingleThemeColorConfigEnv(prefix, config);
|
|
72949
|
+
};
|
|
72950
|
+
var setSingleThemeColorConfigEnv = (prefix, config) => {
|
|
72951
|
+
if (config.dark) {
|
|
72952
|
+
process.env[`${prefix}DARK`] = config.dark;
|
|
72953
|
+
}
|
|
72954
|
+
if (config.light) {
|
|
72955
|
+
process.env[`${prefix}LIGHT`] = config.light;
|
|
72956
|
+
}
|
|
72957
|
+
if (config.primary) {
|
|
72958
|
+
process.env[`${prefix}PRIMARY`] = config.primary;
|
|
72959
|
+
}
|
|
72960
|
+
if (config.secondary) {
|
|
72961
|
+
process.env[`${prefix}SECONDARY`] = config.secondary;
|
|
72962
|
+
}
|
|
72963
|
+
if (config.tertiary) {
|
|
72964
|
+
process.env[`${prefix}TERTIARY`] = config.tertiary;
|
|
72965
|
+
}
|
|
72966
|
+
if (config.accent) {
|
|
72967
|
+
process.env[`${prefix}ACCENT`] = config.accent;
|
|
72968
|
+
}
|
|
72969
|
+
if (config.success) {
|
|
72970
|
+
process.env[`${prefix}SUCCESS`] = config.success;
|
|
72971
|
+
}
|
|
72972
|
+
if (config.info) {
|
|
72973
|
+
process.env[`${prefix}INFO`] = config.info;
|
|
72974
|
+
}
|
|
72975
|
+
if (config.warning) {
|
|
72976
|
+
process.env[`${prefix}WARNING`] = config.warning;
|
|
72977
|
+
}
|
|
72978
|
+
if (config.error) {
|
|
72979
|
+
process.env[`${prefix}ERROR`] = config.error;
|
|
72980
|
+
}
|
|
72981
|
+
if (config.fatal) {
|
|
72982
|
+
process.env[`${prefix}FATAL`] = config.fatal;
|
|
72983
|
+
}
|
|
72984
|
+
};
|
|
72985
|
+
var setMultiThemeColorConfigEnv = (prefix, config) => {
|
|
72986
|
+
return {
|
|
72987
|
+
light: setBaseThemeColorConfigEnv(`${prefix}_LIGHT_`, config.light),
|
|
72988
|
+
dark: setBaseThemeColorConfigEnv(`${prefix}_DARK_`, config.dark)
|
|
72989
|
+
};
|
|
72990
|
+
};
|
|
72991
|
+
var setBaseThemeColorConfigEnv = (prefix, config) => {
|
|
72992
|
+
if (config.foreground) {
|
|
72993
|
+
process.env[`${prefix}FOREGROUND`] = config.foreground;
|
|
72994
|
+
}
|
|
72995
|
+
if (config.background) {
|
|
72996
|
+
process.env[`${prefix}BACKGROUND`] = config.background;
|
|
72997
|
+
}
|
|
72998
|
+
if (config.primary) {
|
|
72999
|
+
process.env[`${prefix}PRIMARY`] = config.primary;
|
|
73000
|
+
}
|
|
73001
|
+
if (config.secondary) {
|
|
73002
|
+
process.env[`${prefix}SECONDARY`] = config.secondary;
|
|
73003
|
+
}
|
|
73004
|
+
if (config.tertiary) {
|
|
73005
|
+
process.env[`${prefix}TERTIARY`] = config.tertiary;
|
|
73006
|
+
}
|
|
73007
|
+
if (config.accent) {
|
|
73008
|
+
process.env[`${prefix}ACCENT`] = config.accent;
|
|
73009
|
+
}
|
|
73010
|
+
if (config.success) {
|
|
73011
|
+
process.env[`${prefix}SUCCESS`] = config.success;
|
|
73012
|
+
}
|
|
73013
|
+
if (config.info) {
|
|
73014
|
+
process.env[`${prefix}INFO`] = config.info;
|
|
73015
|
+
}
|
|
73016
|
+
if (config.warning) {
|
|
73017
|
+
process.env[`${prefix}WARNING`] = config.warning;
|
|
73018
|
+
}
|
|
73019
|
+
if (config.error) {
|
|
73020
|
+
process.env[`${prefix}ERROR`] = config.error;
|
|
73021
|
+
}
|
|
73022
|
+
if (config.fatal) {
|
|
73023
|
+
process.env[`${prefix}FATAL`] = config.fatal;
|
|
73024
|
+
}
|
|
73025
|
+
};
|
|
72862
73026
|
|
|
72863
73027
|
// packages/config-tools/src/create-storm-config.ts
|
|
72864
73028
|
var _extension_cache = /* @__PURE__ */ new WeakMap();
|