@storm-software/config-tools 1.169.7 → 1.169.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storm-software/config-tools",
3
- "version": "1.169.7",
3
+ "version": "1.169.8",
4
4
  "type": "module",
5
5
  "description": "⚡The Storm-Ops monorepo contains utility applications, tools, and various libraries to create modern and scalable web applications.",
6
6
  "repository": {
@@ -1,55 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
-
4
-
5
-
6
- var _chunkJYKZS46Ucjs = require('./chunk-JYKZS46U.cjs');
7
-
8
- // src/utilities/process-handler.ts
9
- var exitWithError = (config) => {
10
- _chunkJYKZS46Ucjs.writeFatal.call(void 0, "Exiting script with an error status...", config);
11
- process.exit(1);
12
- };
13
- var exitWithSuccess = (config) => {
14
- _chunkJYKZS46Ucjs.writeSuccess.call(void 0, "Script completed successfully. Exiting...", config);
15
- process.exit(0);
16
- };
17
- var handleProcess = (config) => {
18
- _chunkJYKZS46Ucjs.writeTrace.call(void 0,
19
- `Using the following arguments to process the script: ${process.argv.join(", ")}`,
20
- config
21
- );
22
- process.on("unhandledRejection", (error) => {
23
- _chunkJYKZS46Ucjs.writeError.call(void 0,
24
- `An Unhandled Rejection occurred while running the program: ${error}`,
25
- config
26
- );
27
- exitWithError(config);
28
- });
29
- process.on("uncaughtException", (error) => {
30
- _chunkJYKZS46Ucjs.writeError.call(void 0,
31
- `An Uncaught Exception occurred while running the program: ${error.message}
32
- Stacktrace: ${error.stack}`,
33
- config
34
- );
35
- exitWithError(config);
36
- });
37
- process.on("SIGTERM", (signal) => {
38
- _chunkJYKZS46Ucjs.writeError.call(void 0, `The program terminated with signal code: ${signal}`, config);
39
- exitWithError(config);
40
- });
41
- process.on("SIGINT", (signal) => {
42
- _chunkJYKZS46Ucjs.writeError.call(void 0, `The program terminated with signal code: ${signal}`, config);
43
- exitWithError(config);
44
- });
45
- process.on("SIGHUP", (signal) => {
46
- _chunkJYKZS46Ucjs.writeError.call(void 0, `The program terminated with signal code: ${signal}`, config);
47
- exitWithError(config);
48
- });
49
- };
50
-
51
-
52
-
53
-
54
-
55
- exports.exitWithError = exitWithError; exports.exitWithSuccess = exitWithSuccess; exports.handleProcess = handleProcess;
@@ -1,92 +0,0 @@
1
- import {
2
- writeTrace
3
- } from "./chunk-SA3JCBON.js";
4
- import {
5
- findWorkspaceRoot
6
- } from "./chunk-VLWSWYG7.js";
7
- import {
8
- joinPaths
9
- } from "./chunk-FRR2ZRWD.js";
10
-
11
- // src/config-file/get-config-file.ts
12
- import { loadConfig } from "c12";
13
- import defu from "defu";
14
- var getConfigFileByName = async (fileName, filePath, options = {}) => {
15
- const workspacePath = filePath || findWorkspaceRoot(filePath);
16
- const configs = await Promise.all([
17
- loadConfig({
18
- cwd: workspacePath,
19
- packageJson: true,
20
- name: fileName,
21
- envName: fileName?.toUpperCase(),
22
- jitiOptions: {
23
- debug: false,
24
- fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths(
25
- process.env.STORM_CACHE_DIR || "node_modules/.cache/storm",
26
- "jiti"
27
- )
28
- },
29
- ...options
30
- }),
31
- loadConfig({
32
- cwd: workspacePath,
33
- packageJson: true,
34
- name: fileName,
35
- envName: fileName?.toUpperCase(),
36
- jitiOptions: {
37
- debug: false,
38
- fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths(
39
- process.env.STORM_CACHE_DIR || "node_modules/.cache/storm",
40
- "jiti"
41
- )
42
- },
43
- configFile: fileName,
44
- ...options
45
- })
46
- ]);
47
- return defu(configs[0] ?? {}, configs[1] ?? {});
48
- };
49
- var getConfigFile = async (filePath, additionalFileNames = []) => {
50
- const workspacePath = filePath ? filePath : findWorkspaceRoot(filePath);
51
- const result = await getConfigFileByName("storm-workspace", workspacePath);
52
- let config = result.config;
53
- const configFile = result.configFile;
54
- if (config && configFile && Object.keys(config).length > 0 && !config.skipConfigLogging) {
55
- writeTrace(
56
- `Found Storm configuration file "${configFile.includes(`${workspacePath}/`) ? configFile.replace(`${workspacePath}/`, "") : configFile}" at "${workspacePath}"`,
57
- {
58
- logLevel: "all"
59
- }
60
- );
61
- }
62
- if (additionalFileNames && additionalFileNames.length > 0) {
63
- const results = await Promise.all(
64
- additionalFileNames.map(
65
- (fileName) => getConfigFileByName(fileName, workspacePath)
66
- )
67
- );
68
- for (const result2 of results) {
69
- if (result2?.config && result2?.configFile && Object.keys(result2.config).length > 0) {
70
- if (!config.skipConfigLogging && !result2.config.skipConfigLogging) {
71
- writeTrace(
72
- `Found alternative configuration file "${result2.configFile.includes(`${workspacePath}/`) ? result2.configFile.replace(`${workspacePath}/`, "") : result2.configFile}" at "${workspacePath}"`,
73
- {
74
- logLevel: "all"
75
- }
76
- );
77
- }
78
- config = defu(result2.config ?? {}, config ?? {});
79
- }
80
- }
81
- }
82
- if (!config || Object.keys(config).length === 0) {
83
- return void 0;
84
- }
85
- config.configFile = configFile;
86
- return config;
87
- };
88
-
89
- export {
90
- getConfigFileByName,
91
- getConfigFile
92
- };
@@ -1,331 +0,0 @@
1
- import {
2
- getLogLevel
3
- } from "./chunk-4XRV4CVP.js";
4
- import {
5
- correctPaths
6
- } from "./chunk-FRR2ZRWD.js";
7
- import {
8
- LogLevel
9
- } from "./chunk-3QAWRU2B.js";
10
-
11
- // src/env/set-env.ts
12
- var setExtensionEnv = (extensionName, extension) => {
13
- for (const key of Object.keys(extension ?? {})) {
14
- if (extension[key]) {
15
- const result = key?.replace(
16
- /([A-Z])+/g,
17
- (input) => input ? input[0]?.toUpperCase() + input.slice(1) : ""
18
- ).split(/(?=[A-Z])|[.\-\s_]/).map((x) => x.toLowerCase()) ?? [];
19
- let extensionKey;
20
- if (result.length === 0) {
21
- return;
22
- }
23
- if (result.length === 1) {
24
- extensionKey = result[0]?.toUpperCase() ?? "";
25
- } else {
26
- extensionKey = result.reduce((ret, part) => {
27
- return `${ret}_${part.toLowerCase()}`;
28
- });
29
- }
30
- process.env[`STORM_EXTENSION_${extensionName.toUpperCase()}_${extensionKey.toUpperCase()}`] = extension[key];
31
- }
32
- }
33
- };
34
- var setConfigEnv = (config) => {
35
- const prefix = "STORM_";
36
- if (config.extends) {
37
- process.env[`${prefix}EXTENDS`] = Array.isArray(config.extends) ? JSON.stringify(config.extends) : config.extends;
38
- }
39
- if (config.name) {
40
- process.env[`${prefix}NAME`] = config.name;
41
- }
42
- if (config.namespace) {
43
- process.env[`${prefix}NAMESPACE`] = config.namespace;
44
- }
45
- if (config.owner) {
46
- process.env[`${prefix}OWNER`] = config.owner;
47
- }
48
- if (config.bot) {
49
- process.env[`${prefix}BOT_NAME`] = config.bot.name;
50
- process.env[`${prefix}BOT_EMAIL`] = config.bot.email;
51
- }
52
- if (config.error) {
53
- process.env[`${prefix}ERROR_CODES_FILE`] = config.error.codesFile;
54
- process.env[`${prefix}ERROR_URL`] = config.error.url;
55
- }
56
- if (config.release) {
57
- process.env[`${prefix}RELEASE_BANNER`] = config.release.banner;
58
- process.env[`${prefix}RELEASE_HEADER`] = config.release.header;
59
- process.env[`${prefix}RELEASE_FOOTER`] = config.release.footer;
60
- }
61
- if (config.account) {
62
- if (config.account.twitter) {
63
- process.env[`${prefix}ACCOUNT_TWITTER`] = config.account.twitter;
64
- }
65
- if (config.account.discord) {
66
- process.env[`${prefix}ACCOUNT_DISCORD`] = config.account.discord;
67
- }
68
- if (config.account.telegram) {
69
- process.env[`${prefix}ACCOUNT_TELEGRAM`] = config.account.telegram;
70
- }
71
- if (config.account.slack) {
72
- process.env[`${prefix}ACCOUNT_SLACK`] = config.account.slack;
73
- }
74
- if (config.account.medium) {
75
- process.env[`${prefix}ACCOUNT_MEDIUM`] = config.account.medium;
76
- }
77
- if (config.account.github) {
78
- process.env[`${prefix}ACCOUNT_GITHUB`] = config.account.github;
79
- }
80
- }
81
- if (config.organization) {
82
- process.env[`${prefix}ORGANIZATION`] = config.organization;
83
- }
84
- if (config.packageManager) {
85
- process.env[`${prefix}PACKAGE_MANAGER`] = config.packageManager;
86
- }
87
- if (config.license) {
88
- process.env[`${prefix}LICENSE`] = config.license;
89
- }
90
- if (config.homepage) {
91
- process.env[`${prefix}HOMEPAGE`] = config.homepage;
92
- }
93
- if (config.docs) {
94
- process.env[`${prefix}DOCS`] = config.docs;
95
- }
96
- if (config.licensing) {
97
- process.env[`${prefix}LICENSING`] = config.licensing;
98
- }
99
- if (config.contact) {
100
- process.env[`${prefix}CONTACT`] = config.contact;
101
- }
102
- if (config.timezone) {
103
- process.env[`${prefix}TIMEZONE`] = config.timezone;
104
- process.env.TZ = config.timezone;
105
- process.env.DEFAULT_TIMEZONE = config.timezone;
106
- }
107
- if (config.locale) {
108
- process.env[`${prefix}LOCALE`] = config.locale;
109
- process.env.LOCALE = config.locale;
110
- process.env.DEFAULT_LOCALE = config.locale;
111
- process.env.LANG = config.locale ? `${config.locale.replaceAll("-", "_")}.UTF-8` : "en_US.UTF-8";
112
- }
113
- if (config.configFile) {
114
- process.env[`${prefix}CONFIG_FILE`] = correctPaths(config.configFile);
115
- }
116
- if (config.workspaceRoot) {
117
- process.env[`${prefix}WORKSPACE_ROOT`] = correctPaths(config.workspaceRoot);
118
- process.env.NX_WORKSPACE_ROOT = correctPaths(config.workspaceRoot);
119
- process.env.NX_WORKSPACE_ROOT_PATH = correctPaths(config.workspaceRoot);
120
- }
121
- if (config.directories) {
122
- if (!config.skipCache && config.directories.cache) {
123
- process.env[`${prefix}CACHE_DIR`] = correctPaths(
124
- config.directories.cache
125
- );
126
- process.env[`${prefix}CACHE_DIRECTORY`] = process.env[`${prefix}CACHE_DIR`];
127
- }
128
- if (config.directories.data) {
129
- process.env[`${prefix}DATA_DIR`] = correctPaths(config.directories.data);
130
- process.env[`${prefix}DATA_DIRECTORY`] = process.env[`${prefix}DATA_DIR`];
131
- }
132
- if (config.directories.config) {
133
- process.env[`${prefix}CONFIG_DIR`] = correctPaths(
134
- config.directories.config
135
- );
136
- process.env[`${prefix}CONFIG_DIRECTORY`] = process.env[`${prefix}CONFIG_DIR`];
137
- }
138
- if (config.directories.temp) {
139
- process.env[`${prefix}TEMP_DIR`] = correctPaths(config.directories.temp);
140
- process.env[`${prefix}TEMP_DIRECTORY`] = process.env[`${prefix}TEMP_DIR`];
141
- }
142
- if (config.directories.log) {
143
- process.env[`${prefix}LOG_DIR`] = correctPaths(config.directories.log);
144
- process.env[`${prefix}LOG_DIRECTORY`] = process.env[`${prefix}LOG_DIR`];
145
- }
146
- if (config.directories.build) {
147
- process.env[`${prefix}BUILD_DIR`] = correctPaths(
148
- config.directories.build
149
- );
150
- process.env[`${prefix}BUILD_DIRECTORY`] = process.env[`${prefix}BUILD_DIR`];
151
- }
152
- }
153
- if (config.skipCache !== void 0) {
154
- process.env[`${prefix}SKIP_CACHE`] = String(config.skipCache);
155
- if (config.skipCache) {
156
- process.env.NX_SKIP_NX_CACHE ??= String(config.skipCache);
157
- process.env.NX_CACHE_PROJECT_GRAPH ??= String(config.skipCache);
158
- }
159
- }
160
- if (config.mode) {
161
- process.env[`${prefix}MODE`] = config.mode;
162
- process.env.NODE_ENV = config.mode;
163
- process.env.ENVIRONMENT = config.mode;
164
- }
165
- if (config.colors?.base?.light || config.colors?.base?.dark) {
166
- for (const key of Object.keys(config.colors)) {
167
- setThemeColorConfigEnv(`${prefix}COLOR_${key}_`, config.colors[key]);
168
- }
169
- } else {
170
- setThemeColorConfigEnv(
171
- `${prefix}COLOR_`,
172
- config.colors
173
- );
174
- }
175
- if (config.repository) {
176
- process.env[`${prefix}REPOSITORY`] = config.repository;
177
- }
178
- if (config.branch) {
179
- process.env[`${prefix}BRANCH`] = config.branch;
180
- }
181
- if (config.preid) {
182
- process.env[`${prefix}PRE_ID`] = String(config.preid);
183
- }
184
- if (config.externalPackagePatterns) {
185
- process.env[`${prefix}EXTERNAL_PACKAGE_PATTERNS`] = JSON.stringify(
186
- config.externalPackagePatterns
187
- );
188
- }
189
- if (config.registry) {
190
- if (config.registry.github) {
191
- process.env[`${prefix}REGISTRY_GITHUB`] = String(config.registry.github);
192
- }
193
- if (config.registry.npm) {
194
- process.env[`${prefix}REGISTRY_NPM`] = String(config.registry.npm);
195
- }
196
- if (config.registry.cargo) {
197
- process.env[`${prefix}REGISTRY_CARGO`] = String(config.registry.cargo);
198
- }
199
- if (config.registry.cyclone) {
200
- process.env[`${prefix}REGISTRY_CYCLONE`] = String(
201
- config.registry.cyclone
202
- );
203
- }
204
- if (config.registry.container) {
205
- process.env[`${prefix}REGISTRY_CONTAINER`] = String(
206
- config.registry.container
207
- );
208
- }
209
- }
210
- if (config.logLevel) {
211
- process.env[`${prefix}LOG_LEVEL`] = String(config.logLevel);
212
- process.env.LOG_LEVEL = String(config.logLevel);
213
- process.env.NX_VERBOSE_LOGGING = String(
214
- getLogLevel(config.logLevel) >= LogLevel.DEBUG ? true : false
215
- );
216
- process.env.RUST_BACKTRACE = getLogLevel(config.logLevel) >= LogLevel.DEBUG ? "full" : "none";
217
- }
218
- if (config.skipConfigLogging !== void 0) {
219
- process.env[`${prefix}SKIP_CONFIG_LOGGING`] = String(
220
- config.skipConfigLogging
221
- );
222
- }
223
- process.env[`${prefix}CONFIG`] = JSON.stringify(config);
224
- for (const key of Object.keys(config.extensions ?? {})) {
225
- if (config.extensions[key] && Object.keys(config.extensions[key])) {
226
- setExtensionEnv(key, config.extensions[key]);
227
- }
228
- }
229
- };
230
- var setThemeColorConfigEnv = (prefix, config) => {
231
- return config?.light?.brand || config?.dark?.brand ? setMultiThemeColorConfigEnv(prefix, config) : setSingleThemeColorConfigEnv(prefix, config);
232
- };
233
- var setSingleThemeColorConfigEnv = (prefix, config) => {
234
- if (config.dark) {
235
- process.env[`${prefix}DARK`] = config.dark;
236
- }
237
- if (config.light) {
238
- process.env[`${prefix}LIGHT`] = config.light;
239
- }
240
- if (config.brand) {
241
- process.env[`${prefix}BRAND`] = config.brand;
242
- }
243
- if (config.alternate) {
244
- process.env[`${prefix}ALTERNATE`] = config.alternate;
245
- }
246
- if (config.accent) {
247
- process.env[`${prefix}ACCENT`] = config.accent;
248
- }
249
- if (config.link) {
250
- process.env[`${prefix}LINK`] = config.link;
251
- }
252
- if (config.help) {
253
- process.env[`${prefix}HELP`] = config.help;
254
- }
255
- if (config.success) {
256
- process.env[`${prefix}SUCCESS`] = config.success;
257
- }
258
- if (config.info) {
259
- process.env[`${prefix}INFO`] = config.info;
260
- }
261
- if (config.warning) {
262
- process.env[`${prefix}WARNING`] = config.warning;
263
- }
264
- if (config.danger) {
265
- process.env[`${prefix}DANGER`] = config.danger;
266
- }
267
- if (config.fatal) {
268
- process.env[`${prefix}FATAL`] = config.fatal;
269
- }
270
- if (config.positive) {
271
- process.env[`${prefix}POSITIVE`] = config.positive;
272
- }
273
- if (config.negative) {
274
- process.env[`${prefix}NEGATIVE`] = config.negative;
275
- }
276
- };
277
- var setMultiThemeColorConfigEnv = (prefix, config) => {
278
- return {
279
- light: setBaseThemeColorConfigEnv(`${prefix}LIGHT_`, config.light),
280
- dark: setBaseThemeColorConfigEnv(`${prefix}DARK_`, config.dark)
281
- };
282
- };
283
- var setBaseThemeColorConfigEnv = (prefix, config) => {
284
- if (config.foreground) {
285
- process.env[`${prefix}FOREGROUND`] = config.foreground;
286
- }
287
- if (config.background) {
288
- process.env[`${prefix}BACKGROUND`] = config.background;
289
- }
290
- if (config.brand) {
291
- process.env[`${prefix}BRAND`] = config.brand;
292
- }
293
- if (config.alternate) {
294
- process.env[`${prefix}ALTERNATE`] = config.alternate;
295
- }
296
- if (config.accent) {
297
- process.env[`${prefix}ACCENT`] = config.accent;
298
- }
299
- if (config.link) {
300
- process.env[`${prefix}LINK`] = config.link;
301
- }
302
- if (config.help) {
303
- process.env[`${prefix}HELP`] = config.help;
304
- }
305
- if (config.success) {
306
- process.env[`${prefix}SUCCESS`] = config.success;
307
- }
308
- if (config.info) {
309
- process.env[`${prefix}INFO`] = config.info;
310
- }
311
- if (config.warning) {
312
- process.env[`${prefix}WARNING`] = config.warning;
313
- }
314
- if (config.danger) {
315
- process.env[`${prefix}DANGER`] = config.danger;
316
- }
317
- if (config.fatal) {
318
- process.env[`${prefix}FATAL`] = config.fatal;
319
- }
320
- if (config.positive) {
321
- process.env[`${prefix}POSITIVE`] = config.positive;
322
- }
323
- if (config.negative) {
324
- process.env[`${prefix}NEGATIVE`] = config.negative;
325
- }
326
- };
327
-
328
- export {
329
- setExtensionEnv,
330
- setConfigEnv
331
- };
@@ -1,192 +0,0 @@
1
- import {
2
- getLogLevelLabel
3
- } from "./chunk-4XRV4CVP.js";
4
- import {
5
- correctPaths
6
- } from "./chunk-FRR2ZRWD.js";
7
-
8
- // src/env/get-env.ts
9
- import {
10
- COLOR_KEYS,
11
- STORM_DEFAULT_DOCS,
12
- STORM_DEFAULT_HOMEPAGE,
13
- STORM_DEFAULT_LICENSING
14
- } from "@storm-software/config";
15
- var getExtensionEnv = (extensionName) => {
16
- const prefix = `STORM_EXTENSION_${extensionName.toUpperCase()}_`;
17
- return Object.keys(process.env).filter((key) => key.startsWith(prefix)).reduce((ret, key) => {
18
- const name = key.replace(prefix, "").split("_").map(
19
- (i) => i.length > 0 ? i.trim().charAt(0).toUpperCase() + i.trim().slice(1) : ""
20
- ).join("");
21
- if (name) {
22
- ret[name] = process.env[key];
23
- }
24
- return ret;
25
- }, {});
26
- };
27
- var getConfigEnv = () => {
28
- const prefix = "STORM_";
29
- let config = {
30
- extends: process.env[`${prefix}EXTENDS`] || void 0,
31
- name: process.env[`${prefix}NAME`] || void 0,
32
- namespace: process.env[`${prefix}NAMESPACE`] || void 0,
33
- owner: process.env[`${prefix}OWNER`] || void 0,
34
- bot: {
35
- name: process.env[`${prefix}BOT_NAME`] || void 0,
36
- email: process.env[`${prefix}BOT_EMAIL`] || void 0
37
- },
38
- release: {
39
- banner: process.env[`${prefix}RELEASE_BANNER`] || void 0,
40
- header: process.env[`${prefix}RELEASE_HEADER`] || void 0,
41
- footer: process.env[`${prefix}RELEASE_FOOTER`] || void 0
42
- },
43
- error: {
44
- codesFile: process.env[`${prefix}ERROR_CODES_FILE`] || void 0,
45
- url: process.env[`${prefix}ERROR_URL`] || void 0
46
- },
47
- account: {
48
- twitter: process.env[`${prefix}ACCOUNT_TWITTER`] || void 0,
49
- discord: process.env[`${prefix}ACCOUNT_DISCORD`] || void 0,
50
- telegram: process.env[`${prefix}ACCOUNT_TELEGRAM`] || void 0,
51
- slack: process.env[`${prefix}ACCOUNT_SLACK`] || void 0,
52
- medium: process.env[`${prefix}ACCOUNT_MEDIUM`] || void 0,
53
- github: process.env[`${prefix}ACCOUNT_GITHUB`] || void 0
54
- },
55
- organization: process.env[`${prefix}ORGANIZATION`] || void 0,
56
- packageManager: process.env[`${prefix}PACKAGE_MANAGER`] || void 0,
57
- license: process.env[`${prefix}LICENSE`] || void 0,
58
- homepage: process.env[`${prefix}HOMEPAGE`] || void 0,
59
- docs: process.env[`${prefix}DOCS`] || void 0,
60
- licensing: process.env[`${prefix}LICENSING`] || void 0,
61
- contact: process.env[`${prefix}CONTACT`] || void 0,
62
- timezone: process.env[`${prefix}TIMEZONE`] || process.env.TZ || void 0,
63
- locale: process.env[`${prefix}LOCALE`] || process.env.LOCALE || void 0,
64
- configFile: process.env[`${prefix}CONFIG_FILE`] ? correctPaths(process.env[`${prefix}CONFIG_FILE`]) : void 0,
65
- workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`] ? correctPaths(process.env[`${prefix}WORKSPACE_ROOT`]) : void 0,
66
- directories: {
67
- cache: process.env[`${prefix}CACHE_DIR`] ? correctPaths(process.env[`${prefix}CACHE_DIR`]) : process.env[`${prefix}CACHE_DIRECTORY`] ? correctPaths(process.env[`${prefix}CACHE_DIRECTORY`]) : void 0,
68
- data: process.env[`${prefix}DATA_DIR`] ? correctPaths(process.env[`${prefix}DATA_DIR`]) : process.env[`${prefix}DATA_DIRECTORY`] ? correctPaths(process.env[`${prefix}DATA_DIRECTORY`]) : void 0,
69
- config: process.env[`${prefix}CONFIG_DIR`] ? correctPaths(process.env[`${prefix}CONFIG_DIR`]) : process.env[`${prefix}CONFIG_DIRECTORY`] ? correctPaths(process.env[`${prefix}CONFIG_DIRECTORY`]) : void 0,
70
- temp: process.env[`${prefix}TEMP_DIR`] ? correctPaths(process.env[`${prefix}TEMP_DIR`]) : process.env[`${prefix}TEMP_DIRECTORY`] ? correctPaths(process.env[`${prefix}TEMP_DIRECTORY`]) : void 0,
71
- log: process.env[`${prefix}LOG_DIR`] ? correctPaths(process.env[`${prefix}LOG_DIR`]) : process.env[`${prefix}LOG_DIRECTORY`] ? correctPaths(process.env[`${prefix}LOG_DIRECTORY`]) : void 0,
72
- build: process.env[`${prefix}BUILD_DIR`] ? correctPaths(process.env[`${prefix}BUILD_DIR`]) : process.env[`${prefix}BUILD_DIRECTORY`] ? correctPaths(process.env[`${prefix}BUILD_DIRECTORY`]) : void 0
73
- },
74
- skipCache: process.env[`${prefix}SKIP_CACHE`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CACHE`]) : void 0,
75
- mode: (process.env[`${prefix}MODE`] ?? process.env.NODE_ENV ?? process.env.ENVIRONMENT) || void 0,
76
- // ci:
77
- // process.env[`${prefix}CI`] !== undefined
78
- // ? Boolean(
79
- // process.env[`${prefix}CI`] ??
80
- // process.env.CI ??
81
- // process.env.CONTINUOUS_INTEGRATION
82
- // )
83
- // : undefined,
84
- repository: process.env[`${prefix}REPOSITORY`] || void 0,
85
- branch: process.env[`${prefix}BRANCH`] || void 0,
86
- preid: process.env[`${prefix}PRE_ID`] || void 0,
87
- externalPackagePatterns: process.env[`${prefix}EXTERNAL_PACKAGE_PATTERNS`] ? JSON.parse(process.env[`${prefix}EXTERNAL_PACKAGE_PATTERNS`]) : [],
88
- registry: {
89
- github: process.env[`${prefix}REGISTRY_GITHUB`] || void 0,
90
- npm: process.env[`${prefix}REGISTRY_NPM`] || void 0,
91
- cargo: process.env[`${prefix}REGISTRY_CARGO`] || void 0,
92
- cyclone: process.env[`${prefix}REGISTRY_CYCLONE`] || void 0,
93
- container: process.env[`${prefix}REGISTRY_CONTAINER`] || void 0
94
- },
95
- logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(
96
- Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
97
- ) ? getLogLevelLabel(
98
- Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
99
- ) : process.env[`${prefix}LOG_LEVEL`] : void 0,
100
- skipConfigLogging: process.env[`${prefix}SKIP_CONFIG_LOGGING`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CONFIG_LOGGING`]) : void 0
101
- };
102
- const themeNames = Object.keys(process.env).filter(
103
- (envKey) => envKey.startsWith(`${prefix}COLOR_`) && COLOR_KEYS.every(
104
- (colorKey) => !envKey.startsWith(`${prefix}COLOR_LIGHT_${colorKey}`) && !envKey.startsWith(`${prefix}COLOR_DARK_${colorKey}`)
105
- )
106
- );
107
- config.colors = themeNames.length > 0 ? themeNames.reduce(
108
- (ret, themeName) => {
109
- ret[themeName] = getThemeColorConfigEnv(prefix, themeName);
110
- return ret;
111
- },
112
- {}
113
- ) : getThemeColorConfigEnv(prefix);
114
- if (config.docs === STORM_DEFAULT_DOCS) {
115
- if (config.homepage === STORM_DEFAULT_HOMEPAGE) {
116
- config.docs = `${STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/docs`;
117
- } else {
118
- config.docs = `${config.homepage}/docs`;
119
- }
120
- }
121
- if (config.licensing === STORM_DEFAULT_LICENSING) {
122
- if (config.homepage === STORM_DEFAULT_HOMEPAGE) {
123
- config.licensing = `${STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/licensing`;
124
- } else {
125
- config.licensing = `${config.homepage}/docs`;
126
- }
127
- }
128
- const serializedConfig = process.env[`${prefix}CONFIG`];
129
- if (serializedConfig) {
130
- const parsed = JSON.parse(serializedConfig);
131
- config = {
132
- ...config,
133
- ...parsed,
134
- colors: { ...config.colors, ...parsed.colors },
135
- extensions: { ...config.extensions, ...parsed.extensions }
136
- };
137
- }
138
- return config;
139
- };
140
- var getThemeColorConfigEnv = (prefix, theme) => {
141
- const themeName = `COLOR_${theme && theme !== "base" ? `${theme}_` : ""}`.toUpperCase();
142
- return process.env[`${prefix}${themeName}LIGHT_BRAND`] || process.env[`${prefix}${themeName}DARK_BRAND`] ? getMultiThemeColorConfigEnv(prefix + themeName) : getSingleThemeColorConfigEnv(prefix + themeName);
143
- };
144
- var getSingleThemeColorConfigEnv = (prefix) => {
145
- return {
146
- dark: process.env[`${prefix}DARK`],
147
- light: process.env[`${prefix}LIGHT`],
148
- brand: process.env[`${prefix}BRAND`],
149
- alternate: process.env[`${prefix}ALTERNATE`],
150
- accent: process.env[`${prefix}ACCENT`],
151
- link: process.env[`${prefix}LINK`],
152
- help: process.env[`${prefix}HELP`],
153
- success: process.env[`${prefix}SUCCESS`],
154
- info: process.env[`${prefix}INFO`],
155
- warning: process.env[`${prefix}WARNING`],
156
- danger: process.env[`${prefix}DANGER`],
157
- fatal: process.env[`${prefix}FATAL`],
158
- positive: process.env[`${prefix}POSITIVE`],
159
- negative: process.env[`${prefix}NEGATIVE`]
160
- };
161
- };
162
- var getMultiThemeColorConfigEnv = (prefix) => {
163
- return {
164
- light: getBaseThemeColorConfigEnv(
165
- `${prefix}_LIGHT_`
166
- ),
167
- dark: getBaseThemeColorConfigEnv(`${prefix}_DARK_`)
168
- };
169
- };
170
- var getBaseThemeColorConfigEnv = (prefix) => {
171
- return {
172
- foreground: process.env[`${prefix}FOREGROUND`],
173
- background: process.env[`${prefix}BACKGROUND`],
174
- brand: process.env[`${prefix}BRAND`],
175
- alternate: process.env[`${prefix}ALTERNATE`],
176
- accent: process.env[`${prefix}ACCENT`],
177
- link: process.env[`${prefix}LINK`],
178
- help: process.env[`${prefix}HELP`],
179
- success: process.env[`${prefix}SUCCESS`],
180
- info: process.env[`${prefix}INFO`],
181
- warning: process.env[`${prefix}WARNING`],
182
- danger: process.env[`${prefix}DANGER`],
183
- fatal: process.env[`${prefix}FATAL`],
184
- positive: process.env[`${prefix}POSITIVE`],
185
- negative: process.env[`${prefix}NEGATIVE`]
186
- };
187
- };
188
-
189
- export {
190
- getExtensionEnv,
191
- getConfigEnv
192
- };