@storm-software/k8s-tools 0.25.19 → 0.25.21
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 +24 -0
- package/README.md +1 -1
- package/dist/chunk-27DDDFDE.mjs +29 -0
- package/dist/{chunk-RKHT4PWO.js → chunk-2SIDLIM5.js} +47 -31
- package/dist/{chunk-2GAU2GHG.js → chunk-4AADQIGW.js} +35 -102
- package/dist/{chunk-T5WNZJOD.js → chunk-7QVOU2PT.js} +3 -11
- package/dist/{chunk-3OATAJ3B.js → chunk-A7ARE63F.js} +83 -55
- package/dist/chunk-ARIMP3W4.mjs +155 -0
- package/dist/{chunk-TNVATOCF.mjs → chunk-BBY7MXHG.mjs} +93 -54
- package/dist/{chunk-OIKG7EMC.js → chunk-DD5DCADP.js} +32 -16
- package/dist/{chunk-IQYUMTUG.js → chunk-GQUK4O4E.js} +30 -23
- package/dist/{chunk-UC4ZBDTX.mjs → chunk-HGXQ6SSU.mjs} +5 -7
- package/dist/{chunk-LFNGKV6F.js → chunk-JSFRUBG5.js} +1 -8
- package/dist/{chunk-LLSJITI4.mjs → chunk-KVKKT3AU.mjs} +24 -13
- package/dist/{chunk-QKTRYJDT.mjs → chunk-MDGD27YL.mjs} +32 -16
- package/dist/{chunk-A2UL7VJH.mjs → chunk-MKWEGZBN.mjs} +31 -24
- package/dist/{chunk-YY3TH3F7.mjs → chunk-MQZUEUAT.mjs} +26 -21
- package/dist/{chunk-F37JQGEZ.mjs → chunk-MWMS7P7U.mjs} +333 -208
- package/dist/{chunk-X7ALQPYH.js → chunk-NMNRCEUZ.js} +21 -12
- package/dist/{chunk-T3C63ATM.mjs → chunk-NWIIGYA4.mjs} +68 -40
- package/dist/{chunk-NJPZBNWH.mjs → chunk-QHFQ2OBL.mjs} +2 -10
- package/dist/chunk-RECJ3G6F.js +21 -0
- package/dist/{chunk-IOT45LXV.js → chunk-RUPAIXLM.js} +59 -38
- package/dist/chunk-RUROM5AC.mjs +136 -0
- package/dist/{chunk-PDHZDUK3.js → chunk-SGNASGK5.js} +94 -55
- package/dist/{chunk-ARMCUBMY.js → chunk-UWVOFPSW.js} +334 -209
- package/dist/{chunk-RDQRJI4Y.mjs → chunk-VREITNWP.mjs} +36 -20
- package/dist/{chunk-EAQFLLRB.js → chunk-XKOZIQT3.js} +6 -8
- package/dist/{chunk-G7TAEXNU.js → chunk-Y2HMMGO2.js} +28 -23
- package/dist/{chunk-YHT26DWR.mjs → chunk-YXXZO2AJ.mjs} +0 -7
- package/dist/executors.js +10 -10
- package/dist/executors.mjs +9 -9
- package/dist/generators.js +7 -7
- package/dist/generators.mjs +6 -6
- package/dist/index.js +15 -15
- package/dist/index.mjs +14 -14
- package/dist/src/executors/container-publish/executor.js +6 -6
- package/dist/src/executors/container-publish/executor.mjs +5 -5
- package/dist/src/executors/helm-package/executor.js +8 -8
- package/dist/src/executors/helm-package/executor.mjs +7 -7
- package/dist/src/generators/helm-chart/generator.js +6 -6
- package/dist/src/generators/helm-chart/generator.mjs +5 -5
- package/dist/src/generators/helm-dependency/generator.js +6 -6
- package/dist/src/generators/helm-dependency/generator.mjs +5 -5
- package/dist/src/plugins/docker/index.js +5 -5
- package/dist/src/plugins/docker/index.mjs +4 -4
- package/dist/src/types.js +3 -3
- package/dist/src/types.mjs +2 -2
- package/dist/src/utils/client.js +5 -5
- package/dist/src/utils/client.mjs +4 -4
- package/dist/src/utils/ensure-init.js +3 -3
- package/dist/src/utils/ensure-init.mjs +2 -2
- package/dist/src/utils/index.js +6 -6
- package/dist/src/utils/index.mjs +5 -5
- package/dist/src/utils/prettier.js +3 -3
- package/dist/src/utils/prettier.mjs +2 -2
- package/dist/tsup.config.js +3 -8
- package/dist/tsup.config.mjs +3 -8
- package/package.json +1 -1
- package/dist/chunk-3GQAWCBQ.js +0 -13
- package/dist/chunk-5JZUTREX.mjs +0 -134
- package/dist/chunk-L2DHGVS5.mjs +0 -21
- package/dist/chunk-ZNGN7YLH.mjs +0 -203
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__name
|
|
3
|
-
} from "./chunk-L2DHGVS5.mjs";
|
|
4
|
-
|
|
5
1
|
// ../config-tools/src/utilities/correct-paths.ts
|
|
6
2
|
var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
7
3
|
function normalizeWindowsPath(input = "") {
|
|
@@ -10,11 +6,10 @@ function normalizeWindowsPath(input = "") {
|
|
|
10
6
|
}
|
|
11
7
|
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
|
|
12
8
|
}
|
|
13
|
-
__name(normalizeWindowsPath, "normalizeWindowsPath");
|
|
14
9
|
var _UNC_REGEX = /^[/\\]{2}/;
|
|
15
10
|
var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
|
16
11
|
var _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
|
|
17
|
-
var correctPaths =
|
|
12
|
+
var correctPaths = function(path) {
|
|
18
13
|
if (!path || path.length === 0) {
|
|
19
14
|
return ".";
|
|
20
15
|
}
|
|
@@ -42,8 +37,8 @@ var correctPaths = /* @__PURE__ */ __name(function(path) {
|
|
|
42
37
|
return `//${path}`;
|
|
43
38
|
}
|
|
44
39
|
return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
|
|
45
|
-
}
|
|
46
|
-
var joinPaths =
|
|
40
|
+
};
|
|
41
|
+
var joinPaths = function(...segments) {
|
|
47
42
|
let path = "";
|
|
48
43
|
for (const seg of segments) {
|
|
49
44
|
if (!seg) {
|
|
@@ -63,7 +58,7 @@ var joinPaths = /* @__PURE__ */ __name(function(...segments) {
|
|
|
63
58
|
}
|
|
64
59
|
}
|
|
65
60
|
return correctPaths(path);
|
|
66
|
-
}
|
|
61
|
+
};
|
|
67
62
|
function normalizeString(path, allowAboveRoot) {
|
|
68
63
|
let res = "";
|
|
69
64
|
let lastSegmentLength = 0;
|
|
@@ -124,10 +119,9 @@ function normalizeString(path, allowAboveRoot) {
|
|
|
124
119
|
}
|
|
125
120
|
return res;
|
|
126
121
|
}
|
|
127
|
-
|
|
128
|
-
var isAbsolute = /* @__PURE__ */ __name(function(p) {
|
|
122
|
+
var isAbsolute = function(p) {
|
|
129
123
|
return _IS_ABSOLUTE_RE.test(p);
|
|
130
|
-
}
|
|
124
|
+
};
|
|
131
125
|
|
|
132
126
|
// ../config-tools/src/utilities/find-up.ts
|
|
133
127
|
import { existsSync } from "node:fs";
|
|
@@ -136,10 +130,14 @@ var MAX_PATH_SEARCH_DEPTH = 30;
|
|
|
136
130
|
var depth = 0;
|
|
137
131
|
function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
|
|
138
132
|
const _startPath = startPath ?? process.cwd();
|
|
139
|
-
if (endDirectoryNames.some(
|
|
133
|
+
if (endDirectoryNames.some(
|
|
134
|
+
(endDirName) => existsSync(join(_startPath, endDirName))
|
|
135
|
+
)) {
|
|
140
136
|
return _startPath;
|
|
141
137
|
}
|
|
142
|
-
if (endFileNames.some(
|
|
138
|
+
if (endFileNames.some(
|
|
139
|
+
(endFileName) => existsSync(join(_startPath, endFileName))
|
|
140
|
+
)) {
|
|
143
141
|
return _startPath;
|
|
144
142
|
}
|
|
145
143
|
if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
|
|
@@ -148,7 +146,6 @@ function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
|
|
|
148
146
|
}
|
|
149
147
|
return void 0;
|
|
150
148
|
}
|
|
151
|
-
__name(findFolderUp, "findFolderUp");
|
|
152
149
|
|
|
153
150
|
// ../config-tools/src/utilities/find-workspace-root.ts
|
|
154
151
|
var rootFiles = [
|
|
@@ -195,21 +192,31 @@ var rootDirectories = [
|
|
|
195
192
|
];
|
|
196
193
|
function findWorkspaceRootSafe(pathInsideMonorepo) {
|
|
197
194
|
if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) {
|
|
198
|
-
return correctPaths(
|
|
199
|
-
|
|
200
|
-
|
|
195
|
+
return correctPaths(
|
|
196
|
+
process.env.STORM_WORKSPACE_ROOT ?? process.env.NX_WORKSPACE_ROOT_PATH
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
return correctPaths(
|
|
200
|
+
findFolderUp(
|
|
201
|
+
pathInsideMonorepo ?? process.cwd(),
|
|
202
|
+
rootFiles,
|
|
203
|
+
rootDirectories
|
|
204
|
+
)
|
|
205
|
+
);
|
|
201
206
|
}
|
|
202
|
-
__name(findWorkspaceRootSafe, "findWorkspaceRootSafe");
|
|
203
207
|
function findWorkspaceRoot(pathInsideMonorepo) {
|
|
204
208
|
const result = findWorkspaceRootSafe(pathInsideMonorepo);
|
|
205
209
|
if (!result) {
|
|
206
|
-
throw new Error(
|
|
207
|
-
|
|
208
|
-
|
|
210
|
+
throw new Error(
|
|
211
|
+
`Cannot find workspace root upwards from known path. Files search list includes:
|
|
212
|
+
${rootFiles.join(
|
|
213
|
+
"\n"
|
|
214
|
+
)}
|
|
215
|
+
Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
|
|
216
|
+
);
|
|
209
217
|
}
|
|
210
218
|
return result;
|
|
211
219
|
}
|
|
212
|
-
__name(findWorkspaceRoot, "findWorkspaceRoot");
|
|
213
220
|
|
|
214
221
|
// ../config-tools/src/types.ts
|
|
215
222
|
var LogLevel = {
|
|
@@ -333,23 +340,39 @@ var RegistryConfigSchema = z.object({
|
|
|
333
340
|
cyclone: RegistryUrlConfigSchema,
|
|
334
341
|
container: RegistryUrlConfigSchema
|
|
335
342
|
}).default({}).describe("A list of remote registry URLs used by Storm Software");
|
|
336
|
-
var ColorConfigSchema = SingleThemeColorConfigSchema.or(
|
|
343
|
+
var ColorConfigSchema = SingleThemeColorConfigSchema.or(
|
|
344
|
+
MultiThemeColorConfigSchema
|
|
345
|
+
).describe("Colors used for various workspace elements");
|
|
337
346
|
var ColorConfigMapSchema = z.union([
|
|
338
|
-
z.object({
|
|
339
|
-
base: ColorConfigSchema
|
|
340
|
-
}),
|
|
347
|
+
z.object({ base: ColorConfigSchema }),
|
|
341
348
|
z.record(z.string(), ColorConfigSchema)
|
|
342
349
|
]);
|
|
343
|
-
var ExtendsItemSchema = z.string().trim().describe(
|
|
344
|
-
|
|
350
|
+
var ExtendsItemSchema = z.string().trim().describe(
|
|
351
|
+
"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."
|
|
352
|
+
);
|
|
353
|
+
var ExtendsSchema = ExtendsItemSchema.or(
|
|
354
|
+
z.array(ExtendsItemSchema)
|
|
355
|
+
).describe(
|
|
356
|
+
"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."
|
|
357
|
+
);
|
|
345
358
|
var WorkspaceBotConfigSchema = z.object({
|
|
346
|
-
name: z.string().trim().default("stormie-bot").describe(
|
|
359
|
+
name: z.string().trim().default("stormie-bot").describe(
|
|
360
|
+
"The workspace bot user's name (this is the bot that will be used to perform various tasks)"
|
|
361
|
+
),
|
|
347
362
|
email: z.string().trim().email().default("bot@stormsoftware.com").describe("The email of the workspace bot")
|
|
348
|
-
}).describe(
|
|
363
|
+
}).describe(
|
|
364
|
+
"The workspace's bot user's config used to automated various operations tasks"
|
|
365
|
+
);
|
|
349
366
|
var WorkspaceReleaseConfigSchema = z.object({
|
|
350
|
-
banner: z.string().trim().default(STORM_DEFAULT_RELEASE_BANNER).describe(
|
|
351
|
-
|
|
352
|
-
|
|
367
|
+
banner: z.string().trim().default(STORM_DEFAULT_RELEASE_BANNER).describe(
|
|
368
|
+
"A URL to a banner image used to display the workspace's release"
|
|
369
|
+
),
|
|
370
|
+
header: z.string().trim().optional().describe(
|
|
371
|
+
"A header message appended to the start of the workspace's release notes"
|
|
372
|
+
),
|
|
373
|
+
footer: z.string().trim().default(STORM_DEFAULT_RELEASE_FOOTER).describe(
|
|
374
|
+
"A footer message appended to the end of the workspace's release notes"
|
|
375
|
+
)
|
|
353
376
|
}).describe("The workspace's release config used during the release process");
|
|
354
377
|
var WorkspaceAccountConfigSchema = z.object({
|
|
355
378
|
twitter: z.string().trim().default(STORM_DEFAULT_ACCOUNT_TWITTER).describe("A Twitter/X account associated with the organization/project"),
|
|
@@ -358,23 +381,41 @@ var WorkspaceAccountConfigSchema = z.object({
|
|
|
358
381
|
slack: z.string().trim().default(STORM_DEFAULT_ACCOUNT_SLACK).describe("A Slack account associated with the organization/project"),
|
|
359
382
|
medium: z.string().trim().default(STORM_DEFAULT_ACCOUNT_MEDIUM).describe("A Medium account associated with the organization/project"),
|
|
360
383
|
github: z.string().trim().default(STORM_DEFAULT_ACCOUNT_GITHUB).describe("A GitHub account associated with the organization/project")
|
|
361
|
-
}).describe(
|
|
384
|
+
}).describe(
|
|
385
|
+
"The workspace's account config used to store various social media links"
|
|
386
|
+
);
|
|
362
387
|
var WorkspaceDirectoryConfigSchema = z.object({
|
|
363
|
-
cache: z.string().trim().optional().describe(
|
|
388
|
+
cache: z.string().trim().optional().describe(
|
|
389
|
+
"The directory used to store the environment's cached file data"
|
|
390
|
+
),
|
|
364
391
|
data: z.string().trim().optional().describe("The directory used to store the environment's data files"),
|
|
365
|
-
config: z.string().trim().optional().describe(
|
|
392
|
+
config: z.string().trim().optional().describe(
|
|
393
|
+
"The directory used to store the environment's configuration files"
|
|
394
|
+
),
|
|
366
395
|
temp: z.string().trim().optional().describe("The directory used to store the environment's temp files"),
|
|
367
396
|
log: z.string().trim().optional().describe("The directory used to store the environment's temp files"),
|
|
368
|
-
build: z.string().trim().default("dist").describe(
|
|
369
|
-
|
|
397
|
+
build: z.string().trim().default("dist").describe(
|
|
398
|
+
"The directory used to store the workspace's distributable files after a build (relative to the workspace root)"
|
|
399
|
+
)
|
|
400
|
+
}).describe(
|
|
401
|
+
"Various directories used by the workspace to store data, cache, and configuration files"
|
|
402
|
+
);
|
|
370
403
|
var errorConfigSchema = z.object({
|
|
371
404
|
codesFile: z.string().trim().default(STORM_DEFAULT_ERROR_CODES_FILE).describe("The path to the workspace's error codes JSON file"),
|
|
372
|
-
url: z.string().trim().url().optional().describe(
|
|
405
|
+
url: z.string().trim().url().optional().describe(
|
|
406
|
+
"A URL to a page that looks up the workspace's error messages given a specific error code"
|
|
407
|
+
)
|
|
373
408
|
}).describe("The workspace's error config used during the error process");
|
|
374
409
|
var stormWorkspaceConfigSchema = z.object({
|
|
375
|
-
$schema: z.string().trim().default(
|
|
410
|
+
$schema: z.string().trim().default(
|
|
411
|
+
"https://cdn.jsdelivr.net/npm/@storm-software/config/schemas/storm-workspace.schema.json"
|
|
412
|
+
).optional().nullish().describe(
|
|
413
|
+
"The URL to the JSON schema file that describes the Storm configuration file"
|
|
414
|
+
),
|
|
376
415
|
extends: ExtendsSchema.optional(),
|
|
377
|
-
name: z.string().trim().toLowerCase().optional().describe(
|
|
416
|
+
name: z.string().trim().toLowerCase().optional().describe(
|
|
417
|
+
"The name of the service/package/scope using this configuration"
|
|
418
|
+
),
|
|
378
419
|
namespace: z.string().trim().toLowerCase().optional().describe("The namespace of the package"),
|
|
379
420
|
organization: z.string().trim().default("storm-software").describe("The organization of the workspace"),
|
|
380
421
|
repository: z.string().trim().optional().describe("The repo URL of the workspace (i.e. GitHub)"),
|
|
@@ -390,21 +431,16 @@ var stormWorkspaceConfigSchema = z.object({
|
|
|
390
431
|
release: WorkspaceReleaseConfigSchema,
|
|
391
432
|
account: WorkspaceAccountConfigSchema,
|
|
392
433
|
error: errorConfigSchema,
|
|
393
|
-
mode: z.enum([
|
|
394
|
-
"development",
|
|
395
|
-
"staging",
|
|
396
|
-
"production"
|
|
397
|
-
]).default("production").describe("The current runtime environment mode for the package"),
|
|
434
|
+
mode: z.enum(["development", "staging", "production"]).default("production").describe("The current runtime environment mode for the package"),
|
|
398
435
|
workspaceRoot: z.string().trim().describe("The root directory of the workspace"),
|
|
399
|
-
externalPackagePatterns: z.array(z.string()).default([]).describe(
|
|
436
|
+
externalPackagePatterns: z.array(z.string()).default([]).describe(
|
|
437
|
+
"The build will use these package patterns to determine if they should be external to the bundle"
|
|
438
|
+
),
|
|
400
439
|
skipCache: z.boolean().default(false).describe("Should all known types of workspace caching be skipped?"),
|
|
401
440
|
directories: WorkspaceDirectoryConfigSchema,
|
|
402
|
-
packageManager: z.enum([
|
|
403
|
-
"
|
|
404
|
-
|
|
405
|
-
"pnpm",
|
|
406
|
-
"bun"
|
|
407
|
-
]).default("npm").describe("The JavaScript/TypeScript package manager used by the repository"),
|
|
441
|
+
packageManager: z.enum(["npm", "yarn", "pnpm", "bun"]).default("npm").describe(
|
|
442
|
+
"The JavaScript/TypeScript package manager used by the repository"
|
|
443
|
+
),
|
|
408
444
|
timezone: z.string().trim().default("America/New_York").describe("The default timezone of the workspace"),
|
|
409
445
|
locale: z.string().trim().default("en-US").describe("The default locale of the workspace"),
|
|
410
446
|
logLevel: z.enum([
|
|
@@ -417,13 +453,23 @@ var stormWorkspaceConfigSchema = z.object({
|
|
|
417
453
|
"debug",
|
|
418
454
|
"trace",
|
|
419
455
|
"all"
|
|
420
|
-
]).default("info").describe(
|
|
421
|
-
|
|
456
|
+
]).default("info").describe(
|
|
457
|
+
"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`)."
|
|
458
|
+
),
|
|
459
|
+
skipConfigLogging: z.boolean().optional().describe(
|
|
460
|
+
"Should the logging of the current Storm Workspace configuration be skipped?"
|
|
461
|
+
),
|
|
422
462
|
registry: RegistryConfigSchema,
|
|
423
|
-
configFile: z.string().trim().nullable().default(null).describe(
|
|
424
|
-
|
|
463
|
+
configFile: z.string().trim().nullable().default(null).describe(
|
|
464
|
+
"The filepath of the Storm config. When this field is null, no config file was found in the current workspace."
|
|
465
|
+
),
|
|
466
|
+
colors: ColorConfigSchema.or(ColorConfigMapSchema).describe(
|
|
467
|
+
"Storm theme config values used for styling various package elements"
|
|
468
|
+
),
|
|
425
469
|
extensions: z.record(z.any()).optional().default({}).describe("Configuration of each used extension")
|
|
426
|
-
}).describe(
|
|
470
|
+
}).describe(
|
|
471
|
+
"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."
|
|
472
|
+
);
|
|
427
473
|
|
|
428
474
|
// ../config/src/types.ts
|
|
429
475
|
var COLOR_KEYS = [
|
|
@@ -476,7 +522,7 @@ var DEFAULT_COLOR_CONFIG = {
|
|
|
476
522
|
negative: "#dc2626"
|
|
477
523
|
}
|
|
478
524
|
};
|
|
479
|
-
var getDefaultConfig =
|
|
525
|
+
var getDefaultConfig = async (root) => {
|
|
480
526
|
let license = STORM_DEFAULT_LICENSE;
|
|
481
527
|
let homepage = STORM_DEFAULT_HOMEPAGE;
|
|
482
528
|
let name = void 0;
|
|
@@ -484,7 +530,10 @@ var getDefaultConfig = /* @__PURE__ */ __name(async (root) => {
|
|
|
484
530
|
let repository = void 0;
|
|
485
531
|
const workspaceRoot = findWorkspaceRoot(root);
|
|
486
532
|
if (existsSync2(join2(workspaceRoot, "package.json"))) {
|
|
487
|
-
const file = await readFile(
|
|
533
|
+
const file = await readFile(
|
|
534
|
+
joinPaths(workspaceRoot, "package.json"),
|
|
535
|
+
"utf8"
|
|
536
|
+
);
|
|
488
537
|
if (file) {
|
|
489
538
|
const packageJson = JSON.parse(file);
|
|
490
539
|
if (packageJson.name) {
|
|
@@ -521,36 +570,36 @@ var getDefaultConfig = /* @__PURE__ */ __name(async (root) => {
|
|
|
521
570
|
url: `${homepage || STORM_DEFAULT_HOMEPAGE}/errors`
|
|
522
571
|
}
|
|
523
572
|
};
|
|
524
|
-
}
|
|
573
|
+
};
|
|
525
574
|
|
|
526
575
|
// ../config-tools/src/logger/chalk.ts
|
|
527
576
|
import chalk from "chalk";
|
|
528
577
|
var chalkDefault = {
|
|
529
|
-
hex:
|
|
530
|
-
bgHex:
|
|
531
|
-
whiteBright:
|
|
532
|
-
}),
|
|
533
|
-
whiteBright:
|
|
534
|
-
gray:
|
|
578
|
+
hex: (_) => (message) => message,
|
|
579
|
+
bgHex: (_) => ({
|
|
580
|
+
whiteBright: (message) => message
|
|
581
|
+
}),
|
|
582
|
+
whiteBright: (message) => message,
|
|
583
|
+
gray: (message) => message,
|
|
535
584
|
bold: {
|
|
536
|
-
hex:
|
|
537
|
-
bgHex:
|
|
538
|
-
whiteBright:
|
|
539
|
-
}),
|
|
540
|
-
whiteBright:
|
|
585
|
+
hex: (_) => (message) => message,
|
|
586
|
+
bgHex: (_) => ({
|
|
587
|
+
whiteBright: (message) => message
|
|
588
|
+
}),
|
|
589
|
+
whiteBright: (message) => message
|
|
541
590
|
},
|
|
542
591
|
dim: {
|
|
543
|
-
hex:
|
|
544
|
-
gray:
|
|
592
|
+
hex: (_) => (message) => message,
|
|
593
|
+
gray: (message) => message
|
|
545
594
|
}
|
|
546
595
|
};
|
|
547
|
-
var getChalk =
|
|
596
|
+
var getChalk = () => {
|
|
548
597
|
let _chalk = chalk;
|
|
549
598
|
if (!_chalk?.hex || !_chalk?.bold?.hex || !_chalk?.bgHex || !_chalk?.whiteBright) {
|
|
550
599
|
_chalk = chalkDefault;
|
|
551
600
|
}
|
|
552
601
|
return _chalk;
|
|
553
|
-
}
|
|
602
|
+
};
|
|
554
603
|
|
|
555
604
|
// ../config-tools/src/logger/is-unicode-supported.ts
|
|
556
605
|
function isUnicodeSupported() {
|
|
@@ -562,10 +611,9 @@ function isUnicodeSupported() {
|
|
|
562
611
|
process.env.ConEmuTask === "{cmd::Cmder}" || // ConEmu and cmder
|
|
563
612
|
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";
|
|
564
613
|
}
|
|
565
|
-
__name(isUnicodeSupported, "isUnicodeSupported");
|
|
566
614
|
|
|
567
615
|
// ../config-tools/src/logger/console-icons.ts
|
|
568
|
-
var useIcon =
|
|
616
|
+
var useIcon = (c, fallback) => isUnicodeSupported() ? c : fallback;
|
|
569
617
|
var CONSOLE_ICONS = {
|
|
570
618
|
[LogLevelLabel.ERROR]: useIcon("\u2718", "\xD7"),
|
|
571
619
|
[LogLevelLabel.FATAL]: useIcon("\u{1F480}", "\xD7"),
|
|
@@ -578,12 +626,12 @@ var CONSOLE_ICONS = {
|
|
|
578
626
|
};
|
|
579
627
|
|
|
580
628
|
// ../config-tools/src/logger/format-timestamp.ts
|
|
581
|
-
var formatTimestamp =
|
|
629
|
+
var formatTimestamp = (date = /* @__PURE__ */ new Date()) => {
|
|
582
630
|
return `${date.toLocaleDateString()} ${date.toLocaleTimeString()}`;
|
|
583
|
-
}
|
|
631
|
+
};
|
|
584
632
|
|
|
585
633
|
// ../config-tools/src/logger/get-log-level.ts
|
|
586
|
-
var getLogLevel =
|
|
634
|
+
var getLogLevel = (label) => {
|
|
587
635
|
switch (label) {
|
|
588
636
|
case "all":
|
|
589
637
|
return LogLevel.ALL;
|
|
@@ -604,8 +652,8 @@ var getLogLevel = /* @__PURE__ */ __name((label) => {
|
|
|
604
652
|
default:
|
|
605
653
|
return LogLevel.INFO;
|
|
606
654
|
}
|
|
607
|
-
}
|
|
608
|
-
var getLogLevelLabel =
|
|
655
|
+
};
|
|
656
|
+
var getLogLevelLabel = (logLevel = LogLevel.INFO) => {
|
|
609
657
|
if (logLevel >= LogLevel.ALL) {
|
|
610
658
|
return LogLevelLabel.ALL;
|
|
611
659
|
}
|
|
@@ -631,10 +679,10 @@ var getLogLevelLabel = /* @__PURE__ */ __name((logLevel = LogLevel.INFO) => {
|
|
|
631
679
|
return LogLevelLabel.SILENT;
|
|
632
680
|
}
|
|
633
681
|
return LogLevelLabel.INFO;
|
|
634
|
-
}
|
|
682
|
+
};
|
|
635
683
|
|
|
636
684
|
// ../config-tools/src/logger/console.ts
|
|
637
|
-
var getLogFn =
|
|
685
|
+
var getLogFn = (logLevel = LogLevel.INFO, config = {}, _chalk = getChalk()) => {
|
|
638
686
|
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;
|
|
639
687
|
const configLogLevel = config.logLevel || process.env.STORM_LOG_LEVEL || LogLevelLabel.INFO;
|
|
640
688
|
if (logLevel > getLogLevel(configLogLevel) || logLevel <= LogLevel.SILENT || getLogLevel(configLogLevel) <= LogLevel.SILENT) {
|
|
@@ -643,99 +691,119 @@ var getLogFn = /* @__PURE__ */ __name((logLevel = LogLevel.INFO, config = {}, _c
|
|
|
643
691
|
}
|
|
644
692
|
if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel) {
|
|
645
693
|
return (message) => {
|
|
646
|
-
console.error(
|
|
694
|
+
console.error(
|
|
695
|
+
`
|
|
647
696
|
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.fatal ?? "#7d1a1a")(`[${CONSOLE_ICONS[LogLevelLabel.FATAL]} Fatal] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
648
|
-
`
|
|
697
|
+
`
|
|
698
|
+
);
|
|
649
699
|
};
|
|
650
700
|
}
|
|
651
701
|
if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel) {
|
|
652
702
|
return (message) => {
|
|
653
|
-
console.error(
|
|
703
|
+
console.error(
|
|
704
|
+
`
|
|
654
705
|
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.danger ?? "#f85149")(`[${CONSOLE_ICONS[LogLevelLabel.ERROR]} Error] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
655
|
-
`
|
|
706
|
+
`
|
|
707
|
+
);
|
|
656
708
|
};
|
|
657
709
|
}
|
|
658
710
|
if (typeof logLevel === "number" && LogLevel.WARN >= logLevel) {
|
|
659
711
|
return (message) => {
|
|
660
|
-
console.warn(
|
|
712
|
+
console.warn(
|
|
713
|
+
`
|
|
661
714
|
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.warning ?? "#e3b341")(`[${CONSOLE_ICONS[LogLevelLabel.WARN]} Warn] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
662
|
-
`
|
|
715
|
+
`
|
|
716
|
+
);
|
|
663
717
|
};
|
|
664
718
|
}
|
|
665
719
|
if (typeof logLevel === "number" && LogLevel.SUCCESS >= logLevel) {
|
|
666
720
|
return (message) => {
|
|
667
|
-
console.info(
|
|
721
|
+
console.info(
|
|
722
|
+
`
|
|
668
723
|
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.success ?? "#56d364")(`[${CONSOLE_ICONS[LogLevelLabel.SUCCESS]} Success] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
669
|
-
`
|
|
724
|
+
`
|
|
725
|
+
);
|
|
670
726
|
};
|
|
671
727
|
}
|
|
672
728
|
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel) {
|
|
673
729
|
return (message) => {
|
|
674
|
-
console.info(
|
|
730
|
+
console.info(
|
|
731
|
+
`
|
|
675
732
|
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.info ?? "#58a6ff")(`[${CONSOLE_ICONS[LogLevelLabel.INFO]} Info] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
676
|
-
`
|
|
733
|
+
`
|
|
734
|
+
);
|
|
677
735
|
};
|
|
678
736
|
}
|
|
679
737
|
if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel) {
|
|
680
738
|
return (message) => {
|
|
681
|
-
console.debug(
|
|
739
|
+
console.debug(
|
|
740
|
+
`
|
|
682
741
|
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.brand ?? "#1fb2a6")(`[${CONSOLE_ICONS[LogLevelLabel.DEBUG]} Debug] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
683
|
-
`
|
|
742
|
+
`
|
|
743
|
+
);
|
|
684
744
|
};
|
|
685
745
|
}
|
|
686
746
|
if (typeof logLevel === "number" && LogLevel.TRACE >= logLevel) {
|
|
687
747
|
return (message) => {
|
|
688
|
-
console.debug(
|
|
748
|
+
console.debug(
|
|
749
|
+
`
|
|
689
750
|
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.brand ?? "#1fb2a6")(`[${CONSOLE_ICONS[LogLevelLabel.TRACE]} Trace] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
690
|
-
`
|
|
751
|
+
`
|
|
752
|
+
);
|
|
691
753
|
};
|
|
692
754
|
}
|
|
693
755
|
return (message) => {
|
|
694
|
-
console.log(
|
|
756
|
+
console.log(
|
|
757
|
+
`
|
|
695
758
|
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.brand ?? "#1fb2a6")(`[${CONSOLE_ICONS[LogLevelLabel.ALL]} System] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
696
|
-
`
|
|
759
|
+
`
|
|
760
|
+
);
|
|
697
761
|
};
|
|
698
|
-
}
|
|
699
|
-
var writeFatal =
|
|
700
|
-
var writeError =
|
|
701
|
-
var writeWarning =
|
|
702
|
-
var writeInfo =
|
|
703
|
-
var writeSuccess =
|
|
704
|
-
var writeDebug =
|
|
705
|
-
var writeTrace =
|
|
706
|
-
var getStopwatch =
|
|
762
|
+
};
|
|
763
|
+
var writeFatal = (message, config) => getLogFn(LogLevel.FATAL, config)(message);
|
|
764
|
+
var writeError = (message, config) => getLogFn(LogLevel.ERROR, config)(message);
|
|
765
|
+
var writeWarning = (message, config) => getLogFn(LogLevel.WARN, config)(message);
|
|
766
|
+
var writeInfo = (message, config) => getLogFn(LogLevel.INFO, config)(message);
|
|
767
|
+
var writeSuccess = (message, config) => getLogFn(LogLevel.SUCCESS, config)(message);
|
|
768
|
+
var writeDebug = (message, config) => getLogFn(LogLevel.DEBUG, config)(message);
|
|
769
|
+
var writeTrace = (message, config) => getLogFn(LogLevel.TRACE, config)(message);
|
|
770
|
+
var getStopwatch = (name) => {
|
|
707
771
|
const start = process.hrtime();
|
|
708
772
|
return () => {
|
|
709
773
|
const end = process.hrtime(start);
|
|
710
|
-
console.info(
|
|
711
|
-
|
|
712
|
-
`
|
|
774
|
+
console.info(
|
|
775
|
+
`
|
|
776
|
+
> \u23F1\uFE0F The${name ? ` ${name}` : ""} process took ${Math.round(
|
|
777
|
+
end[0] * 1e3 + end[1] / 1e6
|
|
778
|
+
)}ms to complete
|
|
779
|
+
`
|
|
780
|
+
);
|
|
713
781
|
};
|
|
714
|
-
}
|
|
782
|
+
};
|
|
715
783
|
var MAX_DEPTH = 4;
|
|
716
|
-
var formatLogMessage =
|
|
784
|
+
var formatLogMessage = (message, options = {}, depth2 = 0) => {
|
|
717
785
|
if (depth2 > MAX_DEPTH) {
|
|
718
786
|
return "<max depth>";
|
|
719
787
|
}
|
|
720
788
|
const prefix = options.prefix ?? "-";
|
|
721
789
|
const skip = options.skip ?? [];
|
|
722
790
|
return typeof message === "undefined" || message === null || !message && typeof message !== "boolean" ? "<none>" : typeof message === "string" ? message : Array.isArray(message) ? `
|
|
723
|
-
${message.map((item, index) => ` ${prefix}> #${index} = ${formatLogMessage(item, {
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
}
|
|
732
|
-
var _isFunction =
|
|
791
|
+
${message.map((item, index) => ` ${prefix}> #${index} = ${formatLogMessage(item, { prefix: `${prefix}-`, skip }, depth2 + 1)}`).join("\n")}` : typeof message === "object" ? `
|
|
792
|
+
${Object.keys(message).filter((key) => !skip.includes(key)).map(
|
|
793
|
+
(key) => ` ${prefix}> ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" ? formatLogMessage(
|
|
794
|
+
message[key],
|
|
795
|
+
{ prefix: `${prefix}-`, skip },
|
|
796
|
+
depth2 + 1
|
|
797
|
+
) : message[key]}`
|
|
798
|
+
).join("\n")}` : message;
|
|
799
|
+
};
|
|
800
|
+
var _isFunction = (value) => {
|
|
733
801
|
try {
|
|
734
802
|
return value instanceof Function || typeof value === "function" || !!(value?.constructor && value?.call && value?.apply);
|
|
735
803
|
} catch (e) {
|
|
736
804
|
return false;
|
|
737
805
|
}
|
|
738
|
-
}
|
|
806
|
+
};
|
|
739
807
|
|
|
740
808
|
// ../config-tools/src/create-storm-config.ts
|
|
741
809
|
import defu2 from "defu";
|
|
@@ -743,7 +811,7 @@ import defu2 from "defu";
|
|
|
743
811
|
// ../config-tools/src/config-file/get-config-file.ts
|
|
744
812
|
import { loadConfig } from "c12";
|
|
745
813
|
import defu from "defu";
|
|
746
|
-
var getConfigFileByName =
|
|
814
|
+
var getConfigFileByName = async (fileName, filePath, options = {}) => {
|
|
747
815
|
const workspacePath = filePath || findWorkspaceRoot(filePath);
|
|
748
816
|
const configs = await Promise.all([
|
|
749
817
|
loadConfig({
|
|
@@ -753,7 +821,10 @@ var getConfigFileByName = /* @__PURE__ */ __name(async (fileName, filePath, opti
|
|
|
753
821
|
envName: fileName?.toUpperCase(),
|
|
754
822
|
jitiOptions: {
|
|
755
823
|
debug: false,
|
|
756
|
-
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths(
|
|
824
|
+
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths(
|
|
825
|
+
process.env.STORM_CACHE_DIR || "node_modules/.cache/storm",
|
|
826
|
+
"jiti"
|
|
827
|
+
)
|
|
757
828
|
},
|
|
758
829
|
...options
|
|
759
830
|
}),
|
|
@@ -764,32 +835,45 @@ var getConfigFileByName = /* @__PURE__ */ __name(async (fileName, filePath, opti
|
|
|
764
835
|
envName: fileName?.toUpperCase(),
|
|
765
836
|
jitiOptions: {
|
|
766
837
|
debug: false,
|
|
767
|
-
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths(
|
|
838
|
+
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths(
|
|
839
|
+
process.env.STORM_CACHE_DIR || "node_modules/.cache/storm",
|
|
840
|
+
"jiti"
|
|
841
|
+
)
|
|
768
842
|
},
|
|
769
843
|
configFile: fileName,
|
|
770
844
|
...options
|
|
771
845
|
})
|
|
772
846
|
]);
|
|
773
847
|
return defu(configs[0] ?? {}, configs[1] ?? {});
|
|
774
|
-
}
|
|
775
|
-
var getConfigFile =
|
|
848
|
+
};
|
|
849
|
+
var getConfigFile = async (filePath, additionalFileNames = []) => {
|
|
776
850
|
const workspacePath = filePath ? filePath : findWorkspaceRoot(filePath);
|
|
777
851
|
const result = await getConfigFileByName("storm-workspace", workspacePath);
|
|
778
852
|
let config = result.config;
|
|
779
853
|
const configFile = result.configFile;
|
|
780
854
|
if (config && configFile && Object.keys(config).length > 0 && !config.skipConfigLogging) {
|
|
781
|
-
writeTrace(
|
|
782
|
-
|
|
783
|
-
|
|
855
|
+
writeTrace(
|
|
856
|
+
`Found Storm configuration file "${configFile.includes(`${workspacePath}/`) ? configFile.replace(`${workspacePath}/`, "") : configFile}" at "${workspacePath}"`,
|
|
857
|
+
{
|
|
858
|
+
logLevel: "all"
|
|
859
|
+
}
|
|
860
|
+
);
|
|
784
861
|
}
|
|
785
862
|
if (additionalFileNames && additionalFileNames.length > 0) {
|
|
786
|
-
const results = await Promise.all(
|
|
863
|
+
const results = await Promise.all(
|
|
864
|
+
additionalFileNames.map(
|
|
865
|
+
(fileName) => getConfigFileByName(fileName, workspacePath)
|
|
866
|
+
)
|
|
867
|
+
);
|
|
787
868
|
for (const result2 of results) {
|
|
788
869
|
if (result2?.config && result2?.configFile && Object.keys(result2.config).length > 0) {
|
|
789
870
|
if (!config.skipConfigLogging && !result2.config.skipConfigLogging) {
|
|
790
|
-
writeTrace(
|
|
791
|
-
|
|
792
|
-
|
|
871
|
+
writeTrace(
|
|
872
|
+
`Found alternative configuration file "${result2.configFile.includes(`${workspacePath}/`) ? result2.configFile.replace(`${workspacePath}/`, "") : result2.configFile}" at "${workspacePath}"`,
|
|
873
|
+
{
|
|
874
|
+
logLevel: "all"
|
|
875
|
+
}
|
|
876
|
+
);
|
|
793
877
|
}
|
|
794
878
|
config = defu(result2.config ?? {}, config ?? {});
|
|
795
879
|
}
|
|
@@ -800,20 +884,22 @@ var getConfigFile = /* @__PURE__ */ __name(async (filePath, additionalFileNames
|
|
|
800
884
|
}
|
|
801
885
|
config.configFile = configFile;
|
|
802
886
|
return config;
|
|
803
|
-
}
|
|
887
|
+
};
|
|
804
888
|
|
|
805
889
|
// ../config-tools/src/env/get-env.ts
|
|
806
|
-
var getExtensionEnv =
|
|
890
|
+
var getExtensionEnv = (extensionName) => {
|
|
807
891
|
const prefix = `STORM_EXTENSION_${extensionName.toUpperCase()}_`;
|
|
808
892
|
return Object.keys(process.env).filter((key) => key.startsWith(prefix)).reduce((ret, key) => {
|
|
809
|
-
const name = key.replace(prefix, "").split("_").map(
|
|
893
|
+
const name = key.replace(prefix, "").split("_").map(
|
|
894
|
+
(i) => i.length > 0 ? i.trim().charAt(0).toUpperCase() + i.trim().slice(1) : ""
|
|
895
|
+
).join("");
|
|
810
896
|
if (name) {
|
|
811
897
|
ret[name] = process.env[key];
|
|
812
898
|
}
|
|
813
899
|
return ret;
|
|
814
900
|
}, {});
|
|
815
|
-
}
|
|
816
|
-
var getConfigEnv =
|
|
901
|
+
};
|
|
902
|
+
var getConfigEnv = () => {
|
|
817
903
|
const prefix = "STORM_";
|
|
818
904
|
let config = {
|
|
819
905
|
extends: process.env[`${prefix}EXTENDS`] || void 0,
|
|
@@ -881,14 +967,25 @@ var getConfigEnv = /* @__PURE__ */ __name(() => {
|
|
|
881
967
|
cyclone: process.env[`${prefix}REGISTRY_CYCLONE`] || void 0,
|
|
882
968
|
container: process.env[`${prefix}REGISTRY_CONTAINER`] || void 0
|
|
883
969
|
},
|
|
884
|
-
logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(
|
|
970
|
+
logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(
|
|
971
|
+
Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
|
|
972
|
+
) ? getLogLevelLabel(
|
|
973
|
+
Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
|
|
974
|
+
) : process.env[`${prefix}LOG_LEVEL`] : void 0,
|
|
885
975
|
skipConfigLogging: process.env[`${prefix}SKIP_CONFIG_LOGGING`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CONFIG_LOGGING`]) : void 0
|
|
886
976
|
};
|
|
887
|
-
const themeNames = Object.keys(process.env).filter(
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
977
|
+
const themeNames = Object.keys(process.env).filter(
|
|
978
|
+
(envKey) => envKey.startsWith(`${prefix}COLOR_`) && COLOR_KEYS.every(
|
|
979
|
+
(colorKey) => !envKey.startsWith(`${prefix}COLOR_LIGHT_${colorKey}`) && !envKey.startsWith(`${prefix}COLOR_DARK_${colorKey}`)
|
|
980
|
+
)
|
|
981
|
+
);
|
|
982
|
+
config.colors = themeNames.length > 0 ? themeNames.reduce(
|
|
983
|
+
(ret, themeName) => {
|
|
984
|
+
ret[themeName] = getThemeColorConfigEnv(prefix, themeName);
|
|
985
|
+
return ret;
|
|
986
|
+
},
|
|
987
|
+
{}
|
|
988
|
+
) : getThemeColorConfigEnv(prefix);
|
|
892
989
|
if (config.docs === STORM_DEFAULT_DOCS) {
|
|
893
990
|
if (config.homepage === STORM_DEFAULT_HOMEPAGE) {
|
|
894
991
|
config.docs = `${STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/docs`;
|
|
@@ -909,23 +1006,17 @@ var getConfigEnv = /* @__PURE__ */ __name(() => {
|
|
|
909
1006
|
config = {
|
|
910
1007
|
...config,
|
|
911
1008
|
...parsed,
|
|
912
|
-
colors: {
|
|
913
|
-
|
|
914
|
-
...parsed.colors
|
|
915
|
-
},
|
|
916
|
-
extensions: {
|
|
917
|
-
...config.extensions,
|
|
918
|
-
...parsed.extensions
|
|
919
|
-
}
|
|
1009
|
+
colors: { ...config.colors, ...parsed.colors },
|
|
1010
|
+
extensions: { ...config.extensions, ...parsed.extensions }
|
|
920
1011
|
};
|
|
921
1012
|
}
|
|
922
1013
|
return config;
|
|
923
|
-
}
|
|
924
|
-
var getThemeColorConfigEnv =
|
|
1014
|
+
};
|
|
1015
|
+
var getThemeColorConfigEnv = (prefix, theme) => {
|
|
925
1016
|
const themeName = `COLOR_${theme && theme !== "base" ? `${theme}_` : ""}`.toUpperCase();
|
|
926
1017
|
return process.env[`${prefix}${themeName}LIGHT_BRAND`] || process.env[`${prefix}${themeName}DARK_BRAND`] ? getMultiThemeColorConfigEnv(prefix + themeName) : getSingleThemeColorConfigEnv(prefix + themeName);
|
|
927
|
-
}
|
|
928
|
-
var getSingleThemeColorConfigEnv =
|
|
1018
|
+
};
|
|
1019
|
+
var getSingleThemeColorConfigEnv = (prefix) => {
|
|
929
1020
|
return {
|
|
930
1021
|
dark: process.env[`${prefix}DARK`],
|
|
931
1022
|
light: process.env[`${prefix}LIGHT`],
|
|
@@ -942,14 +1033,16 @@ var getSingleThemeColorConfigEnv = /* @__PURE__ */ __name((prefix) => {
|
|
|
942
1033
|
positive: process.env[`${prefix}POSITIVE`],
|
|
943
1034
|
negative: process.env[`${prefix}NEGATIVE`]
|
|
944
1035
|
};
|
|
945
|
-
}
|
|
946
|
-
var getMultiThemeColorConfigEnv =
|
|
1036
|
+
};
|
|
1037
|
+
var getMultiThemeColorConfigEnv = (prefix) => {
|
|
947
1038
|
return {
|
|
948
|
-
light: getBaseThemeColorConfigEnv(
|
|
1039
|
+
light: getBaseThemeColorConfigEnv(
|
|
1040
|
+
`${prefix}_LIGHT_`
|
|
1041
|
+
),
|
|
949
1042
|
dark: getBaseThemeColorConfigEnv(`${prefix}_DARK_`)
|
|
950
1043
|
};
|
|
951
|
-
}
|
|
952
|
-
var getBaseThemeColorConfigEnv =
|
|
1044
|
+
};
|
|
1045
|
+
var getBaseThemeColorConfigEnv = (prefix) => {
|
|
953
1046
|
return {
|
|
954
1047
|
foreground: process.env[`${prefix}FOREGROUND`],
|
|
955
1048
|
background: process.env[`${prefix}BACKGROUND`],
|
|
@@ -966,13 +1059,16 @@ var getBaseThemeColorConfigEnv = /* @__PURE__ */ __name((prefix) => {
|
|
|
966
1059
|
positive: process.env[`${prefix}POSITIVE`],
|
|
967
1060
|
negative: process.env[`${prefix}NEGATIVE`]
|
|
968
1061
|
};
|
|
969
|
-
}
|
|
1062
|
+
};
|
|
970
1063
|
|
|
971
1064
|
// ../config-tools/src/env/set-env.ts
|
|
972
|
-
var setExtensionEnv =
|
|
1065
|
+
var setExtensionEnv = (extensionName, extension) => {
|
|
973
1066
|
for (const key of Object.keys(extension ?? {})) {
|
|
974
1067
|
if (extension[key]) {
|
|
975
|
-
const result = key?.replace(
|
|
1068
|
+
const result = key?.replace(
|
|
1069
|
+
/([A-Z])+/g,
|
|
1070
|
+
(input) => input ? input[0]?.toUpperCase() + input.slice(1) : ""
|
|
1071
|
+
).split(/(?=[A-Z])|[.\-\s_]/).map((x) => x.toLowerCase()) ?? [];
|
|
976
1072
|
let extensionKey;
|
|
977
1073
|
if (result.length === 0) {
|
|
978
1074
|
return;
|
|
@@ -987,8 +1083,8 @@ var setExtensionEnv = /* @__PURE__ */ __name((extensionName, extension) => {
|
|
|
987
1083
|
process.env[`STORM_EXTENSION_${extensionName.toUpperCase()}_${extensionKey.toUpperCase()}`] = extension[key];
|
|
988
1084
|
}
|
|
989
1085
|
}
|
|
990
|
-
}
|
|
991
|
-
var setConfigEnv =
|
|
1086
|
+
};
|
|
1087
|
+
var setConfigEnv = (config) => {
|
|
992
1088
|
const prefix = "STORM_";
|
|
993
1089
|
if (config.extends) {
|
|
994
1090
|
process.env[`${prefix}EXTENDS`] = Array.isArray(config.extends) ? JSON.stringify(config.extends) : config.extends;
|
|
@@ -1077,7 +1173,9 @@ var setConfigEnv = /* @__PURE__ */ __name((config) => {
|
|
|
1077
1173
|
}
|
|
1078
1174
|
if (config.directories) {
|
|
1079
1175
|
if (!config.skipCache && config.directories.cache) {
|
|
1080
|
-
process.env[`${prefix}CACHE_DIR`] = correctPaths(
|
|
1176
|
+
process.env[`${prefix}CACHE_DIR`] = correctPaths(
|
|
1177
|
+
config.directories.cache
|
|
1178
|
+
);
|
|
1081
1179
|
process.env[`${prefix}CACHE_DIRECTORY`] = process.env[`${prefix}CACHE_DIR`];
|
|
1082
1180
|
}
|
|
1083
1181
|
if (config.directories.data) {
|
|
@@ -1085,7 +1183,9 @@ var setConfigEnv = /* @__PURE__ */ __name((config) => {
|
|
|
1085
1183
|
process.env[`${prefix}DATA_DIRECTORY`] = process.env[`${prefix}DATA_DIR`];
|
|
1086
1184
|
}
|
|
1087
1185
|
if (config.directories.config) {
|
|
1088
|
-
process.env[`${prefix}CONFIG_DIR`] = correctPaths(
|
|
1186
|
+
process.env[`${prefix}CONFIG_DIR`] = correctPaths(
|
|
1187
|
+
config.directories.config
|
|
1188
|
+
);
|
|
1089
1189
|
process.env[`${prefix}CONFIG_DIRECTORY`] = process.env[`${prefix}CONFIG_DIR`];
|
|
1090
1190
|
}
|
|
1091
1191
|
if (config.directories.temp) {
|
|
@@ -1097,7 +1197,9 @@ var setConfigEnv = /* @__PURE__ */ __name((config) => {
|
|
|
1097
1197
|
process.env[`${prefix}LOG_DIRECTORY`] = process.env[`${prefix}LOG_DIR`];
|
|
1098
1198
|
}
|
|
1099
1199
|
if (config.directories.build) {
|
|
1100
|
-
process.env[`${prefix}BUILD_DIR`] = correctPaths(
|
|
1200
|
+
process.env[`${prefix}BUILD_DIR`] = correctPaths(
|
|
1201
|
+
config.directories.build
|
|
1202
|
+
);
|
|
1101
1203
|
process.env[`${prefix}BUILD_DIRECTORY`] = process.env[`${prefix}BUILD_DIR`];
|
|
1102
1204
|
}
|
|
1103
1205
|
}
|
|
@@ -1118,7 +1220,10 @@ var setConfigEnv = /* @__PURE__ */ __name((config) => {
|
|
|
1118
1220
|
setThemeColorConfigEnv(`${prefix}COLOR_${key}_`, config.colors[key]);
|
|
1119
1221
|
}
|
|
1120
1222
|
} else {
|
|
1121
|
-
setThemeColorConfigEnv(
|
|
1223
|
+
setThemeColorConfigEnv(
|
|
1224
|
+
`${prefix}COLOR_`,
|
|
1225
|
+
config.colors
|
|
1226
|
+
);
|
|
1122
1227
|
}
|
|
1123
1228
|
if (config.repository) {
|
|
1124
1229
|
process.env[`${prefix}REPOSITORY`] = config.repository;
|
|
@@ -1130,7 +1235,9 @@ var setConfigEnv = /* @__PURE__ */ __name((config) => {
|
|
|
1130
1235
|
process.env[`${prefix}PRE_ID`] = String(config.preid);
|
|
1131
1236
|
}
|
|
1132
1237
|
if (config.externalPackagePatterns) {
|
|
1133
|
-
process.env[`${prefix}EXTERNAL_PACKAGE_PATTERNS`] = JSON.stringify(
|
|
1238
|
+
process.env[`${prefix}EXTERNAL_PACKAGE_PATTERNS`] = JSON.stringify(
|
|
1239
|
+
config.externalPackagePatterns
|
|
1240
|
+
);
|
|
1134
1241
|
}
|
|
1135
1242
|
if (config.registry) {
|
|
1136
1243
|
if (config.registry.github) {
|
|
@@ -1143,20 +1250,28 @@ var setConfigEnv = /* @__PURE__ */ __name((config) => {
|
|
|
1143
1250
|
process.env[`${prefix}REGISTRY_CARGO`] = String(config.registry.cargo);
|
|
1144
1251
|
}
|
|
1145
1252
|
if (config.registry.cyclone) {
|
|
1146
|
-
process.env[`${prefix}REGISTRY_CYCLONE`] = String(
|
|
1253
|
+
process.env[`${prefix}REGISTRY_CYCLONE`] = String(
|
|
1254
|
+
config.registry.cyclone
|
|
1255
|
+
);
|
|
1147
1256
|
}
|
|
1148
1257
|
if (config.registry.container) {
|
|
1149
|
-
process.env[`${prefix}REGISTRY_CONTAINER`] = String(
|
|
1258
|
+
process.env[`${prefix}REGISTRY_CONTAINER`] = String(
|
|
1259
|
+
config.registry.container
|
|
1260
|
+
);
|
|
1150
1261
|
}
|
|
1151
1262
|
}
|
|
1152
1263
|
if (config.logLevel) {
|
|
1153
1264
|
process.env[`${prefix}LOG_LEVEL`] = String(config.logLevel);
|
|
1154
1265
|
process.env.LOG_LEVEL = String(config.logLevel);
|
|
1155
|
-
process.env.NX_VERBOSE_LOGGING = String(
|
|
1266
|
+
process.env.NX_VERBOSE_LOGGING = String(
|
|
1267
|
+
getLogLevel(config.logLevel) >= LogLevel.DEBUG ? true : false
|
|
1268
|
+
);
|
|
1156
1269
|
process.env.RUST_BACKTRACE = getLogLevel(config.logLevel) >= LogLevel.DEBUG ? "full" : "none";
|
|
1157
1270
|
}
|
|
1158
1271
|
if (config.skipConfigLogging !== void 0) {
|
|
1159
|
-
process.env[`${prefix}SKIP_CONFIG_LOGGING`] = String(
|
|
1272
|
+
process.env[`${prefix}SKIP_CONFIG_LOGGING`] = String(
|
|
1273
|
+
config.skipConfigLogging
|
|
1274
|
+
);
|
|
1160
1275
|
}
|
|
1161
1276
|
process.env[`${prefix}CONFIG`] = JSON.stringify(config);
|
|
1162
1277
|
for (const key of Object.keys(config.extensions ?? {})) {
|
|
@@ -1164,11 +1279,11 @@ var setConfigEnv = /* @__PURE__ */ __name((config) => {
|
|
|
1164
1279
|
setExtensionEnv(key, config.extensions[key]);
|
|
1165
1280
|
}
|
|
1166
1281
|
}
|
|
1167
|
-
}
|
|
1168
|
-
var setThemeColorConfigEnv =
|
|
1282
|
+
};
|
|
1283
|
+
var setThemeColorConfigEnv = (prefix, config) => {
|
|
1169
1284
|
return config?.light?.brand || config?.dark?.brand ? setMultiThemeColorConfigEnv(prefix, config) : setSingleThemeColorConfigEnv(prefix, config);
|
|
1170
|
-
}
|
|
1171
|
-
var setSingleThemeColorConfigEnv =
|
|
1285
|
+
};
|
|
1286
|
+
var setSingleThemeColorConfigEnv = (prefix, config) => {
|
|
1172
1287
|
if (config.dark) {
|
|
1173
1288
|
process.env[`${prefix}DARK`] = config.dark;
|
|
1174
1289
|
}
|
|
@@ -1211,14 +1326,14 @@ var setSingleThemeColorConfigEnv = /* @__PURE__ */ __name((prefix, config) => {
|
|
|
1211
1326
|
if (config.negative) {
|
|
1212
1327
|
process.env[`${prefix}NEGATIVE`] = config.negative;
|
|
1213
1328
|
}
|
|
1214
|
-
}
|
|
1215
|
-
var setMultiThemeColorConfigEnv =
|
|
1329
|
+
};
|
|
1330
|
+
var setMultiThemeColorConfigEnv = (prefix, config) => {
|
|
1216
1331
|
return {
|
|
1217
1332
|
light: setBaseThemeColorConfigEnv(`${prefix}LIGHT_`, config.light),
|
|
1218
1333
|
dark: setBaseThemeColorConfigEnv(`${prefix}DARK_`, config.dark)
|
|
1219
1334
|
};
|
|
1220
|
-
}
|
|
1221
|
-
var setBaseThemeColorConfigEnv =
|
|
1335
|
+
};
|
|
1336
|
+
var setBaseThemeColorConfigEnv = (prefix, config) => {
|
|
1222
1337
|
if (config.foreground) {
|
|
1223
1338
|
process.env[`${prefix}FOREGROUND`] = config.foreground;
|
|
1224
1339
|
}
|
|
@@ -1261,12 +1376,12 @@ var setBaseThemeColorConfigEnv = /* @__PURE__ */ __name((prefix, config) => {
|
|
|
1261
1376
|
if (config.negative) {
|
|
1262
1377
|
process.env[`${prefix}NEGATIVE`] = config.negative;
|
|
1263
1378
|
}
|
|
1264
|
-
}
|
|
1379
|
+
};
|
|
1265
1380
|
|
|
1266
1381
|
// ../config-tools/src/create-storm-config.ts
|
|
1267
1382
|
var _extension_cache = /* @__PURE__ */ new WeakMap();
|
|
1268
1383
|
var _static_cache = void 0;
|
|
1269
|
-
var createStormWorkspaceConfig =
|
|
1384
|
+
var createStormWorkspaceConfig = async (extensionName, schema, workspaceRoot, skipLogs = false, useDefault = true) => {
|
|
1270
1385
|
let result;
|
|
1271
1386
|
if (!_static_cache?.data || !_static_cache?.timestamp || _static_cache.timestamp < Date.now() - 8e3) {
|
|
1272
1387
|
let _workspaceRoot = workspaceRoot;
|
|
@@ -1277,16 +1392,19 @@ var createStormWorkspaceConfig = /* @__PURE__ */ __name(async (extensionName, sc
|
|
|
1277
1392
|
const configFile = await getConfigFile(_workspaceRoot);
|
|
1278
1393
|
if (!configFile) {
|
|
1279
1394
|
if (!skipLogs) {
|
|
1280
|
-
writeWarning(
|
|
1281
|
-
|
|
1282
|
-
|
|
1395
|
+
writeWarning(
|
|
1396
|
+
"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",
|
|
1397
|
+
{ logLevel: "all" }
|
|
1398
|
+
);
|
|
1283
1399
|
}
|
|
1284
1400
|
if (useDefault === false) {
|
|
1285
1401
|
return void 0;
|
|
1286
1402
|
}
|
|
1287
1403
|
}
|
|
1288
1404
|
const defaultConfig = await getDefaultConfig(_workspaceRoot);
|
|
1289
|
-
result = await stormWorkspaceConfigSchema.parseAsync(
|
|
1405
|
+
result = await stormWorkspaceConfigSchema.parseAsync(
|
|
1406
|
+
defu2(configEnv, configFile, defaultConfig)
|
|
1407
|
+
);
|
|
1290
1408
|
result.workspaceRoot ??= _workspaceRoot;
|
|
1291
1409
|
} else {
|
|
1292
1410
|
result = _static_cache.data;
|
|
@@ -1302,11 +1420,9 @@ var createStormWorkspaceConfig = /* @__PURE__ */ __name(async (extensionName, sc
|
|
|
1302
1420
|
data: result
|
|
1303
1421
|
};
|
|
1304
1422
|
return result;
|
|
1305
|
-
}
|
|
1306
|
-
var createConfigExtension =
|
|
1307
|
-
const extension_cache_key = {
|
|
1308
|
-
extensionName
|
|
1309
|
-
};
|
|
1423
|
+
};
|
|
1424
|
+
var createConfigExtension = (extensionName, schema) => {
|
|
1425
|
+
const extension_cache_key = { extensionName };
|
|
1310
1426
|
if (_extension_cache.has(extension_cache_key)) {
|
|
1311
1427
|
return _extension_cache.get(extension_cache_key);
|
|
1312
1428
|
}
|
|
@@ -1316,21 +1432,30 @@ var createConfigExtension = /* @__PURE__ */ __name((extensionName, schema) => {
|
|
|
1316
1432
|
}
|
|
1317
1433
|
_extension_cache.set(extension_cache_key, extension);
|
|
1318
1434
|
return extension;
|
|
1319
|
-
}
|
|
1320
|
-
var loadStormWorkspaceConfig =
|
|
1321
|
-
const config = await createStormWorkspaceConfig(
|
|
1435
|
+
};
|
|
1436
|
+
var loadStormWorkspaceConfig = async (workspaceRoot, skipLogs = false) => {
|
|
1437
|
+
const config = await createStormWorkspaceConfig(
|
|
1438
|
+
void 0,
|
|
1439
|
+
void 0,
|
|
1440
|
+
workspaceRoot,
|
|
1441
|
+
skipLogs,
|
|
1442
|
+
true
|
|
1443
|
+
);
|
|
1322
1444
|
setConfigEnv(config);
|
|
1323
1445
|
if (!skipLogs && !config.skipConfigLogging) {
|
|
1324
|
-
writeTrace(
|
|
1325
|
-
|
|
1446
|
+
writeTrace(
|
|
1447
|
+
`\u2699\uFE0F Using Storm Workspace configuration:
|
|
1448
|
+
${formatLogMessage(config)}`,
|
|
1449
|
+
config
|
|
1450
|
+
);
|
|
1326
1451
|
}
|
|
1327
1452
|
return config;
|
|
1328
|
-
}
|
|
1453
|
+
};
|
|
1329
1454
|
|
|
1330
1455
|
// ../config-tools/src/get-config.ts
|
|
1331
|
-
var getConfig =
|
|
1456
|
+
var getConfig = (workspaceRoot, skipLogs = false) => {
|
|
1332
1457
|
return loadStormWorkspaceConfig(workspaceRoot, skipLogs);
|
|
1333
|
-
}
|
|
1458
|
+
};
|
|
1334
1459
|
|
|
1335
1460
|
export {
|
|
1336
1461
|
findWorkspaceRoot,
|