@storm-software/config-tools 1.190.120 → 1.190.121
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/bin/config.cjs +1272 -105
- package/bin/config.mjs +1271 -0
- package/dist/_virtual/_rolldown/runtime.cjs +23 -0
- package/dist/config-file/get-config-file.cjs +63 -79
- package/dist/config-file/get-config-file.d.cts +5 -5
- package/dist/config-file/{get-config-file.d.ts → get-config-file.d.mts} +7 -5
- package/dist/config-file/get-config-file.mjs +66 -0
- package/dist/config-file/index.cjs +4 -1
- package/dist/config-file/index.d.cts +2 -3
- package/dist/config-file/index.d.mts +4 -0
- package/dist/config-file/index.mjs +5 -0
- package/dist/create-storm-config.cjs +105 -136
- package/dist/create-storm-config.d.cts +5 -5
- package/dist/{create-storm-config.d.ts → create-storm-config.d.mts} +7 -5
- package/dist/create-storm-config.mjs +113 -0
- package/dist/env/get-env.cjs +190 -214
- package/dist/env/get-env.d.cts +5 -5
- package/dist/env/{get-env.d.ts → get-env.d.mts} +7 -5
- package/dist/env/get-env.mjs +203 -0
- package/dist/env/index.cjs +7 -2
- package/dist/env/index.d.cts +3 -4
- package/dist/env/index.d.mts +5 -0
- package/dist/env/index.mjs +6 -0
- package/dist/env/set-env.cjs +218 -374
- package/dist/env/set-env.d.cts +8 -8
- package/dist/env/{set-env.d.ts → set-env.d.mts} +10 -8
- package/dist/env/set-env.mjs +231 -0
- package/dist/get-config.cjs +40 -29
- package/dist/get-config.d.cts +18 -18
- package/dist/{get-config.d.ts → get-config.d.mts} +20 -18
- package/dist/get-config.mjs +46 -0
- package/dist/index.cjs +98 -7
- package/dist/index.d.cts +27 -28
- package/dist/index.d.mts +29 -0
- package/dist/index.mjs +26 -0
- package/dist/logger/chalk.cjs +38 -29
- package/dist/logger/chalk.d.cts +18 -17
- package/dist/logger/chalk.d.mts +37 -0
- package/dist/logger/chalk.mjs +43 -0
- package/dist/logger/console-icons.cjs +15 -14
- package/dist/logger/console-icons.d.cts +5 -8
- package/dist/logger/console-icons.d.mts +7 -0
- package/dist/logger/console-icons.mjs +20 -0
- package/dist/logger/console.cjs +187 -183
- package/dist/logger/console.d.cts +25 -25
- package/dist/logger/{console.d.ts → console.d.mts} +27 -25
- package/dist/logger/console.mjs +185 -0
- package/dist/logger/create-logger.cjs +31 -24
- package/dist/logger/create-logger.d.cts +5 -6
- package/dist/logger/{create-logger.d.ts → create-logger.d.mts} +7 -6
- package/dist/logger/create-logger.mjs +34 -0
- package/dist/logger/format-timestamp.cjs +12 -4
- package/dist/logger/format-timestamp.d.cts +3 -2
- package/dist/logger/{format-timestamp.d.ts → format-timestamp.d.mts} +5 -2
- package/dist/logger/format-timestamp.mjs +16 -0
- package/dist/logger/get-log-level.cjs +50 -60
- package/dist/logger/get-log-level.d.cts +4 -5
- package/dist/logger/{get-log-level.d.ts → get-log-level.d.mts} +6 -5
- package/dist/logger/get-log-level.mjs +54 -0
- package/dist/logger/index.cjs +29 -7
- package/dist/logger/index.d.cts +8 -10
- package/dist/logger/index.d.mts +10 -0
- package/dist/logger/index.mjs +11 -0
- package/dist/logger/is-unicode-supported.cjs +6 -10
- package/dist/logger/is-unicode-supported.d.cts +3 -2
- package/dist/logger/is-unicode-supported.d.mts +6 -0
- package/dist/logger/is-unicode-supported.mjs +10 -0
- package/dist/types.cjs +26 -25
- package/dist/types.d.cts +39 -41
- package/dist/types.d.mts +53 -0
- package/dist/types.mjs +30 -0
- package/dist/utilities/apply-workspace-tokens.cjs +31 -70
- package/dist/utilities/apply-workspace-tokens.d.cts +4 -5
- package/dist/utilities/{apply-workspace-tokens.d.ts → apply-workspace-tokens.d.mts} +6 -5
- package/dist/utilities/apply-workspace-tokens.mjs +37 -0
- package/dist/utilities/colors.cjs +91 -74
- package/dist/utilities/colors.d.cts +4 -4
- package/dist/utilities/{colors.d.ts → colors.d.mts} +6 -4
- package/dist/utilities/colors.mjs +97 -0
- package/dist/utilities/correct-paths.cjs +166 -196
- package/dist/utilities/correct-paths.d.cts +4 -4
- package/dist/utilities/{correct-paths.d.ts → correct-paths.d.mts} +6 -4
- package/dist/utilities/correct-paths.mjs +190 -0
- package/dist/utilities/file-path-utils.cjs +42 -27
- package/dist/utilities/file-path-utils.d.cts +15 -14
- package/dist/utilities/{file-path-utils.d.ts → file-path-utils.d.mts} +17 -14
- package/dist/utilities/file-path-utils.mjs +48 -0
- package/dist/utilities/find-up.cjs +12 -18
- package/dist/utilities/find-up.d.cts +3 -2
- package/dist/utilities/{find-up.d.ts → find-up.d.mts} +5 -2
- package/dist/utilities/find-up.mjs +19 -0
- package/dist/utilities/find-workspace-root.cjs +64 -69
- package/dist/utilities/find-workspace-root.d.cts +3 -2
- package/dist/utilities/{find-workspace-root.d.ts → find-workspace-root.d.mts} +5 -2
- package/dist/utilities/find-workspace-root.mjs +73 -0
- package/dist/utilities/get-default-config.cjs +69 -91
- package/dist/utilities/get-default-config.d.cts +4 -4
- package/dist/utilities/{get-default-config.d.ts → get-default-config.d.mts} +6 -4
- package/dist/utilities/get-default-config.mjs +74 -0
- package/dist/utilities/index.cjs +49 -9
- package/dist/utilities/index.d.cts +10 -14
- package/dist/utilities/index.d.mts +12 -0
- package/dist/utilities/index.mjs +13 -0
- package/dist/utilities/process-handler.cjs +32 -47
- package/dist/utilities/process-handler.d.cts +4 -4
- package/dist/utilities/process-handler.d.mts +9 -0
- package/dist/utilities/process-handler.mjs +38 -0
- package/dist/utilities/run.cjs +62 -36
- package/dist/utilities/run.d.cts +5 -6
- package/dist/utilities/{run.d.ts → run.d.mts} +7 -6
- package/dist/utilities/run.mjs +64 -0
- package/dist/utilities/toml.cjs +27 -32
- package/dist/utilities/toml.d.cts +148 -147
- package/dist/utilities/toml.d.mts +192 -0
- package/dist/utilities/toml.mjs +33 -0
- package/package.json +105 -157
- package/bin/config.js +0 -108
- package/dist/config-file/get-config-file.js +0 -83
- package/dist/config-file/index.d.ts +0 -3
- package/dist/config-file/index.js +0 -1
- package/dist/create-storm-config.js +0 -147
- package/dist/env/get-env.js +0 -226
- package/dist/env/index.d.ts +0 -4
- package/dist/env/index.js +0 -2
- package/dist/env/set-env.js +0 -386
- package/dist/get-config.js +0 -35
- package/dist/index.d.ts +0 -28
- package/dist/index.js +0 -7
- package/dist/logger/chalk.d.ts +0 -34
- package/dist/logger/chalk.js +0 -34
- package/dist/logger/console-icons.d.ts +0 -8
- package/dist/logger/console-icons.js +0 -17
- package/dist/logger/console.js +0 -191
- package/dist/logger/create-logger.js +0 -27
- package/dist/logger/format-timestamp.js +0 -6
- package/dist/logger/get-log-level.js +0 -64
- package/dist/logger/index.d.ts +0 -10
- package/dist/logger/index.js +0 -7
- package/dist/logger/is-unicode-supported.d.ts +0 -3
- package/dist/logger/is-unicode-supported.js +0 -12
- package/dist/types.d.ts +0 -53
- package/dist/types.js +0 -28
- package/dist/utilities/apply-workspace-tokens.js +0 -76
- package/dist/utilities/colors.js +0 -81
- package/dist/utilities/correct-paths.js +0 -231
- package/dist/utilities/file-path-utils.js +0 -33
- package/dist/utilities/find-up.js +0 -23
- package/dist/utilities/find-workspace-root.js +0 -77
- package/dist/utilities/get-default-config.js +0 -95
- package/dist/utilities/index.d.ts +0 -14
- package/dist/utilities/index.js +0 -9
- package/dist/utilities/process-handler.d.ts +0 -7
- package/dist/utilities/process-handler.js +0 -53
- package/dist/utilities/run.js +0 -38
- package/dist/utilities/toml.d.ts +0 -189
- package/dist/utilities/toml.js +0 -42
package/dist/env/set-env.cjs
CHANGED
|
@@ -1,386 +1,230 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_types = require("../types.cjs");
|
|
3
|
+
const require_logger_get_log_level = require("../logger/get-log-level.cjs");
|
|
4
|
+
const require_utilities_correct_paths = require("../utilities/correct-paths.cjs");
|
|
5
|
+
//#region src/env/set-env.ts
|
|
6
|
+
/**
|
|
7
|
+
* Get the config for an extension module of Storm workspace from environment variables
|
|
8
|
+
*
|
|
9
|
+
* @param extensionName - The name of the extension module
|
|
10
|
+
* @returns The config for the specified Storm extension module. If the module does not exist, `undefined` is returned.
|
|
11
|
+
*/
|
|
4
12
|
const setExtensionEnv = (extensionName, extension) => {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
if (result.length === 1) {
|
|
16
|
-
extensionKey = _nullishCoalesce(_optionalChain([result, 'access', _10 => _10[0], 'optionalAccess', _11 => _11.toUpperCase, 'call', _12 => _12()]), () => ( ""));
|
|
17
|
-
} else {
|
|
18
|
-
extensionKey = result.reduce((ret, part) => {
|
|
19
|
-
return `${ret}_${part.toLowerCase()}`;
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
process.env[`STORM_EXTENSION_${extensionName.toUpperCase()}_${extensionKey.toUpperCase()}`] = extension[key];
|
|
23
|
-
}
|
|
24
|
-
}
|
|
13
|
+
for (const key of Object.keys(extension ?? {})) if (extension[key]) {
|
|
14
|
+
const result = key?.replace(/([A-Z])+/g, (input) => input ? input[0]?.toUpperCase() + input.slice(1) : "").split(/(?=[A-Z])|[.\-\s_]/).map((x) => x.toLowerCase()) ?? [];
|
|
15
|
+
let extensionKey;
|
|
16
|
+
if (result.length === 0) return;
|
|
17
|
+
if (result.length === 1) extensionKey = result[0]?.toUpperCase() ?? "";
|
|
18
|
+
else extensionKey = result.reduce((ret, part) => {
|
|
19
|
+
return `${ret}_${part.toLowerCase()}`;
|
|
20
|
+
});
|
|
21
|
+
process.env[`STORM_EXTENSION_${extensionName.toUpperCase()}_${extensionKey.toUpperCase()}`] = extension[key];
|
|
22
|
+
}
|
|
25
23
|
};
|
|
24
|
+
/**
|
|
25
|
+
* Get the config for the current Storm workspace
|
|
26
|
+
*
|
|
27
|
+
* @returns The config for the current Storm workspace from environment variables
|
|
28
|
+
*/
|
|
26
29
|
const setConfigEnv = (config) => {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
if (config.directories.temp) {
|
|
178
|
-
process.env[`${prefix}TEMP_DIR`] = _correctpaths.correctPaths.call(void 0, config.directories.temp);
|
|
179
|
-
process.env[`${prefix}TEMP_DIRECTORY`] = process.env[`${prefix}TEMP_DIR`];
|
|
180
|
-
}
|
|
181
|
-
if (config.directories.log) {
|
|
182
|
-
process.env[`${prefix}LOG_DIR`] = _correctpaths.correctPaths.call(void 0, config.directories.log);
|
|
183
|
-
process.env[`${prefix}LOG_DIRECTORY`] = process.env[`${prefix}LOG_DIR`];
|
|
184
|
-
}
|
|
185
|
-
if (config.directories.build) {
|
|
186
|
-
process.env[`${prefix}BUILD_DIR`] = _correctpaths.correctPaths.call(void 0,
|
|
187
|
-
config.directories.build
|
|
188
|
-
);
|
|
189
|
-
process.env[`${prefix}BUILD_DIRECTORY`] = process.env[`${prefix}BUILD_DIR`];
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
if (config.skipCache !== void 0) {
|
|
193
|
-
process.env[`${prefix}SKIP_CACHE`] = String(config.skipCache);
|
|
194
|
-
if (config.skipCache) {
|
|
195
|
-
process.env.NX_SKIP_NX_CACHE ??= String(config.skipCache);
|
|
196
|
-
process.env.NX_CACHE_PROJECT_GRAPH ??= String(config.skipCache);
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
if (config.mode) {
|
|
200
|
-
process.env[`${prefix}MODE`] = config.mode;
|
|
201
|
-
process.env.NODE_ENV = config.mode;
|
|
202
|
-
process.env.ENVIRONMENT = config.mode;
|
|
203
|
-
}
|
|
204
|
-
if (_optionalChain([config, 'access', _13 => _13.colors, 'optionalAccess', _14 => _14.base, 'optionalAccess', _15 => _15.light]) || _optionalChain([config, 'access', _16 => _16.colors, 'optionalAccess', _17 => _17.base, 'optionalAccess', _18 => _18.dark])) {
|
|
205
|
-
for (const key of Object.keys(config.colors)) {
|
|
206
|
-
setThemeColorsEnv(`${prefix}COLOR_${key}_`, config.colors[key]);
|
|
207
|
-
}
|
|
208
|
-
} else {
|
|
209
|
-
setThemeColorsEnv(
|
|
210
|
-
`${prefix}COLOR_`,
|
|
211
|
-
config.colors
|
|
212
|
-
);
|
|
213
|
-
}
|
|
214
|
-
if (config.repository) {
|
|
215
|
-
process.env[`${prefix}REPOSITORY`] = config.repository;
|
|
216
|
-
}
|
|
217
|
-
if (config.branch) {
|
|
218
|
-
process.env[`${prefix}BRANCH`] = config.branch;
|
|
219
|
-
}
|
|
220
|
-
if (config.preid) {
|
|
221
|
-
process.env[`${prefix}PRE_ID`] = String(config.preid);
|
|
222
|
-
}
|
|
223
|
-
if (config.registry) {
|
|
224
|
-
if (config.registry.github) {
|
|
225
|
-
process.env[`${prefix}REGISTRY_GITHUB`] = String(config.registry.github);
|
|
226
|
-
}
|
|
227
|
-
if (config.registry.npm) {
|
|
228
|
-
process.env[`${prefix}REGISTRY_NPM`] = String(config.registry.npm);
|
|
229
|
-
}
|
|
230
|
-
if (config.registry.cargo) {
|
|
231
|
-
process.env[`${prefix}REGISTRY_CARGO`] = String(config.registry.cargo);
|
|
232
|
-
}
|
|
233
|
-
if (config.registry.cyclone) {
|
|
234
|
-
process.env[`${prefix}REGISTRY_CYCLONE`] = String(
|
|
235
|
-
config.registry.cyclone
|
|
236
|
-
);
|
|
237
|
-
}
|
|
238
|
-
if (config.registry.container) {
|
|
239
|
-
process.env[`${prefix}REGISTRY_CONTAINER`] = String(
|
|
240
|
-
config.registry.container
|
|
241
|
-
);
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
if (config.logLevel) {
|
|
245
|
-
process.env[`${prefix}LOG_LEVEL`] = String(config.logLevel);
|
|
246
|
-
process.env.LOG_LEVEL = String(config.logLevel);
|
|
247
|
-
process.env.NX_VERBOSE_LOGGING = String(
|
|
248
|
-
_getloglevel.getLogLevel.call(void 0, config.logLevel) >= _types.LogLevel.DEBUG ? true : false
|
|
249
|
-
);
|
|
250
|
-
process.env.RUST_BACKTRACE = _getloglevel.getLogLevel.call(void 0, config.logLevel) >= _types.LogLevel.DEBUG ? "full" : "none";
|
|
251
|
-
}
|
|
252
|
-
if (config.skipConfigLogging !== void 0) {
|
|
253
|
-
process.env[`${prefix}SKIP_CONFIG_LOGGING`] = String(
|
|
254
|
-
config.skipConfigLogging
|
|
255
|
-
);
|
|
256
|
-
}
|
|
257
|
-
process.env[`${prefix}WORKSPACE_CONFIG`] = JSON.stringify(config);
|
|
258
|
-
for (const key of Object.keys(_nullishCoalesce(config.extensions, () => ( {})))) {
|
|
259
|
-
if (config.extensions[key] && Object.keys(config.extensions[key])) {
|
|
260
|
-
setExtensionEnv(key, config.extensions[key]);
|
|
261
|
-
}
|
|
262
|
-
}
|
|
30
|
+
const prefix = "STORM_";
|
|
31
|
+
if (config.extends) process.env[`${prefix}EXTENDS`] = Array.isArray(config.extends) ? JSON.stringify(config.extends) : config.extends;
|
|
32
|
+
if (config.name) process.env[`${prefix}NAME`] = config.name;
|
|
33
|
+
if (config.variant) process.env[`${prefix}VARIANT`] = config.variant;
|
|
34
|
+
if (config.namespace) process.env[`${prefix}NAMESPACE`] = config.namespace;
|
|
35
|
+
if (config.owner) process.env[`${prefix}OWNER`] = config.owner;
|
|
36
|
+
if (config.bot) {
|
|
37
|
+
process.env[`${prefix}BOT_NAME`] = config.bot.name;
|
|
38
|
+
process.env[`${prefix}BOT_EMAIL`] = config.bot.email;
|
|
39
|
+
}
|
|
40
|
+
if (config.error) {
|
|
41
|
+
process.env[`${prefix}ERROR_CODES_FILE`] = config.error.codesFile;
|
|
42
|
+
process.env[`${prefix}ERROR_URL`] = config.error.url;
|
|
43
|
+
}
|
|
44
|
+
if (config.release) {
|
|
45
|
+
if (config.release.banner) {
|
|
46
|
+
if (typeof config.release.banner === "string") {
|
|
47
|
+
process.env[`${prefix}RELEASE_BANNER`] = config.release.banner;
|
|
48
|
+
process.env[`${prefix}RELEASE_BANNER_URL`] = config.release.banner;
|
|
49
|
+
} else {
|
|
50
|
+
process.env[`${prefix}RELEASE_BANNER`] = config.release.banner.url;
|
|
51
|
+
process.env[`${prefix}RELEASE_BANNER_URL`] = config.release.banner.url;
|
|
52
|
+
process.env[`${prefix}RELEASE_BANNER_ALT`] = config.release.banner.alt;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
process.env[`${prefix}RELEASE_HEADER`] = config.release.header;
|
|
56
|
+
process.env[`${prefix}RELEASE_FOOTER`] = config.release.footer;
|
|
57
|
+
}
|
|
58
|
+
if (config.socials) {
|
|
59
|
+
if (config.socials.twitter) process.env[`${prefix}SOCIAL_TWITTER`] = config.socials.twitter;
|
|
60
|
+
if (config.socials.discord) process.env[`${prefix}SOCIAL_DISCORD`] = config.socials.discord;
|
|
61
|
+
if (config.socials.telegram) process.env[`${prefix}SOCIAL_TELEGRAM`] = config.socials.telegram;
|
|
62
|
+
if (config.socials.slack) process.env[`${prefix}SOCIAL_SLACK`] = config.socials.slack;
|
|
63
|
+
if (config.socials.medium) process.env[`${prefix}SOCIAL_MEDIUM`] = config.socials.medium;
|
|
64
|
+
if (config.socials.github) process.env[`${prefix}SOCIAL_GITHUB`] = config.socials.github;
|
|
65
|
+
}
|
|
66
|
+
if (config.organization) {
|
|
67
|
+
if (typeof config.organization === "string") {
|
|
68
|
+
process.env[`${prefix}ORG`] = config.organization;
|
|
69
|
+
process.env[`${prefix}ORG_NAME`] = config.organization;
|
|
70
|
+
process.env[`${prefix}ORGANIZATION`] = config.organization;
|
|
71
|
+
process.env[`${prefix}ORGANIZATION_NAME`] = config.organization;
|
|
72
|
+
} else {
|
|
73
|
+
process.env[`${prefix}ORG`] = config.organization.name;
|
|
74
|
+
process.env[`${prefix}ORG_NAME`] = config.organization.name;
|
|
75
|
+
process.env[`${prefix}ORGANIZATION`] = config.organization.name;
|
|
76
|
+
process.env[`${prefix}ORGANIZATION_NAME`] = config.organization.name;
|
|
77
|
+
if (config.organization.url) {
|
|
78
|
+
process.env[`${prefix}ORG_URL`] = config.organization.url;
|
|
79
|
+
process.env[`${prefix}ORGANIZATION_URL`] = config.organization.url;
|
|
80
|
+
}
|
|
81
|
+
if (config.organization.description) {
|
|
82
|
+
process.env[`${prefix}ORG_DESCRIPTION`] = config.organization.description;
|
|
83
|
+
process.env[`${prefix}ORGANIZATION_DESCRIPTION`] = config.organization.description;
|
|
84
|
+
}
|
|
85
|
+
if (config.organization.logo) {
|
|
86
|
+
process.env[`${prefix}ORG_LOGO`] = config.organization.logo;
|
|
87
|
+
process.env[`${prefix}ORGANIZATION_LOGO`] = config.organization.logo;
|
|
88
|
+
}
|
|
89
|
+
if (config.organization.icon) {
|
|
90
|
+
process.env[`${prefix}ORG_ICON`] = config.organization.icon;
|
|
91
|
+
process.env[`${prefix}ORGANIZATION_ICON`] = config.organization.icon;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
if (config.packageManager) process.env[`${prefix}PACKAGE_MANAGER`] = config.packageManager;
|
|
96
|
+
if (config.license) process.env[`${prefix}LICENSE`] = config.license;
|
|
97
|
+
if (config.homepage) process.env[`${prefix}HOMEPAGE`] = config.homepage;
|
|
98
|
+
if (config.docs) process.env[`${prefix}DOCS`] = config.docs;
|
|
99
|
+
if (config.portal) process.env[`${prefix}PORTAL`] = config.portal;
|
|
100
|
+
if (config.licensing) process.env[`${prefix}LICENSING`] = config.licensing;
|
|
101
|
+
if (config.contact) process.env[`${prefix}CONTACT`] = config.contact;
|
|
102
|
+
if (config.support) process.env[`${prefix}SUPPORT`] = config.support;
|
|
103
|
+
if (config.timezone) {
|
|
104
|
+
process.env[`${prefix}TIMEZONE`] = config.timezone;
|
|
105
|
+
process.env.TZ = config.timezone;
|
|
106
|
+
process.env.DEFAULT_TIMEZONE = config.timezone;
|
|
107
|
+
process.env.TIMEZONE = config.timezone;
|
|
108
|
+
}
|
|
109
|
+
if (config.locale) {
|
|
110
|
+
process.env[`${prefix}LOCALE`] = config.locale;
|
|
111
|
+
process.env.DEFAULT_LOCALE = config.locale;
|
|
112
|
+
process.env.LOCALE = config.locale;
|
|
113
|
+
process.env.LANG = config.locale ? `${config.locale.replaceAll("-", "_")}.UTF-8` : "en_US.UTF-8";
|
|
114
|
+
}
|
|
115
|
+
if (config.configFile) process.env[`${prefix}WORKSPACE_CONFIG_FILE`] = require_utilities_correct_paths.correctPaths(config.configFile);
|
|
116
|
+
if (config.workspaceRoot) {
|
|
117
|
+
process.env[`${prefix}WORKSPACE_ROOT`] = require_utilities_correct_paths.correctPaths(config.workspaceRoot);
|
|
118
|
+
process.env.NX_WORKSPACE_ROOT = require_utilities_correct_paths.correctPaths(config.workspaceRoot);
|
|
119
|
+
process.env.NX_WORKSPACE_ROOT_PATH = require_utilities_correct_paths.correctPaths(config.workspaceRoot);
|
|
120
|
+
}
|
|
121
|
+
if (config.directories) {
|
|
122
|
+
if (!config.skipCache && config.directories.cache) {
|
|
123
|
+
process.env[`${prefix}CACHE_DIR`] = require_utilities_correct_paths.correctPaths(config.directories.cache);
|
|
124
|
+
process.env[`${prefix}CACHE_DIRECTORY`] = process.env[`${prefix}CACHE_DIR`];
|
|
125
|
+
}
|
|
126
|
+
if (config.directories.data) {
|
|
127
|
+
process.env[`${prefix}DATA_DIR`] = require_utilities_correct_paths.correctPaths(config.directories.data);
|
|
128
|
+
process.env[`${prefix}DATA_DIRECTORY`] = process.env[`${prefix}DATA_DIR`];
|
|
129
|
+
}
|
|
130
|
+
if (config.directories.config) {
|
|
131
|
+
process.env[`${prefix}CONFIG_DIR`] = require_utilities_correct_paths.correctPaths(config.directories.config);
|
|
132
|
+
process.env[`${prefix}CONFIG_DIRECTORY`] = process.env[`${prefix}CONFIG_DIR`];
|
|
133
|
+
}
|
|
134
|
+
if (config.directories.temp) {
|
|
135
|
+
process.env[`${prefix}TEMP_DIR`] = require_utilities_correct_paths.correctPaths(config.directories.temp);
|
|
136
|
+
process.env[`${prefix}TEMP_DIRECTORY`] = process.env[`${prefix}TEMP_DIR`];
|
|
137
|
+
}
|
|
138
|
+
if (config.directories.log) {
|
|
139
|
+
process.env[`${prefix}LOG_DIR`] = require_utilities_correct_paths.correctPaths(config.directories.log);
|
|
140
|
+
process.env[`${prefix}LOG_DIRECTORY`] = process.env[`${prefix}LOG_DIR`];
|
|
141
|
+
}
|
|
142
|
+
if (config.directories.build) {
|
|
143
|
+
process.env[`${prefix}BUILD_DIR`] = require_utilities_correct_paths.correctPaths(config.directories.build);
|
|
144
|
+
process.env[`${prefix}BUILD_DIRECTORY`] = process.env[`${prefix}BUILD_DIR`];
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
if (config.skipCache !== void 0) {
|
|
148
|
+
process.env[`${prefix}SKIP_CACHE`] = String(config.skipCache);
|
|
149
|
+
if (config.skipCache) {
|
|
150
|
+
process.env.NX_SKIP_NX_CACHE ??= String(config.skipCache);
|
|
151
|
+
process.env.NX_CACHE_PROJECT_GRAPH ??= String(config.skipCache);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
if (config.mode) {
|
|
155
|
+
process.env[`${prefix}MODE`] = config.mode;
|
|
156
|
+
process.env.NODE_ENV = config.mode;
|
|
157
|
+
process.env.ENVIRONMENT = config.mode;
|
|
158
|
+
}
|
|
159
|
+
if (config.colors?.base?.light || config.colors?.base?.dark) for (const key of Object.keys(config.colors)) setThemeColorsEnv(`${prefix}COLOR_${key}_`, config.colors[key]);
|
|
160
|
+
else setThemeColorsEnv(`${prefix}COLOR_`, config.colors);
|
|
161
|
+
if (config.repository) process.env[`${prefix}REPOSITORY`] = config.repository;
|
|
162
|
+
if (config.branch) process.env[`${prefix}BRANCH`] = config.branch;
|
|
163
|
+
if (config.preid) process.env[`${prefix}PRE_ID`] = String(config.preid);
|
|
164
|
+
if (config.registry) {
|
|
165
|
+
if (config.registry.github) process.env[`${prefix}REGISTRY_GITHUB`] = String(config.registry.github);
|
|
166
|
+
if (config.registry.npm) process.env[`${prefix}REGISTRY_NPM`] = String(config.registry.npm);
|
|
167
|
+
if (config.registry.cargo) process.env[`${prefix}REGISTRY_CARGO`] = String(config.registry.cargo);
|
|
168
|
+
if (config.registry.cyclone) process.env[`${prefix}REGISTRY_CYCLONE`] = String(config.registry.cyclone);
|
|
169
|
+
if (config.registry.container) process.env[`${prefix}REGISTRY_CONTAINER`] = String(config.registry.container);
|
|
170
|
+
}
|
|
171
|
+
if (config.logLevel) {
|
|
172
|
+
process.env[`${prefix}LOG_LEVEL`] = String(config.logLevel);
|
|
173
|
+
process.env.LOG_LEVEL = String(config.logLevel);
|
|
174
|
+
process.env.NX_VERBOSE_LOGGING = String(require_logger_get_log_level.getLogLevel(config.logLevel) >= require_types.LogLevel.DEBUG ? true : false);
|
|
175
|
+
process.env.RUST_BACKTRACE = require_logger_get_log_level.getLogLevel(config.logLevel) >= require_types.LogLevel.DEBUG ? "full" : "none";
|
|
176
|
+
}
|
|
177
|
+
if (config.skipConfigLogging !== void 0) process.env[`${prefix}SKIP_CONFIG_LOGGING`] = String(config.skipConfigLogging);
|
|
178
|
+
process.env[`${prefix}WORKSPACE_CONFIG`] = JSON.stringify(config);
|
|
179
|
+
for (const key of Object.keys(config.extensions ?? {})) if (config.extensions[key] && Object.keys(config.extensions[key])) setExtensionEnv(key, config.extensions[key]);
|
|
263
180
|
};
|
|
264
181
|
const setThemeColorsEnv = (prefix, config) => {
|
|
265
|
-
|
|
182
|
+
return config?.light?.brand || config?.dark?.brand ? setMultiThemeColorsEnv(prefix, config) : setSingleThemeColorsEnv(prefix, config);
|
|
266
183
|
};
|
|
267
184
|
const setSingleThemeColorsEnv = (prefix, config) => {
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
}
|
|
286
|
-
if (config.discovery) {
|
|
287
|
-
process.env[`${prefix}DISCOVERY`] = config.discovery;
|
|
288
|
-
}
|
|
289
|
-
if (config.success) {
|
|
290
|
-
process.env[`${prefix}SUCCESS`] = config.success;
|
|
291
|
-
}
|
|
292
|
-
if (config.info) {
|
|
293
|
-
process.env[`${prefix}INFO`] = config.info;
|
|
294
|
-
}
|
|
295
|
-
if (config.debug) {
|
|
296
|
-
process.env[`${prefix}DEBUG`] = config.debug;
|
|
297
|
-
}
|
|
298
|
-
if (config.warning) {
|
|
299
|
-
process.env[`${prefix}WARNING`] = config.warning;
|
|
300
|
-
}
|
|
301
|
-
if (config.danger) {
|
|
302
|
-
process.env[`${prefix}DANGER`] = config.danger;
|
|
303
|
-
}
|
|
304
|
-
if (config.fatal) {
|
|
305
|
-
process.env[`${prefix}FATAL`] = config.fatal;
|
|
306
|
-
}
|
|
307
|
-
if (config.performance) {
|
|
308
|
-
process.env[`${prefix}PERFORMANCE`] = config.performance;
|
|
309
|
-
}
|
|
310
|
-
if (config.positive) {
|
|
311
|
-
process.env[`${prefix}POSITIVE`] = config.positive;
|
|
312
|
-
}
|
|
313
|
-
if (config.negative) {
|
|
314
|
-
process.env[`${prefix}NEGATIVE`] = config.negative;
|
|
315
|
-
}
|
|
316
|
-
if (config.gradient) {
|
|
317
|
-
for (let i = 0; i < config.gradient.length; i++) {
|
|
318
|
-
process.env[`${prefix}GRADIENT_${i}`] = config.gradient[i];
|
|
319
|
-
}
|
|
320
|
-
}
|
|
185
|
+
if (config.dark) process.env[`${prefix}DARK`] = config.dark;
|
|
186
|
+
if (config.light) process.env[`${prefix}LIGHT`] = config.light;
|
|
187
|
+
if (config.brand) process.env[`${prefix}BRAND`] = config.brand;
|
|
188
|
+
if (config.alternate) process.env[`${prefix}ALTERNATE`] = config.alternate;
|
|
189
|
+
if (config.accent) process.env[`${prefix}ACCENT`] = config.accent;
|
|
190
|
+
if (config.link) process.env[`${prefix}LINK`] = config.link;
|
|
191
|
+
if (config.discovery) process.env[`${prefix}DISCOVERY`] = config.discovery;
|
|
192
|
+
if (config.success) process.env[`${prefix}SUCCESS`] = config.success;
|
|
193
|
+
if (config.info) process.env[`${prefix}INFO`] = config.info;
|
|
194
|
+
if (config.debug) process.env[`${prefix}DEBUG`] = config.debug;
|
|
195
|
+
if (config.warning) process.env[`${prefix}WARNING`] = config.warning;
|
|
196
|
+
if (config.danger) process.env[`${prefix}DANGER`] = config.danger;
|
|
197
|
+
if (config.fatal) process.env[`${prefix}FATAL`] = config.fatal;
|
|
198
|
+
if (config.performance) process.env[`${prefix}PERFORMANCE`] = config.performance;
|
|
199
|
+
if (config.positive) process.env[`${prefix}POSITIVE`] = config.positive;
|
|
200
|
+
if (config.negative) process.env[`${prefix}NEGATIVE`] = config.negative;
|
|
201
|
+
if (config.gradient) for (let i = 0; i < config.gradient.length; i++) process.env[`${prefix}GRADIENT_${i}`] = config.gradient[i];
|
|
321
202
|
};
|
|
322
203
|
const setMultiThemeColorsEnv = (prefix, config) => {
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
204
|
+
return {
|
|
205
|
+
light: setBaseThemeColorsEnv(`${prefix}LIGHT_`, config.light),
|
|
206
|
+
dark: setBaseThemeColorsEnv(`${prefix}DARK_`, config.dark)
|
|
207
|
+
};
|
|
327
208
|
};
|
|
328
209
|
const setBaseThemeColorsEnv = (prefix, config) => {
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
}
|
|
347
|
-
if (config.discovery) {
|
|
348
|
-
process.env[`${prefix}DISCOVERY`] = config.discovery;
|
|
349
|
-
}
|
|
350
|
-
if (config.success) {
|
|
351
|
-
process.env[`${prefix}SUCCESS`] = config.success;
|
|
352
|
-
}
|
|
353
|
-
if (config.info) {
|
|
354
|
-
process.env[`${prefix}INFO`] = config.info;
|
|
355
|
-
}
|
|
356
|
-
if (config.debug) {
|
|
357
|
-
process.env[`${prefix}DEBUG`] = config.debug;
|
|
358
|
-
}
|
|
359
|
-
if (config.warning) {
|
|
360
|
-
process.env[`${prefix}WARNING`] = config.warning;
|
|
361
|
-
}
|
|
362
|
-
if (config.danger) {
|
|
363
|
-
process.env[`${prefix}DANGER`] = config.danger;
|
|
364
|
-
}
|
|
365
|
-
if (config.fatal) {
|
|
366
|
-
process.env[`${prefix}FATAL`] = config.fatal;
|
|
367
|
-
}
|
|
368
|
-
if (config.performance) {
|
|
369
|
-
process.env[`${prefix}PERFORMANCE`] = config.performance;
|
|
370
|
-
}
|
|
371
|
-
if (config.positive) {
|
|
372
|
-
process.env[`${prefix}POSITIVE`] = config.positive;
|
|
373
|
-
}
|
|
374
|
-
if (config.negative) {
|
|
375
|
-
process.env[`${prefix}NEGATIVE`] = config.negative;
|
|
376
|
-
}
|
|
377
|
-
if (config.gradient) {
|
|
378
|
-
for (let i = 0; i < config.gradient.length; i++) {
|
|
379
|
-
process.env[`${prefix}GRADIENT_${i}`] = config.gradient[i];
|
|
380
|
-
}
|
|
381
|
-
}
|
|
210
|
+
if (config.foreground) process.env[`${prefix}FOREGROUND`] = config.foreground;
|
|
211
|
+
if (config.background) process.env[`${prefix}BACKGROUND`] = config.background;
|
|
212
|
+
if (config.brand) process.env[`${prefix}BRAND`] = config.brand;
|
|
213
|
+
if (config.alternate) process.env[`${prefix}ALTERNATE`] = config.alternate;
|
|
214
|
+
if (config.accent) process.env[`${prefix}ACCENT`] = config.accent;
|
|
215
|
+
if (config.link) process.env[`${prefix}LINK`] = config.link;
|
|
216
|
+
if (config.discovery) process.env[`${prefix}DISCOVERY`] = config.discovery;
|
|
217
|
+
if (config.success) process.env[`${prefix}SUCCESS`] = config.success;
|
|
218
|
+
if (config.info) process.env[`${prefix}INFO`] = config.info;
|
|
219
|
+
if (config.debug) process.env[`${prefix}DEBUG`] = config.debug;
|
|
220
|
+
if (config.warning) process.env[`${prefix}WARNING`] = config.warning;
|
|
221
|
+
if (config.danger) process.env[`${prefix}DANGER`] = config.danger;
|
|
222
|
+
if (config.fatal) process.env[`${prefix}FATAL`] = config.fatal;
|
|
223
|
+
if (config.performance) process.env[`${prefix}PERFORMANCE`] = config.performance;
|
|
224
|
+
if (config.positive) process.env[`${prefix}POSITIVE`] = config.positive;
|
|
225
|
+
if (config.negative) process.env[`${prefix}NEGATIVE`] = config.negative;
|
|
226
|
+
if (config.gradient) for (let i = 0; i < config.gradient.length; i++) process.env[`${prefix}GRADIENT_${i}`] = config.gradient[i];
|
|
382
227
|
};
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
exports.setConfigEnv = setConfigEnv; exports.setExtensionEnv = setExtensionEnv;
|
|
228
|
+
//#endregion
|
|
229
|
+
exports.setConfigEnv = setConfigEnv;
|
|
230
|
+
exports.setExtensionEnv = setExtensionEnv;
|
package/dist/env/set-env.d.cts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { StormWorkspaceConfig } from
|
|
2
|
-
|
|
1
|
+
import { StormWorkspaceConfig } from "@storm-software/config";
|
|
2
|
+
//#region src/env/set-env.d.ts
|
|
3
3
|
declare global {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
4
|
+
namespace NodeJS {
|
|
5
|
+
interface ProcessEnv {
|
|
6
|
+
[key: string]: string | undefined;
|
|
8
7
|
}
|
|
8
|
+
}
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
11
|
* Get the config for an extension module of Storm workspace from environment variables
|
|
@@ -20,5 +20,5 @@ declare const setExtensionEnv: <TConfig extends Record<string, any> = Record<str
|
|
|
20
20
|
* @returns The config for the current Storm workspace from environment variables
|
|
21
21
|
*/
|
|
22
22
|
declare const setConfigEnv: (config: StormWorkspaceConfig) => void;
|
|
23
|
-
|
|
24
|
-
export { setConfigEnv, setExtensionEnv };
|
|
23
|
+
//#endregion
|
|
24
|
+
export { setConfigEnv, setExtensionEnv };
|