@storm-software/config-tools 1.148.3 → 1.149.0
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/dist/config-file/get-config-file.cjs +66 -22
- package/dist/config-file/get-config-file.js +65 -21
- package/dist/config-file/index.cjs +1 -27
- package/dist/config-file/index.js +1 -27
- package/dist/create-storm-config.cjs +68 -26
- package/dist/create-storm-config.js +67 -25
- package/dist/env/get-env.cjs +152 -9
- package/dist/env/get-env.js +151 -8
- package/dist/env/index.cjs +2 -20
- package/dist/env/index.js +2 -20
- package/dist/env/set-env.cjs +259 -8
- package/dist/env/set-env.js +258 -7
- package/dist/get-config.cjs +9 -25
- package/dist/get-config.js +9 -25
- package/dist/index.cjs +7 -171
- package/dist/index.js +7 -171
- package/dist/logger/chalk.cjs +30 -4
- package/dist/logger/chalk.js +29 -3
- package/dist/logger/console-icons.cjs +15 -5
- package/dist/logger/console-icons.js +15 -5
- package/dist/logger/console.cjs +126 -38
- package/dist/logger/console.js +112 -24
- package/dist/logger/create-logger.cjs +31 -16
- package/dist/logger/create-logger.js +30 -15
- package/dist/logger/format-timestamp.cjs +5 -3
- package/dist/logger/format-timestamp.js +5 -3
- package/dist/logger/get-log-level.cjs +56 -6
- package/dist/logger/get-log-level.js +56 -6
- package/dist/logger/index.cjs +7 -62
- package/dist/logger/index.js +7 -62
- package/dist/logger/is-unicode-supported.cjs +16 -4
- package/dist/logger/is-unicode-supported.js +15 -3
- package/dist/types.cjs +24 -6
- package/dist/types.js +22 -4
- package/dist/utilities/apply-workspace-tokens.cjs +55 -9
- package/dist/utilities/apply-workspace-tokens.js +54 -8
- package/dist/utilities/correct-paths.cjs +242 -33
- package/dist/utilities/correct-paths.js +225 -16
- package/dist/utilities/file-path-utils.cjs +18 -5
- package/dist/utilities/file-path-utils.js +17 -4
- package/dist/utilities/find-up.cjs +22 -4
- package/dist/utilities/find-up.js +21 -3
- package/dist/utilities/find-workspace-root.cjs +64 -7
- package/dist/utilities/find-workspace-root.js +63 -6
- package/dist/utilities/get-default-config.cjs +79 -8
- package/dist/utilities/get-default-config.js +79 -8
- package/dist/utilities/index.cjs +7 -85
- package/dist/utilities/index.js +7 -85
- package/dist/utilities/process-handler.cjs +35 -17
- package/dist/utilities/process-handler.js +35 -17
- package/dist/utilities/run.cjs +34 -6
- package/dist/utilities/run.js +33 -5
- package/package.json +1 -1
- package/dist/chunk-23WUCNWX.js +0 -142
- package/dist/chunk-2AVLCXLT.js +0 -0
- package/dist/chunk-2IKEUEGY.cjs +0 -94
- package/dist/chunk-3NWKPYIG.cjs +0 -68
- package/dist/chunk-4DLP6LZY.cjs +0 -65
- package/dist/chunk-65SWKEHV.cjs +0 -1
- package/dist/chunk-6OM23J4N.js +0 -65
- package/dist/chunk-6T3V5XJK.js +0 -180
- package/dist/chunk-7JBLPO7O.cjs +0 -168
- package/dist/chunk-7NSHGJWY.cjs +0 -12
- package/dist/chunk-7PV6L7I7.cjs +0 -1
- package/dist/chunk-BHZFTVXN.js +0 -42
- package/dist/chunk-C4RHWKK6.cjs +0 -142
- package/dist/chunk-CCO2PASC.js +0 -168
- package/dist/chunk-DD3HX2NX.cjs +0 -1
- package/dist/chunk-DD5UX56L.cjs +0 -272
- package/dist/chunk-FDJZUZKJ.js +0 -93
- package/dist/chunk-GS25DBTT.cjs +0 -93
- package/dist/chunk-GZFXEQPB.js +0 -94
- package/dist/chunk-HESFC24Z.cjs +0 -245
- package/dist/chunk-HI33NNPB.js +0 -68
- package/dist/chunk-HKZSDZZ4.cjs +0 -19
- package/dist/chunk-HSCCBYAV.js +0 -25
- package/dist/chunk-IRCFHYKZ.cjs +0 -28
- package/dist/chunk-IUT7Y2UY.js +0 -26
- package/dist/chunk-IWD6YQKX.cjs +0 -1
- package/dist/chunk-KNLWLA7O.cjs +0 -75
- package/dist/chunk-L6UNTUC4.js +0 -0
- package/dist/chunk-MLUBD3PU.js +0 -245
- package/dist/chunk-NJVL3GF4.js +0 -0
- package/dist/chunk-OIEEXHKO.js +0 -75
- package/dist/chunk-P7Q327IR.js +0 -272
- package/dist/chunk-POXTJ6GF.js +0 -28
- package/dist/chunk-PR7RQHRE.js +0 -12
- package/dist/chunk-Q7MMWMEN.js +0 -44
- package/dist/chunk-QBS3OCHH.js +0 -22
- package/dist/chunk-RRKB32OH.js +0 -0
- package/dist/chunk-RVM5N5ZI.cjs +0 -22
- package/dist/chunk-SLGVSUEV.cjs +0 -36
- package/dist/chunk-SVQE7WVB.cjs +0 -180
- package/dist/chunk-SWX2MJHI.cjs +0 -28
- package/dist/chunk-TZO4SYUO.cjs +0 -49
- package/dist/chunk-UZ5SHCFX.js +0 -49
- package/dist/chunk-WMWOH7LS.js +0 -79
- package/dist/chunk-XAJB3BSF.cjs +0 -25
- package/dist/chunk-XDBACKKN.cjs +0 -42
- package/dist/chunk-XIVRONKM.cjs +0 -44
- package/dist/chunk-XQPQRRG3.js +0 -28
- package/dist/chunk-XVIPFWZW.cjs +0 -79
- package/dist/chunk-XY2LDOQ4.cjs +0 -26
- package/dist/chunk-ZA4IO7YJ.js +0 -36
- package/dist/chunk-ZU6V7IRV.js +0 -19
package/dist/chunk-DD5UX56L.cjs
DELETED
|
@@ -1,272 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
-
|
|
3
|
-
var _chunkHESFC24Zcjs = require('./chunk-HESFC24Z.cjs');
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var _chunk3NWKPYIGcjs = require('./chunk-3NWKPYIG.cjs');
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _chunkIRCFHYKZcjs = require('./chunk-IRCFHYKZ.cjs');
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var _chunkUSNT2KNTcjs = require('./chunk-USNT2KNT.cjs');
|
|
13
|
-
|
|
14
|
-
// src/env/set-env.ts
|
|
15
|
-
var setExtensionEnv = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (extensionName, extension) => {
|
|
16
|
-
for (const key of Object.keys(_nullishCoalesce(extension, () => ( {})))) {
|
|
17
|
-
if (extension[key]) {
|
|
18
|
-
const result = _nullishCoalesce(_optionalChain([key, 'optionalAccess', _ => _.replace, 'call', _2 => _2(/([A-Z])+/g, (input) => input ? _optionalChain([input, 'access', _3 => _3[0], 'optionalAccess', _4 => _4.toUpperCase, 'call', _5 => _5()]) + input.slice(1) : ""), 'access', _6 => _6.split, 'call', _7 => _7(/(?=[A-Z])|[.\-\s_]/), 'access', _8 => _8.map, 'call', _9 => _9((x) => x.toLowerCase())]), () => ( []));
|
|
19
|
-
let extensionKey;
|
|
20
|
-
if (result.length === 0) {
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
if (result.length === 1) {
|
|
24
|
-
extensionKey = _nullishCoalesce(_optionalChain([result, 'access', _10 => _10[0], 'optionalAccess', _11 => _11.toUpperCase, 'call', _12 => _12()]), () => ( ""));
|
|
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
|
-
}, "setExtensionEnv");
|
|
34
|
-
var setConfigEnv = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (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.organization) {
|
|
53
|
-
process.env[`${prefix}ORGANIZATION`] = config.organization;
|
|
54
|
-
}
|
|
55
|
-
if (config.packageManager) {
|
|
56
|
-
process.env[`${prefix}PACKAGE_MANAGER`] = config.packageManager;
|
|
57
|
-
}
|
|
58
|
-
if (config.license) {
|
|
59
|
-
process.env[`${prefix}LICENSE`] = config.license;
|
|
60
|
-
}
|
|
61
|
-
if (config.homepage) {
|
|
62
|
-
process.env[`${prefix}HOMEPAGE`] = config.homepage;
|
|
63
|
-
}
|
|
64
|
-
if (config.docs) {
|
|
65
|
-
process.env[`${prefix}DOCS`] = config.docs;
|
|
66
|
-
}
|
|
67
|
-
if (config.licensing) {
|
|
68
|
-
process.env[`${prefix}LICENSING`] = config.licensing;
|
|
69
|
-
}
|
|
70
|
-
if (config.timezone) {
|
|
71
|
-
process.env[`${prefix}TIMEZONE`] = config.timezone;
|
|
72
|
-
process.env.TZ = config.timezone;
|
|
73
|
-
process.env.DEFAULT_TIMEZONE = config.timezone;
|
|
74
|
-
}
|
|
75
|
-
if (config.locale) {
|
|
76
|
-
process.env[`${prefix}LOCALE`] = config.locale;
|
|
77
|
-
process.env.LOCALE = config.locale;
|
|
78
|
-
process.env.DEFAULT_LOCALE = config.locale;
|
|
79
|
-
process.env.LANG = config.locale ? `${config.locale.replaceAll("-", "_")}.UTF-8` : "en_US.UTF-8";
|
|
80
|
-
}
|
|
81
|
-
if (config.configFile) {
|
|
82
|
-
process.env[`${prefix}CONFIG_FILE`] = _chunkHESFC24Zcjs.correctPaths.call(void 0, config.configFile);
|
|
83
|
-
}
|
|
84
|
-
if (config.workspaceRoot) {
|
|
85
|
-
process.env[`${prefix}WORKSPACE_ROOT`] = _chunkHESFC24Zcjs.correctPaths.call(void 0, config.workspaceRoot);
|
|
86
|
-
process.env.NX_WORKSPACE_ROOT = _chunkHESFC24Zcjs.correctPaths.call(void 0, config.workspaceRoot);
|
|
87
|
-
process.env.NX_WORKSPACE_ROOT_PATH = _chunkHESFC24Zcjs.correctPaths.call(void 0, config.workspaceRoot);
|
|
88
|
-
}
|
|
89
|
-
if (config.directories) {
|
|
90
|
-
if (!config.skipCache && config.directories.cache) {
|
|
91
|
-
process.env[`${prefix}CACHE_DIR`] = _chunkHESFC24Zcjs.correctPaths.call(void 0, config.directories.cache);
|
|
92
|
-
}
|
|
93
|
-
if (config.directories.data) {
|
|
94
|
-
process.env[`${prefix}DATA_DIR`] = _chunkHESFC24Zcjs.correctPaths.call(void 0, config.directories.data);
|
|
95
|
-
}
|
|
96
|
-
if (config.directories.config) {
|
|
97
|
-
process.env[`${prefix}CONFIG_DIR`] = _chunkHESFC24Zcjs.correctPaths.call(void 0, config.directories.config);
|
|
98
|
-
}
|
|
99
|
-
if (config.directories.temp) {
|
|
100
|
-
process.env[`${prefix}TEMP_DIR`] = _chunkHESFC24Zcjs.correctPaths.call(void 0, config.directories.temp);
|
|
101
|
-
}
|
|
102
|
-
if (config.directories.log) {
|
|
103
|
-
process.env[`${prefix}LOG_DIR`] = _chunkHESFC24Zcjs.correctPaths.call(void 0, config.directories.log);
|
|
104
|
-
}
|
|
105
|
-
if (config.directories.build) {
|
|
106
|
-
process.env[`${prefix}BUILD_DIR`] = _chunkHESFC24Zcjs.correctPaths.call(void 0, config.directories.build);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
if (config.skipCache !== void 0) {
|
|
110
|
-
process.env[`${prefix}SKIP_CACHE`] = String(config.skipCache);
|
|
111
|
-
if (config.skipCache) {
|
|
112
|
-
process.env.NX_SKIP_NX_CACHE ??= String(config.skipCache);
|
|
113
|
-
process.env.NX_CACHE_PROJECT_GRAPH ??= String(config.skipCache);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
if (config.env) {
|
|
117
|
-
process.env[`${prefix}ENV`] = config.env;
|
|
118
|
-
process.env.NODE_ENV = config.env;
|
|
119
|
-
process.env.ENVIRONMENT = config.env;
|
|
120
|
-
}
|
|
121
|
-
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])) {
|
|
122
|
-
for (const key of Object.keys(config.colors)) {
|
|
123
|
-
setThemeColorConfigEnv(`${prefix}COLOR_${key}_`, config.colors[key]);
|
|
124
|
-
}
|
|
125
|
-
} else {
|
|
126
|
-
setThemeColorConfigEnv(`${prefix}COLOR_`, config.colors);
|
|
127
|
-
}
|
|
128
|
-
if (config.repository) {
|
|
129
|
-
process.env[`${prefix}REPOSITORY`] = config.repository;
|
|
130
|
-
}
|
|
131
|
-
if (config.branch) {
|
|
132
|
-
process.env[`${prefix}BRANCH`] = config.branch;
|
|
133
|
-
}
|
|
134
|
-
if (config.preid) {
|
|
135
|
-
process.env[`${prefix}PRE_ID`] = String(config.preid);
|
|
136
|
-
}
|
|
137
|
-
if (config.externalPackagePatterns) {
|
|
138
|
-
process.env[`${prefix}EXTERNAL_PACKAGE_PATTERNS`] = JSON.stringify(config.externalPackagePatterns);
|
|
139
|
-
}
|
|
140
|
-
if (config.registry) {
|
|
141
|
-
if (config.registry.github) {
|
|
142
|
-
process.env[`${prefix}REGISTRY_GITHUB`] = String(config.registry.github);
|
|
143
|
-
}
|
|
144
|
-
if (config.registry.npm) {
|
|
145
|
-
process.env[`${prefix}REGISTRY_NPM`] = String(config.registry.npm);
|
|
146
|
-
}
|
|
147
|
-
if (config.registry.cargo) {
|
|
148
|
-
process.env[`${prefix}REGISTRY_CARGO`] = String(config.registry.cargo);
|
|
149
|
-
}
|
|
150
|
-
if (config.registry.cyclone) {
|
|
151
|
-
process.env[`${prefix}REGISTRY_CYCLONE`] = String(config.registry.cyclone);
|
|
152
|
-
}
|
|
153
|
-
if (config.registry.container) {
|
|
154
|
-
process.env[`${prefix}REGISTRY_CONTAINER`] = String(config.registry.cyclone);
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
if (config.logLevel) {
|
|
158
|
-
process.env[`${prefix}LOG_LEVEL`] = String(config.logLevel);
|
|
159
|
-
process.env.LOG_LEVEL = String(config.logLevel);
|
|
160
|
-
process.env.NX_VERBOSE_LOGGING = String(_chunk3NWKPYIGcjs.getLogLevel.call(void 0, config.logLevel) >= _chunkIRCFHYKZcjs.LogLevel.DEBUG ? true : false);
|
|
161
|
-
process.env.RUST_BACKTRACE = _chunk3NWKPYIGcjs.getLogLevel.call(void 0, config.logLevel) >= _chunkIRCFHYKZcjs.LogLevel.DEBUG ? "full" : "none";
|
|
162
|
-
}
|
|
163
|
-
if (config.skipConfigLogging !== void 0) {
|
|
164
|
-
process.env[`${prefix}SKIP_CONFIG_LOGGING`] = String(config.skipConfigLogging);
|
|
165
|
-
}
|
|
166
|
-
process.env[`${prefix}CONFIG`] = JSON.stringify(config);
|
|
167
|
-
for (const key of Object.keys(_nullishCoalesce(config.extensions, () => ( {})))) {
|
|
168
|
-
config.extensions[key] && Object.keys(config.extensions[key]) && setExtensionEnv(key, config.extensions[key]);
|
|
169
|
-
}
|
|
170
|
-
}, "setConfigEnv");
|
|
171
|
-
var setThemeColorConfigEnv = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (prefix, config) => {
|
|
172
|
-
return _optionalChain([config, 'optionalAccess', _19 => _19.light, 'optionalAccess', _20 => _20.brand]) || _optionalChain([config, 'optionalAccess', _21 => _21.dark, 'optionalAccess', _22 => _22.brand]) ? setMultiThemeColorConfigEnv(prefix, config) : setSingleThemeColorConfigEnv(prefix, config);
|
|
173
|
-
}, "setThemeColorConfigEnv");
|
|
174
|
-
var setSingleThemeColorConfigEnv = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (prefix, config) => {
|
|
175
|
-
if (config.dark) {
|
|
176
|
-
process.env[`${prefix}DARK`] = config.dark;
|
|
177
|
-
}
|
|
178
|
-
if (config.light) {
|
|
179
|
-
process.env[`${prefix}LIGHT`] = config.light;
|
|
180
|
-
}
|
|
181
|
-
if (config.brand) {
|
|
182
|
-
process.env[`${prefix}BRAND`] = config.brand;
|
|
183
|
-
}
|
|
184
|
-
if (config.alternate) {
|
|
185
|
-
process.env[`${prefix}ALTERNATE`] = config.alternate;
|
|
186
|
-
}
|
|
187
|
-
if (config.accent) {
|
|
188
|
-
process.env[`${prefix}ACCENT`] = config.accent;
|
|
189
|
-
}
|
|
190
|
-
if (config.link) {
|
|
191
|
-
process.env[`${prefix}LINK`] = config.link;
|
|
192
|
-
}
|
|
193
|
-
if (config.help) {
|
|
194
|
-
process.env[`${prefix}HELP`] = config.help;
|
|
195
|
-
}
|
|
196
|
-
if (config.success) {
|
|
197
|
-
process.env[`${prefix}SUCCESS`] = config.success;
|
|
198
|
-
}
|
|
199
|
-
if (config.info) {
|
|
200
|
-
process.env[`${prefix}INFO`] = config.info;
|
|
201
|
-
}
|
|
202
|
-
if (config.warning) {
|
|
203
|
-
process.env[`${prefix}WARNING`] = config.warning;
|
|
204
|
-
}
|
|
205
|
-
if (config.danger) {
|
|
206
|
-
process.env[`${prefix}DANGER`] = config.danger;
|
|
207
|
-
}
|
|
208
|
-
if (config.fatal) {
|
|
209
|
-
process.env[`${prefix}FATAL`] = config.fatal;
|
|
210
|
-
}
|
|
211
|
-
if (config.positive) {
|
|
212
|
-
process.env[`${prefix}POSITIVE`] = config.positive;
|
|
213
|
-
}
|
|
214
|
-
if (config.negative) {
|
|
215
|
-
process.env[`${prefix}NEGATIVE`] = config.negative;
|
|
216
|
-
}
|
|
217
|
-
}, "setSingleThemeColorConfigEnv");
|
|
218
|
-
var setMultiThemeColorConfigEnv = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (prefix, config) => {
|
|
219
|
-
return {
|
|
220
|
-
light: setBaseThemeColorConfigEnv(`${prefix}LIGHT_`, config.light),
|
|
221
|
-
dark: setBaseThemeColorConfigEnv(`${prefix}DARK_`, config.dark)
|
|
222
|
-
};
|
|
223
|
-
}, "setMultiThemeColorConfigEnv");
|
|
224
|
-
var setBaseThemeColorConfigEnv = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (prefix, config) => {
|
|
225
|
-
if (config.foreground) {
|
|
226
|
-
process.env[`${prefix}FOREGROUND`] = config.foreground;
|
|
227
|
-
}
|
|
228
|
-
if (config.background) {
|
|
229
|
-
process.env[`${prefix}BACKGROUND`] = config.background;
|
|
230
|
-
}
|
|
231
|
-
if (config.brand) {
|
|
232
|
-
process.env[`${prefix}BRAND`] = config.brand;
|
|
233
|
-
}
|
|
234
|
-
if (config.alternate) {
|
|
235
|
-
process.env[`${prefix}ALTERNATE`] = config.alternate;
|
|
236
|
-
}
|
|
237
|
-
if (config.accent) {
|
|
238
|
-
process.env[`${prefix}ACCENT`] = config.accent;
|
|
239
|
-
}
|
|
240
|
-
if (config.link) {
|
|
241
|
-
process.env[`${prefix}LINK`] = config.link;
|
|
242
|
-
}
|
|
243
|
-
if (config.help) {
|
|
244
|
-
process.env[`${prefix}HELP`] = config.help;
|
|
245
|
-
}
|
|
246
|
-
if (config.success) {
|
|
247
|
-
process.env[`${prefix}SUCCESS`] = config.success;
|
|
248
|
-
}
|
|
249
|
-
if (config.info) {
|
|
250
|
-
process.env[`${prefix}INFO`] = config.info;
|
|
251
|
-
}
|
|
252
|
-
if (config.warning) {
|
|
253
|
-
process.env[`${prefix}WARNING`] = config.warning;
|
|
254
|
-
}
|
|
255
|
-
if (config.danger) {
|
|
256
|
-
process.env[`${prefix}DANGER`] = config.danger;
|
|
257
|
-
}
|
|
258
|
-
if (config.fatal) {
|
|
259
|
-
process.env[`${prefix}FATAL`] = config.fatal;
|
|
260
|
-
}
|
|
261
|
-
if (config.positive) {
|
|
262
|
-
process.env[`${prefix}POSITIVE`] = config.positive;
|
|
263
|
-
}
|
|
264
|
-
if (config.negative) {
|
|
265
|
-
process.env[`${prefix}NEGATIVE`] = config.negative;
|
|
266
|
-
}
|
|
267
|
-
}, "setBaseThemeColorConfigEnv");
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
exports.setExtensionEnv = setExtensionEnv; exports.setConfigEnv = setConfigEnv;
|
package/dist/chunk-FDJZUZKJ.js
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getConfigFile
|
|
3
|
-
} from "./chunk-WMWOH7LS.js";
|
|
4
|
-
import {
|
|
5
|
-
formatLogMessage,
|
|
6
|
-
writeTrace,
|
|
7
|
-
writeWarning
|
|
8
|
-
} from "./chunk-23WUCNWX.js";
|
|
9
|
-
import {
|
|
10
|
-
getDefaultConfig
|
|
11
|
-
} from "./chunk-GZFXEQPB.js";
|
|
12
|
-
import {
|
|
13
|
-
findWorkspaceRoot
|
|
14
|
-
} from "./chunk-OIEEXHKO.js";
|
|
15
|
-
import {
|
|
16
|
-
setConfigEnv
|
|
17
|
-
} from "./chunk-P7Q327IR.js";
|
|
18
|
-
import {
|
|
19
|
-
getConfigEnv,
|
|
20
|
-
getExtensionEnv
|
|
21
|
-
} from "./chunk-CCO2PASC.js";
|
|
22
|
-
import {
|
|
23
|
-
StormConfigSchema
|
|
24
|
-
} from "./chunk-6T3V5XJK.js";
|
|
25
|
-
import {
|
|
26
|
-
__name
|
|
27
|
-
} from "./chunk-SHUYVCID.js";
|
|
28
|
-
|
|
29
|
-
// src/create-storm-config.ts
|
|
30
|
-
import defu from "defu";
|
|
31
|
-
var _extension_cache = /* @__PURE__ */ new WeakMap();
|
|
32
|
-
var _static_cache = void 0;
|
|
33
|
-
var createStormConfig = /* @__PURE__ */ __name(async (extensionName, schema, workspaceRoot, skipLogs = false) => {
|
|
34
|
-
let result;
|
|
35
|
-
if (!_static_cache?.data || !_static_cache?.timestamp || _static_cache.timestamp < Date.now() - 8e3) {
|
|
36
|
-
let _workspaceRoot = workspaceRoot;
|
|
37
|
-
if (!_workspaceRoot) {
|
|
38
|
-
_workspaceRoot = findWorkspaceRoot();
|
|
39
|
-
}
|
|
40
|
-
const configEnv = getConfigEnv();
|
|
41
|
-
const defaultConfig = await getDefaultConfig(_workspaceRoot);
|
|
42
|
-
const configFile = await getConfigFile(_workspaceRoot);
|
|
43
|
-
if (!configFile && !skipLogs) {
|
|
44
|
-
writeWarning("No Storm Workspace configuration file found in the current repository. Please ensure this is the expected behavior - you can add a `storm-workspace.json` file to the root of your workspace if it is not.\n", {
|
|
45
|
-
logLevel: "all"
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
result = await StormConfigSchema.parseAsync(defu(configEnv, configFile, defaultConfig));
|
|
49
|
-
result.workspaceRoot ??= _workspaceRoot;
|
|
50
|
-
} else {
|
|
51
|
-
result = _static_cache.data;
|
|
52
|
-
}
|
|
53
|
-
if (schema && extensionName) {
|
|
54
|
-
result.extensions = {
|
|
55
|
-
...result.extensions,
|
|
56
|
-
[extensionName]: createConfigExtension(extensionName, schema)
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
_static_cache = {
|
|
60
|
-
timestamp: Date.now(),
|
|
61
|
-
data: result
|
|
62
|
-
};
|
|
63
|
-
return result;
|
|
64
|
-
}, "createStormConfig");
|
|
65
|
-
var createConfigExtension = /* @__PURE__ */ __name((extensionName, schema) => {
|
|
66
|
-
const extension_cache_key = {
|
|
67
|
-
extensionName
|
|
68
|
-
};
|
|
69
|
-
if (_extension_cache.has(extension_cache_key)) {
|
|
70
|
-
return _extension_cache.get(extension_cache_key);
|
|
71
|
-
}
|
|
72
|
-
let extension = getExtensionEnv(extensionName);
|
|
73
|
-
if (schema) {
|
|
74
|
-
extension = schema.parse(extension);
|
|
75
|
-
}
|
|
76
|
-
_extension_cache.set(extension_cache_key, extension);
|
|
77
|
-
return extension;
|
|
78
|
-
}, "createConfigExtension");
|
|
79
|
-
var loadStormConfig = /* @__PURE__ */ __name(async (workspaceRoot, skipLogs = false) => {
|
|
80
|
-
const config = await createStormConfig(void 0, void 0, workspaceRoot, skipLogs);
|
|
81
|
-
setConfigEnv(config);
|
|
82
|
-
if (!skipLogs && !config.skipConfigLogging) {
|
|
83
|
-
writeTrace(`\u2699\uFE0F Using Storm Workspace configuration:
|
|
84
|
-
${formatLogMessage(config)}`, config);
|
|
85
|
-
}
|
|
86
|
-
return config;
|
|
87
|
-
}, "loadStormConfig");
|
|
88
|
-
|
|
89
|
-
export {
|
|
90
|
-
createStormConfig,
|
|
91
|
-
createConfigExtension,
|
|
92
|
-
loadStormConfig
|
|
93
|
-
};
|
package/dist/chunk-GS25DBTT.cjs
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
-
|
|
3
|
-
var _chunkXVIPFWZWcjs = require('./chunk-XVIPFWZW.cjs');
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var _chunkC4RHWKK6cjs = require('./chunk-C4RHWKK6.cjs');
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var _chunk2IKEUEGYcjs = require('./chunk-2IKEUEGY.cjs');
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var _chunkKNLWLA7Ocjs = require('./chunk-KNLWLA7O.cjs');
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
var _chunkDD5UX56Lcjs = require('./chunk-DD5UX56L.cjs');
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
var _chunk7JBLPO7Ocjs = require('./chunk-7JBLPO7O.cjs');
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
var _chunkSVQE7WVBcjs = require('./chunk-SVQE7WVB.cjs');
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
var _chunkUSNT2KNTcjs = require('./chunk-USNT2KNT.cjs');
|
|
28
|
-
|
|
29
|
-
// src/create-storm-config.ts
|
|
30
|
-
var _defu = require('defu'); var _defu2 = _interopRequireDefault(_defu);
|
|
31
|
-
var _extension_cache = /* @__PURE__ */ new WeakMap();
|
|
32
|
-
var _static_cache = void 0;
|
|
33
|
-
var createStormConfig = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async (extensionName, schema, workspaceRoot, skipLogs = false) => {
|
|
34
|
-
let result;
|
|
35
|
-
if (!_optionalChain([_static_cache, 'optionalAccess', _ => _.data]) || !_optionalChain([_static_cache, 'optionalAccess', _2 => _2.timestamp]) || _static_cache.timestamp < Date.now() - 8e3) {
|
|
36
|
-
let _workspaceRoot = workspaceRoot;
|
|
37
|
-
if (!_workspaceRoot) {
|
|
38
|
-
_workspaceRoot = _chunkKNLWLA7Ocjs.findWorkspaceRoot.call(void 0, );
|
|
39
|
-
}
|
|
40
|
-
const configEnv = _chunk7JBLPO7Ocjs.getConfigEnv.call(void 0, );
|
|
41
|
-
const defaultConfig = await _chunk2IKEUEGYcjs.getDefaultConfig.call(void 0, _workspaceRoot);
|
|
42
|
-
const configFile = await _chunkXVIPFWZWcjs.getConfigFile.call(void 0, _workspaceRoot);
|
|
43
|
-
if (!configFile && !skipLogs) {
|
|
44
|
-
_chunkC4RHWKK6cjs.writeWarning.call(void 0, "No Storm Workspace configuration file found in the current repository. Please ensure this is the expected behavior - you can add a `storm-workspace.json` file to the root of your workspace if it is not.\n", {
|
|
45
|
-
logLevel: "all"
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
result = await _chunkSVQE7WVBcjs.StormConfigSchema.parseAsync(_defu2.default.call(void 0, configEnv, configFile, defaultConfig));
|
|
49
|
-
result.workspaceRoot ??= _workspaceRoot;
|
|
50
|
-
} else {
|
|
51
|
-
result = _static_cache.data;
|
|
52
|
-
}
|
|
53
|
-
if (schema && extensionName) {
|
|
54
|
-
result.extensions = {
|
|
55
|
-
...result.extensions,
|
|
56
|
-
[extensionName]: createConfigExtension(extensionName, schema)
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
_static_cache = {
|
|
60
|
-
timestamp: Date.now(),
|
|
61
|
-
data: result
|
|
62
|
-
};
|
|
63
|
-
return result;
|
|
64
|
-
}, "createStormConfig");
|
|
65
|
-
var createConfigExtension = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (extensionName, schema) => {
|
|
66
|
-
const extension_cache_key = {
|
|
67
|
-
extensionName
|
|
68
|
-
};
|
|
69
|
-
if (_extension_cache.has(extension_cache_key)) {
|
|
70
|
-
return _extension_cache.get(extension_cache_key);
|
|
71
|
-
}
|
|
72
|
-
let extension = _chunk7JBLPO7Ocjs.getExtensionEnv.call(void 0, extensionName);
|
|
73
|
-
if (schema) {
|
|
74
|
-
extension = schema.parse(extension);
|
|
75
|
-
}
|
|
76
|
-
_extension_cache.set(extension_cache_key, extension);
|
|
77
|
-
return extension;
|
|
78
|
-
}, "createConfigExtension");
|
|
79
|
-
var loadStormConfig = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async (workspaceRoot, skipLogs = false) => {
|
|
80
|
-
const config = await createStormConfig(void 0, void 0, workspaceRoot, skipLogs);
|
|
81
|
-
_chunkDD5UX56Lcjs.setConfigEnv.call(void 0, config);
|
|
82
|
-
if (!skipLogs && !config.skipConfigLogging) {
|
|
83
|
-
_chunkC4RHWKK6cjs.writeTrace.call(void 0, `\u2699\uFE0F Using Storm Workspace configuration:
|
|
84
|
-
${_chunkC4RHWKK6cjs.formatLogMessage.call(void 0, config)}`, config);
|
|
85
|
-
}
|
|
86
|
-
return config;
|
|
87
|
-
}, "loadStormConfig");
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
exports.createStormConfig = createStormConfig; exports.createConfigExtension = createConfigExtension; exports.loadStormConfig = loadStormConfig;
|
package/dist/chunk-GZFXEQPB.js
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
findWorkspaceRoot
|
|
3
|
-
} from "./chunk-OIEEXHKO.js";
|
|
4
|
-
import {
|
|
5
|
-
STORM_DEFAULT_HOMEPAGE,
|
|
6
|
-
STORM_DEFAULT_LICENSE
|
|
7
|
-
} from "./chunk-6T3V5XJK.js";
|
|
8
|
-
import {
|
|
9
|
-
joinPaths
|
|
10
|
-
} from "./chunk-MLUBD3PU.js";
|
|
11
|
-
import {
|
|
12
|
-
__name
|
|
13
|
-
} from "./chunk-SHUYVCID.js";
|
|
14
|
-
|
|
15
|
-
// src/utilities/get-default-config.ts
|
|
16
|
-
import { existsSync } from "node:fs";
|
|
17
|
-
import { readFile } from "node:fs/promises";
|
|
18
|
-
import { join } from "node:path";
|
|
19
|
-
var DEFAULT_COLOR_CONFIG = {
|
|
20
|
-
"light": {
|
|
21
|
-
"background": "#fafafa",
|
|
22
|
-
"foreground": "#1d1e22",
|
|
23
|
-
"brand": "#1fb2a6",
|
|
24
|
-
"alternate": "#db2777",
|
|
25
|
-
"help": "#5C4EE5",
|
|
26
|
-
"success": "#087f5b",
|
|
27
|
-
"info": "#0550ae",
|
|
28
|
-
"warning": "#e3b341",
|
|
29
|
-
"danger": "#D8314A",
|
|
30
|
-
"positive": "#22c55e",
|
|
31
|
-
"negative": "#dc2626"
|
|
32
|
-
},
|
|
33
|
-
"dark": {
|
|
34
|
-
"background": "#1d1e22",
|
|
35
|
-
"foreground": "#cbd5e1",
|
|
36
|
-
"brand": "#2dd4bf",
|
|
37
|
-
"alternate": "#db2777",
|
|
38
|
-
"help": "#818cf8",
|
|
39
|
-
"success": "#10b981",
|
|
40
|
-
"info": "#58a6ff",
|
|
41
|
-
"warning": "#f3d371",
|
|
42
|
-
"danger": "#D8314A",
|
|
43
|
-
"positive": "#22c55e",
|
|
44
|
-
"negative": "#dc2626"
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
var getDefaultConfig = /* @__PURE__ */ __name(async (root) => {
|
|
48
|
-
let license = STORM_DEFAULT_LICENSE;
|
|
49
|
-
let homepage = STORM_DEFAULT_HOMEPAGE;
|
|
50
|
-
let name = void 0;
|
|
51
|
-
let namespace = void 0;
|
|
52
|
-
let repository = void 0;
|
|
53
|
-
const workspaceRoot = findWorkspaceRoot(root);
|
|
54
|
-
if (existsSync(join(workspaceRoot, "package.json"))) {
|
|
55
|
-
const file = await readFile(joinPaths(workspaceRoot, "package.json"), "utf8");
|
|
56
|
-
if (file) {
|
|
57
|
-
const packageJson = JSON.parse(file);
|
|
58
|
-
if (packageJson.name) {
|
|
59
|
-
name = packageJson.name;
|
|
60
|
-
}
|
|
61
|
-
if (packageJson.namespace) {
|
|
62
|
-
namespace = packageJson.namespace;
|
|
63
|
-
}
|
|
64
|
-
if (packageJson.repository) {
|
|
65
|
-
if (typeof packageJson.repository === "string") {
|
|
66
|
-
repository = packageJson.repository;
|
|
67
|
-
} else if (packageJson.repository.url) {
|
|
68
|
-
repository = packageJson.repository.url;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
if (packageJson.license) {
|
|
72
|
-
license = packageJson.license;
|
|
73
|
-
}
|
|
74
|
-
if (packageJson.homepage) {
|
|
75
|
-
homepage = packageJson.homepage;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
return {
|
|
80
|
-
workspaceRoot,
|
|
81
|
-
name,
|
|
82
|
-
namespace,
|
|
83
|
-
repository,
|
|
84
|
-
license,
|
|
85
|
-
homepage,
|
|
86
|
-
docs: `${homepage || STORM_DEFAULT_HOMEPAGE}/docs`,
|
|
87
|
-
licensing: `${homepage || STORM_DEFAULT_HOMEPAGE}/license`
|
|
88
|
-
};
|
|
89
|
-
}, "getDefaultConfig");
|
|
90
|
-
|
|
91
|
-
export {
|
|
92
|
-
DEFAULT_COLOR_CONFIG,
|
|
93
|
-
getDefaultConfig
|
|
94
|
-
};
|