@storm-software/pnpm-tools 0.6.144 → 0.6.146
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/CHANGELOG.md +27 -0
- package/README.md +1 -1
- package/bin/pnpm.cjs +2296 -60
- package/bin/pnpm.js +2258 -54
- package/package.json +15 -14
package/bin/pnpm.js
CHANGED
|
@@ -1,49 +1,2252 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
//
|
|
4
|
-
import
|
|
5
|
-
|
|
3
|
+
// ../config/src/schema.ts
|
|
4
|
+
import * as z from "zod/mini";
|
|
5
|
+
|
|
6
|
+
// ../config/src/constants.ts
|
|
7
|
+
var STORM_DEFAULT_DOCS = "https://docs.stormsoftware.com";
|
|
8
|
+
var STORM_DEFAULT_HOMEPAGE = "https://stormsoftware.com";
|
|
9
|
+
var STORM_DEFAULT_CONTACT = "https://stormsoftware.com/contact";
|
|
10
|
+
var STORM_DEFAULT_LICENSING = "https://stormsoftware.com/license";
|
|
11
|
+
var STORM_DEFAULT_LICENSE = "Apache-2.0";
|
|
12
|
+
var STORM_DEFAULT_SOCIAL_DISCORD = "https://discord.gg/MQ6YVzakM5";
|
|
13
|
+
var STORM_DEFAULT_SOCIAL_SLACK = "https://join.slack.com/t/storm-software/shared_invite/zt-2gsmk04hs-i6yhK_r6urq0dkZYAwq2pA";
|
|
14
|
+
var STORM_DEFAULT_RELEASE_FOOTER = `
|
|
15
|
+
Storm Software is an open source software development organization with the mission is to make software development more accessible. Our ideal future is one where anyone can create software without years of prior development experience serving as a barrier to entry. We hope to achieve this via LLMs, Generative AI, and intuitive, high-level data modeling/programming languages.
|
|
16
|
+
|
|
17
|
+
Join us on [Discord](${STORM_DEFAULT_SOCIAL_DISCORD}) to chat with the team, receive release notifications, ask questions, and get involved.
|
|
18
|
+
|
|
19
|
+
If this sounds interesting, and you would like to help us in creating the next generation of development tools, please reach out on our [website](${STORM_DEFAULT_CONTACT}) or join our [Slack](${STORM_DEFAULT_SOCIAL_SLACK}) channel!
|
|
20
|
+
`;
|
|
21
|
+
var STORM_DEFAULT_ERROR_CODES_FILE = "tools/errors/codes.json";
|
|
22
|
+
var STORM_DEFAULT_BANNER_ALT = "The workspace's banner image";
|
|
23
|
+
|
|
24
|
+
// ../config/src/schema.ts
|
|
25
|
+
var schemaRegistry = z.registry();
|
|
26
|
+
var colorSchema = z.string().check(
|
|
27
|
+
z.length(7),
|
|
28
|
+
z.toLowerCase(),
|
|
29
|
+
z.regex(/^#([0-9a-f]{3}){1,2}$/i),
|
|
30
|
+
z.trim()
|
|
31
|
+
);
|
|
32
|
+
schemaRegistry.add(colorSchema, {
|
|
33
|
+
description: "A base schema for describing the format of colors"
|
|
34
|
+
});
|
|
35
|
+
var darkColorSchema = z._default(colorSchema, "#151718");
|
|
36
|
+
schemaRegistry.add(darkColorSchema, {
|
|
37
|
+
description: "The dark background color of the workspace"
|
|
38
|
+
});
|
|
39
|
+
var lightColorSchema = z._default(colorSchema, "#cbd5e1");
|
|
40
|
+
schemaRegistry.add(lightColorSchema, {
|
|
41
|
+
description: "The light background color of the workspace"
|
|
42
|
+
});
|
|
43
|
+
var brandColorSchema = z._default(colorSchema, "#1fb2a6");
|
|
44
|
+
schemaRegistry.add(brandColorSchema, {
|
|
45
|
+
description: "The primary brand specific color of the workspace"
|
|
46
|
+
});
|
|
47
|
+
var alternateColorSchema = z.optional(colorSchema);
|
|
48
|
+
schemaRegistry.add(alternateColorSchema, {
|
|
49
|
+
description: "The alternate brand specific color of the workspace"
|
|
50
|
+
});
|
|
51
|
+
var accentColorSchema = z.optional(colorSchema);
|
|
52
|
+
schemaRegistry.add(accentColorSchema, {
|
|
53
|
+
description: "The secondary brand specific color of the workspace"
|
|
54
|
+
});
|
|
55
|
+
var linkColorSchema = z._default(colorSchema, "#3fa6ff");
|
|
56
|
+
schemaRegistry.add(linkColorSchema, {
|
|
57
|
+
description: "The color used to display hyperlink text"
|
|
58
|
+
});
|
|
59
|
+
var helpColorSchema = z._default(colorSchema, "#818cf8");
|
|
60
|
+
schemaRegistry.add(helpColorSchema, {
|
|
61
|
+
description: "The second brand specific color of the workspace"
|
|
62
|
+
});
|
|
63
|
+
var successColorSchema = z._default(colorSchema, "#45b27e");
|
|
64
|
+
schemaRegistry.add(successColorSchema, {
|
|
65
|
+
description: "The success color of the workspace"
|
|
66
|
+
});
|
|
67
|
+
var infoColorSchema = z._default(colorSchema, "#38bdf8");
|
|
68
|
+
schemaRegistry.add(infoColorSchema, {
|
|
69
|
+
description: "The informational color of the workspace"
|
|
70
|
+
});
|
|
71
|
+
var debugColorSchema = z._default(colorSchema, "#8afafc");
|
|
72
|
+
schemaRegistry.add(debugColorSchema, {
|
|
73
|
+
description: "The debug color of the workspace"
|
|
74
|
+
});
|
|
75
|
+
var warningColorSchema = z._default(colorSchema, "#f3d371");
|
|
76
|
+
schemaRegistry.add(warningColorSchema, {
|
|
77
|
+
description: "The warning color of the workspace"
|
|
78
|
+
});
|
|
79
|
+
var dangerColorSchema = z._default(colorSchema, "#d8314a");
|
|
80
|
+
schemaRegistry.add(dangerColorSchema, {
|
|
81
|
+
description: "The danger color of the workspace"
|
|
82
|
+
});
|
|
83
|
+
var fatalColorSchema = z.optional(colorSchema);
|
|
84
|
+
schemaRegistry.add(fatalColorSchema, {
|
|
85
|
+
description: "The fatal color of the workspace"
|
|
86
|
+
});
|
|
87
|
+
var performanceColorSchema = z._default(colorSchema, "#80fd74");
|
|
88
|
+
schemaRegistry.add(performanceColorSchema, {
|
|
89
|
+
description: "The performance color of the workspace"
|
|
90
|
+
});
|
|
91
|
+
var positiveColorSchema = z._default(colorSchema, "#4ade80");
|
|
92
|
+
schemaRegistry.add(positiveColorSchema, {
|
|
93
|
+
description: "The positive number color of the workspace"
|
|
94
|
+
});
|
|
95
|
+
var negativeColorSchema = z._default(colorSchema, "#ef4444");
|
|
96
|
+
schemaRegistry.add(negativeColorSchema, {
|
|
97
|
+
description: "The negative number color of the workspace"
|
|
98
|
+
});
|
|
99
|
+
var gradientStopsSchema = z.optional(z.array(colorSchema));
|
|
100
|
+
schemaRegistry.add(gradientStopsSchema, {
|
|
101
|
+
description: "The color stops for the base gradient color pattern used in the workspace"
|
|
102
|
+
});
|
|
103
|
+
var darkColorsSchema = z.object({
|
|
104
|
+
foreground: lightColorSchema,
|
|
105
|
+
background: darkColorSchema,
|
|
106
|
+
brand: brandColorSchema,
|
|
107
|
+
alternate: alternateColorSchema,
|
|
108
|
+
accent: accentColorSchema,
|
|
109
|
+
link: linkColorSchema,
|
|
110
|
+
help: helpColorSchema,
|
|
111
|
+
success: successColorSchema,
|
|
112
|
+
info: infoColorSchema,
|
|
113
|
+
debug: debugColorSchema,
|
|
114
|
+
warning: warningColorSchema,
|
|
115
|
+
danger: dangerColorSchema,
|
|
116
|
+
fatal: fatalColorSchema,
|
|
117
|
+
performance: performanceColorSchema,
|
|
118
|
+
positive: positiveColorSchema,
|
|
119
|
+
negative: negativeColorSchema,
|
|
120
|
+
gradient: gradientStopsSchema
|
|
121
|
+
});
|
|
122
|
+
var lightColorsSchema = z.object({
|
|
123
|
+
foreground: darkColorSchema,
|
|
124
|
+
background: lightColorSchema,
|
|
125
|
+
brand: brandColorSchema,
|
|
126
|
+
alternate: alternateColorSchema,
|
|
127
|
+
accent: accentColorSchema,
|
|
128
|
+
link: linkColorSchema,
|
|
129
|
+
help: helpColorSchema,
|
|
130
|
+
success: successColorSchema,
|
|
131
|
+
info: infoColorSchema,
|
|
132
|
+
debug: debugColorSchema,
|
|
133
|
+
warning: warningColorSchema,
|
|
134
|
+
danger: dangerColorSchema,
|
|
135
|
+
fatal: fatalColorSchema,
|
|
136
|
+
performance: performanceColorSchema,
|
|
137
|
+
positive: positiveColorSchema,
|
|
138
|
+
negative: negativeColorSchema,
|
|
139
|
+
gradient: gradientStopsSchema
|
|
140
|
+
});
|
|
141
|
+
var multiColorsSchema = z.object({
|
|
142
|
+
dark: darkColorsSchema,
|
|
143
|
+
light: lightColorsSchema
|
|
144
|
+
});
|
|
145
|
+
var singleColorsSchema = z.object({
|
|
146
|
+
dark: darkColorSchema,
|
|
147
|
+
light: lightColorSchema,
|
|
148
|
+
brand: brandColorSchema,
|
|
149
|
+
alternate: alternateColorSchema,
|
|
150
|
+
accent: accentColorSchema,
|
|
151
|
+
link: linkColorSchema,
|
|
152
|
+
help: helpColorSchema,
|
|
153
|
+
success: successColorSchema,
|
|
154
|
+
info: infoColorSchema,
|
|
155
|
+
debug: debugColorSchema,
|
|
156
|
+
warning: warningColorSchema,
|
|
157
|
+
danger: dangerColorSchema,
|
|
158
|
+
fatal: fatalColorSchema,
|
|
159
|
+
performance: performanceColorSchema,
|
|
160
|
+
positive: positiveColorSchema,
|
|
161
|
+
negative: negativeColorSchema,
|
|
162
|
+
gradient: gradientStopsSchema
|
|
163
|
+
});
|
|
164
|
+
var registryUrlConfigSchema = z.optional(z.url());
|
|
165
|
+
schemaRegistry.add(registryUrlConfigSchema, {
|
|
166
|
+
description: "A remote registry URL used to publish distributable packages"
|
|
167
|
+
});
|
|
168
|
+
var registrySchema = z._default(
|
|
169
|
+
z.object({
|
|
170
|
+
github: registryUrlConfigSchema,
|
|
171
|
+
npm: registryUrlConfigSchema,
|
|
172
|
+
cargo: registryUrlConfigSchema,
|
|
173
|
+
cyclone: registryUrlConfigSchema,
|
|
174
|
+
container: registryUrlConfigSchema
|
|
175
|
+
}),
|
|
176
|
+
{}
|
|
177
|
+
);
|
|
178
|
+
schemaRegistry.add(registrySchema, {
|
|
179
|
+
description: "A list of remote registry URLs used by Storm Software"
|
|
180
|
+
});
|
|
181
|
+
var colorsSchema = z.union([singleColorsSchema, multiColorsSchema]);
|
|
182
|
+
schemaRegistry.add(colorsSchema, {
|
|
183
|
+
description: "Colors used for various workspace elements"
|
|
184
|
+
});
|
|
185
|
+
var themeColorsSchema = z.record(
|
|
186
|
+
z.union([z.union([z.literal("base"), z.string()]), z.string()]),
|
|
187
|
+
colorsSchema
|
|
188
|
+
);
|
|
189
|
+
schemaRegistry.add(themeColorsSchema, {
|
|
190
|
+
description: "Storm theme config values used for styling various package elements"
|
|
191
|
+
});
|
|
192
|
+
var extendsSchema = z.optional(
|
|
193
|
+
z.union([z.string().check(z.trim()), z.array(z.string().check(z.trim()))])
|
|
194
|
+
);
|
|
195
|
+
schemaRegistry.add(extendsSchema, {
|
|
196
|
+
description: "The path to a base config file to use as a configuration preset file. Documentation can be found at https://github.com/unjs/c12#extending-configuration."
|
|
197
|
+
});
|
|
198
|
+
var workspaceBotNameSchema = z.string().check(z.trim());
|
|
199
|
+
schemaRegistry.add(workspaceBotNameSchema, {
|
|
200
|
+
description: "The workspace bot user's name (this is the bot that will be used to perform various tasks)"
|
|
201
|
+
});
|
|
202
|
+
var workspaceBotEmailSchema = z.string().check(z.trim());
|
|
203
|
+
schemaRegistry.add(workspaceBotEmailSchema, {
|
|
204
|
+
description: "The email of the workspace bot"
|
|
205
|
+
});
|
|
206
|
+
var workspaceBotSchema = z.object({
|
|
207
|
+
name: workspaceBotNameSchema,
|
|
208
|
+
email: workspaceBotEmailSchema
|
|
209
|
+
});
|
|
210
|
+
schemaRegistry.add(workspaceBotSchema, {
|
|
211
|
+
description: "The workspace's bot user's config used to automated various operations tasks"
|
|
212
|
+
});
|
|
213
|
+
var workspaceReleaseBannerUrlSchema = z.optional(
|
|
214
|
+
z.string().check(z.trim(), z.url())
|
|
215
|
+
);
|
|
216
|
+
schemaRegistry.add(workspaceReleaseBannerUrlSchema, {
|
|
217
|
+
description: "A URL to a banner image used to display the workspace's release"
|
|
218
|
+
});
|
|
219
|
+
var workspaceReleaseBannerAltSchema = z._default(
|
|
220
|
+
z.string().check(z.trim()),
|
|
221
|
+
STORM_DEFAULT_BANNER_ALT
|
|
222
|
+
);
|
|
223
|
+
schemaRegistry.add(workspaceReleaseBannerAltSchema, {
|
|
224
|
+
description: "The alt text for the workspace's release banner image"
|
|
225
|
+
});
|
|
226
|
+
var workspaceReleaseBannerSchema = z.object({
|
|
227
|
+
url: workspaceReleaseBannerUrlSchema,
|
|
228
|
+
alt: workspaceReleaseBannerAltSchema
|
|
229
|
+
});
|
|
230
|
+
schemaRegistry.add(workspaceReleaseBannerSchema, {
|
|
231
|
+
description: "The workspace's banner image used during the release process"
|
|
232
|
+
});
|
|
233
|
+
var workspaceReleaseHeaderSchema = z.optional(
|
|
234
|
+
z.string().check(z.trim())
|
|
235
|
+
);
|
|
236
|
+
schemaRegistry.add(workspaceReleaseHeaderSchema, {
|
|
237
|
+
description: "A header message appended to the start of the workspace's release notes"
|
|
238
|
+
});
|
|
239
|
+
var workspaceReleaseFooterSchema = z.optional(
|
|
240
|
+
z.string().check(z.trim())
|
|
241
|
+
);
|
|
242
|
+
schemaRegistry.add(workspaceReleaseFooterSchema, {
|
|
243
|
+
description: "A footer message appended to the end of the workspace's release notes"
|
|
244
|
+
});
|
|
245
|
+
var workspaceReleaseSchema = z.object({
|
|
246
|
+
banner: z.union([
|
|
247
|
+
workspaceReleaseBannerSchema,
|
|
248
|
+
z.string().check(z.trim(), z.url())
|
|
249
|
+
]),
|
|
250
|
+
header: workspaceReleaseHeaderSchema,
|
|
251
|
+
footer: workspaceReleaseFooterSchema
|
|
252
|
+
});
|
|
253
|
+
schemaRegistry.add(workspaceReleaseSchema, {
|
|
254
|
+
description: "The workspace's release config used during the release process"
|
|
255
|
+
});
|
|
256
|
+
var workspaceSocialsTwitterSchema = z.optional(
|
|
257
|
+
z.string().check(z.trim())
|
|
258
|
+
);
|
|
259
|
+
schemaRegistry.add(workspaceSocialsTwitterSchema, {
|
|
260
|
+
description: "A Twitter/X account associated with the organization/project"
|
|
261
|
+
});
|
|
262
|
+
var workspaceSocialsDiscordSchema = z.optional(
|
|
263
|
+
z.string().check(z.trim())
|
|
264
|
+
);
|
|
265
|
+
schemaRegistry.add(workspaceSocialsDiscordSchema, {
|
|
266
|
+
description: "A Discord account associated with the organization/project"
|
|
267
|
+
});
|
|
268
|
+
var workspaceSocialsTelegramSchema = z.optional(
|
|
269
|
+
z.string().check(z.trim())
|
|
270
|
+
);
|
|
271
|
+
schemaRegistry.add(workspaceSocialsTelegramSchema, {
|
|
272
|
+
description: "A Telegram account associated with the organization/project"
|
|
273
|
+
});
|
|
274
|
+
var workspaceSocialsSlackSchema = z.optional(
|
|
275
|
+
z.string().check(z.trim())
|
|
276
|
+
);
|
|
277
|
+
schemaRegistry.add(workspaceSocialsSlackSchema, {
|
|
278
|
+
description: "A Slack account associated with the organization/project"
|
|
279
|
+
});
|
|
280
|
+
var workspaceSocialsMediumSchema = z.optional(
|
|
281
|
+
z.string().check(z.trim())
|
|
282
|
+
);
|
|
283
|
+
schemaRegistry.add(workspaceSocialsMediumSchema, {
|
|
284
|
+
description: "A Medium account associated with the organization/project"
|
|
285
|
+
});
|
|
286
|
+
var workspaceSocialsGithubSchema = z.optional(
|
|
287
|
+
z.string().check(z.trim())
|
|
288
|
+
);
|
|
289
|
+
schemaRegistry.add(workspaceSocialsGithubSchema, {
|
|
290
|
+
description: "A GitHub account associated with the organization/project"
|
|
291
|
+
});
|
|
292
|
+
var workspaceSocialsSchema = z.object({
|
|
293
|
+
twitter: workspaceSocialsTwitterSchema,
|
|
294
|
+
discord: workspaceSocialsDiscordSchema,
|
|
295
|
+
telegram: workspaceSocialsTelegramSchema,
|
|
296
|
+
slack: workspaceSocialsSlackSchema,
|
|
297
|
+
medium: workspaceSocialsMediumSchema,
|
|
298
|
+
github: workspaceSocialsGithubSchema
|
|
299
|
+
});
|
|
300
|
+
schemaRegistry.add(workspaceSocialsSchema, {
|
|
301
|
+
description: "The workspace's account config used to store various social media links"
|
|
302
|
+
});
|
|
303
|
+
var workspaceDirectoryCacheSchema = z.optional(
|
|
304
|
+
z.string().check(z.trim())
|
|
305
|
+
);
|
|
306
|
+
schemaRegistry.add(workspaceDirectoryCacheSchema, {
|
|
307
|
+
description: "The directory used to store the environment's cached file data"
|
|
308
|
+
});
|
|
309
|
+
var workspaceDirectoryDataSchema = z.optional(
|
|
310
|
+
z.string().check(z.trim())
|
|
311
|
+
);
|
|
312
|
+
schemaRegistry.add(workspaceDirectoryDataSchema, {
|
|
313
|
+
description: "The directory used to store the environment's data files"
|
|
314
|
+
});
|
|
315
|
+
var workspaceDirectoryConfigSchema = z.optional(
|
|
316
|
+
z.string().check(z.trim())
|
|
317
|
+
);
|
|
318
|
+
schemaRegistry.add(workspaceDirectoryConfigSchema, {
|
|
319
|
+
description: "The directory used to store the environment's configuration files"
|
|
320
|
+
});
|
|
321
|
+
var workspaceDirectoryTempSchema = z.optional(
|
|
322
|
+
z.string().check(z.trim())
|
|
323
|
+
);
|
|
324
|
+
schemaRegistry.add(workspaceDirectoryTempSchema, {
|
|
325
|
+
description: "The directory used to store the environment's temp files"
|
|
326
|
+
});
|
|
327
|
+
var workspaceDirectoryLogSchema = z.optional(
|
|
328
|
+
z.string().check(z.trim())
|
|
329
|
+
);
|
|
330
|
+
schemaRegistry.add(workspaceDirectoryLogSchema, {
|
|
331
|
+
description: "The directory used to store the environment's log files"
|
|
332
|
+
});
|
|
333
|
+
var workspaceDirectoryBuildSchema = z._default(
|
|
334
|
+
z.string().check(z.trim()),
|
|
335
|
+
"dist"
|
|
336
|
+
);
|
|
337
|
+
schemaRegistry.add(workspaceDirectoryBuildSchema, {
|
|
338
|
+
description: "The directory used to store the workspace's distributable files after a build (relative to the workspace root)"
|
|
339
|
+
});
|
|
340
|
+
var workspaceDirectorySchema = z.object({
|
|
341
|
+
cache: workspaceDirectoryCacheSchema,
|
|
342
|
+
data: workspaceDirectoryDataSchema,
|
|
343
|
+
config: workspaceDirectoryConfigSchema,
|
|
344
|
+
temp: workspaceDirectoryTempSchema,
|
|
345
|
+
log: workspaceDirectoryLogSchema,
|
|
346
|
+
build: workspaceDirectoryBuildSchema
|
|
347
|
+
});
|
|
348
|
+
schemaRegistry.add(workspaceDirectorySchema, {
|
|
349
|
+
description: "Various directories used by the workspace to store data, cache, and configuration files"
|
|
350
|
+
});
|
|
351
|
+
var variantSchema = z._default(
|
|
352
|
+
z.enum(["minimal", "monorepo"]),
|
|
353
|
+
"monorepo"
|
|
354
|
+
);
|
|
355
|
+
schemaRegistry.add(variantSchema, {
|
|
356
|
+
description: "The variant of the workspace. This can be used to enable or disable certain features or configurations."
|
|
357
|
+
});
|
|
358
|
+
var errorCodesFileSchema = z._default(
|
|
359
|
+
z.string().check(z.trim()),
|
|
360
|
+
STORM_DEFAULT_ERROR_CODES_FILE
|
|
361
|
+
);
|
|
362
|
+
schemaRegistry.add(errorCodesFileSchema, {
|
|
363
|
+
description: "The path to the workspace's error codes JSON file"
|
|
364
|
+
});
|
|
365
|
+
var errorUrlSchema = z.optional(z.url());
|
|
366
|
+
schemaRegistry.add(errorUrlSchema, {
|
|
367
|
+
description: "A URL to a page that looks up the workspace's error messages given a specific error code"
|
|
368
|
+
});
|
|
369
|
+
var errorSchema = z.object({
|
|
370
|
+
codesFile: errorCodesFileSchema,
|
|
371
|
+
url: errorUrlSchema
|
|
372
|
+
});
|
|
373
|
+
schemaRegistry.add(errorSchema, {
|
|
374
|
+
description: "The workspace's error config used when creating error details during a system error"
|
|
375
|
+
});
|
|
376
|
+
var organizationNameSchema = z.optional(
|
|
377
|
+
z.string().check(z.trim(), z.toLowerCase())
|
|
378
|
+
);
|
|
379
|
+
schemaRegistry.add(organizationNameSchema, {
|
|
380
|
+
description: "The name of the organization"
|
|
381
|
+
});
|
|
382
|
+
var organizationDescriptionSchema = z.optional(
|
|
383
|
+
z.string().check(z.trim())
|
|
384
|
+
);
|
|
385
|
+
schemaRegistry.add(organizationDescriptionSchema, {
|
|
386
|
+
description: "A description of the organization"
|
|
387
|
+
});
|
|
388
|
+
var organizationLogoSchema = z.optional(z.url());
|
|
389
|
+
schemaRegistry.add(organizationLogoSchema, {
|
|
390
|
+
description: "A URL to the organization's logo image"
|
|
391
|
+
});
|
|
392
|
+
var organizationIconSchema = z.optional(z.url());
|
|
393
|
+
schemaRegistry.add(organizationIconSchema, {
|
|
394
|
+
description: "A URL to the organization's icon image"
|
|
395
|
+
});
|
|
396
|
+
var organizationUrlSchema = z.optional(z.url());
|
|
397
|
+
schemaRegistry.add(organizationUrlSchema, {
|
|
398
|
+
description: "A URL to a page that provides more information about the organization"
|
|
399
|
+
});
|
|
400
|
+
var organizationSchema = z.object({
|
|
401
|
+
name: organizationNameSchema,
|
|
402
|
+
description: organizationDescriptionSchema,
|
|
403
|
+
logo: organizationLogoSchema,
|
|
404
|
+
icon: organizationIconSchema,
|
|
405
|
+
url: organizationUrlSchema
|
|
406
|
+
});
|
|
407
|
+
schemaRegistry.add(organizationSchema, {
|
|
408
|
+
description: "The workspace's organization details"
|
|
409
|
+
});
|
|
410
|
+
var schemaNameSchema = z._default(
|
|
411
|
+
z.string().check(z.trim(), z.toLowerCase()),
|
|
412
|
+
"https://public.storm-cdn.com/schemas/storm-workspace.schema.json"
|
|
413
|
+
);
|
|
414
|
+
schemaRegistry.add(schemaNameSchema, {
|
|
415
|
+
description: "The URL or file path to the JSON schema file that describes the Storm configuration file"
|
|
416
|
+
});
|
|
417
|
+
var nameSchema = z.string().check(z.trim(), z.toLowerCase());
|
|
418
|
+
schemaRegistry.add(nameSchema, {
|
|
419
|
+
description: "The name of the workspace/project/service/package/scope using this configuration"
|
|
420
|
+
});
|
|
421
|
+
var namespaceSchema = z.string().check(z.trim(), z.toLowerCase());
|
|
422
|
+
schemaRegistry.add(namespaceSchema, {
|
|
423
|
+
description: "The namespace of the workspace/project/service/package/scope using this configuration"
|
|
424
|
+
});
|
|
425
|
+
var orgSchema = z.union([
|
|
426
|
+
organizationSchema,
|
|
427
|
+
z.string().check(z.trim(), z.toLowerCase())
|
|
428
|
+
]);
|
|
429
|
+
schemaRegistry.add(orgSchema, {
|
|
430
|
+
description: "The organization of the workspace. This can be a string or an object containing the organization's details"
|
|
431
|
+
});
|
|
432
|
+
var repositorySchema = z.string().check(z.trim(), z.toLowerCase());
|
|
433
|
+
schemaRegistry.add(repositorySchema, {
|
|
434
|
+
description: "The repo URL of the workspace (i.e. the GitHub repository URL)"
|
|
435
|
+
});
|
|
436
|
+
var licenseSchema = z._default(
|
|
437
|
+
z.string().check(z.trim()),
|
|
438
|
+
"Apache-2.0"
|
|
439
|
+
);
|
|
440
|
+
schemaRegistry.add(licenseSchema, {
|
|
441
|
+
description: "The license type of the package"
|
|
442
|
+
});
|
|
443
|
+
var homepageSchema = z.optional(z.url());
|
|
444
|
+
schemaRegistry.add(homepageSchema, {
|
|
445
|
+
description: "The homepage of the workspace"
|
|
446
|
+
});
|
|
447
|
+
var docsSchema = z.optional(z.url());
|
|
448
|
+
schemaRegistry.add(docsSchema, {
|
|
449
|
+
description: "The documentation site for the workspace"
|
|
450
|
+
});
|
|
451
|
+
var portalSchema = z.optional(z.url());
|
|
452
|
+
schemaRegistry.add(portalSchema, {
|
|
453
|
+
description: "The development portal site for the workspace"
|
|
454
|
+
});
|
|
455
|
+
var licensingSchema = z.optional(z.url());
|
|
456
|
+
schemaRegistry.add(licensingSchema, {
|
|
457
|
+
description: "The licensing site for the workspace"
|
|
458
|
+
});
|
|
459
|
+
var contactSchema = z.optional(z.url());
|
|
460
|
+
schemaRegistry.add(contactSchema, {
|
|
461
|
+
description: "The contact site for the workspace"
|
|
462
|
+
});
|
|
463
|
+
var supportSchema = z.optional(z.url());
|
|
464
|
+
schemaRegistry.add(supportSchema, {
|
|
465
|
+
description: "The support site for the workspace. If not provided, this is defaulted to the `contact` config value"
|
|
466
|
+
});
|
|
467
|
+
var branchSchema = z._default(
|
|
468
|
+
z.string().check(z.trim(), z.toLowerCase()),
|
|
469
|
+
"main"
|
|
470
|
+
);
|
|
471
|
+
schemaRegistry.add(branchSchema, {
|
|
472
|
+
description: "The branch of the workspace"
|
|
473
|
+
});
|
|
474
|
+
var preidSchema = z.optional(
|
|
475
|
+
z.string().check(z.trim(), z.toLowerCase())
|
|
476
|
+
);
|
|
477
|
+
schemaRegistry.add(preidSchema, {
|
|
478
|
+
description: "A tag specifying the version pre-release identifier"
|
|
479
|
+
});
|
|
480
|
+
var ownerSchema = z.optional(
|
|
481
|
+
z.string().check(z.trim(), z.toLowerCase())
|
|
482
|
+
);
|
|
483
|
+
schemaRegistry.add(ownerSchema, {
|
|
484
|
+
description: "The owner of the package"
|
|
485
|
+
});
|
|
486
|
+
var modeSchema = z._default(
|
|
487
|
+
z.enum(["development", "test", "production"]).check(z.trim(), z.toLowerCase()),
|
|
488
|
+
"production"
|
|
489
|
+
);
|
|
490
|
+
schemaRegistry.add(modeSchema, {
|
|
491
|
+
description: "The current runtime environment mode for the package"
|
|
492
|
+
});
|
|
493
|
+
var workspaceRootSchema = z.string().check(z.trim(), z.toLowerCase());
|
|
494
|
+
schemaRegistry.add(workspaceRootSchema, {
|
|
495
|
+
description: "The root directory of the workspace"
|
|
496
|
+
});
|
|
497
|
+
var skipCacheSchema = z._default(z.boolean(), false);
|
|
498
|
+
schemaRegistry.add(skipCacheSchema, {
|
|
499
|
+
description: "Should all known types of workspace caching be skipped?"
|
|
500
|
+
});
|
|
501
|
+
var packageManagerSchema = z._default(
|
|
502
|
+
z.enum(["npm", "yarn", "pnpm", "bun"]),
|
|
503
|
+
"npm"
|
|
504
|
+
);
|
|
505
|
+
schemaRegistry.add(packageManagerSchema, {
|
|
506
|
+
description: "The JavaScript/TypeScript package manager used by the repository"
|
|
507
|
+
});
|
|
508
|
+
var timezoneSchema = z._default(
|
|
509
|
+
z.string().check(z.trim()),
|
|
510
|
+
"America/New_York"
|
|
511
|
+
);
|
|
512
|
+
schemaRegistry.add(timezoneSchema, {
|
|
513
|
+
description: "The default timezone of the workspace"
|
|
514
|
+
});
|
|
515
|
+
var localeSchema = z._default(z.string().check(z.trim()), "en-US");
|
|
516
|
+
schemaRegistry.add(localeSchema, {
|
|
517
|
+
description: "The default locale of the workspace"
|
|
518
|
+
});
|
|
519
|
+
var logLevelSchema = z._default(
|
|
520
|
+
z.enum([
|
|
521
|
+
"silent",
|
|
522
|
+
"fatal",
|
|
523
|
+
"error",
|
|
524
|
+
"warn",
|
|
525
|
+
"success",
|
|
526
|
+
"info",
|
|
527
|
+
"performance",
|
|
528
|
+
"debug",
|
|
529
|
+
"trace",
|
|
530
|
+
"all"
|
|
531
|
+
]),
|
|
532
|
+
"info"
|
|
533
|
+
);
|
|
534
|
+
schemaRegistry.add(logLevelSchema, {
|
|
535
|
+
description: "The log level used to filter out lower priority log messages. If not provided, this is defaulted using the `environment` config value (if `environment` is set to `production` then `level` is `error`, else `level` is `debug`)."
|
|
536
|
+
});
|
|
537
|
+
var skipConfigLoggingSchema = z._default(z.boolean(), true);
|
|
538
|
+
schemaRegistry.add(skipConfigLoggingSchema, {
|
|
539
|
+
description: "Should the logging of the current Storm Workspace configuration be skipped?"
|
|
540
|
+
});
|
|
541
|
+
var configFileSchema = z._default(
|
|
542
|
+
z.nullable(z.string().check(z.trim())),
|
|
543
|
+
null
|
|
544
|
+
);
|
|
545
|
+
schemaRegistry.add(configFileSchema, {
|
|
546
|
+
description: "The filepath of the Storm config. When this field is null, no config file was found in the current workspace."
|
|
547
|
+
});
|
|
548
|
+
var extensionsSchema = z._default(z.record(z.string(), z.any()), {});
|
|
549
|
+
schemaRegistry.add(extensionsSchema, {
|
|
550
|
+
description: "Configuration of each used extension"
|
|
551
|
+
});
|
|
552
|
+
var workspaceConfigSchema = z.object({
|
|
553
|
+
$schema: schemaNameSchema,
|
|
554
|
+
extends: extendsSchema,
|
|
555
|
+
name: nameSchema,
|
|
556
|
+
variant: variantSchema,
|
|
557
|
+
namespace: namespaceSchema,
|
|
558
|
+
organization: orgSchema,
|
|
559
|
+
repository: repositorySchema,
|
|
560
|
+
license: licenseSchema,
|
|
561
|
+
homepage: homepageSchema,
|
|
562
|
+
docs: docsSchema,
|
|
563
|
+
portal: portalSchema,
|
|
564
|
+
licensing: licensingSchema,
|
|
565
|
+
contact: contactSchema,
|
|
566
|
+
support: supportSchema,
|
|
567
|
+
branch: branchSchema,
|
|
568
|
+
preid: preidSchema,
|
|
569
|
+
owner: ownerSchema,
|
|
570
|
+
bot: workspaceBotSchema,
|
|
571
|
+
release: workspaceReleaseSchema,
|
|
572
|
+
socials: workspaceSocialsSchema,
|
|
573
|
+
error: errorSchema,
|
|
574
|
+
mode: modeSchema,
|
|
575
|
+
workspaceRoot: workspaceRootSchema,
|
|
576
|
+
skipCache: skipCacheSchema,
|
|
577
|
+
directories: workspaceDirectorySchema,
|
|
578
|
+
packageManager: packageManagerSchema,
|
|
579
|
+
timezone: timezoneSchema,
|
|
580
|
+
locale: localeSchema,
|
|
581
|
+
logLevel: logLevelSchema,
|
|
582
|
+
skipConfigLogging: skipConfigLoggingSchema,
|
|
583
|
+
registry: registrySchema,
|
|
584
|
+
configFile: configFileSchema,
|
|
585
|
+
colors: z.union([colorsSchema, themeColorsSchema]),
|
|
586
|
+
extensions: extensionsSchema
|
|
587
|
+
});
|
|
588
|
+
schemaRegistry.add(extensionsSchema, {
|
|
589
|
+
description: "Storm Workspace config values used during various dev-ops processes. This type is a combination of the StormPackageConfig and StormProject types. It represents the config of the entire monorepo."
|
|
590
|
+
});
|
|
591
|
+
|
|
592
|
+
// ../config-tools/src/create-storm-config.ts
|
|
593
|
+
import defu2 from "defu";
|
|
594
|
+
import { existsSync as existsSync3 } from "node:fs";
|
|
595
|
+
|
|
596
|
+
// ../config-tools/src/config-file/get-config-file.ts
|
|
597
|
+
import { loadConfig } from "c12";
|
|
598
|
+
import defu from "defu";
|
|
599
|
+
|
|
600
|
+
// ../config-tools/src/logger/console.ts
|
|
601
|
+
import { formatDistanceToNow } from "date-fns/formatDistanceToNow";
|
|
602
|
+
|
|
603
|
+
// ../config-tools/src/types.ts
|
|
604
|
+
var LogLevel = {
|
|
605
|
+
SILENT: 0,
|
|
606
|
+
FATAL: 10,
|
|
607
|
+
ERROR: 20,
|
|
608
|
+
WARN: 30,
|
|
609
|
+
SUCCESS: 35,
|
|
610
|
+
INFO: 40,
|
|
611
|
+
PERFORMANCE: 50,
|
|
612
|
+
DEBUG: 60,
|
|
613
|
+
TRACE: 70,
|
|
614
|
+
ALL: 100
|
|
615
|
+
};
|
|
616
|
+
var LogLevelLabel = {
|
|
617
|
+
SILENT: "silent",
|
|
618
|
+
FATAL: "fatal",
|
|
619
|
+
ERROR: "error",
|
|
620
|
+
WARN: "warn",
|
|
621
|
+
SUCCESS: "success",
|
|
622
|
+
INFO: "info",
|
|
623
|
+
PERFORMANCE: "performance",
|
|
624
|
+
DEBUG: "debug",
|
|
625
|
+
TRACE: "trace",
|
|
626
|
+
ALL: "all"
|
|
627
|
+
};
|
|
628
|
+
|
|
629
|
+
// ../config-tools/src/utilities/colors.ts
|
|
630
|
+
var DEFAULT_COLOR_CONFIG = {
|
|
631
|
+
light: {
|
|
632
|
+
background: "#fafafa",
|
|
633
|
+
foreground: "#1d1e22",
|
|
634
|
+
brand: "#1fb2a6",
|
|
635
|
+
alternate: "#db2777",
|
|
636
|
+
help: "#5C4EE5",
|
|
637
|
+
success: "#087f5b",
|
|
638
|
+
info: "#0550ae",
|
|
639
|
+
debug: "#8afafc",
|
|
640
|
+
warning: "#e3b341",
|
|
641
|
+
danger: "#D8314A",
|
|
642
|
+
fatal: "#51070f",
|
|
643
|
+
performance: "#13c302",
|
|
644
|
+
link: "#3fa6ff",
|
|
645
|
+
positive: "#22c55e",
|
|
646
|
+
negative: "#dc2626",
|
|
647
|
+
gradient: ["#1fb2a6", "#db2777", "#5C4EE5"]
|
|
648
|
+
},
|
|
649
|
+
dark: {
|
|
650
|
+
background: "#1d1e22",
|
|
651
|
+
foreground: "#cbd5e1",
|
|
652
|
+
brand: "#2dd4bf",
|
|
653
|
+
alternate: "#db2777",
|
|
654
|
+
help: "#818cf8",
|
|
655
|
+
success: "#10b981",
|
|
656
|
+
info: "#58a6ff",
|
|
657
|
+
debug: "#8afafc",
|
|
658
|
+
warning: "#f3d371",
|
|
659
|
+
danger: "#D8314A",
|
|
660
|
+
fatal: "#a40e26",
|
|
661
|
+
performance: "#80fd74",
|
|
662
|
+
link: "#3fa6ff",
|
|
663
|
+
positive: "#22c55e",
|
|
664
|
+
negative: "#dc2626",
|
|
665
|
+
gradient: ["#1fb2a6", "#db2777", "#818cf8"]
|
|
666
|
+
}
|
|
667
|
+
};
|
|
668
|
+
function getColors(config) {
|
|
669
|
+
if (!config?.colors || typeof config.colors !== "object" || !config.colors["dark"] && (!config.colors["base"] || typeof config.colors !== "object" || !config.colors["base"]?.["dark"])) {
|
|
670
|
+
return DEFAULT_COLOR_CONFIG;
|
|
671
|
+
}
|
|
672
|
+
if (config.colors["base"]) {
|
|
673
|
+
if (typeof config.colors["base"]["dark"] === "object") {
|
|
674
|
+
return config.colors["base"]["dark"];
|
|
675
|
+
} else if (config.colors["base"]["dark"] === "string") {
|
|
676
|
+
return config.colors["base"];
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
if (typeof config.colors["dark"] === "object") {
|
|
680
|
+
return config.colors["dark"];
|
|
681
|
+
}
|
|
682
|
+
return config.colors ?? DEFAULT_COLOR_CONFIG;
|
|
683
|
+
}
|
|
684
|
+
function getColor(key, config) {
|
|
685
|
+
const colors = getColors(config);
|
|
686
|
+
const result = (typeof colors["dark"] === "object" ? colors["dark"][key] : colors[key]) || DEFAULT_COLOR_CONFIG["dark"][key] || DEFAULT_COLOR_CONFIG[key];
|
|
687
|
+
if (result) {
|
|
688
|
+
return result;
|
|
689
|
+
}
|
|
690
|
+
if (key === "link" || key === "debug") {
|
|
691
|
+
return getColor("info", config);
|
|
692
|
+
} else if (key === "fatal") {
|
|
693
|
+
return getColor("danger", config);
|
|
694
|
+
}
|
|
695
|
+
return getColor("brand", config);
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
// ../config-tools/src/logger/chalk.ts
|
|
699
|
+
import chalk from "chalk";
|
|
700
|
+
var chalkDefault = {
|
|
701
|
+
hex: (_) => (message) => message,
|
|
702
|
+
bgHex: (_) => ({
|
|
703
|
+
whiteBright: (message) => message,
|
|
704
|
+
white: (message) => message
|
|
705
|
+
}),
|
|
706
|
+
white: (message) => message,
|
|
707
|
+
whiteBright: (message) => message,
|
|
708
|
+
gray: (message) => message,
|
|
709
|
+
bold: {
|
|
710
|
+
hex: (_) => (message) => message,
|
|
711
|
+
bgHex: (_) => ({
|
|
712
|
+
whiteBright: (message) => message,
|
|
713
|
+
white: (message) => message
|
|
714
|
+
}),
|
|
715
|
+
whiteBright: (message) => message,
|
|
716
|
+
white: (message) => message
|
|
717
|
+
},
|
|
718
|
+
dim: {
|
|
719
|
+
hex: (_) => (message) => message,
|
|
720
|
+
gray: (message) => message
|
|
721
|
+
}
|
|
722
|
+
};
|
|
723
|
+
var getChalk = () => {
|
|
724
|
+
let _chalk = chalk;
|
|
725
|
+
if (!_chalk?.hex || !_chalk?.bold?.hex || !_chalk?.bgHex || !_chalk?.whiteBright || !_chalk?.white) {
|
|
726
|
+
_chalk = chalkDefault;
|
|
727
|
+
}
|
|
728
|
+
return _chalk;
|
|
729
|
+
};
|
|
730
|
+
|
|
731
|
+
// ../config-tools/src/logger/is-unicode-supported.ts
|
|
732
|
+
function isUnicodeSupported() {
|
|
733
|
+
if (process.platform !== "win32") {
|
|
734
|
+
return process.env.TERM !== "linux";
|
|
735
|
+
}
|
|
736
|
+
return Boolean(process.env.WT_SESSION) || // Windows Terminal
|
|
737
|
+
Boolean(process.env.TERMINUS_SUBLIME) || // Terminus (<0.2.27)
|
|
738
|
+
process.env.ConEmuTask === "{cmd::Cmder}" || // ConEmu and cmder
|
|
739
|
+
process.env.TERM_PROGRAM === "Terminus-Sublime" || process.env.TERM_PROGRAM === "vscode" || process.env.TERM === "xterm-256color" || process.env.TERM === "alacritty" || process.env.TERM === "rxvt-unicode" || process.env.TERM === "rxvt-unicode-256color" || process.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
// ../config-tools/src/logger/console-icons.ts
|
|
743
|
+
var useIcon = (c, fallback) => isUnicodeSupported() ? c : fallback;
|
|
744
|
+
var CONSOLE_ICONS = {
|
|
745
|
+
[LogLevelLabel.ERROR]: useIcon("\u2718", "\xD7"),
|
|
746
|
+
[LogLevelLabel.FATAL]: useIcon("\u{1F571}", "\xD7"),
|
|
747
|
+
[LogLevelLabel.WARN]: useIcon("\u26A0", "\u203C"),
|
|
748
|
+
[LogLevelLabel.INFO]: useIcon("\u2139", "i"),
|
|
749
|
+
[LogLevelLabel.PERFORMANCE]: useIcon("\u23F1", "\u23F1"),
|
|
750
|
+
[LogLevelLabel.SUCCESS]: useIcon("\u2714", "\u221A"),
|
|
751
|
+
[LogLevelLabel.DEBUG]: useIcon("\u{1F6E0}", "D"),
|
|
752
|
+
[LogLevelLabel.TRACE]: useIcon("\u2699", "T"),
|
|
753
|
+
[LogLevelLabel.ALL]: useIcon("\u2709", "\u2192")
|
|
754
|
+
};
|
|
755
|
+
|
|
756
|
+
// ../config-tools/src/logger/format-timestamp.ts
|
|
757
|
+
var formatTimestamp = (date = /* @__PURE__ */ new Date()) => {
|
|
758
|
+
return `${date.toLocaleDateString()} ${date.toLocaleTimeString()}`;
|
|
759
|
+
};
|
|
760
|
+
|
|
761
|
+
// ../config-tools/src/logger/get-log-level.ts
|
|
762
|
+
var getLogLevel = (label) => {
|
|
763
|
+
switch (label) {
|
|
764
|
+
case "all":
|
|
765
|
+
return LogLevel.ALL;
|
|
766
|
+
case "trace":
|
|
767
|
+
return LogLevel.TRACE;
|
|
768
|
+
case "debug":
|
|
769
|
+
return LogLevel.DEBUG;
|
|
770
|
+
case "performance":
|
|
771
|
+
return LogLevel.PERFORMANCE;
|
|
772
|
+
case "info":
|
|
773
|
+
return LogLevel.INFO;
|
|
774
|
+
case "warn":
|
|
775
|
+
return LogLevel.WARN;
|
|
776
|
+
case "error":
|
|
777
|
+
return LogLevel.ERROR;
|
|
778
|
+
case "fatal":
|
|
779
|
+
return LogLevel.FATAL;
|
|
780
|
+
case "silent":
|
|
781
|
+
return LogLevel.SILENT;
|
|
782
|
+
default:
|
|
783
|
+
return LogLevel.INFO;
|
|
784
|
+
}
|
|
785
|
+
};
|
|
786
|
+
var getLogLevelLabel = (logLevel = LogLevel.INFO) => {
|
|
787
|
+
if (logLevel >= LogLevel.ALL) {
|
|
788
|
+
return LogLevelLabel.ALL;
|
|
789
|
+
}
|
|
790
|
+
if (logLevel >= LogLevel.TRACE) {
|
|
791
|
+
return LogLevelLabel.TRACE;
|
|
792
|
+
}
|
|
793
|
+
if (logLevel >= LogLevel.DEBUG) {
|
|
794
|
+
return LogLevelLabel.DEBUG;
|
|
795
|
+
}
|
|
796
|
+
if (logLevel >= LogLevel.PERFORMANCE) {
|
|
797
|
+
return LogLevelLabel.PERFORMANCE;
|
|
798
|
+
}
|
|
799
|
+
if (logLevel >= LogLevel.INFO) {
|
|
800
|
+
return LogLevelLabel.INFO;
|
|
801
|
+
}
|
|
802
|
+
if (logLevel >= LogLevel.WARN) {
|
|
803
|
+
return LogLevelLabel.WARN;
|
|
804
|
+
}
|
|
805
|
+
if (logLevel >= LogLevel.ERROR) {
|
|
806
|
+
return LogLevelLabel.ERROR;
|
|
807
|
+
}
|
|
808
|
+
if (logLevel >= LogLevel.FATAL) {
|
|
809
|
+
return LogLevelLabel.FATAL;
|
|
810
|
+
}
|
|
811
|
+
if (logLevel <= LogLevel.SILENT) {
|
|
812
|
+
return LogLevelLabel.SILENT;
|
|
813
|
+
}
|
|
814
|
+
return LogLevelLabel.INFO;
|
|
815
|
+
};
|
|
816
|
+
|
|
817
|
+
// ../config-tools/src/logger/console.ts
|
|
818
|
+
var getLogFn = (logLevel = LogLevel.INFO, config = {}, _chalk = getChalk()) => {
|
|
819
|
+
const colors = !config.colors?.dark && !config.colors?.["base"] && !config.colors?.["base"]?.dark ? DEFAULT_COLOR_CONFIG : config.colors?.dark && typeof config.colors.dark === "string" ? config.colors : config.colors?.["base"]?.dark && typeof config.colors["base"].dark === "string" ? config.colors["base"].dark : config.colors?.["base"] ? config.colors?.["base"] : DEFAULT_COLOR_CONFIG;
|
|
820
|
+
const configLogLevel = config.logLevel || process.env.STORM_LOG_LEVEL || LogLevelLabel.INFO;
|
|
821
|
+
if (logLevel > getLogLevel(configLogLevel) || logLevel <= LogLevel.SILENT || getLogLevel(configLogLevel) <= LogLevel.SILENT) {
|
|
822
|
+
return (_) => {
|
|
823
|
+
};
|
|
824
|
+
}
|
|
825
|
+
if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel) {
|
|
826
|
+
return (message) => {
|
|
827
|
+
console.error(
|
|
828
|
+
`
|
|
829
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(
|
|
830
|
+
colors.fatal ?? DEFAULT_COLOR_CONFIG.dark.fatal
|
|
831
|
+
)(
|
|
832
|
+
`[${CONSOLE_ICONS[LogLevelLabel.FATAL]} Fatal] `
|
|
833
|
+
)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
834
|
+
`
|
|
835
|
+
);
|
|
836
|
+
};
|
|
837
|
+
}
|
|
838
|
+
if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel) {
|
|
839
|
+
return (message) => {
|
|
840
|
+
console.error(
|
|
841
|
+
`
|
|
842
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(
|
|
843
|
+
colors.danger ?? DEFAULT_COLOR_CONFIG.dark.danger
|
|
844
|
+
)(
|
|
845
|
+
`[${CONSOLE_ICONS[LogLevelLabel.ERROR]} Error] `
|
|
846
|
+
)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
847
|
+
`
|
|
848
|
+
);
|
|
849
|
+
};
|
|
850
|
+
}
|
|
851
|
+
if (typeof logLevel === "number" && LogLevel.WARN >= logLevel) {
|
|
852
|
+
return (message) => {
|
|
853
|
+
console.warn(
|
|
854
|
+
`
|
|
855
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(
|
|
856
|
+
colors.warning ?? DEFAULT_COLOR_CONFIG.dark.warning
|
|
857
|
+
)(
|
|
858
|
+
`[${CONSOLE_ICONS[LogLevelLabel.WARN]} Warn] `
|
|
859
|
+
)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
860
|
+
`
|
|
861
|
+
);
|
|
862
|
+
};
|
|
863
|
+
}
|
|
864
|
+
if (typeof logLevel === "number" && LogLevel.SUCCESS >= logLevel) {
|
|
865
|
+
return (message) => {
|
|
866
|
+
console.info(
|
|
867
|
+
`
|
|
868
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(
|
|
869
|
+
colors.success ?? DEFAULT_COLOR_CONFIG.dark.success
|
|
870
|
+
)(
|
|
871
|
+
`[${CONSOLE_ICONS[LogLevelLabel.SUCCESS]} Success] `
|
|
872
|
+
)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
873
|
+
`
|
|
874
|
+
);
|
|
875
|
+
};
|
|
876
|
+
}
|
|
877
|
+
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel) {
|
|
878
|
+
return (message) => {
|
|
879
|
+
console.info(
|
|
880
|
+
`
|
|
881
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(
|
|
882
|
+
colors.info ?? DEFAULT_COLOR_CONFIG.dark.info
|
|
883
|
+
)(
|
|
884
|
+
`[${CONSOLE_ICONS[LogLevelLabel.INFO]} Info] `
|
|
885
|
+
)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
886
|
+
`
|
|
887
|
+
);
|
|
888
|
+
};
|
|
889
|
+
}
|
|
890
|
+
if (typeof logLevel === "number" && LogLevel.PERFORMANCE >= logLevel) {
|
|
891
|
+
return (message) => {
|
|
892
|
+
console.debug(
|
|
893
|
+
`
|
|
894
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(
|
|
895
|
+
colors.performance ?? DEFAULT_COLOR_CONFIG.dark.performance
|
|
896
|
+
)(
|
|
897
|
+
`[${CONSOLE_ICONS[LogLevelLabel.PERFORMANCE]} Performance] `
|
|
898
|
+
)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
899
|
+
`
|
|
900
|
+
);
|
|
901
|
+
};
|
|
902
|
+
}
|
|
903
|
+
if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel) {
|
|
904
|
+
return (message) => {
|
|
905
|
+
console.debug(
|
|
906
|
+
`
|
|
907
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(
|
|
908
|
+
colors.debug ?? DEFAULT_COLOR_CONFIG.dark.debug
|
|
909
|
+
)(
|
|
910
|
+
`[${CONSOLE_ICONS[LogLevelLabel.DEBUG]} Debug] `
|
|
911
|
+
)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
912
|
+
`
|
|
913
|
+
);
|
|
914
|
+
};
|
|
915
|
+
}
|
|
916
|
+
if (typeof logLevel === "number" && LogLevel.TRACE >= logLevel) {
|
|
917
|
+
return (message) => {
|
|
918
|
+
console.debug(
|
|
919
|
+
`
|
|
920
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex("#bbbbbb")(
|
|
921
|
+
`[${CONSOLE_ICONS[LogLevelLabel.TRACE]} Trace] `
|
|
922
|
+
)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
923
|
+
`
|
|
924
|
+
);
|
|
925
|
+
};
|
|
926
|
+
}
|
|
927
|
+
return (message) => {
|
|
928
|
+
console.log(
|
|
929
|
+
`
|
|
930
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(
|
|
931
|
+
colors.brand ?? DEFAULT_COLOR_CONFIG.dark.brand
|
|
932
|
+
)(
|
|
933
|
+
`[${CONSOLE_ICONS[LogLevelLabel.ALL]} System] `
|
|
934
|
+
)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
935
|
+
`
|
|
936
|
+
);
|
|
937
|
+
};
|
|
938
|
+
};
|
|
939
|
+
var writeFatal = (message, config) => getLogFn(LogLevel.FATAL, config)(message);
|
|
940
|
+
var writeError = (message, config) => getLogFn(LogLevel.ERROR, config)(message);
|
|
941
|
+
var writeWarning = (message, config) => getLogFn(LogLevel.WARN, config)(message);
|
|
942
|
+
var writeInfo = (message, config) => getLogFn(LogLevel.INFO, config)(message);
|
|
943
|
+
var writeSuccess = (message, config) => getLogFn(LogLevel.SUCCESS, config)(message);
|
|
944
|
+
var writeDebug = (message, config) => getLogFn(LogLevel.DEBUG, config)(message);
|
|
945
|
+
var writeTrace = (message, config) => getLogFn(LogLevel.TRACE, config)(message);
|
|
946
|
+
var MAX_DEPTH = 6;
|
|
947
|
+
var formatLogMessage = (message, options = {}, depth2 = 0) => {
|
|
948
|
+
if (depth2 > MAX_DEPTH) {
|
|
949
|
+
return "<max depth>";
|
|
950
|
+
}
|
|
951
|
+
const prefix = options.prefix ?? "-";
|
|
952
|
+
const skip = options.skip ?? [];
|
|
953
|
+
return typeof message === "undefined" || message === null || !message && typeof message !== "boolean" ? "<none>" : typeof message === "string" ? message : Array.isArray(message) ? `
|
|
954
|
+
${message.map((item, index) => ` ${prefix}> #${index} = ${formatLogMessage(item, { prefix: `${prefix}-`, skip }, depth2 + 1)}`).join("\n")}` : typeof message === "object" ? `
|
|
955
|
+
${Object.keys(message).filter((key) => !skip.includes(key)).map(
|
|
956
|
+
(key) => ` ${prefix}> ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" ? formatLogMessage(
|
|
957
|
+
message[key],
|
|
958
|
+
{ prefix: `${prefix}-`, skip },
|
|
959
|
+
depth2 + 1
|
|
960
|
+
) : message[key]}`
|
|
961
|
+
).join("\n")}` : message;
|
|
962
|
+
};
|
|
963
|
+
var _isFunction = (value) => {
|
|
964
|
+
try {
|
|
965
|
+
return value instanceof Function || typeof value === "function" || !!(value?.constructor && value?.call && value?.apply);
|
|
966
|
+
} catch {
|
|
967
|
+
return false;
|
|
968
|
+
}
|
|
969
|
+
};
|
|
970
|
+
var brandIcon = (config = {}, _chalk = getChalk()) => _chalk.hex(getColor("brand", config))("\u{1F5F2}");
|
|
971
|
+
|
|
972
|
+
// ../config-tools/src/utilities/correct-paths.ts
|
|
973
|
+
var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
974
|
+
function normalizeWindowsPath(input = "") {
|
|
975
|
+
if (!input) {
|
|
976
|
+
return input;
|
|
977
|
+
}
|
|
978
|
+
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
|
|
979
|
+
}
|
|
980
|
+
var _UNC_REGEX = /^[/\\]{2}/;
|
|
981
|
+
var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
|
982
|
+
var _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
|
|
983
|
+
var correctPaths = function(path2) {
|
|
984
|
+
if (!path2 || path2.length === 0) {
|
|
985
|
+
return ".";
|
|
986
|
+
}
|
|
987
|
+
path2 = normalizeWindowsPath(path2);
|
|
988
|
+
const isUNCPath = path2?.match(_UNC_REGEX);
|
|
989
|
+
const isPathAbsolute = isAbsolute(path2);
|
|
990
|
+
const trailingSeparator = path2[path2.length - 1] === "/";
|
|
991
|
+
path2 = normalizeString(path2, !isPathAbsolute);
|
|
992
|
+
if (path2.length === 0) {
|
|
993
|
+
if (isPathAbsolute) {
|
|
994
|
+
return "/";
|
|
995
|
+
}
|
|
996
|
+
return trailingSeparator ? "./" : ".";
|
|
997
|
+
}
|
|
998
|
+
if (trailingSeparator) {
|
|
999
|
+
path2 += "/";
|
|
1000
|
+
}
|
|
1001
|
+
if (_DRIVE_LETTER_RE.test(path2)) {
|
|
1002
|
+
path2 += "/";
|
|
1003
|
+
}
|
|
1004
|
+
if (isUNCPath) {
|
|
1005
|
+
if (!isPathAbsolute) {
|
|
1006
|
+
return `//./${path2}`;
|
|
1007
|
+
}
|
|
1008
|
+
return `//${path2}`;
|
|
1009
|
+
}
|
|
1010
|
+
return isPathAbsolute && !isAbsolute(path2) ? `/${path2}` : path2;
|
|
1011
|
+
};
|
|
1012
|
+
var joinPaths = function(...segments) {
|
|
1013
|
+
let path2 = "";
|
|
1014
|
+
for (const seg of segments) {
|
|
1015
|
+
if (!seg) {
|
|
1016
|
+
continue;
|
|
1017
|
+
}
|
|
1018
|
+
if (path2.length > 0) {
|
|
1019
|
+
const pathTrailing = path2[path2.length - 1] === "/";
|
|
1020
|
+
const segLeading = seg[0] === "/";
|
|
1021
|
+
const both = pathTrailing && segLeading;
|
|
1022
|
+
if (both) {
|
|
1023
|
+
path2 += seg.slice(1);
|
|
1024
|
+
} else {
|
|
1025
|
+
path2 += pathTrailing || segLeading ? seg : `/${seg}`;
|
|
1026
|
+
}
|
|
1027
|
+
} else {
|
|
1028
|
+
path2 += seg;
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1031
|
+
return correctPaths(path2);
|
|
1032
|
+
};
|
|
1033
|
+
function normalizeString(path2, allowAboveRoot) {
|
|
1034
|
+
let res = "";
|
|
1035
|
+
let lastSegmentLength = 0;
|
|
1036
|
+
let lastSlash = -1;
|
|
1037
|
+
let dots = 0;
|
|
1038
|
+
let char = null;
|
|
1039
|
+
for (let index = 0; index <= path2.length; ++index) {
|
|
1040
|
+
if (index < path2.length) {
|
|
1041
|
+
char = path2[index];
|
|
1042
|
+
} else if (char === "/") {
|
|
1043
|
+
break;
|
|
1044
|
+
} else {
|
|
1045
|
+
char = "/";
|
|
1046
|
+
}
|
|
1047
|
+
if (char === "/") {
|
|
1048
|
+
if (lastSlash === index - 1 || dots === 1) {
|
|
1049
|
+
} else if (dots === 2) {
|
|
1050
|
+
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
1051
|
+
if (res.length > 2) {
|
|
1052
|
+
const lastSlashIndex = res.lastIndexOf("/");
|
|
1053
|
+
if (lastSlashIndex === -1) {
|
|
1054
|
+
res = "";
|
|
1055
|
+
lastSegmentLength = 0;
|
|
1056
|
+
} else {
|
|
1057
|
+
res = res.slice(0, lastSlashIndex);
|
|
1058
|
+
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
|
|
1059
|
+
}
|
|
1060
|
+
lastSlash = index;
|
|
1061
|
+
dots = 0;
|
|
1062
|
+
continue;
|
|
1063
|
+
} else if (res.length > 0) {
|
|
1064
|
+
res = "";
|
|
1065
|
+
lastSegmentLength = 0;
|
|
1066
|
+
lastSlash = index;
|
|
1067
|
+
dots = 0;
|
|
1068
|
+
continue;
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1071
|
+
if (allowAboveRoot) {
|
|
1072
|
+
res += res.length > 0 ? "/.." : "..";
|
|
1073
|
+
lastSegmentLength = 2;
|
|
1074
|
+
}
|
|
1075
|
+
} else {
|
|
1076
|
+
if (res.length > 0) {
|
|
1077
|
+
res += `/${path2.slice(lastSlash + 1, index)}`;
|
|
1078
|
+
} else {
|
|
1079
|
+
res = path2.slice(lastSlash + 1, index);
|
|
1080
|
+
}
|
|
1081
|
+
lastSegmentLength = index - lastSlash - 1;
|
|
1082
|
+
}
|
|
1083
|
+
lastSlash = index;
|
|
1084
|
+
dots = 0;
|
|
1085
|
+
} else if (char === "." && dots !== -1) {
|
|
1086
|
+
++dots;
|
|
1087
|
+
} else {
|
|
1088
|
+
dots = -1;
|
|
1089
|
+
}
|
|
1090
|
+
}
|
|
1091
|
+
return res;
|
|
1092
|
+
}
|
|
1093
|
+
var isAbsolute = function(p) {
|
|
1094
|
+
return _IS_ABSOLUTE_RE.test(p);
|
|
1095
|
+
};
|
|
1096
|
+
|
|
1097
|
+
// ../config-tools/src/utilities/find-up.ts
|
|
1098
|
+
import { existsSync } from "node:fs";
|
|
1099
|
+
import { join } from "node:path";
|
|
1100
|
+
var MAX_PATH_SEARCH_DEPTH = 30;
|
|
1101
|
+
var depth = 0;
|
|
1102
|
+
function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
|
|
1103
|
+
const _startPath = startPath ?? process.cwd();
|
|
1104
|
+
if (endDirectoryNames.some(
|
|
1105
|
+
(endDirName) => existsSync(join(_startPath, endDirName))
|
|
1106
|
+
)) {
|
|
1107
|
+
return _startPath;
|
|
1108
|
+
}
|
|
1109
|
+
if (endFileNames.some((endFileName) => existsSync(join(_startPath, endFileName)))) {
|
|
1110
|
+
return _startPath;
|
|
1111
|
+
}
|
|
1112
|
+
if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
|
|
1113
|
+
const parent = join(_startPath, "..");
|
|
1114
|
+
return findFolderUp(parent, endFileNames, endDirectoryNames);
|
|
1115
|
+
}
|
|
1116
|
+
return void 0;
|
|
1117
|
+
}
|
|
1118
|
+
|
|
1119
|
+
// ../config-tools/src/utilities/find-workspace-root.ts
|
|
1120
|
+
var rootFiles = [
|
|
1121
|
+
"storm-workspace.json",
|
|
1122
|
+
"storm-workspace.yaml",
|
|
1123
|
+
"storm-workspace.yml",
|
|
1124
|
+
"storm-workspace.js",
|
|
1125
|
+
"storm-workspace.ts",
|
|
1126
|
+
".storm-workspace.json",
|
|
1127
|
+
".storm-workspace.yaml",
|
|
1128
|
+
".storm-workspace.yml",
|
|
1129
|
+
".storm-workspace.js",
|
|
1130
|
+
".storm-workspace.ts",
|
|
1131
|
+
"lerna.json",
|
|
1132
|
+
"nx.json",
|
|
1133
|
+
"turbo.json",
|
|
1134
|
+
"npm-workspace.json",
|
|
1135
|
+
"yarn-workspace.json",
|
|
1136
|
+
"pnpm-workspace.json",
|
|
1137
|
+
"npm-workspace.yaml",
|
|
1138
|
+
"yarn-workspace.yaml",
|
|
1139
|
+
"pnpm-workspace.yaml",
|
|
1140
|
+
"npm-workspace.yml",
|
|
1141
|
+
"yarn-workspace.yml",
|
|
1142
|
+
"pnpm-workspace.yml",
|
|
1143
|
+
"npm-lock.json",
|
|
1144
|
+
"yarn-lock.json",
|
|
1145
|
+
"pnpm-lock.json",
|
|
1146
|
+
"npm-lock.yaml",
|
|
1147
|
+
"yarn-lock.yaml",
|
|
1148
|
+
"pnpm-lock.yaml",
|
|
1149
|
+
"npm-lock.yml",
|
|
1150
|
+
"yarn-lock.yml",
|
|
1151
|
+
"pnpm-lock.yml",
|
|
1152
|
+
"bun.lockb"
|
|
1153
|
+
];
|
|
1154
|
+
var rootDirectories = [
|
|
1155
|
+
".storm-workspace",
|
|
1156
|
+
".nx",
|
|
1157
|
+
".git",
|
|
1158
|
+
".github",
|
|
1159
|
+
".vscode",
|
|
1160
|
+
".verdaccio"
|
|
1161
|
+
];
|
|
1162
|
+
function findWorkspaceRootSafe(pathInsideMonorepo) {
|
|
1163
|
+
if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) {
|
|
1164
|
+
return correctPaths(
|
|
1165
|
+
process.env.STORM_WORKSPACE_ROOT ?? process.env.NX_WORKSPACE_ROOT_PATH
|
|
1166
|
+
);
|
|
1167
|
+
}
|
|
1168
|
+
return correctPaths(
|
|
1169
|
+
findFolderUp(
|
|
1170
|
+
pathInsideMonorepo ?? process.cwd(),
|
|
1171
|
+
rootFiles,
|
|
1172
|
+
rootDirectories
|
|
1173
|
+
)
|
|
1174
|
+
);
|
|
1175
|
+
}
|
|
1176
|
+
function findWorkspaceRoot(pathInsideMonorepo) {
|
|
1177
|
+
const result = findWorkspaceRootSafe(pathInsideMonorepo);
|
|
1178
|
+
if (!result) {
|
|
1179
|
+
throw new Error(
|
|
1180
|
+
`Cannot find workspace root upwards from known path. Files search list includes:
|
|
1181
|
+
${rootFiles.join(
|
|
1182
|
+
"\n"
|
|
1183
|
+
)}
|
|
1184
|
+
Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
|
|
1185
|
+
);
|
|
1186
|
+
}
|
|
1187
|
+
return result;
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1190
|
+
// ../config/src/types.ts
|
|
1191
|
+
var COLOR_KEYS = [
|
|
1192
|
+
"dark",
|
|
1193
|
+
"light",
|
|
1194
|
+
"base",
|
|
1195
|
+
"brand",
|
|
1196
|
+
"alternate",
|
|
1197
|
+
"accent",
|
|
1198
|
+
"link",
|
|
1199
|
+
"success",
|
|
1200
|
+
"help",
|
|
1201
|
+
"info",
|
|
1202
|
+
"warning",
|
|
1203
|
+
"danger",
|
|
1204
|
+
"fatal",
|
|
1205
|
+
"performance",
|
|
1206
|
+
"positive",
|
|
1207
|
+
"negative"
|
|
1208
|
+
];
|
|
1209
|
+
|
|
1210
|
+
// ../config-tools/src/utilities/get-default-config.ts
|
|
1211
|
+
import { existsSync as existsSync2 } from "node:fs";
|
|
1212
|
+
import { readFile } from "node:fs/promises";
|
|
1213
|
+
import { join as join2 } from "node:path";
|
|
1214
|
+
async function getPackageJsonConfig(root) {
|
|
1215
|
+
let license = STORM_DEFAULT_LICENSE;
|
|
1216
|
+
let homepage = void 0;
|
|
1217
|
+
let support = void 0;
|
|
1218
|
+
let name = void 0;
|
|
1219
|
+
let namespace = void 0;
|
|
1220
|
+
let repository = void 0;
|
|
1221
|
+
const workspaceRoot = findWorkspaceRoot(root);
|
|
1222
|
+
if (existsSync2(join2(workspaceRoot, "package.json"))) {
|
|
1223
|
+
const file = await readFile(
|
|
1224
|
+
joinPaths(workspaceRoot, "package.json"),
|
|
1225
|
+
"utf8"
|
|
1226
|
+
);
|
|
1227
|
+
if (file) {
|
|
1228
|
+
const packageJson = JSON.parse(file);
|
|
1229
|
+
if (packageJson.name) {
|
|
1230
|
+
name = packageJson.name;
|
|
1231
|
+
}
|
|
1232
|
+
if (packageJson.namespace) {
|
|
1233
|
+
namespace = packageJson.namespace;
|
|
1234
|
+
}
|
|
1235
|
+
if (packageJson.repository) {
|
|
1236
|
+
if (typeof packageJson.repository === "string") {
|
|
1237
|
+
repository = packageJson.repository;
|
|
1238
|
+
} else if (packageJson.repository.url) {
|
|
1239
|
+
repository = packageJson.repository.url;
|
|
1240
|
+
}
|
|
1241
|
+
}
|
|
1242
|
+
if (packageJson.license) {
|
|
1243
|
+
license = packageJson.license;
|
|
1244
|
+
}
|
|
1245
|
+
if (packageJson.homepage) {
|
|
1246
|
+
homepage = packageJson.homepage;
|
|
1247
|
+
}
|
|
1248
|
+
if (packageJson.bugs) {
|
|
1249
|
+
if (typeof packageJson.bugs === "string") {
|
|
1250
|
+
support = packageJson.bugs;
|
|
1251
|
+
} else if (packageJson.bugs.url) {
|
|
1252
|
+
support = packageJson.bugs.url;
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
}
|
|
1256
|
+
}
|
|
1257
|
+
return {
|
|
1258
|
+
workspaceRoot,
|
|
1259
|
+
name,
|
|
1260
|
+
namespace,
|
|
1261
|
+
repository,
|
|
1262
|
+
license,
|
|
1263
|
+
homepage,
|
|
1264
|
+
support
|
|
1265
|
+
};
|
|
1266
|
+
}
|
|
1267
|
+
function applyDefaultConfig(config) {
|
|
1268
|
+
if (!config.support && config.contact) {
|
|
1269
|
+
config.support = config.contact;
|
|
1270
|
+
}
|
|
1271
|
+
if (!config.contact && config.support) {
|
|
1272
|
+
config.contact = config.support;
|
|
1273
|
+
}
|
|
1274
|
+
if (config.homepage) {
|
|
1275
|
+
if (!config.docs) {
|
|
1276
|
+
config.docs = `${config.homepage}/docs`;
|
|
1277
|
+
}
|
|
1278
|
+
if (!config.license) {
|
|
1279
|
+
config.license = `${config.homepage}/license`;
|
|
1280
|
+
}
|
|
1281
|
+
if (!config.support) {
|
|
1282
|
+
config.support = `${config.homepage}/support`;
|
|
1283
|
+
}
|
|
1284
|
+
if (!config.contact) {
|
|
1285
|
+
config.contact = `${config.homepage}/contact`;
|
|
1286
|
+
}
|
|
1287
|
+
if (!config.error?.codesFile || !config?.error?.url) {
|
|
1288
|
+
config.error ??= { codesFile: STORM_DEFAULT_ERROR_CODES_FILE };
|
|
1289
|
+
if (config.homepage) {
|
|
1290
|
+
config.error.url ??= `${config.homepage}/errors`;
|
|
1291
|
+
}
|
|
1292
|
+
}
|
|
1293
|
+
}
|
|
1294
|
+
return config;
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
// ../config-tools/src/utilities/process-handler.ts
|
|
1298
|
+
var exitWithError = (config) => {
|
|
1299
|
+
writeFatal("Exiting script with an error status...", config);
|
|
1300
|
+
process.exit(1);
|
|
1301
|
+
};
|
|
1302
|
+
var exitWithSuccess = (config) => {
|
|
1303
|
+
writeSuccess("Script completed successfully. Exiting...", config);
|
|
1304
|
+
process.exit(0);
|
|
1305
|
+
};
|
|
1306
|
+
var handleProcess = (config) => {
|
|
1307
|
+
writeTrace(
|
|
1308
|
+
`Using the following arguments to process the script: ${process.argv.join(", ")}`,
|
|
1309
|
+
config
|
|
1310
|
+
);
|
|
1311
|
+
process.on("unhandledRejection", (error) => {
|
|
1312
|
+
writeError(
|
|
1313
|
+
`An Unhandled Rejection occurred while running the program: ${error}`,
|
|
1314
|
+
config
|
|
1315
|
+
);
|
|
1316
|
+
exitWithError(config);
|
|
1317
|
+
});
|
|
1318
|
+
process.on("uncaughtException", (error) => {
|
|
1319
|
+
writeError(
|
|
1320
|
+
`An Uncaught Exception occurred while running the program: ${error.message}
|
|
1321
|
+
Stacktrace: ${error.stack}`,
|
|
1322
|
+
config
|
|
1323
|
+
);
|
|
1324
|
+
exitWithError(config);
|
|
1325
|
+
});
|
|
1326
|
+
process.on("SIGTERM", (signal) => {
|
|
1327
|
+
writeError(`The program terminated with signal code: ${signal}`, config);
|
|
1328
|
+
exitWithError(config);
|
|
1329
|
+
});
|
|
1330
|
+
process.on("SIGINT", (signal) => {
|
|
1331
|
+
writeError(`The program terminated with signal code: ${signal}`, config);
|
|
1332
|
+
exitWithError(config);
|
|
1333
|
+
});
|
|
1334
|
+
process.on("SIGHUP", (signal) => {
|
|
1335
|
+
writeError(`The program terminated with signal code: ${signal}`, config);
|
|
1336
|
+
exitWithError(config);
|
|
1337
|
+
});
|
|
1338
|
+
};
|
|
1339
|
+
|
|
1340
|
+
// ../config-tools/src/utilities/run.ts
|
|
1341
|
+
import { exec, execSync } from "node:child_process";
|
|
1342
|
+
var LARGE_BUFFER = 1024 * 1e6;
|
|
1343
|
+
var runAsync = (config, command, cwd = config.workspaceRoot ?? process.cwd(), env = process.env) => {
|
|
1344
|
+
return exec(command, {
|
|
1345
|
+
cwd,
|
|
1346
|
+
env: {
|
|
1347
|
+
...process.env,
|
|
1348
|
+
...env,
|
|
1349
|
+
CLICOLOR: "true",
|
|
1350
|
+
FORCE_COLOR: "true"
|
|
1351
|
+
},
|
|
1352
|
+
windowsHide: true,
|
|
1353
|
+
maxBuffer: LARGE_BUFFER,
|
|
1354
|
+
killSignal: "SIGTERM",
|
|
1355
|
+
encoding: "utf8"
|
|
1356
|
+
});
|
|
1357
|
+
};
|
|
1358
|
+
|
|
1359
|
+
// ../config-tools/src/config-file/get-config-file.ts
|
|
1360
|
+
var getConfigFileByName = async (fileName, filePath, options = {}) => {
|
|
1361
|
+
const workspacePath = filePath || findWorkspaceRoot(filePath);
|
|
1362
|
+
const configs = await Promise.all([
|
|
1363
|
+
loadConfig({
|
|
1364
|
+
cwd: workspacePath,
|
|
1365
|
+
packageJson: true,
|
|
1366
|
+
name: fileName,
|
|
1367
|
+
envName: fileName?.toUpperCase(),
|
|
1368
|
+
jitiOptions: {
|
|
1369
|
+
debug: false,
|
|
1370
|
+
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths(
|
|
1371
|
+
process.env.STORM_CACHE_DIR || "node_modules/.cache/storm",
|
|
1372
|
+
"jiti"
|
|
1373
|
+
)
|
|
1374
|
+
},
|
|
1375
|
+
...options
|
|
1376
|
+
}),
|
|
1377
|
+
loadConfig({
|
|
1378
|
+
cwd: workspacePath,
|
|
1379
|
+
packageJson: true,
|
|
1380
|
+
name: fileName,
|
|
1381
|
+
envName: fileName?.toUpperCase(),
|
|
1382
|
+
jitiOptions: {
|
|
1383
|
+
debug: false,
|
|
1384
|
+
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths(
|
|
1385
|
+
process.env.STORM_CACHE_DIR || "node_modules/.cache/storm",
|
|
1386
|
+
"jiti"
|
|
1387
|
+
)
|
|
1388
|
+
},
|
|
1389
|
+
configFile: fileName,
|
|
1390
|
+
...options
|
|
1391
|
+
})
|
|
1392
|
+
]);
|
|
1393
|
+
return defu(configs[0] ?? {}, configs[1] ?? {});
|
|
1394
|
+
};
|
|
1395
|
+
var getConfigFile = async (filePath, additionalFileNames = []) => {
|
|
1396
|
+
const workspacePath = filePath ? filePath : findWorkspaceRoot(filePath);
|
|
1397
|
+
const result = await getConfigFileByName("storm-workspace", workspacePath);
|
|
1398
|
+
let config = result.config;
|
|
1399
|
+
const configFile = result.configFile;
|
|
1400
|
+
if (config && configFile && Object.keys(config).length > 0 && !config.skipConfigLogging) {
|
|
1401
|
+
writeTrace(
|
|
1402
|
+
`Found Storm configuration file "${configFile.includes(`${workspacePath}/`) ? configFile.replace(`${workspacePath}/`, "") : configFile}" at "${workspacePath}"`,
|
|
1403
|
+
{
|
|
1404
|
+
logLevel: "all"
|
|
1405
|
+
}
|
|
1406
|
+
);
|
|
1407
|
+
}
|
|
1408
|
+
if (additionalFileNames && additionalFileNames.length > 0) {
|
|
1409
|
+
const results = await Promise.all(
|
|
1410
|
+
additionalFileNames.map(
|
|
1411
|
+
(fileName) => getConfigFileByName(fileName, workspacePath)
|
|
1412
|
+
)
|
|
1413
|
+
);
|
|
1414
|
+
for (const result2 of results) {
|
|
1415
|
+
if (result2?.config && result2?.configFile && Object.keys(result2.config).length > 0) {
|
|
1416
|
+
if (!config.skipConfigLogging && !result2.config.skipConfigLogging) {
|
|
1417
|
+
writeTrace(
|
|
1418
|
+
`Found alternative configuration file "${result2.configFile.includes(`${workspacePath}/`) ? result2.configFile.replace(`${workspacePath}/`, "") : result2.configFile}" at "${workspacePath}"`,
|
|
1419
|
+
{
|
|
1420
|
+
logLevel: "all"
|
|
1421
|
+
}
|
|
1422
|
+
);
|
|
1423
|
+
}
|
|
1424
|
+
config = defu(result2.config ?? {}, config ?? {});
|
|
1425
|
+
}
|
|
1426
|
+
}
|
|
1427
|
+
}
|
|
1428
|
+
if (!config || Object.keys(config).length === 0) {
|
|
1429
|
+
return void 0;
|
|
1430
|
+
}
|
|
1431
|
+
config.configFile = configFile;
|
|
1432
|
+
return config;
|
|
1433
|
+
};
|
|
1434
|
+
|
|
1435
|
+
// ../config-tools/src/env/get-env.ts
|
|
1436
|
+
var getExtensionEnv = (extensionName) => {
|
|
1437
|
+
const prefix = `STORM_EXTENSION_${extensionName.toUpperCase()}_`;
|
|
1438
|
+
return Object.keys(process.env).filter((key) => key.startsWith(prefix)).reduce((ret, key) => {
|
|
1439
|
+
const name = key.replace(prefix, "").split("_").map(
|
|
1440
|
+
(i) => i.length > 0 ? i.trim().charAt(0).toUpperCase() + i.trim().slice(1) : ""
|
|
1441
|
+
).join("");
|
|
1442
|
+
if (name) {
|
|
1443
|
+
ret[name] = process.env[key];
|
|
1444
|
+
}
|
|
1445
|
+
return ret;
|
|
1446
|
+
}, {});
|
|
1447
|
+
};
|
|
1448
|
+
var getConfigEnv = () => {
|
|
1449
|
+
const prefix = "STORM_";
|
|
1450
|
+
let config = {
|
|
1451
|
+
extends: process.env[`${prefix}EXTENDS`] || void 0,
|
|
1452
|
+
name: process.env[`${prefix}NAME`] || void 0,
|
|
1453
|
+
variant: process.env[`${prefix}VARIANT`] || void 0,
|
|
1454
|
+
namespace: process.env[`${prefix}NAMESPACE`] || void 0,
|
|
1455
|
+
owner: process.env[`${prefix}OWNER`] || void 0,
|
|
1456
|
+
bot: {
|
|
1457
|
+
name: process.env[`${prefix}BOT_NAME`] || void 0,
|
|
1458
|
+
email: process.env[`${prefix}BOT_EMAIL`] || void 0
|
|
1459
|
+
},
|
|
1460
|
+
release: {
|
|
1461
|
+
banner: {
|
|
1462
|
+
url: process.env[`${prefix}RELEASE_BANNER_URL`] || void 0,
|
|
1463
|
+
alt: process.env[`${prefix}RELEASE_BANNER_ALT`] || void 0
|
|
1464
|
+
},
|
|
1465
|
+
header: process.env[`${prefix}RELEASE_HEADER`] || void 0,
|
|
1466
|
+
footer: process.env[`${prefix}RELEASE_FOOTER`] || void 0
|
|
1467
|
+
},
|
|
1468
|
+
error: {
|
|
1469
|
+
codesFile: process.env[`${prefix}ERROR_CODES_FILE`] || void 0,
|
|
1470
|
+
url: process.env[`${prefix}ERROR_URL`] || void 0
|
|
1471
|
+
},
|
|
1472
|
+
socials: {
|
|
1473
|
+
twitter: process.env[`${prefix}SOCIAL_TWITTER`] || void 0,
|
|
1474
|
+
discord: process.env[`${prefix}SOCIAL_DISCORD`] || void 0,
|
|
1475
|
+
telegram: process.env[`${prefix}SOCIAL_TELEGRAM`] || void 0,
|
|
1476
|
+
slack: process.env[`${prefix}SOCIAL_SLACK`] || void 0,
|
|
1477
|
+
medium: process.env[`${prefix}SOCIAL_MEDIUM`] || void 0,
|
|
1478
|
+
github: process.env[`${prefix}SOCIAL_GITHUB`] || void 0
|
|
1479
|
+
},
|
|
1480
|
+
organization: process.env[`${prefix}ORG`] || process.env[`${prefix}ORGANIZATION`] || process.env[`${prefix}ORG_NAME`] || process.env[`${prefix}ORGANIZATION_NAME`] ? process.env[`${prefix}ORG_DESCRIPTION`] || process.env[`${prefix}ORGANIZATION_DESCRIPTION`] || process.env[`${prefix}ORG_URL`] || process.env[`${prefix}ORGANIZATION_URL`] || process.env[`${prefix}ORG_LOGO`] || process.env[`${prefix}ORGANIZATION_LOGO`] ? {
|
|
1481
|
+
name: process.env[`${prefix}ORG`] || process.env[`${prefix}ORGANIZATION`] || process.env[`${prefix}ORG_NAME`] || process.env[`${prefix}ORGANIZATION_NAME`],
|
|
1482
|
+
description: process.env[`${prefix}ORG_DESCRIPTION`] || process.env[`${prefix}ORGANIZATION_DESCRIPTION`] || void 0,
|
|
1483
|
+
url: process.env[`${prefix}ORG_URL`] || process.env[`${prefix}ORGANIZATION_URL`] || void 0,
|
|
1484
|
+
logo: process.env[`${prefix}ORG_LOGO`] || process.env[`${prefix}ORGANIZATION_LOGO`] || void 0,
|
|
1485
|
+
icon: process.env[`${prefix}ORG_ICON`] || process.env[`${prefix}ORGANIZATION_ICON`] || void 0
|
|
1486
|
+
} : process.env[`${prefix}ORG`] || process.env[`${prefix}ORGANIZATION`] || process.env[`${prefix}ORG_NAME`] || process.env[`${prefix}ORGANIZATION_NAME`] : void 0,
|
|
1487
|
+
packageManager: process.env[`${prefix}PACKAGE_MANAGER`] || void 0,
|
|
1488
|
+
license: process.env[`${prefix}LICENSE`] || void 0,
|
|
1489
|
+
homepage: process.env[`${prefix}HOMEPAGE`] || void 0,
|
|
1490
|
+
docs: process.env[`${prefix}DOCS`] || void 0,
|
|
1491
|
+
portal: process.env[`${prefix}PORTAL`] || void 0,
|
|
1492
|
+
licensing: process.env[`${prefix}LICENSING`] || void 0,
|
|
1493
|
+
contact: process.env[`${prefix}CONTACT`] || void 0,
|
|
1494
|
+
support: process.env[`${prefix}SUPPORT`] || void 0,
|
|
1495
|
+
timezone: process.env[`${prefix}TIMEZONE`] || process.env.TZ || void 0,
|
|
1496
|
+
locale: process.env[`${prefix}LOCALE`] || process.env.LOCALE || void 0,
|
|
1497
|
+
configFile: process.env[`${prefix}WORKSPACE_CONFIG_FILE`] ? correctPaths(process.env[`${prefix}WORKSPACE_CONFIG_FILE`]) : void 0,
|
|
1498
|
+
workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`] ? correctPaths(process.env[`${prefix}WORKSPACE_ROOT`]) : void 0,
|
|
1499
|
+
directories: {
|
|
1500
|
+
cache: process.env[`${prefix}CACHE_DIR`] ? correctPaths(process.env[`${prefix}CACHE_DIR`]) : process.env[`${prefix}CACHE_DIRECTORY`] ? correctPaths(process.env[`${prefix}CACHE_DIRECTORY`]) : void 0,
|
|
1501
|
+
data: process.env[`${prefix}DATA_DIR`] ? correctPaths(process.env[`${prefix}DATA_DIR`]) : process.env[`${prefix}DATA_DIRECTORY`] ? correctPaths(process.env[`${prefix}DATA_DIRECTORY`]) : void 0,
|
|
1502
|
+
config: process.env[`${prefix}CONFIG_DIR`] ? correctPaths(process.env[`${prefix}CONFIG_DIR`]) : process.env[`${prefix}CONFIG_DIRECTORY`] ? correctPaths(process.env[`${prefix}CONFIG_DIRECTORY`]) : void 0,
|
|
1503
|
+
temp: process.env[`${prefix}TEMP_DIR`] ? correctPaths(process.env[`${prefix}TEMP_DIR`]) : process.env[`${prefix}TEMP_DIRECTORY`] ? correctPaths(process.env[`${prefix}TEMP_DIRECTORY`]) : void 0,
|
|
1504
|
+
log: process.env[`${prefix}LOG_DIR`] ? correctPaths(process.env[`${prefix}LOG_DIR`]) : process.env[`${prefix}LOG_DIRECTORY`] ? correctPaths(process.env[`${prefix}LOG_DIRECTORY`]) : void 0,
|
|
1505
|
+
build: process.env[`${prefix}BUILD_DIR`] ? correctPaths(process.env[`${prefix}BUILD_DIR`]) : process.env[`${prefix}BUILD_DIRECTORY`] ? correctPaths(process.env[`${prefix}BUILD_DIRECTORY`]) : void 0
|
|
1506
|
+
},
|
|
1507
|
+
skipCache: process.env[`${prefix}SKIP_CACHE`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CACHE`]) : void 0,
|
|
1508
|
+
mode: (process.env[`${prefix}MODE`] ?? process.env.NODE_ENV ?? process.env.ENVIRONMENT) || void 0,
|
|
1509
|
+
// ci:
|
|
1510
|
+
// process.env[`${prefix}CI`] !== undefined
|
|
1511
|
+
// ? Boolean(
|
|
1512
|
+
// process.env[`${prefix}CI`] ??
|
|
1513
|
+
// process.env.CI ??
|
|
1514
|
+
// process.env.CONTINUOUS_INTEGRATION
|
|
1515
|
+
// )
|
|
1516
|
+
// : undefined,
|
|
1517
|
+
repository: process.env[`${prefix}REPOSITORY`] || void 0,
|
|
1518
|
+
branch: process.env[`${prefix}BRANCH`] || void 0,
|
|
1519
|
+
preid: process.env[`${prefix}PRE_ID`] || void 0,
|
|
1520
|
+
registry: {
|
|
1521
|
+
github: process.env[`${prefix}REGISTRY_GITHUB`] || void 0,
|
|
1522
|
+
npm: process.env[`${prefix}REGISTRY_NPM`] || void 0,
|
|
1523
|
+
cargo: process.env[`${prefix}REGISTRY_CARGO`] || void 0,
|
|
1524
|
+
cyclone: process.env[`${prefix}REGISTRY_CYCLONE`] || void 0,
|
|
1525
|
+
container: process.env[`${prefix}REGISTRY_CONTAINER`] || void 0
|
|
1526
|
+
},
|
|
1527
|
+
logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(
|
|
1528
|
+
Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
|
|
1529
|
+
) ? getLogLevelLabel(
|
|
1530
|
+
Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
|
|
1531
|
+
) : process.env[`${prefix}LOG_LEVEL`] : void 0,
|
|
1532
|
+
skipConfigLogging: process.env[`${prefix}SKIP_CONFIG_LOGGING`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CONFIG_LOGGING`]) : void 0
|
|
1533
|
+
};
|
|
1534
|
+
const themeNames = Object.keys(process.env).filter(
|
|
1535
|
+
(envKey) => envKey.startsWith(`${prefix}COLOR_`) && COLOR_KEYS.every(
|
|
1536
|
+
(colorKey) => !envKey.startsWith(`${prefix}COLOR_LIGHT_${colorKey}`) && !envKey.startsWith(`${prefix}COLOR_DARK_${colorKey}`)
|
|
1537
|
+
)
|
|
1538
|
+
);
|
|
1539
|
+
config.colors = themeNames.length > 0 ? themeNames.reduce(
|
|
1540
|
+
(ret, themeName) => {
|
|
1541
|
+
ret[themeName] = getThemeColorsEnv(prefix, themeName);
|
|
1542
|
+
return ret;
|
|
1543
|
+
},
|
|
1544
|
+
{}
|
|
1545
|
+
) : getThemeColorsEnv(prefix);
|
|
1546
|
+
if (config.docs === STORM_DEFAULT_DOCS) {
|
|
1547
|
+
if (config.homepage === STORM_DEFAULT_HOMEPAGE) {
|
|
1548
|
+
config.docs = `${STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/docs`;
|
|
1549
|
+
} else {
|
|
1550
|
+
config.docs = `${config.homepage}/docs`;
|
|
1551
|
+
}
|
|
1552
|
+
}
|
|
1553
|
+
if (config.licensing === STORM_DEFAULT_LICENSING) {
|
|
1554
|
+
if (config.homepage === STORM_DEFAULT_HOMEPAGE) {
|
|
1555
|
+
config.licensing = `${STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/licensing`;
|
|
1556
|
+
} else {
|
|
1557
|
+
config.licensing = `${config.homepage}/docs`;
|
|
1558
|
+
}
|
|
1559
|
+
}
|
|
1560
|
+
const serializedConfig = process.env[`${prefix}WORKSPACE_CONFIG`];
|
|
1561
|
+
if (serializedConfig) {
|
|
1562
|
+
const parsed = JSON.parse(serializedConfig);
|
|
1563
|
+
config = {
|
|
1564
|
+
...config,
|
|
1565
|
+
...parsed,
|
|
1566
|
+
colors: { ...config.colors, ...parsed.colors },
|
|
1567
|
+
extensions: { ...config.extensions, ...parsed.extensions }
|
|
1568
|
+
};
|
|
1569
|
+
}
|
|
1570
|
+
return config;
|
|
1571
|
+
};
|
|
1572
|
+
var getThemeColorsEnv = (prefix, theme) => {
|
|
1573
|
+
const themeName = `COLOR_${theme && theme !== "base" ? `${theme}_` : ""}`.toUpperCase();
|
|
1574
|
+
return process.env[`${prefix}${themeName}LIGHT_BRAND`] || process.env[`${prefix}${themeName}DARK_BRAND`] ? getMultiThemeColorsEnv(prefix + themeName) : getSingleThemeColorsEnv(prefix + themeName);
|
|
1575
|
+
};
|
|
1576
|
+
var getSingleThemeColorsEnv = (prefix) => {
|
|
1577
|
+
const gradient = [];
|
|
1578
|
+
if (process.env[`${prefix}GRADIENT_START`] && process.env[`${prefix}GRADIENT_END`]) {
|
|
1579
|
+
gradient.push(
|
|
1580
|
+
process.env[`${prefix}GRADIENT_START`],
|
|
1581
|
+
process.env[`${prefix}GRADIENT_END`]
|
|
1582
|
+
);
|
|
1583
|
+
} else if (process.env[`${prefix}GRADIENT_0`] || process.env[`${prefix}GRADIENT_1`]) {
|
|
1584
|
+
let index = process.env[`${prefix}GRADIENT_0`] ? 0 : 1;
|
|
1585
|
+
while (process.env[`${prefix}GRADIENT_${index}`]) {
|
|
1586
|
+
gradient.push(process.env[`${prefix}GRADIENT_${index}`]);
|
|
1587
|
+
index++;
|
|
1588
|
+
}
|
|
1589
|
+
}
|
|
1590
|
+
return {
|
|
1591
|
+
dark: process.env[`${prefix}DARK`],
|
|
1592
|
+
light: process.env[`${prefix}LIGHT`],
|
|
1593
|
+
brand: process.env[`${prefix}BRAND`],
|
|
1594
|
+
alternate: process.env[`${prefix}ALTERNATE`],
|
|
1595
|
+
accent: process.env[`${prefix}ACCENT`],
|
|
1596
|
+
link: process.env[`${prefix}LINK`],
|
|
1597
|
+
help: process.env[`${prefix}HELP`],
|
|
1598
|
+
success: process.env[`${prefix}SUCCESS`],
|
|
1599
|
+
info: process.env[`${prefix}INFO`],
|
|
1600
|
+
debug: process.env[`${prefix}DEBUG`],
|
|
1601
|
+
warning: process.env[`${prefix}WARNING`],
|
|
1602
|
+
danger: process.env[`${prefix}DANGER`],
|
|
1603
|
+
fatal: process.env[`${prefix}FATAL`],
|
|
1604
|
+
performance: process.env[`${prefix}PERFORMANCE`],
|
|
1605
|
+
positive: process.env[`${prefix}POSITIVE`],
|
|
1606
|
+
negative: process.env[`${prefix}NEGATIVE`],
|
|
1607
|
+
gradient
|
|
1608
|
+
};
|
|
1609
|
+
};
|
|
1610
|
+
var getMultiThemeColorsEnv = (prefix) => {
|
|
1611
|
+
return {
|
|
1612
|
+
light: getBaseThemeColorsEnv(`${prefix}_LIGHT_`),
|
|
1613
|
+
dark: getBaseThemeColorsEnv(`${prefix}_DARK_`)
|
|
1614
|
+
};
|
|
1615
|
+
};
|
|
1616
|
+
var getBaseThemeColorsEnv = (prefix) => {
|
|
1617
|
+
const gradient = [];
|
|
1618
|
+
if (process.env[`${prefix}GRADIENT_START`] && process.env[`${prefix}GRADIENT_END`]) {
|
|
1619
|
+
gradient.push(
|
|
1620
|
+
process.env[`${prefix}GRADIENT_START`],
|
|
1621
|
+
process.env[`${prefix}GRADIENT_END`]
|
|
1622
|
+
);
|
|
1623
|
+
} else if (process.env[`${prefix}GRADIENT_0`] || process.env[`${prefix}GRADIENT_1`]) {
|
|
1624
|
+
let index = process.env[`${prefix}GRADIENT_0`] ? 0 : 1;
|
|
1625
|
+
while (process.env[`${prefix}GRADIENT_${index}`]) {
|
|
1626
|
+
gradient.push(process.env[`${prefix}GRADIENT_${index}`]);
|
|
1627
|
+
index++;
|
|
1628
|
+
}
|
|
1629
|
+
}
|
|
1630
|
+
return {
|
|
1631
|
+
foreground: process.env[`${prefix}FOREGROUND`],
|
|
1632
|
+
background: process.env[`${prefix}BACKGROUND`],
|
|
1633
|
+
brand: process.env[`${prefix}BRAND`],
|
|
1634
|
+
alternate: process.env[`${prefix}ALTERNATE`],
|
|
1635
|
+
accent: process.env[`${prefix}ACCENT`],
|
|
1636
|
+
link: process.env[`${prefix}LINK`],
|
|
1637
|
+
help: process.env[`${prefix}HELP`],
|
|
1638
|
+
success: process.env[`${prefix}SUCCESS`],
|
|
1639
|
+
info: process.env[`${prefix}INFO`],
|
|
1640
|
+
debug: process.env[`${prefix}DEBUG`],
|
|
1641
|
+
warning: process.env[`${prefix}WARNING`],
|
|
1642
|
+
danger: process.env[`${prefix}DANGER`],
|
|
1643
|
+
fatal: process.env[`${prefix}FATAL`],
|
|
1644
|
+
performance: process.env[`${prefix}PERFORMANCE`],
|
|
1645
|
+
positive: process.env[`${prefix}POSITIVE`],
|
|
1646
|
+
negative: process.env[`${prefix}NEGATIVE`],
|
|
1647
|
+
gradient
|
|
1648
|
+
};
|
|
1649
|
+
};
|
|
1650
|
+
|
|
1651
|
+
// ../config-tools/src/env/set-env.ts
|
|
1652
|
+
var setExtensionEnv = (extensionName, extension) => {
|
|
1653
|
+
for (const key of Object.keys(extension ?? {})) {
|
|
1654
|
+
if (extension[key]) {
|
|
1655
|
+
const result = key?.replace(
|
|
1656
|
+
/([A-Z])+/g,
|
|
1657
|
+
(input) => input ? input[0]?.toUpperCase() + input.slice(1) : ""
|
|
1658
|
+
).split(/(?=[A-Z])|[.\-\s_]/).map((x) => x.toLowerCase()) ?? [];
|
|
1659
|
+
let extensionKey;
|
|
1660
|
+
if (result.length === 0) {
|
|
1661
|
+
return;
|
|
1662
|
+
}
|
|
1663
|
+
if (result.length === 1) {
|
|
1664
|
+
extensionKey = result[0]?.toUpperCase() ?? "";
|
|
1665
|
+
} else {
|
|
1666
|
+
extensionKey = result.reduce((ret, part) => {
|
|
1667
|
+
return `${ret}_${part.toLowerCase()}`;
|
|
1668
|
+
});
|
|
1669
|
+
}
|
|
1670
|
+
process.env[`STORM_EXTENSION_${extensionName.toUpperCase()}_${extensionKey.toUpperCase()}`] = extension[key];
|
|
1671
|
+
}
|
|
1672
|
+
}
|
|
1673
|
+
};
|
|
1674
|
+
var setConfigEnv = (config) => {
|
|
1675
|
+
const prefix = "STORM_";
|
|
1676
|
+
if (config.extends) {
|
|
1677
|
+
process.env[`${prefix}EXTENDS`] = Array.isArray(config.extends) ? JSON.stringify(config.extends) : config.extends;
|
|
1678
|
+
}
|
|
1679
|
+
if (config.name) {
|
|
1680
|
+
process.env[`${prefix}NAME`] = config.name;
|
|
1681
|
+
}
|
|
1682
|
+
if (config.variant) {
|
|
1683
|
+
process.env[`${prefix}VARIANT`] = config.variant;
|
|
1684
|
+
}
|
|
1685
|
+
if (config.namespace) {
|
|
1686
|
+
process.env[`${prefix}NAMESPACE`] = config.namespace;
|
|
1687
|
+
}
|
|
1688
|
+
if (config.owner) {
|
|
1689
|
+
process.env[`${prefix}OWNER`] = config.owner;
|
|
1690
|
+
}
|
|
1691
|
+
if (config.bot) {
|
|
1692
|
+
process.env[`${prefix}BOT_NAME`] = config.bot.name;
|
|
1693
|
+
process.env[`${prefix}BOT_EMAIL`] = config.bot.email;
|
|
1694
|
+
}
|
|
1695
|
+
if (config.error) {
|
|
1696
|
+
process.env[`${prefix}ERROR_CODES_FILE`] = config.error.codesFile;
|
|
1697
|
+
process.env[`${prefix}ERROR_URL`] = config.error.url;
|
|
1698
|
+
}
|
|
1699
|
+
if (config.release) {
|
|
1700
|
+
if (config.release.banner) {
|
|
1701
|
+
if (typeof config.release.banner === "string") {
|
|
1702
|
+
process.env[`${prefix}RELEASE_BANNER`] = config.release.banner;
|
|
1703
|
+
process.env[`${prefix}RELEASE_BANNER_URL`] = config.release.banner;
|
|
1704
|
+
} else {
|
|
1705
|
+
process.env[`${prefix}RELEASE_BANNER`] = config.release.banner.url;
|
|
1706
|
+
process.env[`${prefix}RELEASE_BANNER_URL`] = config.release.banner.url;
|
|
1707
|
+
process.env[`${prefix}RELEASE_BANNER_ALT`] = config.release.banner.alt;
|
|
1708
|
+
}
|
|
1709
|
+
}
|
|
1710
|
+
process.env[`${prefix}RELEASE_HEADER`] = config.release.header;
|
|
1711
|
+
process.env[`${prefix}RELEASE_FOOTER`] = config.release.footer;
|
|
1712
|
+
}
|
|
1713
|
+
if (config.socials) {
|
|
1714
|
+
if (config.socials.twitter) {
|
|
1715
|
+
process.env[`${prefix}SOCIAL_TWITTER`] = config.socials.twitter;
|
|
1716
|
+
}
|
|
1717
|
+
if (config.socials.discord) {
|
|
1718
|
+
process.env[`${prefix}SOCIAL_DISCORD`] = config.socials.discord;
|
|
1719
|
+
}
|
|
1720
|
+
if (config.socials.telegram) {
|
|
1721
|
+
process.env[`${prefix}SOCIAL_TELEGRAM`] = config.socials.telegram;
|
|
1722
|
+
}
|
|
1723
|
+
if (config.socials.slack) {
|
|
1724
|
+
process.env[`${prefix}SOCIAL_SLACK`] = config.socials.slack;
|
|
1725
|
+
}
|
|
1726
|
+
if (config.socials.medium) {
|
|
1727
|
+
process.env[`${prefix}SOCIAL_MEDIUM`] = config.socials.medium;
|
|
1728
|
+
}
|
|
1729
|
+
if (config.socials.github) {
|
|
1730
|
+
process.env[`${prefix}SOCIAL_GITHUB`] = config.socials.github;
|
|
1731
|
+
}
|
|
1732
|
+
}
|
|
1733
|
+
if (config.organization) {
|
|
1734
|
+
if (typeof config.organization === "string") {
|
|
1735
|
+
process.env[`${prefix}ORG`] = config.organization;
|
|
1736
|
+
process.env[`${prefix}ORG_NAME`] = config.organization;
|
|
1737
|
+
process.env[`${prefix}ORGANIZATION`] = config.organization;
|
|
1738
|
+
process.env[`${prefix}ORGANIZATION_NAME`] = config.organization;
|
|
1739
|
+
} else {
|
|
1740
|
+
process.env[`${prefix}ORG`] = config.organization.name;
|
|
1741
|
+
process.env[`${prefix}ORG_NAME`] = config.organization.name;
|
|
1742
|
+
process.env[`${prefix}ORGANIZATION`] = config.organization.name;
|
|
1743
|
+
process.env[`${prefix}ORGANIZATION_NAME`] = config.organization.name;
|
|
1744
|
+
if (config.organization.url) {
|
|
1745
|
+
process.env[`${prefix}ORG_URL`] = config.organization.url;
|
|
1746
|
+
process.env[`${prefix}ORGANIZATION_URL`] = config.organization.url;
|
|
1747
|
+
}
|
|
1748
|
+
if (config.organization.description) {
|
|
1749
|
+
process.env[`${prefix}ORG_DESCRIPTION`] = config.organization.description;
|
|
1750
|
+
process.env[`${prefix}ORGANIZATION_DESCRIPTION`] = config.organization.description;
|
|
1751
|
+
}
|
|
1752
|
+
if (config.organization.logo) {
|
|
1753
|
+
process.env[`${prefix}ORG_LOGO`] = config.organization.logo;
|
|
1754
|
+
process.env[`${prefix}ORGANIZATION_LOGO`] = config.organization.logo;
|
|
1755
|
+
}
|
|
1756
|
+
if (config.organization.icon) {
|
|
1757
|
+
process.env[`${prefix}ORG_ICON`] = config.organization.icon;
|
|
1758
|
+
process.env[`${prefix}ORGANIZATION_ICON`] = config.organization.icon;
|
|
1759
|
+
}
|
|
1760
|
+
}
|
|
1761
|
+
}
|
|
1762
|
+
if (config.packageManager) {
|
|
1763
|
+
process.env[`${prefix}PACKAGE_MANAGER`] = config.packageManager;
|
|
1764
|
+
}
|
|
1765
|
+
if (config.license) {
|
|
1766
|
+
process.env[`${prefix}LICENSE`] = config.license;
|
|
1767
|
+
}
|
|
1768
|
+
if (config.homepage) {
|
|
1769
|
+
process.env[`${prefix}HOMEPAGE`] = config.homepage;
|
|
1770
|
+
}
|
|
1771
|
+
if (config.docs) {
|
|
1772
|
+
process.env[`${prefix}DOCS`] = config.docs;
|
|
1773
|
+
}
|
|
1774
|
+
if (config.portal) {
|
|
1775
|
+
process.env[`${prefix}PORTAL`] = config.portal;
|
|
1776
|
+
}
|
|
1777
|
+
if (config.licensing) {
|
|
1778
|
+
process.env[`${prefix}LICENSING`] = config.licensing;
|
|
1779
|
+
}
|
|
1780
|
+
if (config.contact) {
|
|
1781
|
+
process.env[`${prefix}CONTACT`] = config.contact;
|
|
1782
|
+
}
|
|
1783
|
+
if (config.support) {
|
|
1784
|
+
process.env[`${prefix}SUPPORT`] = config.support;
|
|
1785
|
+
}
|
|
1786
|
+
if (config.timezone) {
|
|
1787
|
+
process.env[`${prefix}TIMEZONE`] = config.timezone;
|
|
1788
|
+
process.env.TZ = config.timezone;
|
|
1789
|
+
process.env.DEFAULT_TIMEZONE = config.timezone;
|
|
1790
|
+
process.env.TIMEZONE = config.timezone;
|
|
1791
|
+
}
|
|
1792
|
+
if (config.locale) {
|
|
1793
|
+
process.env[`${prefix}LOCALE`] = config.locale;
|
|
1794
|
+
process.env.DEFAULT_LOCALE = config.locale;
|
|
1795
|
+
process.env.LOCALE = config.locale;
|
|
1796
|
+
process.env.LANG = config.locale ? `${config.locale.replaceAll("-", "_")}.UTF-8` : "en_US.UTF-8";
|
|
1797
|
+
}
|
|
1798
|
+
if (config.configFile) {
|
|
1799
|
+
process.env[`${prefix}WORKSPACE_CONFIG_FILE`] = correctPaths(
|
|
1800
|
+
config.configFile
|
|
1801
|
+
);
|
|
1802
|
+
}
|
|
1803
|
+
if (config.workspaceRoot) {
|
|
1804
|
+
process.env[`${prefix}WORKSPACE_ROOT`] = correctPaths(config.workspaceRoot);
|
|
1805
|
+
process.env.NX_WORKSPACE_ROOT = correctPaths(config.workspaceRoot);
|
|
1806
|
+
process.env.NX_WORKSPACE_ROOT_PATH = correctPaths(config.workspaceRoot);
|
|
1807
|
+
}
|
|
1808
|
+
if (config.directories) {
|
|
1809
|
+
if (!config.skipCache && config.directories.cache) {
|
|
1810
|
+
process.env[`${prefix}CACHE_DIR`] = correctPaths(
|
|
1811
|
+
config.directories.cache
|
|
1812
|
+
);
|
|
1813
|
+
process.env[`${prefix}CACHE_DIRECTORY`] = process.env[`${prefix}CACHE_DIR`];
|
|
1814
|
+
}
|
|
1815
|
+
if (config.directories.data) {
|
|
1816
|
+
process.env[`${prefix}DATA_DIR`] = correctPaths(config.directories.data);
|
|
1817
|
+
process.env[`${prefix}DATA_DIRECTORY`] = process.env[`${prefix}DATA_DIR`];
|
|
1818
|
+
}
|
|
1819
|
+
if (config.directories.config) {
|
|
1820
|
+
process.env[`${prefix}CONFIG_DIR`] = correctPaths(
|
|
1821
|
+
config.directories.config
|
|
1822
|
+
);
|
|
1823
|
+
process.env[`${prefix}CONFIG_DIRECTORY`] = process.env[`${prefix}CONFIG_DIR`];
|
|
1824
|
+
}
|
|
1825
|
+
if (config.directories.temp) {
|
|
1826
|
+
process.env[`${prefix}TEMP_DIR`] = correctPaths(config.directories.temp);
|
|
1827
|
+
process.env[`${prefix}TEMP_DIRECTORY`] = process.env[`${prefix}TEMP_DIR`];
|
|
1828
|
+
}
|
|
1829
|
+
if (config.directories.log) {
|
|
1830
|
+
process.env[`${prefix}LOG_DIR`] = correctPaths(config.directories.log);
|
|
1831
|
+
process.env[`${prefix}LOG_DIRECTORY`] = process.env[`${prefix}LOG_DIR`];
|
|
1832
|
+
}
|
|
1833
|
+
if (config.directories.build) {
|
|
1834
|
+
process.env[`${prefix}BUILD_DIR`] = correctPaths(
|
|
1835
|
+
config.directories.build
|
|
1836
|
+
);
|
|
1837
|
+
process.env[`${prefix}BUILD_DIRECTORY`] = process.env[`${prefix}BUILD_DIR`];
|
|
1838
|
+
}
|
|
1839
|
+
}
|
|
1840
|
+
if (config.skipCache !== void 0) {
|
|
1841
|
+
process.env[`${prefix}SKIP_CACHE`] = String(config.skipCache);
|
|
1842
|
+
if (config.skipCache) {
|
|
1843
|
+
process.env.NX_SKIP_NX_CACHE ??= String(config.skipCache);
|
|
1844
|
+
process.env.NX_CACHE_PROJECT_GRAPH ??= String(config.skipCache);
|
|
1845
|
+
}
|
|
1846
|
+
}
|
|
1847
|
+
if (config.mode) {
|
|
1848
|
+
process.env[`${prefix}MODE`] = config.mode;
|
|
1849
|
+
process.env.NODE_ENV = config.mode;
|
|
1850
|
+
process.env.ENVIRONMENT = config.mode;
|
|
1851
|
+
}
|
|
1852
|
+
if (config.colors?.base?.light || config.colors?.base?.dark) {
|
|
1853
|
+
for (const key of Object.keys(config.colors)) {
|
|
1854
|
+
setThemeColorsEnv(`${prefix}COLOR_${key}_`, config.colors[key]);
|
|
1855
|
+
}
|
|
1856
|
+
} else {
|
|
1857
|
+
setThemeColorsEnv(
|
|
1858
|
+
`${prefix}COLOR_`,
|
|
1859
|
+
config.colors
|
|
1860
|
+
);
|
|
1861
|
+
}
|
|
1862
|
+
if (config.repository) {
|
|
1863
|
+
process.env[`${prefix}REPOSITORY`] = config.repository;
|
|
1864
|
+
}
|
|
1865
|
+
if (config.branch) {
|
|
1866
|
+
process.env[`${prefix}BRANCH`] = config.branch;
|
|
1867
|
+
}
|
|
1868
|
+
if (config.preid) {
|
|
1869
|
+
process.env[`${prefix}PRE_ID`] = String(config.preid);
|
|
1870
|
+
}
|
|
1871
|
+
if (config.registry) {
|
|
1872
|
+
if (config.registry.github) {
|
|
1873
|
+
process.env[`${prefix}REGISTRY_GITHUB`] = String(config.registry.github);
|
|
1874
|
+
}
|
|
1875
|
+
if (config.registry.npm) {
|
|
1876
|
+
process.env[`${prefix}REGISTRY_NPM`] = String(config.registry.npm);
|
|
1877
|
+
}
|
|
1878
|
+
if (config.registry.cargo) {
|
|
1879
|
+
process.env[`${prefix}REGISTRY_CARGO`] = String(config.registry.cargo);
|
|
1880
|
+
}
|
|
1881
|
+
if (config.registry.cyclone) {
|
|
1882
|
+
process.env[`${prefix}REGISTRY_CYCLONE`] = String(
|
|
1883
|
+
config.registry.cyclone
|
|
1884
|
+
);
|
|
1885
|
+
}
|
|
1886
|
+
if (config.registry.container) {
|
|
1887
|
+
process.env[`${prefix}REGISTRY_CONTAINER`] = String(
|
|
1888
|
+
config.registry.container
|
|
1889
|
+
);
|
|
1890
|
+
}
|
|
1891
|
+
}
|
|
1892
|
+
if (config.logLevel) {
|
|
1893
|
+
process.env[`${prefix}LOG_LEVEL`] = String(config.logLevel);
|
|
1894
|
+
process.env.LOG_LEVEL = String(config.logLevel);
|
|
1895
|
+
process.env.NX_VERBOSE_LOGGING = String(
|
|
1896
|
+
getLogLevel(config.logLevel) >= LogLevel.DEBUG ? true : false
|
|
1897
|
+
);
|
|
1898
|
+
process.env.RUST_BACKTRACE = getLogLevel(config.logLevel) >= LogLevel.DEBUG ? "full" : "none";
|
|
1899
|
+
}
|
|
1900
|
+
if (config.skipConfigLogging !== void 0) {
|
|
1901
|
+
process.env[`${prefix}SKIP_CONFIG_LOGGING`] = String(
|
|
1902
|
+
config.skipConfigLogging
|
|
1903
|
+
);
|
|
1904
|
+
}
|
|
1905
|
+
process.env[`${prefix}WORKSPACE_CONFIG`] = JSON.stringify(config);
|
|
1906
|
+
for (const key of Object.keys(config.extensions ?? {})) {
|
|
1907
|
+
if (config.extensions[key] && Object.keys(config.extensions[key])) {
|
|
1908
|
+
setExtensionEnv(key, config.extensions[key]);
|
|
1909
|
+
}
|
|
1910
|
+
}
|
|
1911
|
+
};
|
|
1912
|
+
var setThemeColorsEnv = (prefix, config) => {
|
|
1913
|
+
return config?.light?.brand || config?.dark?.brand ? setMultiThemeColorsEnv(prefix, config) : setSingleThemeColorsEnv(prefix, config);
|
|
1914
|
+
};
|
|
1915
|
+
var setSingleThemeColorsEnv = (prefix, config) => {
|
|
1916
|
+
if (config.dark) {
|
|
1917
|
+
process.env[`${prefix}DARK`] = config.dark;
|
|
1918
|
+
}
|
|
1919
|
+
if (config.light) {
|
|
1920
|
+
process.env[`${prefix}LIGHT`] = config.light;
|
|
1921
|
+
}
|
|
1922
|
+
if (config.brand) {
|
|
1923
|
+
process.env[`${prefix}BRAND`] = config.brand;
|
|
1924
|
+
}
|
|
1925
|
+
if (config.alternate) {
|
|
1926
|
+
process.env[`${prefix}ALTERNATE`] = config.alternate;
|
|
1927
|
+
}
|
|
1928
|
+
if (config.accent) {
|
|
1929
|
+
process.env[`${prefix}ACCENT`] = config.accent;
|
|
1930
|
+
}
|
|
1931
|
+
if (config.link) {
|
|
1932
|
+
process.env[`${prefix}LINK`] = config.link;
|
|
1933
|
+
}
|
|
1934
|
+
if (config.help) {
|
|
1935
|
+
process.env[`${prefix}HELP`] = config.help;
|
|
1936
|
+
}
|
|
1937
|
+
if (config.success) {
|
|
1938
|
+
process.env[`${prefix}SUCCESS`] = config.success;
|
|
1939
|
+
}
|
|
1940
|
+
if (config.info) {
|
|
1941
|
+
process.env[`${prefix}INFO`] = config.info;
|
|
1942
|
+
}
|
|
1943
|
+
if (config.debug) {
|
|
1944
|
+
process.env[`${prefix}DEBUG`] = config.debug;
|
|
1945
|
+
}
|
|
1946
|
+
if (config.warning) {
|
|
1947
|
+
process.env[`${prefix}WARNING`] = config.warning;
|
|
1948
|
+
}
|
|
1949
|
+
if (config.danger) {
|
|
1950
|
+
process.env[`${prefix}DANGER`] = config.danger;
|
|
1951
|
+
}
|
|
1952
|
+
if (config.fatal) {
|
|
1953
|
+
process.env[`${prefix}FATAL`] = config.fatal;
|
|
1954
|
+
}
|
|
1955
|
+
if (config.performance) {
|
|
1956
|
+
process.env[`${prefix}PERFORMANCE`] = config.performance;
|
|
1957
|
+
}
|
|
1958
|
+
if (config.positive) {
|
|
1959
|
+
process.env[`${prefix}POSITIVE`] = config.positive;
|
|
1960
|
+
}
|
|
1961
|
+
if (config.negative) {
|
|
1962
|
+
process.env[`${prefix}NEGATIVE`] = config.negative;
|
|
1963
|
+
}
|
|
1964
|
+
if (config.gradient) {
|
|
1965
|
+
for (let i = 0; i < config.gradient.length; i++) {
|
|
1966
|
+
process.env[`${prefix}GRADIENT_${i}`] = config.gradient[i];
|
|
1967
|
+
}
|
|
1968
|
+
}
|
|
1969
|
+
};
|
|
1970
|
+
var setMultiThemeColorsEnv = (prefix, config) => {
|
|
1971
|
+
return {
|
|
1972
|
+
light: setBaseThemeColorsEnv(`${prefix}LIGHT_`, config.light),
|
|
1973
|
+
dark: setBaseThemeColorsEnv(`${prefix}DARK_`, config.dark)
|
|
1974
|
+
};
|
|
1975
|
+
};
|
|
1976
|
+
var setBaseThemeColorsEnv = (prefix, config) => {
|
|
1977
|
+
if (config.foreground) {
|
|
1978
|
+
process.env[`${prefix}FOREGROUND`] = config.foreground;
|
|
1979
|
+
}
|
|
1980
|
+
if (config.background) {
|
|
1981
|
+
process.env[`${prefix}BACKGROUND`] = config.background;
|
|
1982
|
+
}
|
|
1983
|
+
if (config.brand) {
|
|
1984
|
+
process.env[`${prefix}BRAND`] = config.brand;
|
|
1985
|
+
}
|
|
1986
|
+
if (config.alternate) {
|
|
1987
|
+
process.env[`${prefix}ALTERNATE`] = config.alternate;
|
|
1988
|
+
}
|
|
1989
|
+
if (config.accent) {
|
|
1990
|
+
process.env[`${prefix}ACCENT`] = config.accent;
|
|
1991
|
+
}
|
|
1992
|
+
if (config.link) {
|
|
1993
|
+
process.env[`${prefix}LINK`] = config.link;
|
|
1994
|
+
}
|
|
1995
|
+
if (config.help) {
|
|
1996
|
+
process.env[`${prefix}HELP`] = config.help;
|
|
1997
|
+
}
|
|
1998
|
+
if (config.success) {
|
|
1999
|
+
process.env[`${prefix}SUCCESS`] = config.success;
|
|
2000
|
+
}
|
|
2001
|
+
if (config.info) {
|
|
2002
|
+
process.env[`${prefix}INFO`] = config.info;
|
|
2003
|
+
}
|
|
2004
|
+
if (config.debug) {
|
|
2005
|
+
process.env[`${prefix}DEBUG`] = config.debug;
|
|
2006
|
+
}
|
|
2007
|
+
if (config.warning) {
|
|
2008
|
+
process.env[`${prefix}WARNING`] = config.warning;
|
|
2009
|
+
}
|
|
2010
|
+
if (config.danger) {
|
|
2011
|
+
process.env[`${prefix}DANGER`] = config.danger;
|
|
2012
|
+
}
|
|
2013
|
+
if (config.fatal) {
|
|
2014
|
+
process.env[`${prefix}FATAL`] = config.fatal;
|
|
2015
|
+
}
|
|
2016
|
+
if (config.performance) {
|
|
2017
|
+
process.env[`${prefix}PERFORMANCE`] = config.performance;
|
|
2018
|
+
}
|
|
2019
|
+
if (config.positive) {
|
|
2020
|
+
process.env[`${prefix}POSITIVE`] = config.positive;
|
|
2021
|
+
}
|
|
2022
|
+
if (config.negative) {
|
|
2023
|
+
process.env[`${prefix}NEGATIVE`] = config.negative;
|
|
2024
|
+
}
|
|
2025
|
+
if (config.gradient) {
|
|
2026
|
+
for (let i = 0; i < config.gradient.length; i++) {
|
|
2027
|
+
process.env[`${prefix}GRADIENT_${i}`] = config.gradient[i];
|
|
2028
|
+
}
|
|
2029
|
+
}
|
|
2030
|
+
};
|
|
2031
|
+
|
|
2032
|
+
// ../config-tools/src/create-storm-config.ts
|
|
2033
|
+
var _extension_cache = /* @__PURE__ */ new WeakMap();
|
|
2034
|
+
var _static_cache = void 0;
|
|
2035
|
+
var createStormWorkspaceConfig = async (extensionName, schema, workspaceRoot, skipLogs = false, useDefault = true) => {
|
|
2036
|
+
let result;
|
|
2037
|
+
if (!_static_cache?.data || !_static_cache?.timestamp || _static_cache.timestamp < Date.now() - 8e3) {
|
|
2038
|
+
let _workspaceRoot = workspaceRoot;
|
|
2039
|
+
if (!_workspaceRoot) {
|
|
2040
|
+
_workspaceRoot = findWorkspaceRoot();
|
|
2041
|
+
}
|
|
2042
|
+
const configEnv = getConfigEnv();
|
|
2043
|
+
const configFile = await getConfigFile(_workspaceRoot);
|
|
2044
|
+
if (!configFile) {
|
|
2045
|
+
if (!skipLogs) {
|
|
2046
|
+
writeWarning(
|
|
2047
|
+
"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",
|
|
2048
|
+
{ logLevel: "all" }
|
|
2049
|
+
);
|
|
2050
|
+
}
|
|
2051
|
+
if (useDefault === false) {
|
|
2052
|
+
return void 0;
|
|
2053
|
+
}
|
|
2054
|
+
}
|
|
2055
|
+
const defaultConfig = await getPackageJsonConfig(_workspaceRoot);
|
|
2056
|
+
const configInput = defu2(
|
|
2057
|
+
configEnv,
|
|
2058
|
+
configFile,
|
|
2059
|
+
defaultConfig
|
|
2060
|
+
);
|
|
2061
|
+
if (!configInput.variant) {
|
|
2062
|
+
configInput.variant = existsSync3(joinPaths(_workspaceRoot, "nx.json")) || existsSync3(joinPaths(_workspaceRoot, ".nx")) || existsSync3(joinPaths(_workspaceRoot, "lerna.json")) || existsSync3(joinPaths(_workspaceRoot, "turbo.json")) ? "monorepo" : "minimal";
|
|
2063
|
+
}
|
|
2064
|
+
try {
|
|
2065
|
+
result = applyDefaultConfig(
|
|
2066
|
+
await workspaceConfigSchema.parseAsync(configInput)
|
|
2067
|
+
);
|
|
2068
|
+
result.workspaceRoot ??= _workspaceRoot;
|
|
2069
|
+
} catch (error) {
|
|
2070
|
+
throw new Error(
|
|
2071
|
+
`Failed to parse Storm Workspace configuration${error?.message ? `: ${error.message}` : ""}
|
|
2072
|
+
|
|
2073
|
+
Please ensure your configuration file is valid JSON and matches the expected schema. The current workspace configuration input is: ${formatLogMessage(
|
|
2074
|
+
configInput
|
|
2075
|
+
)}`,
|
|
2076
|
+
{
|
|
2077
|
+
cause: error
|
|
2078
|
+
}
|
|
2079
|
+
);
|
|
2080
|
+
}
|
|
2081
|
+
} else {
|
|
2082
|
+
result = _static_cache.data;
|
|
2083
|
+
}
|
|
2084
|
+
if (schema && extensionName) {
|
|
2085
|
+
result.extensions = {
|
|
2086
|
+
...result.extensions,
|
|
2087
|
+
[extensionName]: createConfigExtension(extensionName, schema)
|
|
2088
|
+
};
|
|
2089
|
+
}
|
|
2090
|
+
_static_cache = {
|
|
2091
|
+
timestamp: Date.now(),
|
|
2092
|
+
data: result
|
|
2093
|
+
};
|
|
2094
|
+
return result;
|
|
2095
|
+
};
|
|
2096
|
+
var createConfigExtension = (extensionName, schema) => {
|
|
2097
|
+
const extension_cache_key = { extensionName };
|
|
2098
|
+
if (_extension_cache.has(extension_cache_key)) {
|
|
2099
|
+
return _extension_cache.get(extension_cache_key);
|
|
2100
|
+
}
|
|
2101
|
+
let extension = getExtensionEnv(extensionName);
|
|
2102
|
+
if (schema) {
|
|
2103
|
+
extension = schema.parse(extension);
|
|
2104
|
+
}
|
|
2105
|
+
_extension_cache.set(extension_cache_key, extension);
|
|
2106
|
+
return extension;
|
|
2107
|
+
};
|
|
2108
|
+
var loadStormWorkspaceConfig = async (workspaceRoot, skipLogs = false) => {
|
|
2109
|
+
const config = await createStormWorkspaceConfig(
|
|
2110
|
+
void 0,
|
|
2111
|
+
void 0,
|
|
2112
|
+
workspaceRoot,
|
|
2113
|
+
skipLogs,
|
|
2114
|
+
true
|
|
2115
|
+
);
|
|
2116
|
+
setConfigEnv(config);
|
|
2117
|
+
if (!skipLogs && !config.skipConfigLogging) {
|
|
2118
|
+
writeTrace(
|
|
2119
|
+
`\u2699\uFE0F Using Storm Workspace configuration:
|
|
2120
|
+
${formatLogMessage(config)}`,
|
|
2121
|
+
config
|
|
2122
|
+
);
|
|
2123
|
+
}
|
|
2124
|
+
return config;
|
|
2125
|
+
};
|
|
2126
|
+
|
|
2127
|
+
// ../config-tools/src/get-config.ts
|
|
2128
|
+
function getConfig(workspaceRoot, skipLogs = false) {
|
|
2129
|
+
return loadStormWorkspaceConfig(workspaceRoot, skipLogs);
|
|
2130
|
+
}
|
|
2131
|
+
function getWorkspaceConfig(skipLogs = true, options = {}) {
|
|
2132
|
+
let workspaceRoot = options.workspaceRoot;
|
|
2133
|
+
if (!workspaceRoot) {
|
|
2134
|
+
workspaceRoot = findWorkspaceRoot(options.cwd);
|
|
2135
|
+
}
|
|
2136
|
+
return getConfig(workspaceRoot, skipLogs);
|
|
2137
|
+
}
|
|
2138
|
+
|
|
2139
|
+
// ../build-tools/src/constants/internal-packages.ts
|
|
2140
|
+
var INTERNAL_PACKAGES = [
|
|
2141
|
+
"@storm-software/*",
|
|
2142
|
+
"conventional-changelog-storm-software",
|
|
2143
|
+
"pnpm-plugin-storm-software",
|
|
2144
|
+
"@stryke/*",
|
|
2145
|
+
"@powerlines/*",
|
|
2146
|
+
"powerlines",
|
|
2147
|
+
"@shell-shock/*",
|
|
2148
|
+
"@earthquake/*",
|
|
2149
|
+
"earthquake"
|
|
2150
|
+
];
|
|
2151
|
+
|
|
2152
|
+
// ../build-tools/src/plugins/swc.ts
|
|
2153
|
+
import { transform } from "@swc/core";
|
|
2154
|
+
|
|
2155
|
+
// ../build-tools/src/plugins/ts-resolve.ts
|
|
2156
|
+
import fs from "node:fs";
|
|
2157
|
+
import { builtinModules } from "node:module";
|
|
2158
|
+
import path from "node:path";
|
|
2159
|
+
import _resolve from "resolve";
|
|
2160
|
+
|
|
2161
|
+
// ../build-tools/src/plugins/type-definitions.ts
|
|
2162
|
+
import { stripIndents } from "@nx/devkit";
|
|
2163
|
+
import { relative } from "path";
|
|
2164
|
+
|
|
2165
|
+
// ../build-tools/src/utilities/copy-assets.ts
|
|
2166
|
+
import { CopyAssetsHandler } from "@nx/js/src/utils/assets/copy-assets-handler";
|
|
2167
|
+
import { glob } from "glob";
|
|
2168
|
+
import { readFile as readFile2, writeFile } from "node:fs/promises";
|
|
2169
|
+
|
|
2170
|
+
// ../build-tools/src/utilities/generate-package-json.ts
|
|
2171
|
+
import { calculateProjectBuildableDependencies } from "@nx/js/src/utils/buildable-libs-utils";
|
|
2172
|
+
import { Glob } from "glob";
|
|
2173
|
+
import { existsSync as existsSync4, readFileSync } from "node:fs";
|
|
2174
|
+
import { readFile as readFile3 } from "node:fs/promises";
|
|
6
2175
|
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
} from "
|
|
2176
|
+
createProjectGraphAsync,
|
|
2177
|
+
readCachedProjectGraph,
|
|
2178
|
+
readProjectsConfigurationFromProjectGraph
|
|
2179
|
+
} from "nx/src/project-graph/project-graph";
|
|
11
2180
|
|
|
12
|
-
// src/
|
|
2181
|
+
// ../build-tools/src/utilities/get-entry-points.ts
|
|
2182
|
+
import { glob as glob2 } from "glob";
|
|
2183
|
+
|
|
2184
|
+
// ../build-tools/src/utilities/read-nx-config.ts
|
|
2185
|
+
import { existsSync as existsSync5 } from "node:fs";
|
|
2186
|
+
import { readFile as readFile4 } from "node:fs/promises";
|
|
2187
|
+
|
|
2188
|
+
// ../build-tools/src/utilities/task-graph.ts
|
|
13
2189
|
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
writeInfo,
|
|
20
|
-
writeTrace as writeTrace3,
|
|
21
|
-
writeWarning as writeWarning2
|
|
22
|
-
} from "@storm-software/config-tools";
|
|
2190
|
+
createTaskGraph,
|
|
2191
|
+
mapTargetDefaultsToDependencies
|
|
2192
|
+
} from "nx/src/tasks-runner/create-task-graph";
|
|
2193
|
+
|
|
2194
|
+
// src/cli/index.ts
|
|
23
2195
|
import { Command } from "commander";
|
|
24
2196
|
|
|
2197
|
+
// ../npm-tools/src/constants.ts
|
|
2198
|
+
var LATEST_NPM_TAG = "latest";
|
|
2199
|
+
var DEFAULT_NPM_TAG = LATEST_NPM_TAG;
|
|
2200
|
+
|
|
2201
|
+
// ../npm-tools/src/helpers/get-version.ts
|
|
2202
|
+
import { exec as exec3 } from "node:child_process";
|
|
2203
|
+
|
|
2204
|
+
// ../npm-tools/src/helpers/get-registry.ts
|
|
2205
|
+
import { exec as exec2 } from "node:child_process";
|
|
2206
|
+
async function getRegistry(executable = "npm") {
|
|
2207
|
+
return new Promise((resolve, reject) => {
|
|
2208
|
+
exec2(`${executable} config get registry`, (error, stdout, stderr) => {
|
|
2209
|
+
if (error && !error.message.toLowerCase().trim().startsWith("npm warn")) {
|
|
2210
|
+
return reject(error);
|
|
2211
|
+
}
|
|
2212
|
+
if (stderr && !stderr.toLowerCase().trim().startsWith("npm warn")) {
|
|
2213
|
+
return reject(stderr);
|
|
2214
|
+
}
|
|
2215
|
+
return resolve(stdout.trim());
|
|
2216
|
+
});
|
|
2217
|
+
});
|
|
2218
|
+
}
|
|
2219
|
+
|
|
2220
|
+
// ../npm-tools/src/helpers/get-version.ts
|
|
2221
|
+
async function getVersion(packageName, tag = DEFAULT_NPM_TAG, options = {}) {
|
|
2222
|
+
const executable = options.executable || "npm";
|
|
2223
|
+
const registry2 = options.registry || await getRegistry(executable);
|
|
2224
|
+
return new Promise((resolve, reject) => {
|
|
2225
|
+
exec3(
|
|
2226
|
+
`${executable} view ${packageName} version --registry=${registry2} --tag=${tag}`,
|
|
2227
|
+
(error, stdout, stderr) => {
|
|
2228
|
+
if (error && !error.message.toLowerCase().trim().startsWith("npm warn")) {
|
|
2229
|
+
return reject(error);
|
|
2230
|
+
}
|
|
2231
|
+
if (stderr && !stderr.toLowerCase().trim().startsWith("npm warn")) {
|
|
2232
|
+
return reject(stderr);
|
|
2233
|
+
}
|
|
2234
|
+
return resolve(stdout.trim());
|
|
2235
|
+
}
|
|
2236
|
+
);
|
|
2237
|
+
});
|
|
2238
|
+
}
|
|
2239
|
+
|
|
25
2240
|
// src/helpers/catalog.ts
|
|
26
|
-
import { getWorkspaceConfig as getWorkspaceConfig2 } from "@storm-software/config-tools/get-config";
|
|
27
|
-
import {
|
|
28
|
-
writeDebug,
|
|
29
|
-
writeTrace as writeTrace2,
|
|
30
|
-
writeWarning
|
|
31
|
-
} from "@storm-software/config-tools/logger/console";
|
|
32
|
-
import { findWorkspaceRoot as findWorkspaceRoot2 } from "@storm-software/config-tools/utilities/find-workspace-root";
|
|
33
|
-
import { DEFAULT_NPM_TAG } from "@storm-software/npm-tools/constants";
|
|
34
|
-
import { getVersion } from "@storm-software/npm-tools/helpers/get-version";
|
|
35
2241
|
import { coerce, gt, valid } from "semver";
|
|
36
2242
|
|
|
37
2243
|
// src/helpers/pnpm-workspace.ts
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import { findWorkspaceRoot } from "@storm-software/config-tools/utilities/find-workspace-root";
|
|
41
|
-
import { existsSync } from "node:fs";
|
|
42
|
-
import { readFile, writeFile } from "node:fs/promises";
|
|
2244
|
+
import { existsSync as existsSync6 } from "node:fs";
|
|
2245
|
+
import { readFile as readFile5, writeFile as writeFile2 } from "node:fs/promises";
|
|
43
2246
|
import { parse, stringify } from "yaml";
|
|
44
2247
|
function getPnpmWorkspaceFilePath(workspaceRoot = findWorkspaceRoot(process.cwd())) {
|
|
45
2248
|
const pnpmWorkspacePath = joinPaths(workspaceRoot, "pnpm-workspace.yaml");
|
|
46
|
-
if (!
|
|
2249
|
+
if (!existsSync6(pnpmWorkspacePath)) {
|
|
47
2250
|
throw new Error(
|
|
48
2251
|
`No \`pnpm-workspace.yaml\` file found in workspace root (searched in: ${pnpmWorkspacePath}).`
|
|
49
2252
|
);
|
|
@@ -51,7 +2254,7 @@ function getPnpmWorkspaceFilePath(workspaceRoot = findWorkspaceRoot(process.cwd(
|
|
|
51
2254
|
return pnpmWorkspacePath;
|
|
52
2255
|
}
|
|
53
2256
|
async function readPnpmWorkspaceFile(workspaceRoot = findWorkspaceRoot(process.cwd())) {
|
|
54
|
-
const result = await
|
|
2257
|
+
const result = await readFile5(
|
|
55
2258
|
getPnpmWorkspaceFilePath(workspaceRoot),
|
|
56
2259
|
"utf8"
|
|
57
2260
|
);
|
|
@@ -67,11 +2270,11 @@ async function writePnpmWorkspaceFile(pnpmWorkspaceFile, workspaceRoot = findWor
|
|
|
67
2270
|
`Writing updated pnpm-workspace.yaml file to workspace root: ${stringified}`,
|
|
68
2271
|
config
|
|
69
2272
|
);
|
|
70
|
-
await
|
|
2273
|
+
await writeFile2(getPnpmWorkspaceFilePath(workspaceRoot), stringified);
|
|
71
2274
|
}
|
|
72
2275
|
|
|
73
2276
|
// src/helpers/catalog.ts
|
|
74
|
-
async function getCatalogSafe(workspaceRoot =
|
|
2277
|
+
async function getCatalogSafe(workspaceRoot = findWorkspaceRoot(process.cwd())) {
|
|
75
2278
|
const pnpmWorkspaceFile = await readPnpmWorkspaceFile(workspaceRoot);
|
|
76
2279
|
if (!pnpmWorkspaceFile) {
|
|
77
2280
|
throw new Error("No pnpm-workspace.yaml file found");
|
|
@@ -94,14 +2297,14 @@ File content: ${JSON.stringify(
|
|
|
94
2297
|
}
|
|
95
2298
|
return void 0;
|
|
96
2299
|
}
|
|
97
|
-
async function getCatalog(workspaceRoot =
|
|
2300
|
+
async function getCatalog(workspaceRoot = findWorkspaceRoot(process.cwd())) {
|
|
98
2301
|
const catalog = await getCatalogSafe(workspaceRoot);
|
|
99
2302
|
if (!catalog) {
|
|
100
2303
|
throw new Error("No catalog entries found in pnpm-workspace.yaml file");
|
|
101
2304
|
}
|
|
102
2305
|
return catalog;
|
|
103
2306
|
}
|
|
104
|
-
async function setCatalog(catalog, workspaceRoot =
|
|
2307
|
+
async function setCatalog(catalog, workspaceRoot = findWorkspaceRoot(process.cwd())) {
|
|
105
2308
|
const pnpmWorkspaceFile = await readPnpmWorkspaceFile(workspaceRoot);
|
|
106
2309
|
if (!pnpmWorkspaceFile) {
|
|
107
2310
|
throw new Error("No pnpm-workspace.yaml file found");
|
|
@@ -117,10 +2320,10 @@ async function upgradeCatalog(catalog, packageName, options = {}) {
|
|
|
117
2320
|
const {
|
|
118
2321
|
tag = DEFAULT_NPM_TAG,
|
|
119
2322
|
prefix = "^",
|
|
120
|
-
workspaceRoot =
|
|
2323
|
+
workspaceRoot = findWorkspaceRoot()
|
|
121
2324
|
} = options;
|
|
122
|
-
const workspaceConfig = await
|
|
123
|
-
|
|
2325
|
+
const workspaceConfig = await getWorkspaceConfig(true, { workspaceRoot });
|
|
2326
|
+
writeTrace(
|
|
124
2327
|
`Upgrading catalog entry for package "${packageName}" with tag "${tag}"`,
|
|
125
2328
|
workspaceConfig
|
|
126
2329
|
);
|
|
@@ -163,8 +2366,8 @@ function createProgram(config) {
|
|
|
163
2366
|
const program = new Command("storm-pnpm");
|
|
164
2367
|
program.version("1.0.0", "-v --version", "display CLI version");
|
|
165
2368
|
program.command("update").description("Update pnpm catalog dependency package version.").argument(
|
|
166
|
-
"<
|
|
167
|
-
"The package name/pattern to update the version for (e.g., @storm-software/config or @storm-software/
|
|
2369
|
+
"<packages...>",
|
|
2370
|
+
"The package name/pattern to update the version for (e.g., @storm-software/config or @storm-software/ or @storm-software/*)."
|
|
168
2371
|
).option(
|
|
169
2372
|
"-t, --tag <string>",
|
|
170
2373
|
`The npm tag to use when fetching the latest version of the package (e.g., "latest", "next", etc.). Defaults to "latest".`,
|
|
@@ -172,7 +2375,7 @@ function createProgram(config) {
|
|
|
172
2375
|
).option(
|
|
173
2376
|
"-i, --install",
|
|
174
2377
|
"Whether to install the package after updating the version."
|
|
175
|
-
).option(
|
|
2378
|
+
).option("--all", "Whether to update all Storm Software packages.").option(
|
|
176
2379
|
"-p, --prefix <string>",
|
|
177
2380
|
`The version prefix to use when updating the package (e.g., "^", "~", or "1.2.3"). Defaults to "^".
|
|
178
2381
|
- Caret (^): The default prefix. It allows updates to the latest minor or patch version while staying within the same major version. Example: \u201C^1.2.3" allows updates to 1.3.0 or 1.2.4, but not 2.0.0.
|
|
@@ -184,15 +2387,16 @@ function createProgram(config) {
|
|
|
184
2387
|
).action(updateAction);
|
|
185
2388
|
return program;
|
|
186
2389
|
}
|
|
187
|
-
async function updateAction(
|
|
2390
|
+
async function updateAction(packages, {
|
|
188
2391
|
tag,
|
|
189
2392
|
install = false,
|
|
2393
|
+
all = false,
|
|
190
2394
|
prefix = "^"
|
|
191
2395
|
}) {
|
|
192
2396
|
try {
|
|
193
|
-
const
|
|
2397
|
+
const pkgs = (Array.isArray(packages) ? packages : [packages.split(",")].flat()).map((pkg) => pkg.trim().replaceAll("*", "")).concat(all ? INTERNAL_PACKAGES : []);
|
|
194
2398
|
writeInfo(
|
|
195
|
-
`${brandIcon(_config)} Preparing to update the package version for ${
|
|
2399
|
+
`${brandIcon(_config)} Preparing to update the package version for ${pkgs.join(", ")}.`,
|
|
196
2400
|
_config
|
|
197
2401
|
);
|
|
198
2402
|
let catalog = await getCatalog();
|
|
@@ -203,7 +2407,7 @@ async function updateAction(packageNames, {
|
|
|
203
2407
|
}
|
|
204
2408
|
let packagesFound = false;
|
|
205
2409
|
let packagesUpdated = false;
|
|
206
|
-
for (const pkg of
|
|
2410
|
+
for (const pkg of pkgs) {
|
|
207
2411
|
const matchedPackages = Object.keys(catalog).filter(
|
|
208
2412
|
(p) => pkg.endsWith("/") ? p.startsWith(pkg) : p === pkg
|
|
209
2413
|
);
|
|
@@ -213,7 +2417,7 @@ async function updateAction(packageNames, {
|
|
|
213
2417
|
_config
|
|
214
2418
|
);
|
|
215
2419
|
} else {
|
|
216
|
-
|
|
2420
|
+
writeDebug(
|
|
217
2421
|
`${brandIcon(_config)} Found ${matchedPackages.length} packages matching "${pkg}" in the pnpm catalog file:
|
|
218
2422
|
|
|
219
2423
|
- ${matchedPackages.map((p) => `${p} (${catalog[p] || "unknown"})`).join("\n- ")}`,
|
|
@@ -221,7 +2425,7 @@ async function updateAction(packageNames, {
|
|
|
221
2425
|
);
|
|
222
2426
|
packagesFound = true;
|
|
223
2427
|
for (const matchedPackage of matchedPackages) {
|
|
224
|
-
|
|
2428
|
+
writeTrace(`- Upgrading ${matchedPackage}...`, _config);
|
|
225
2429
|
const result = await upgradeCatalog(catalog, matchedPackage, {
|
|
226
2430
|
tag,
|
|
227
2431
|
prefix,
|
|
@@ -235,18 +2439,18 @@ async function updateAction(packageNames, {
|
|
|
235
2439
|
}
|
|
236
2440
|
}
|
|
237
2441
|
if (!packagesFound) {
|
|
238
|
-
|
|
2442
|
+
writeWarning(
|
|
239
2443
|
`No packages were updated since no matching packages were found in the catalog.`,
|
|
240
2444
|
_config
|
|
241
2445
|
);
|
|
242
2446
|
return;
|
|
243
2447
|
}
|
|
244
|
-
|
|
2448
|
+
writeDebug(
|
|
245
2449
|
"Finalizing changes to the pnpm workspace's catalog dependencies",
|
|
246
2450
|
_config
|
|
247
2451
|
);
|
|
248
2452
|
if (!packagesUpdated) {
|
|
249
|
-
|
|
2453
|
+
writeDebug(
|
|
250
2454
|
"No packages were updated since all matching packages are already up to date in the catalog.",
|
|
251
2455
|
_config
|
|
252
2456
|
);
|
|
@@ -254,7 +2458,7 @@ async function updateAction(packageNames, {
|
|
|
254
2458
|
}
|
|
255
2459
|
await setCatalog(catalog, _config.workspaceRoot);
|
|
256
2460
|
if (install) {
|
|
257
|
-
|
|
2461
|
+
writeDebug(
|
|
258
2462
|
"Running `pnpm install --no-frozen-lockfile` to update local dependency versions",
|
|
259
2463
|
_config
|
|
260
2464
|
);
|
|
@@ -280,7 +2484,7 @@ ${JSON.stringify(
|
|
|
280
2484
|
|
|
281
2485
|
// bin/pnpm.ts
|
|
282
2486
|
void (async () => {
|
|
283
|
-
const config = await
|
|
2487
|
+
const config = await getWorkspaceConfig();
|
|
284
2488
|
try {
|
|
285
2489
|
handleProcess(config);
|
|
286
2490
|
const program = createProgram(config);
|