@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.js
DELETED
|
@@ -1,386 +0,0 @@
|
|
|
1
|
-
import { getLogLevel } from "../logger/get-log-level";
|
|
2
|
-
import { LogLevel } from "../types";
|
|
3
|
-
import { correctPaths } from "../utilities/correct-paths";
|
|
4
|
-
const setExtensionEnv = (extensionName, extension) => {
|
|
5
|
-
for (const key of Object.keys(extension ?? {})) {
|
|
6
|
-
if (extension[key]) {
|
|
7
|
-
const result = key?.replace(
|
|
8
|
-
/([A-Z])+/g,
|
|
9
|
-
(input) => input ? input[0]?.toUpperCase() + input.slice(1) : ""
|
|
10
|
-
).split(/(?=[A-Z])|[.\-\s_]/).map((x) => x.toLowerCase()) ?? [];
|
|
11
|
-
let extensionKey;
|
|
12
|
-
if (result.length === 0) {
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
if (result.length === 1) {
|
|
16
|
-
extensionKey = result[0]?.toUpperCase() ?? "";
|
|
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
|
-
}
|
|
25
|
-
};
|
|
26
|
-
const setConfigEnv = (config) => {
|
|
27
|
-
const prefix = "STORM_";
|
|
28
|
-
if (config.extends) {
|
|
29
|
-
process.env[`${prefix}EXTENDS`] = Array.isArray(config.extends) ? JSON.stringify(config.extends) : config.extends;
|
|
30
|
-
}
|
|
31
|
-
if (config.name) {
|
|
32
|
-
process.env[`${prefix}NAME`] = config.name;
|
|
33
|
-
}
|
|
34
|
-
if (config.variant) {
|
|
35
|
-
process.env[`${prefix}VARIANT`] = config.variant;
|
|
36
|
-
}
|
|
37
|
-
if (config.namespace) {
|
|
38
|
-
process.env[`${prefix}NAMESPACE`] = config.namespace;
|
|
39
|
-
}
|
|
40
|
-
if (config.owner) {
|
|
41
|
-
process.env[`${prefix}OWNER`] = config.owner;
|
|
42
|
-
}
|
|
43
|
-
if (config.bot) {
|
|
44
|
-
process.env[`${prefix}BOT_NAME`] = config.bot.name;
|
|
45
|
-
process.env[`${prefix}BOT_EMAIL`] = config.bot.email;
|
|
46
|
-
}
|
|
47
|
-
if (config.error) {
|
|
48
|
-
process.env[`${prefix}ERROR_CODES_FILE`] = config.error.codesFile;
|
|
49
|
-
process.env[`${prefix}ERROR_URL`] = config.error.url;
|
|
50
|
-
}
|
|
51
|
-
if (config.release) {
|
|
52
|
-
if (config.release.banner) {
|
|
53
|
-
if (typeof config.release.banner === "string") {
|
|
54
|
-
process.env[`${prefix}RELEASE_BANNER`] = config.release.banner;
|
|
55
|
-
process.env[`${prefix}RELEASE_BANNER_URL`] = config.release.banner;
|
|
56
|
-
} else {
|
|
57
|
-
process.env[`${prefix}RELEASE_BANNER`] = config.release.banner.url;
|
|
58
|
-
process.env[`${prefix}RELEASE_BANNER_URL`] = config.release.banner.url;
|
|
59
|
-
process.env[`${prefix}RELEASE_BANNER_ALT`] = config.release.banner.alt;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
process.env[`${prefix}RELEASE_HEADER`] = config.release.header;
|
|
63
|
-
process.env[`${prefix}RELEASE_FOOTER`] = config.release.footer;
|
|
64
|
-
}
|
|
65
|
-
if (config.socials) {
|
|
66
|
-
if (config.socials.twitter) {
|
|
67
|
-
process.env[`${prefix}SOCIAL_TWITTER`] = config.socials.twitter;
|
|
68
|
-
}
|
|
69
|
-
if (config.socials.discord) {
|
|
70
|
-
process.env[`${prefix}SOCIAL_DISCORD`] = config.socials.discord;
|
|
71
|
-
}
|
|
72
|
-
if (config.socials.telegram) {
|
|
73
|
-
process.env[`${prefix}SOCIAL_TELEGRAM`] = config.socials.telegram;
|
|
74
|
-
}
|
|
75
|
-
if (config.socials.slack) {
|
|
76
|
-
process.env[`${prefix}SOCIAL_SLACK`] = config.socials.slack;
|
|
77
|
-
}
|
|
78
|
-
if (config.socials.medium) {
|
|
79
|
-
process.env[`${prefix}SOCIAL_MEDIUM`] = config.socials.medium;
|
|
80
|
-
}
|
|
81
|
-
if (config.socials.github) {
|
|
82
|
-
process.env[`${prefix}SOCIAL_GITHUB`] = config.socials.github;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
if (config.organization) {
|
|
86
|
-
if (typeof config.organization === "string") {
|
|
87
|
-
process.env[`${prefix}ORG`] = config.organization;
|
|
88
|
-
process.env[`${prefix}ORG_NAME`] = config.organization;
|
|
89
|
-
process.env[`${prefix}ORGANIZATION`] = config.organization;
|
|
90
|
-
process.env[`${prefix}ORGANIZATION_NAME`] = config.organization;
|
|
91
|
-
} else {
|
|
92
|
-
process.env[`${prefix}ORG`] = config.organization.name;
|
|
93
|
-
process.env[`${prefix}ORG_NAME`] = config.organization.name;
|
|
94
|
-
process.env[`${prefix}ORGANIZATION`] = config.organization.name;
|
|
95
|
-
process.env[`${prefix}ORGANIZATION_NAME`] = config.organization.name;
|
|
96
|
-
if (config.organization.url) {
|
|
97
|
-
process.env[`${prefix}ORG_URL`] = config.organization.url;
|
|
98
|
-
process.env[`${prefix}ORGANIZATION_URL`] = config.organization.url;
|
|
99
|
-
}
|
|
100
|
-
if (config.organization.description) {
|
|
101
|
-
process.env[`${prefix}ORG_DESCRIPTION`] = config.organization.description;
|
|
102
|
-
process.env[`${prefix}ORGANIZATION_DESCRIPTION`] = config.organization.description;
|
|
103
|
-
}
|
|
104
|
-
if (config.organization.logo) {
|
|
105
|
-
process.env[`${prefix}ORG_LOGO`] = config.organization.logo;
|
|
106
|
-
process.env[`${prefix}ORGANIZATION_LOGO`] = config.organization.logo;
|
|
107
|
-
}
|
|
108
|
-
if (config.organization.icon) {
|
|
109
|
-
process.env[`${prefix}ORG_ICON`] = config.organization.icon;
|
|
110
|
-
process.env[`${prefix}ORGANIZATION_ICON`] = config.organization.icon;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
if (config.packageManager) {
|
|
115
|
-
process.env[`${prefix}PACKAGE_MANAGER`] = config.packageManager;
|
|
116
|
-
}
|
|
117
|
-
if (config.license) {
|
|
118
|
-
process.env[`${prefix}LICENSE`] = config.license;
|
|
119
|
-
}
|
|
120
|
-
if (config.homepage) {
|
|
121
|
-
process.env[`${prefix}HOMEPAGE`] = config.homepage;
|
|
122
|
-
}
|
|
123
|
-
if (config.docs) {
|
|
124
|
-
process.env[`${prefix}DOCS`] = config.docs;
|
|
125
|
-
}
|
|
126
|
-
if (config.portal) {
|
|
127
|
-
process.env[`${prefix}PORTAL`] = config.portal;
|
|
128
|
-
}
|
|
129
|
-
if (config.licensing) {
|
|
130
|
-
process.env[`${prefix}LICENSING`] = config.licensing;
|
|
131
|
-
}
|
|
132
|
-
if (config.contact) {
|
|
133
|
-
process.env[`${prefix}CONTACT`] = config.contact;
|
|
134
|
-
}
|
|
135
|
-
if (config.support) {
|
|
136
|
-
process.env[`${prefix}SUPPORT`] = config.support;
|
|
137
|
-
}
|
|
138
|
-
if (config.timezone) {
|
|
139
|
-
process.env[`${prefix}TIMEZONE`] = config.timezone;
|
|
140
|
-
process.env.TZ = config.timezone;
|
|
141
|
-
process.env.DEFAULT_TIMEZONE = config.timezone;
|
|
142
|
-
process.env.TIMEZONE = config.timezone;
|
|
143
|
-
}
|
|
144
|
-
if (config.locale) {
|
|
145
|
-
process.env[`${prefix}LOCALE`] = config.locale;
|
|
146
|
-
process.env.DEFAULT_LOCALE = config.locale;
|
|
147
|
-
process.env.LOCALE = config.locale;
|
|
148
|
-
process.env.LANG = config.locale ? `${config.locale.replaceAll("-", "_")}.UTF-8` : "en_US.UTF-8";
|
|
149
|
-
}
|
|
150
|
-
if (config.configFile) {
|
|
151
|
-
process.env[`${prefix}WORKSPACE_CONFIG_FILE`] = correctPaths(
|
|
152
|
-
config.configFile
|
|
153
|
-
);
|
|
154
|
-
}
|
|
155
|
-
if (config.workspaceRoot) {
|
|
156
|
-
process.env[`${prefix}WORKSPACE_ROOT`] = correctPaths(config.workspaceRoot);
|
|
157
|
-
process.env.NX_WORKSPACE_ROOT = correctPaths(config.workspaceRoot);
|
|
158
|
-
process.env.NX_WORKSPACE_ROOT_PATH = correctPaths(config.workspaceRoot);
|
|
159
|
-
}
|
|
160
|
-
if (config.directories) {
|
|
161
|
-
if (!config.skipCache && config.directories.cache) {
|
|
162
|
-
process.env[`${prefix}CACHE_DIR`] = correctPaths(
|
|
163
|
-
config.directories.cache
|
|
164
|
-
);
|
|
165
|
-
process.env[`${prefix}CACHE_DIRECTORY`] = process.env[`${prefix}CACHE_DIR`];
|
|
166
|
-
}
|
|
167
|
-
if (config.directories.data) {
|
|
168
|
-
process.env[`${prefix}DATA_DIR`] = correctPaths(config.directories.data);
|
|
169
|
-
process.env[`${prefix}DATA_DIRECTORY`] = process.env[`${prefix}DATA_DIR`];
|
|
170
|
-
}
|
|
171
|
-
if (config.directories.config) {
|
|
172
|
-
process.env[`${prefix}CONFIG_DIR`] = correctPaths(
|
|
173
|
-
config.directories.config
|
|
174
|
-
);
|
|
175
|
-
process.env[`${prefix}CONFIG_DIRECTORY`] = process.env[`${prefix}CONFIG_DIR`];
|
|
176
|
-
}
|
|
177
|
-
if (config.directories.temp) {
|
|
178
|
-
process.env[`${prefix}TEMP_DIR`] = correctPaths(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(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(
|
|
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 (config.colors?.base?.light || config.colors?.base?.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(config.logLevel) >= LogLevel.DEBUG ? true : false
|
|
249
|
-
);
|
|
250
|
-
process.env.RUST_BACKTRACE = getLogLevel(config.logLevel) >= 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(config.extensions ?? {})) {
|
|
259
|
-
if (config.extensions[key] && Object.keys(config.extensions[key])) {
|
|
260
|
-
setExtensionEnv(key, config.extensions[key]);
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
};
|
|
264
|
-
const setThemeColorsEnv = (prefix, config) => {
|
|
265
|
-
return config?.light?.brand || config?.dark?.brand ? setMultiThemeColorsEnv(prefix, config) : setSingleThemeColorsEnv(prefix, config);
|
|
266
|
-
};
|
|
267
|
-
const setSingleThemeColorsEnv = (prefix, config) => {
|
|
268
|
-
if (config.dark) {
|
|
269
|
-
process.env[`${prefix}DARK`] = config.dark;
|
|
270
|
-
}
|
|
271
|
-
if (config.light) {
|
|
272
|
-
process.env[`${prefix}LIGHT`] = config.light;
|
|
273
|
-
}
|
|
274
|
-
if (config.brand) {
|
|
275
|
-
process.env[`${prefix}BRAND`] = config.brand;
|
|
276
|
-
}
|
|
277
|
-
if (config.alternate) {
|
|
278
|
-
process.env[`${prefix}ALTERNATE`] = config.alternate;
|
|
279
|
-
}
|
|
280
|
-
if (config.accent) {
|
|
281
|
-
process.env[`${prefix}ACCENT`] = config.accent;
|
|
282
|
-
}
|
|
283
|
-
if (config.link) {
|
|
284
|
-
process.env[`${prefix}LINK`] = config.link;
|
|
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
|
-
}
|
|
321
|
-
};
|
|
322
|
-
const setMultiThemeColorsEnv = (prefix, config) => {
|
|
323
|
-
return {
|
|
324
|
-
light: setBaseThemeColorsEnv(`${prefix}LIGHT_`, config.light),
|
|
325
|
-
dark: setBaseThemeColorsEnv(`${prefix}DARK_`, config.dark)
|
|
326
|
-
};
|
|
327
|
-
};
|
|
328
|
-
const setBaseThemeColorsEnv = (prefix, config) => {
|
|
329
|
-
if (config.foreground) {
|
|
330
|
-
process.env[`${prefix}FOREGROUND`] = config.foreground;
|
|
331
|
-
}
|
|
332
|
-
if (config.background) {
|
|
333
|
-
process.env[`${prefix}BACKGROUND`] = config.background;
|
|
334
|
-
}
|
|
335
|
-
if (config.brand) {
|
|
336
|
-
process.env[`${prefix}BRAND`] = config.brand;
|
|
337
|
-
}
|
|
338
|
-
if (config.alternate) {
|
|
339
|
-
process.env[`${prefix}ALTERNATE`] = config.alternate;
|
|
340
|
-
}
|
|
341
|
-
if (config.accent) {
|
|
342
|
-
process.env[`${prefix}ACCENT`] = config.accent;
|
|
343
|
-
}
|
|
344
|
-
if (config.link) {
|
|
345
|
-
process.env[`${prefix}LINK`] = config.link;
|
|
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
|
-
}
|
|
382
|
-
};
|
|
383
|
-
export {
|
|
384
|
-
setConfigEnv,
|
|
385
|
-
setExtensionEnv
|
|
386
|
-
};
|
package/dist/get-config.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
loadStormWorkspaceConfig,
|
|
3
|
-
tryLoadStormWorkspaceConfig
|
|
4
|
-
} from "./create-storm-config";
|
|
5
|
-
import { findWorkspaceRoot } from "./utilities/find-workspace-root";
|
|
6
|
-
function getConfig(workspaceRoot, skipLogs = false) {
|
|
7
|
-
return loadStormWorkspaceConfig(workspaceRoot, skipLogs);
|
|
8
|
-
}
|
|
9
|
-
function getWorkspaceConfig(skipLogs = true, options = {}) {
|
|
10
|
-
let workspaceRoot = options.workspaceRoot;
|
|
11
|
-
if (!workspaceRoot) {
|
|
12
|
-
workspaceRoot = findWorkspaceRoot(options.cwd);
|
|
13
|
-
}
|
|
14
|
-
return getConfig(workspaceRoot, skipLogs);
|
|
15
|
-
}
|
|
16
|
-
async function tryGetWorkspaceConfig(skipLogs = true, options = {}) {
|
|
17
|
-
try {
|
|
18
|
-
let workspaceRoot = options.workspaceRoot;
|
|
19
|
-
if (!workspaceRoot) {
|
|
20
|
-
workspaceRoot = findWorkspaceRoot(options.cwd);
|
|
21
|
-
}
|
|
22
|
-
return tryLoadStormWorkspaceConfig(
|
|
23
|
-
workspaceRoot,
|
|
24
|
-
skipLogs,
|
|
25
|
-
options.useDefault
|
|
26
|
-
);
|
|
27
|
-
} catch {
|
|
28
|
-
return void 0;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
export {
|
|
32
|
-
getConfig,
|
|
33
|
-
getWorkspaceConfig,
|
|
34
|
-
tryGetWorkspaceConfig
|
|
35
|
-
};
|
package/dist/index.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export { getConfigFile, getConfigFileByName } from './config-file/get-config-file.js';
|
|
2
|
-
export { createConfigExtension, createStormWorkspaceConfig, loadStormWorkspaceConfig, tryLoadStormWorkspaceConfig } from './create-storm-config.js';
|
|
3
|
-
export { getConfigEnv, getExtensionEnv } from './env/get-env.js';
|
|
4
|
-
export { setConfigEnv, setExtensionEnv } from './env/set-env.js';
|
|
5
|
-
export { GetWorkspaceConfigOptions, getConfig, getWorkspaceConfig, tryGetWorkspaceConfig } from './get-config.js';
|
|
6
|
-
export { GetChalkReturn, getChalk } from './logger/chalk.js';
|
|
7
|
-
export { FormatLogMessageOptions, GetLogFnOptions, brandIcon, formatLogMessage, getLogFn, getStopwatch, writeDebug, writeError, writeFatal, writeInfo, writePerformance, writeSuccess, writeSystem, writeTrace, writeWarning } from './logger/console.js';
|
|
8
|
-
export { CONSOLE_ICONS } from './logger/console-icons.js';
|
|
9
|
-
export { createLogger } from './logger/create-logger.js';
|
|
10
|
-
export { formatTimestamp } from './logger/format-timestamp.js';
|
|
11
|
-
export { getLogLevel, getLogLevelLabel, isVerbose } from './logger/get-log-level.js';
|
|
12
|
-
export { isUnicodeSupported } from './logger/is-unicode-supported.js';
|
|
13
|
-
export { BaseTokenizerOptions, DeepPartial, LogLevel, LogLevelLabel, Logger, ProjectTokenizerOptions } from './types.js';
|
|
14
|
-
export { applyWorkspaceBaseTokens, applyWorkspaceProjectTokens, applyWorkspaceTokens } from './utilities/apply-workspace-tokens.js';
|
|
15
|
-
export { DEFAULT_COLOR_CONFIG, getColor, getColors, getGradient } from './utilities/colors.js';
|
|
16
|
-
export { basename, correctPaths, dirname, extname, format, isAbsolute, joinPaths, normalizeString, normalizeWindowsPath, parse, relative, resolve, sep, toNamespacedPath } from './utilities/correct-paths.js';
|
|
17
|
-
export { FindFileNameOptions, findFileName, findFilePath, removeExtension } from './utilities/file-path-utils.js';
|
|
18
|
-
export { findWorkspaceRoot, findWorkspaceRootSafe } from './utilities/find-workspace-root.js';
|
|
19
|
-
export { applyDefaultConfig, getPackageJsonConfig } from './utilities/get-default-config.js';
|
|
20
|
-
export { exitWithError, exitWithSuccess, handleProcess } from './utilities/process-handler.js';
|
|
21
|
-
export { IOType, LARGE_BUFFER, StdioOptions, run, runAsync } from './utilities/run.js';
|
|
22
|
-
export { CargoMetadata, CargoToml, Dep, DepKind, Dependency, Docs, Docs2, Features, Metadata, Metadata2, Node, Package, Resolve, Rs, Rs2, Target, Tree, modifyCargoNestedTable, modifyCargoTable, parseCargoToml, parseCargoTomlWithTree, stringifyCargoToml } from './utilities/toml.js';
|
|
23
|
-
import '@storm-software/config';
|
|
24
|
-
import 'c12';
|
|
25
|
-
import 'zod';
|
|
26
|
-
import '@storm-software/config/types';
|
|
27
|
-
import 'node:path';
|
|
28
|
-
import 'node:child_process';
|
package/dist/index.js
DELETED
package/dist/logger/chalk.d.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
type GetChalkReturn = {
|
|
2
|
-
hex: (_: string) => (message?: string) => string | undefined;
|
|
3
|
-
bgHex: (_: string) => {
|
|
4
|
-
whiteBright: (message?: string) => string | undefined;
|
|
5
|
-
white: (message?: string) => string | undefined;
|
|
6
|
-
};
|
|
7
|
-
whiteBright: (message?: string) => string | undefined;
|
|
8
|
-
white: (message?: string) => string | undefined;
|
|
9
|
-
gray: (message?: string) => string | undefined;
|
|
10
|
-
bold: {
|
|
11
|
-
hex: (_: string) => (message?: string) => string | undefined;
|
|
12
|
-
bgHex: (_: string) => {
|
|
13
|
-
whiteBright: (message?: string) => string | undefined;
|
|
14
|
-
white: (message?: string) => string | undefined;
|
|
15
|
-
};
|
|
16
|
-
whiteBright: (message?: string) => string | undefined;
|
|
17
|
-
white: (message?: string) => string | undefined;
|
|
18
|
-
};
|
|
19
|
-
dim: {
|
|
20
|
-
hex: (_: string) => (message?: string) => string | undefined;
|
|
21
|
-
gray: (message?: string) => string | undefined;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
/**
|
|
25
|
-
* Get the chalk instance
|
|
26
|
-
*
|
|
27
|
-
* @remarks
|
|
28
|
-
* Annoying polyfill to temporarily fix the issue with the `chalk` import
|
|
29
|
-
*
|
|
30
|
-
* @returns The chalk instance
|
|
31
|
-
*/
|
|
32
|
-
declare const getChalk: () => GetChalkReturn;
|
|
33
|
-
|
|
34
|
-
export { type GetChalkReturn, getChalk };
|
package/dist/logger/chalk.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import chalk from "chalk";
|
|
2
|
-
const chalkDefault = {
|
|
3
|
-
hex: (_) => (message) => message,
|
|
4
|
-
bgHex: (_) => ({
|
|
5
|
-
whiteBright: (message) => message,
|
|
6
|
-
white: (message) => message
|
|
7
|
-
}),
|
|
8
|
-
white: (message) => message,
|
|
9
|
-
whiteBright: (message) => message,
|
|
10
|
-
gray: (message) => message,
|
|
11
|
-
bold: {
|
|
12
|
-
hex: (_) => (message) => message,
|
|
13
|
-
bgHex: (_) => ({
|
|
14
|
-
whiteBright: (message) => message,
|
|
15
|
-
white: (message) => message
|
|
16
|
-
}),
|
|
17
|
-
whiteBright: (message) => message,
|
|
18
|
-
white: (message) => message
|
|
19
|
-
},
|
|
20
|
-
dim: {
|
|
21
|
-
hex: (_) => (message) => message,
|
|
22
|
-
gray: (message) => message
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
const getChalk = () => {
|
|
26
|
-
let _chalk = chalk;
|
|
27
|
-
if (!_chalk?.hex || !_chalk?.bold?.hex || !_chalk?.bgHex || !_chalk?.whiteBright || !_chalk?.white) {
|
|
28
|
-
_chalk = chalkDefault;
|
|
29
|
-
}
|
|
30
|
-
return _chalk;
|
|
31
|
-
};
|
|
32
|
-
export {
|
|
33
|
-
getChalk
|
|
34
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { LogLevelLabel } from "../types";
|
|
2
|
-
import { isUnicodeSupported } from "./is-unicode-supported";
|
|
3
|
-
const useIcon = (c, fallback) => isUnicodeSupported() ? c : fallback;
|
|
4
|
-
const CONSOLE_ICONS = {
|
|
5
|
-
[LogLevelLabel.ERROR]: useIcon("\u2718", "\xD7"),
|
|
6
|
-
[LogLevelLabel.FATAL]: useIcon("\u{1F571}", "\xD7"),
|
|
7
|
-
[LogLevelLabel.WARN]: useIcon("\u26A0", "\u203C"),
|
|
8
|
-
[LogLevelLabel.INFO]: useIcon("\u2139", "i"),
|
|
9
|
-
[LogLevelLabel.PERFORMANCE]: useIcon("\u23F1", "\u23F1"),
|
|
10
|
-
[LogLevelLabel.SUCCESS]: useIcon("\u2714", "\u221A"),
|
|
11
|
-
[LogLevelLabel.DEBUG]: useIcon("\u{1F6E0}", "D"),
|
|
12
|
-
[LogLevelLabel.TRACE]: useIcon("\u2699", "T"),
|
|
13
|
-
[LogLevelLabel.ALL]: useIcon("\u2709", "\u2192")
|
|
14
|
-
};
|
|
15
|
-
export {
|
|
16
|
-
CONSOLE_ICONS
|
|
17
|
-
};
|