@storm-software/config-tools 1.150.5 → 1.150.9
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/README.md +1 -1
- package/bin/config.cjs +14795 -283
- package/bin/config.js +14806 -266
- package/dist/chunk-2MY3KGBB.cjs +70 -0
- package/dist/chunk-322YBAWX.js +6 -0
- package/dist/chunk-3BGF4LNL.cjs +67 -0
- package/dist/chunk-3OZGKUMC.js +1120 -0
- package/dist/chunk-4CTFS6DM.js +143 -0
- package/dist/chunk-4YA7DJB5.cjs +451 -0
- package/dist/chunk-56RY3KW7.cjs +6 -0
- package/dist/chunk-5LYWI7E7.cjs +49 -0
- package/dist/chunk-5SDU662B.js +274 -0
- package/dist/chunk-5XAQKBRL.js +510 -0
- package/dist/chunk-6JG5O6FD.js +2645 -0
- package/dist/chunk-6R6FJLKT.cjs +84 -0
- package/dist/chunk-6ZPVROB4.js +51 -0
- package/dist/chunk-73C3QB67.js +27 -0
- package/dist/chunk-77YC3XPW.js +9228 -0
- package/dist/chunk-7PDFNXOV.js +67 -0
- package/dist/chunk-B2HXAAFT.cjs +274 -0
- package/dist/chunk-BKJUQIEL.cjs +6 -0
- package/dist/chunk-CHYZZRN6.cjs +165 -0
- package/dist/chunk-CUX3BOLK.cjs +6 -0
- package/dist/chunk-DYTSQ3L3.js +14 -0
- package/dist/chunk-E554LMEP.cjs +28 -0
- package/dist/chunk-FUALBFYR.cjs +247 -0
- package/dist/chunk-FZMUKCM5.js +50 -0
- package/dist/chunk-G62PQROD.cjs +510 -0
- package/dist/chunk-GJDVCWVL.cjs +27 -0
- package/dist/chunk-GZ6SGFYZ.cjs +2645 -0
- package/dist/chunk-HAYTD5F2.js +247 -0
- package/dist/chunk-HBJSM6VU.js +6 -0
- package/dist/chunk-HLB4MOTZ.js +6 -0
- package/dist/chunk-HUMXKKE6.js +765 -0
- package/dist/chunk-HVVHVCVH.js +24 -0
- package/dist/chunk-I2LFMHGF.cjs +14 -0
- package/dist/chunk-I5FJ2QOS.js +84 -0
- package/dist/chunk-IYMLNFGA.cjs +33 -0
- package/dist/chunk-JN37L7NL.js +33 -0
- package/dist/chunk-JVONSFJS.cjs +765 -0
- package/dist/chunk-KN7POPML.cjs +21 -0
- package/dist/chunk-KONO4OMT.cjs +9231 -0
- package/dist/chunk-KQLERSRE.js +93 -0
- package/dist/chunk-KXHNOCVY.cjs +24 -0
- package/dist/chunk-LAIQ2Z5B.cjs +93 -0
- package/dist/chunk-LUQRLSMI.js +6 -0
- package/dist/chunk-M3KQNO7N.cjs +93 -0
- package/dist/chunk-MJL6D7T3.js +28 -0
- package/dist/chunk-MKB5GTL4.js +451 -0
- package/dist/chunk-MMMRCNC6.js +77 -0
- package/dist/chunk-NERZUU47.js +93 -0
- package/dist/chunk-NVXMXDZM.js +70 -0
- package/dist/chunk-NWFS53UA.js +21 -0
- package/dist/chunk-PBEGXSGU.js +165 -0
- package/dist/chunk-PMRCDW2Q.cjs +44 -0
- package/dist/chunk-RDWCJD4I.cjs +30 -0
- package/dist/chunk-RN5XBSCX.cjs +77 -0
- package/dist/chunk-TJ7RSPG3.cjs +6 -0
- package/dist/chunk-US52HP52.cjs +143 -0
- package/dist/chunk-UXYX4UF4.cjs +50 -0
- package/dist/chunk-W7YJIINP.js +49 -0
- package/dist/chunk-WTHXS4H2.js +44 -0
- package/dist/chunk-X3T2GC65.cjs +51 -0
- package/dist/chunk-XUGBUGHC.cjs +1120 -0
- package/dist/chunk-YO6XHACG.js +30 -0
- package/dist/config-file/get-config-file.cjs +26 -66
- package/dist/config-file/get-config-file.js +25 -65
- package/dist/config-file/index.cjs +31 -1
- package/dist/config-file/index.js +31 -1
- package/dist/create-storm-config.cjs +30 -68
- package/dist/create-storm-config.js +29 -67
- package/dist/env/get-env.cjs +8 -152
- package/dist/env/get-env.js +7 -151
- package/dist/env/index.cjs +19 -2
- package/dist/env/index.js +19 -2
- package/dist/env/set-env.cjs +8 -259
- package/dist/env/set-env.js +7 -258
- package/dist/esm-HKV66HQZ.js +1716 -0
- package/dist/esm-TZUWSATN.cjs +1716 -0
- package/dist/get-config.cjs +29 -9
- package/dist/get-config.js +29 -9
- package/dist/index.cjs +180 -7
- package/dist/index.js +180 -7
- package/dist/json5-NI4CISQP.cjs +10 -0
- package/dist/json5-XMK3UBET.js +10 -0
- package/dist/jsonc-GYGN4BMZ.js +15 -0
- package/dist/jsonc-TDL6NXBV.cjs +15 -0
- package/dist/logger/chalk.cjs +4 -30
- package/dist/logger/chalk.js +3 -29
- package/dist/logger/console-icons.cjs +5 -15
- package/dist/logger/console-icons.js +5 -15
- package/dist/logger/console.cjs +37 -125
- package/dist/logger/console.js +23 -111
- package/dist/logger/create-logger.cjs +15 -31
- package/dist/logger/create-logger.js +14 -30
- package/dist/logger/format-timestamp.cjs +3 -5
- package/dist/logger/format-timestamp.js +3 -5
- package/dist/logger/get-log-level.cjs +6 -56
- package/dist/logger/get-log-level.js +6 -56
- package/dist/logger/index.cjs +61 -7
- package/dist/logger/index.js +61 -7
- package/dist/logger/is-unicode-supported.cjs +4 -16
- package/dist/logger/is-unicode-supported.js +3 -15
- package/dist/toml-5NX5FGDD.cjs +10 -0
- package/dist/toml-ZYXFVZLI.js +10 -0
- package/dist/types.cjs +6 -24
- package/dist/types.js +5 -23
- package/dist/utilities/apply-workspace-tokens.cjs +9 -55
- package/dist/utilities/apply-workspace-tokens.js +8 -54
- package/dist/utilities/correct-paths.cjs +33 -242
- package/dist/utilities/correct-paths.js +16 -225
- package/dist/utilities/file-path-utils.cjs +5 -18
- package/dist/utilities/file-path-utils.js +4 -17
- package/dist/utilities/find-up.cjs +4 -22
- package/dist/utilities/find-up.js +3 -21
- package/dist/utilities/find-workspace-root.cjs +7 -64
- package/dist/utilities/find-workspace-root.js +6 -63
- package/dist/utilities/get-default-config.cjs +7 -79
- package/dist/utilities/get-default-config.js +7 -79
- package/dist/utilities/index.cjs +84 -7
- package/dist/utilities/index.js +84 -7
- package/dist/utilities/process-handler.cjs +16 -35
- package/dist/utilities/process-handler.js +16 -35
- package/dist/utilities/run.cjs +6 -34
- package/dist/utilities/run.js +5 -33
- package/dist/yaml-GRT7ORXT.cjs +10 -0
- package/dist/yaml-WD4DF2QH.js +10 -0
- package/package.json +7 -4
- package/dist/chunk-SHUYVCID.js +0 -6
- package/dist/chunk-USNT2KNT.cjs +0 -6
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
import {
|
|
2
|
+
correctPaths
|
|
3
|
+
} from "./chunk-HAYTD5F2.js";
|
|
4
|
+
import {
|
|
5
|
+
getLogLevel
|
|
6
|
+
} from "./chunk-NVXMXDZM.js";
|
|
7
|
+
import {
|
|
8
|
+
LogLevel
|
|
9
|
+
} from "./chunk-JN37L7NL.js";
|
|
10
|
+
import {
|
|
11
|
+
__name,
|
|
12
|
+
init_esm_shims
|
|
13
|
+
} from "./chunk-W7YJIINP.js";
|
|
14
|
+
|
|
15
|
+
// src/env/set-env.ts
|
|
16
|
+
init_esm_shims();
|
|
17
|
+
var setExtensionEnv = /* @__PURE__ */ __name((extensionName, extension) => {
|
|
18
|
+
for (const key of Object.keys(extension ?? {})) {
|
|
19
|
+
if (extension[key]) {
|
|
20
|
+
const result = key?.replace(/([A-Z])+/g, (input) => input ? input[0]?.toUpperCase() + input.slice(1) : "").split(/(?=[A-Z])|[.\-\s_]/).map((x) => x.toLowerCase()) ?? [];
|
|
21
|
+
let extensionKey;
|
|
22
|
+
if (result.length === 0) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
if (result.length === 1) {
|
|
26
|
+
extensionKey = result[0]?.toUpperCase() ?? "";
|
|
27
|
+
} else {
|
|
28
|
+
extensionKey = result.reduce((ret, part) => {
|
|
29
|
+
return `${ret}_${part.toLowerCase()}`;
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
process.env[`STORM_EXTENSION_${extensionName.toUpperCase()}_${extensionKey.toUpperCase()}`] = extension[key];
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}, "setExtensionEnv");
|
|
36
|
+
var setConfigEnv = /* @__PURE__ */ __name((config) => {
|
|
37
|
+
const prefix = "STORM_";
|
|
38
|
+
if (config.extends) {
|
|
39
|
+
process.env[`${prefix}EXTENDS`] = Array.isArray(config.extends) ? JSON.stringify(config.extends) : config.extends;
|
|
40
|
+
}
|
|
41
|
+
if (config.name) {
|
|
42
|
+
process.env[`${prefix}NAME`] = config.name;
|
|
43
|
+
}
|
|
44
|
+
if (config.namespace) {
|
|
45
|
+
process.env[`${prefix}NAMESPACE`] = config.namespace;
|
|
46
|
+
}
|
|
47
|
+
if (config.owner) {
|
|
48
|
+
process.env[`${prefix}OWNER`] = config.owner;
|
|
49
|
+
}
|
|
50
|
+
if (config.bot) {
|
|
51
|
+
process.env[`${prefix}BOT_NAME`] = config.bot.name;
|
|
52
|
+
process.env[`${prefix}BOT_EMAIL`] = config.bot.email;
|
|
53
|
+
}
|
|
54
|
+
if (config.organization) {
|
|
55
|
+
process.env[`${prefix}ORGANIZATION`] = config.organization;
|
|
56
|
+
}
|
|
57
|
+
if (config.packageManager) {
|
|
58
|
+
process.env[`${prefix}PACKAGE_MANAGER`] = config.packageManager;
|
|
59
|
+
}
|
|
60
|
+
if (config.license) {
|
|
61
|
+
process.env[`${prefix}LICENSE`] = config.license;
|
|
62
|
+
}
|
|
63
|
+
if (config.homepage) {
|
|
64
|
+
process.env[`${prefix}HOMEPAGE`] = config.homepage;
|
|
65
|
+
}
|
|
66
|
+
if (config.docs) {
|
|
67
|
+
process.env[`${prefix}DOCS`] = config.docs;
|
|
68
|
+
}
|
|
69
|
+
if (config.licensing) {
|
|
70
|
+
process.env[`${prefix}LICENSING`] = config.licensing;
|
|
71
|
+
}
|
|
72
|
+
if (config.timezone) {
|
|
73
|
+
process.env[`${prefix}TIMEZONE`] = config.timezone;
|
|
74
|
+
process.env.TZ = config.timezone;
|
|
75
|
+
process.env.DEFAULT_TIMEZONE = config.timezone;
|
|
76
|
+
}
|
|
77
|
+
if (config.locale) {
|
|
78
|
+
process.env[`${prefix}LOCALE`] = config.locale;
|
|
79
|
+
process.env.LOCALE = config.locale;
|
|
80
|
+
process.env.DEFAULT_LOCALE = config.locale;
|
|
81
|
+
process.env.LANG = config.locale ? `${config.locale.replaceAll("-", "_")}.UTF-8` : "en_US.UTF-8";
|
|
82
|
+
}
|
|
83
|
+
if (config.configFile) {
|
|
84
|
+
process.env[`${prefix}CONFIG_FILE`] = correctPaths(config.configFile);
|
|
85
|
+
}
|
|
86
|
+
if (config.workspaceRoot) {
|
|
87
|
+
process.env[`${prefix}WORKSPACE_ROOT`] = correctPaths(config.workspaceRoot);
|
|
88
|
+
process.env.NX_WORKSPACE_ROOT = correctPaths(config.workspaceRoot);
|
|
89
|
+
process.env.NX_WORKSPACE_ROOT_PATH = correctPaths(config.workspaceRoot);
|
|
90
|
+
}
|
|
91
|
+
if (config.directories) {
|
|
92
|
+
if (!config.skipCache && config.directories.cache) {
|
|
93
|
+
process.env[`${prefix}CACHE_DIR`] = correctPaths(config.directories.cache);
|
|
94
|
+
}
|
|
95
|
+
if (config.directories.data) {
|
|
96
|
+
process.env[`${prefix}DATA_DIR`] = correctPaths(config.directories.data);
|
|
97
|
+
}
|
|
98
|
+
if (config.directories.config) {
|
|
99
|
+
process.env[`${prefix}CONFIG_DIR`] = correctPaths(config.directories.config);
|
|
100
|
+
}
|
|
101
|
+
if (config.directories.temp) {
|
|
102
|
+
process.env[`${prefix}TEMP_DIR`] = correctPaths(config.directories.temp);
|
|
103
|
+
}
|
|
104
|
+
if (config.directories.log) {
|
|
105
|
+
process.env[`${prefix}LOG_DIR`] = correctPaths(config.directories.log);
|
|
106
|
+
}
|
|
107
|
+
if (config.directories.build) {
|
|
108
|
+
process.env[`${prefix}BUILD_DIR`] = correctPaths(config.directories.build);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
if (config.skipCache !== void 0) {
|
|
112
|
+
process.env[`${prefix}SKIP_CACHE`] = String(config.skipCache);
|
|
113
|
+
if (config.skipCache) {
|
|
114
|
+
process.env.NX_SKIP_NX_CACHE ??= String(config.skipCache);
|
|
115
|
+
process.env.NX_CACHE_PROJECT_GRAPH ??= String(config.skipCache);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
if (config.env) {
|
|
119
|
+
process.env[`${prefix}ENV`] = config.env;
|
|
120
|
+
process.env.NODE_ENV = config.env;
|
|
121
|
+
process.env.ENVIRONMENT = config.env;
|
|
122
|
+
}
|
|
123
|
+
if (config.colors?.base?.light || config.colors?.base?.dark) {
|
|
124
|
+
for (const key of Object.keys(config.colors)) {
|
|
125
|
+
setThemeColorConfigEnv(`${prefix}COLOR_${key}_`, config.colors[key]);
|
|
126
|
+
}
|
|
127
|
+
} else {
|
|
128
|
+
setThemeColorConfigEnv(`${prefix}COLOR_`, config.colors);
|
|
129
|
+
}
|
|
130
|
+
if (config.repository) {
|
|
131
|
+
process.env[`${prefix}REPOSITORY`] = config.repository;
|
|
132
|
+
}
|
|
133
|
+
if (config.branch) {
|
|
134
|
+
process.env[`${prefix}BRANCH`] = config.branch;
|
|
135
|
+
}
|
|
136
|
+
if (config.preid) {
|
|
137
|
+
process.env[`${prefix}PRE_ID`] = String(config.preid);
|
|
138
|
+
}
|
|
139
|
+
if (config.externalPackagePatterns) {
|
|
140
|
+
process.env[`${prefix}EXTERNAL_PACKAGE_PATTERNS`] = JSON.stringify(config.externalPackagePatterns);
|
|
141
|
+
}
|
|
142
|
+
if (config.registry) {
|
|
143
|
+
if (config.registry.github) {
|
|
144
|
+
process.env[`${prefix}REGISTRY_GITHUB`] = String(config.registry.github);
|
|
145
|
+
}
|
|
146
|
+
if (config.registry.npm) {
|
|
147
|
+
process.env[`${prefix}REGISTRY_NPM`] = String(config.registry.npm);
|
|
148
|
+
}
|
|
149
|
+
if (config.registry.cargo) {
|
|
150
|
+
process.env[`${prefix}REGISTRY_CARGO`] = String(config.registry.cargo);
|
|
151
|
+
}
|
|
152
|
+
if (config.registry.cyclone) {
|
|
153
|
+
process.env[`${prefix}REGISTRY_CYCLONE`] = String(config.registry.cyclone);
|
|
154
|
+
}
|
|
155
|
+
if (config.registry.container) {
|
|
156
|
+
process.env[`${prefix}REGISTRY_CONTAINER`] = String(config.registry.cyclone);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
if (config.logLevel) {
|
|
160
|
+
process.env[`${prefix}LOG_LEVEL`] = String(config.logLevel);
|
|
161
|
+
process.env.LOG_LEVEL = String(config.logLevel);
|
|
162
|
+
process.env.NX_VERBOSE_LOGGING = String(getLogLevel(config.logLevel) >= LogLevel.DEBUG ? true : false);
|
|
163
|
+
process.env.RUST_BACKTRACE = getLogLevel(config.logLevel) >= LogLevel.DEBUG ? "full" : "none";
|
|
164
|
+
}
|
|
165
|
+
if (config.skipConfigLogging !== void 0) {
|
|
166
|
+
process.env[`${prefix}SKIP_CONFIG_LOGGING`] = String(config.skipConfigLogging);
|
|
167
|
+
}
|
|
168
|
+
process.env[`${prefix}CONFIG`] = JSON.stringify(config);
|
|
169
|
+
for (const key of Object.keys(config.extensions ?? {})) {
|
|
170
|
+
config.extensions[key] && Object.keys(config.extensions[key]) && setExtensionEnv(key, config.extensions[key]);
|
|
171
|
+
}
|
|
172
|
+
}, "setConfigEnv");
|
|
173
|
+
var setThemeColorConfigEnv = /* @__PURE__ */ __name((prefix, config) => {
|
|
174
|
+
return config?.light?.brand || config?.dark?.brand ? setMultiThemeColorConfigEnv(prefix, config) : setSingleThemeColorConfigEnv(prefix, config);
|
|
175
|
+
}, "setThemeColorConfigEnv");
|
|
176
|
+
var setSingleThemeColorConfigEnv = /* @__PURE__ */ __name((prefix, config) => {
|
|
177
|
+
if (config.dark) {
|
|
178
|
+
process.env[`${prefix}DARK`] = config.dark;
|
|
179
|
+
}
|
|
180
|
+
if (config.light) {
|
|
181
|
+
process.env[`${prefix}LIGHT`] = config.light;
|
|
182
|
+
}
|
|
183
|
+
if (config.brand) {
|
|
184
|
+
process.env[`${prefix}BRAND`] = config.brand;
|
|
185
|
+
}
|
|
186
|
+
if (config.alternate) {
|
|
187
|
+
process.env[`${prefix}ALTERNATE`] = config.alternate;
|
|
188
|
+
}
|
|
189
|
+
if (config.accent) {
|
|
190
|
+
process.env[`${prefix}ACCENT`] = config.accent;
|
|
191
|
+
}
|
|
192
|
+
if (config.link) {
|
|
193
|
+
process.env[`${prefix}LINK`] = config.link;
|
|
194
|
+
}
|
|
195
|
+
if (config.help) {
|
|
196
|
+
process.env[`${prefix}HELP`] = config.help;
|
|
197
|
+
}
|
|
198
|
+
if (config.success) {
|
|
199
|
+
process.env[`${prefix}SUCCESS`] = config.success;
|
|
200
|
+
}
|
|
201
|
+
if (config.info) {
|
|
202
|
+
process.env[`${prefix}INFO`] = config.info;
|
|
203
|
+
}
|
|
204
|
+
if (config.warning) {
|
|
205
|
+
process.env[`${prefix}WARNING`] = config.warning;
|
|
206
|
+
}
|
|
207
|
+
if (config.danger) {
|
|
208
|
+
process.env[`${prefix}DANGER`] = config.danger;
|
|
209
|
+
}
|
|
210
|
+
if (config.fatal) {
|
|
211
|
+
process.env[`${prefix}FATAL`] = config.fatal;
|
|
212
|
+
}
|
|
213
|
+
if (config.positive) {
|
|
214
|
+
process.env[`${prefix}POSITIVE`] = config.positive;
|
|
215
|
+
}
|
|
216
|
+
if (config.negative) {
|
|
217
|
+
process.env[`${prefix}NEGATIVE`] = config.negative;
|
|
218
|
+
}
|
|
219
|
+
}, "setSingleThemeColorConfigEnv");
|
|
220
|
+
var setMultiThemeColorConfigEnv = /* @__PURE__ */ __name((prefix, config) => {
|
|
221
|
+
return {
|
|
222
|
+
light: setBaseThemeColorConfigEnv(`${prefix}LIGHT_`, config.light),
|
|
223
|
+
dark: setBaseThemeColorConfigEnv(`${prefix}DARK_`, config.dark)
|
|
224
|
+
};
|
|
225
|
+
}, "setMultiThemeColorConfigEnv");
|
|
226
|
+
var setBaseThemeColorConfigEnv = /* @__PURE__ */ __name((prefix, config) => {
|
|
227
|
+
if (config.foreground) {
|
|
228
|
+
process.env[`${prefix}FOREGROUND`] = config.foreground;
|
|
229
|
+
}
|
|
230
|
+
if (config.background) {
|
|
231
|
+
process.env[`${prefix}BACKGROUND`] = config.background;
|
|
232
|
+
}
|
|
233
|
+
if (config.brand) {
|
|
234
|
+
process.env[`${prefix}BRAND`] = config.brand;
|
|
235
|
+
}
|
|
236
|
+
if (config.alternate) {
|
|
237
|
+
process.env[`${prefix}ALTERNATE`] = config.alternate;
|
|
238
|
+
}
|
|
239
|
+
if (config.accent) {
|
|
240
|
+
process.env[`${prefix}ACCENT`] = config.accent;
|
|
241
|
+
}
|
|
242
|
+
if (config.link) {
|
|
243
|
+
process.env[`${prefix}LINK`] = config.link;
|
|
244
|
+
}
|
|
245
|
+
if (config.help) {
|
|
246
|
+
process.env[`${prefix}HELP`] = config.help;
|
|
247
|
+
}
|
|
248
|
+
if (config.success) {
|
|
249
|
+
process.env[`${prefix}SUCCESS`] = config.success;
|
|
250
|
+
}
|
|
251
|
+
if (config.info) {
|
|
252
|
+
process.env[`${prefix}INFO`] = config.info;
|
|
253
|
+
}
|
|
254
|
+
if (config.warning) {
|
|
255
|
+
process.env[`${prefix}WARNING`] = config.warning;
|
|
256
|
+
}
|
|
257
|
+
if (config.danger) {
|
|
258
|
+
process.env[`${prefix}DANGER`] = config.danger;
|
|
259
|
+
}
|
|
260
|
+
if (config.fatal) {
|
|
261
|
+
process.env[`${prefix}FATAL`] = config.fatal;
|
|
262
|
+
}
|
|
263
|
+
if (config.positive) {
|
|
264
|
+
process.env[`${prefix}POSITIVE`] = config.positive;
|
|
265
|
+
}
|
|
266
|
+
if (config.negative) {
|
|
267
|
+
process.env[`${prefix}NEGATIVE`] = config.negative;
|
|
268
|
+
}
|
|
269
|
+
}, "setBaseThemeColorConfigEnv");
|
|
270
|
+
|
|
271
|
+
export {
|
|
272
|
+
setExtensionEnv,
|
|
273
|
+
setConfigEnv
|
|
274
|
+
};
|