@storm-software/terraform-tools 0.54.84 → 0.54.86
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 +21 -0
- package/README.md +1 -2
- package/dist/{chunk-LXKO7ZLH.js → chunk-2WTDMDFS.js} +2 -2
- package/dist/chunk-3RG5ZIWI.js +10 -0
- package/dist/{chunk-JQCUCWAF.mjs → chunk-5TXZ2IQ6.mjs} +1 -1
- package/dist/chunk-7GH4VDRM.mjs +95 -0
- package/dist/{chunk-FC5AL6FF.js → chunk-A4RDGLKC.js} +420 -248
- package/dist/{chunk-YBMM6DDX.js → chunk-AJVSFBNT.js} +2 -2
- package/dist/{chunk-YA4E2N42.mjs → chunk-DIXFQWYR.mjs} +419 -247
- package/dist/{chunk-WPRKDCZP.mjs → chunk-IEZKYJSF.mjs} +3 -6
- package/dist/{chunk-EMBHVVES.mjs → chunk-L3RPHNAE.mjs} +751 -560
- package/dist/{chunk-DXM2JXJD.mjs → chunk-LHAZ3WPQ.mjs} +1 -1
- package/dist/{chunk-SR7JIQJV.js → chunk-N5AGYIJO.js} +810 -619
- package/dist/{chunk-WWAFUN4V.mjs → chunk-ONGG25RY.mjs} +1 -1
- package/dist/{chunk-JPGERIM3.js → chunk-OV7TVEAC.js} +2 -2
- package/dist/{chunk-YMKC4F5V.mjs → chunk-VNME2RIT.mjs} +1 -1
- package/dist/{chunk-ESAA5DIO.js → chunk-WJV4GOSN.js} +2 -2
- package/dist/chunk-ZLPOE4VZ.js +95 -0
- package/dist/executors.js +7 -7
- package/dist/executors.mjs +7 -7
- package/dist/generators.js +4 -4
- package/dist/generators.mjs +3 -3
- package/dist/index.js +9 -9
- package/dist/index.mjs +8 -8
- package/dist/src/base/base-terraform-executor.untyped.js +1 -1
- package/dist/src/base/base-terraform-executor.untyped.mjs +1 -1
- package/dist/src/base/index.js +4 -4
- package/dist/src/base/index.mjs +3 -3
- package/dist/src/base/terraform-executor.js +4 -4
- package/dist/src/base/terraform-executor.mjs +3 -3
- package/dist/src/executors/apply/executor.js +5 -5
- package/dist/src/executors/apply/executor.mjs +4 -4
- package/dist/src/executors/destroy/executor.js +5 -5
- package/dist/src/executors/destroy/executor.mjs +4 -4
- package/dist/src/executors/output/executor.js +5 -5
- package/dist/src/executors/output/executor.mjs +4 -4
- package/dist/src/executors/plan/executor.js +5 -5
- package/dist/src/executors/plan/executor.mjs +4 -4
- package/dist/src/generators/init/init.js +4 -4
- package/dist/src/generators/init/init.mjs +3 -3
- 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-Q6WCEL5B.mjs +0 -71
- package/dist/chunk-ZAMME4JX.js +0 -71
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__name
|
|
3
|
-
} from "./chunk-WPRKDCZP.mjs";
|
|
4
|
-
|
|
5
1
|
// ../config-tools/src/config-file/get-config-file.ts
|
|
6
2
|
import { loadConfig } from "c12";
|
|
7
3
|
import defu from "defu";
|
|
@@ -128,23 +124,39 @@ var RegistryConfigSchema = z.object({
|
|
|
128
124
|
cyclone: RegistryUrlConfigSchema,
|
|
129
125
|
container: RegistryUrlConfigSchema
|
|
130
126
|
}).default({}).describe("A list of remote registry URLs used by Storm Software");
|
|
131
|
-
var ColorConfigSchema = SingleThemeColorConfigSchema.or(
|
|
127
|
+
var ColorConfigSchema = SingleThemeColorConfigSchema.or(
|
|
128
|
+
MultiThemeColorConfigSchema
|
|
129
|
+
).describe("Colors used for various workspace elements");
|
|
132
130
|
var ColorConfigMapSchema = z.union([
|
|
133
|
-
z.object({
|
|
134
|
-
base: ColorConfigSchema
|
|
135
|
-
}),
|
|
131
|
+
z.object({ base: ColorConfigSchema }),
|
|
136
132
|
z.record(z.string(), ColorConfigSchema)
|
|
137
133
|
]);
|
|
138
|
-
var ExtendsItemSchema = z.string().trim().describe(
|
|
139
|
-
|
|
134
|
+
var ExtendsItemSchema = z.string().trim().describe(
|
|
135
|
+
"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."
|
|
136
|
+
);
|
|
137
|
+
var ExtendsSchema = ExtendsItemSchema.or(
|
|
138
|
+
z.array(ExtendsItemSchema)
|
|
139
|
+
).describe(
|
|
140
|
+
"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."
|
|
141
|
+
);
|
|
140
142
|
var WorkspaceBotConfigSchema = z.object({
|
|
141
|
-
name: z.string().trim().default("stormie-bot").describe(
|
|
143
|
+
name: z.string().trim().default("stormie-bot").describe(
|
|
144
|
+
"The workspace bot user's name (this is the bot that will be used to perform various tasks)"
|
|
145
|
+
),
|
|
142
146
|
email: z.string().trim().email().default("bot@stormsoftware.com").describe("The email of the workspace bot")
|
|
143
|
-
}).describe(
|
|
147
|
+
}).describe(
|
|
148
|
+
"The workspace's bot user's config used to automated various operations tasks"
|
|
149
|
+
);
|
|
144
150
|
var WorkspaceReleaseConfigSchema = z.object({
|
|
145
|
-
banner: z.string().trim().default(STORM_DEFAULT_RELEASE_BANNER).describe(
|
|
146
|
-
|
|
147
|
-
|
|
151
|
+
banner: z.string().trim().default(STORM_DEFAULT_RELEASE_BANNER).describe(
|
|
152
|
+
"A URL to a banner image used to display the workspace's release"
|
|
153
|
+
),
|
|
154
|
+
header: z.string().trim().optional().describe(
|
|
155
|
+
"A header message appended to the start of the workspace's release notes"
|
|
156
|
+
),
|
|
157
|
+
footer: z.string().trim().default(STORM_DEFAULT_RELEASE_FOOTER).describe(
|
|
158
|
+
"A footer message appended to the end of the workspace's release notes"
|
|
159
|
+
)
|
|
148
160
|
}).describe("The workspace's release config used during the release process");
|
|
149
161
|
var WorkspaceAccountConfigSchema = z.object({
|
|
150
162
|
twitter: z.string().trim().default(STORM_DEFAULT_ACCOUNT_TWITTER).describe("A Twitter/X account associated with the organization/project"),
|
|
@@ -153,23 +165,41 @@ var WorkspaceAccountConfigSchema = z.object({
|
|
|
153
165
|
slack: z.string().trim().default(STORM_DEFAULT_ACCOUNT_SLACK).describe("A Slack account associated with the organization/project"),
|
|
154
166
|
medium: z.string().trim().default(STORM_DEFAULT_ACCOUNT_MEDIUM).describe("A Medium account associated with the organization/project"),
|
|
155
167
|
github: z.string().trim().default(STORM_DEFAULT_ACCOUNT_GITHUB).describe("A GitHub account associated with the organization/project")
|
|
156
|
-
}).describe(
|
|
168
|
+
}).describe(
|
|
169
|
+
"The workspace's account config used to store various social media links"
|
|
170
|
+
);
|
|
157
171
|
var WorkspaceDirectoryConfigSchema = z.object({
|
|
158
|
-
cache: z.string().trim().optional().describe(
|
|
172
|
+
cache: z.string().trim().optional().describe(
|
|
173
|
+
"The directory used to store the environment's cached file data"
|
|
174
|
+
),
|
|
159
175
|
data: z.string().trim().optional().describe("The directory used to store the environment's data files"),
|
|
160
|
-
config: z.string().trim().optional().describe(
|
|
176
|
+
config: z.string().trim().optional().describe(
|
|
177
|
+
"The directory used to store the environment's configuration files"
|
|
178
|
+
),
|
|
161
179
|
temp: z.string().trim().optional().describe("The directory used to store the environment's temp files"),
|
|
162
180
|
log: z.string().trim().optional().describe("The directory used to store the environment's temp files"),
|
|
163
|
-
build: z.string().trim().default("dist").describe(
|
|
164
|
-
|
|
181
|
+
build: z.string().trim().default("dist").describe(
|
|
182
|
+
"The directory used to store the workspace's distributable files after a build (relative to the workspace root)"
|
|
183
|
+
)
|
|
184
|
+
}).describe(
|
|
185
|
+
"Various directories used by the workspace to store data, cache, and configuration files"
|
|
186
|
+
);
|
|
165
187
|
var errorConfigSchema = z.object({
|
|
166
188
|
codesFile: z.string().trim().default(STORM_DEFAULT_ERROR_CODES_FILE).describe("The path to the workspace's error codes JSON file"),
|
|
167
|
-
url: z.string().trim().url().optional().describe(
|
|
189
|
+
url: z.string().trim().url().optional().describe(
|
|
190
|
+
"A URL to a page that looks up the workspace's error messages given a specific error code"
|
|
191
|
+
)
|
|
168
192
|
}).describe("The workspace's error config used during the error process");
|
|
169
193
|
var stormWorkspaceConfigSchema = z.object({
|
|
170
|
-
$schema: z.string().trim().default(
|
|
194
|
+
$schema: z.string().trim().default(
|
|
195
|
+
"https://cdn.jsdelivr.net/npm/@storm-software/config/schemas/storm-workspace.schema.json"
|
|
196
|
+
).optional().nullish().describe(
|
|
197
|
+
"The URL to the JSON schema file that describes the Storm configuration file"
|
|
198
|
+
),
|
|
171
199
|
extends: ExtendsSchema.optional(),
|
|
172
|
-
name: z.string().trim().toLowerCase().optional().describe(
|
|
200
|
+
name: z.string().trim().toLowerCase().optional().describe(
|
|
201
|
+
"The name of the service/package/scope using this configuration"
|
|
202
|
+
),
|
|
173
203
|
namespace: z.string().trim().toLowerCase().optional().describe("The namespace of the package"),
|
|
174
204
|
organization: z.string().trim().default("storm-software").describe("The organization of the workspace"),
|
|
175
205
|
repository: z.string().trim().optional().describe("The repo URL of the workspace (i.e. GitHub)"),
|
|
@@ -185,21 +215,16 @@ var stormWorkspaceConfigSchema = z.object({
|
|
|
185
215
|
release: WorkspaceReleaseConfigSchema,
|
|
186
216
|
account: WorkspaceAccountConfigSchema,
|
|
187
217
|
error: errorConfigSchema,
|
|
188
|
-
mode: z.enum([
|
|
189
|
-
"development",
|
|
190
|
-
"staging",
|
|
191
|
-
"production"
|
|
192
|
-
]).default("production").describe("The current runtime environment mode for the package"),
|
|
218
|
+
mode: z.enum(["development", "staging", "production"]).default("production").describe("The current runtime environment mode for the package"),
|
|
193
219
|
workspaceRoot: z.string().trim().describe("The root directory of the workspace"),
|
|
194
|
-
externalPackagePatterns: z.array(z.string()).default([]).describe(
|
|
220
|
+
externalPackagePatterns: z.array(z.string()).default([]).describe(
|
|
221
|
+
"The build will use these package patterns to determine if they should be external to the bundle"
|
|
222
|
+
),
|
|
195
223
|
skipCache: z.boolean().default(false).describe("Should all known types of workspace caching be skipped?"),
|
|
196
224
|
directories: WorkspaceDirectoryConfigSchema,
|
|
197
|
-
packageManager: z.enum([
|
|
198
|
-
"
|
|
199
|
-
|
|
200
|
-
"pnpm",
|
|
201
|
-
"bun"
|
|
202
|
-
]).default("npm").describe("The JavaScript/TypeScript package manager used by the repository"),
|
|
225
|
+
packageManager: z.enum(["npm", "yarn", "pnpm", "bun"]).default("npm").describe(
|
|
226
|
+
"The JavaScript/TypeScript package manager used by the repository"
|
|
227
|
+
),
|
|
203
228
|
timezone: z.string().trim().default("America/New_York").describe("The default timezone of the workspace"),
|
|
204
229
|
locale: z.string().trim().default("en-US").describe("The default locale of the workspace"),
|
|
205
230
|
logLevel: z.enum([
|
|
@@ -212,13 +237,23 @@ var stormWorkspaceConfigSchema = z.object({
|
|
|
212
237
|
"debug",
|
|
213
238
|
"trace",
|
|
214
239
|
"all"
|
|
215
|
-
]).default("info").describe(
|
|
216
|
-
|
|
240
|
+
]).default("info").describe(
|
|
241
|
+
"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`)."
|
|
242
|
+
),
|
|
243
|
+
skipConfigLogging: z.boolean().optional().describe(
|
|
244
|
+
"Should the logging of the current Storm Workspace configuration be skipped?"
|
|
245
|
+
),
|
|
217
246
|
registry: RegistryConfigSchema,
|
|
218
|
-
configFile: z.string().trim().nullable().default(null).describe(
|
|
219
|
-
|
|
247
|
+
configFile: z.string().trim().nullable().default(null).describe(
|
|
248
|
+
"The filepath of the Storm config. When this field is null, no config file was found in the current workspace."
|
|
249
|
+
),
|
|
250
|
+
colors: ColorConfigSchema.or(ColorConfigMapSchema).describe(
|
|
251
|
+
"Storm theme config values used for styling various package elements"
|
|
252
|
+
),
|
|
220
253
|
extensions: z.record(z.any()).optional().default({}).describe("Configuration of each used extension")
|
|
221
|
-
}).describe(
|
|
254
|
+
}).describe(
|
|
255
|
+
"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."
|
|
256
|
+
);
|
|
222
257
|
|
|
223
258
|
// ../config/src/types.ts
|
|
224
259
|
var COLOR_KEYS = [
|
|
@@ -252,11 +287,10 @@ function normalizeWindowsPath(input = "") {
|
|
|
252
287
|
}
|
|
253
288
|
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
|
|
254
289
|
}
|
|
255
|
-
__name(normalizeWindowsPath, "normalizeWindowsPath");
|
|
256
290
|
var _UNC_REGEX = /^[/\\]{2}/;
|
|
257
291
|
var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
|
258
292
|
var _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
|
|
259
|
-
var correctPaths =
|
|
293
|
+
var correctPaths = function(path) {
|
|
260
294
|
if (!path || path.length === 0) {
|
|
261
295
|
return ".";
|
|
262
296
|
}
|
|
@@ -284,8 +318,8 @@ var correctPaths = /* @__PURE__ */ __name(function(path) {
|
|
|
284
318
|
return `//${path}`;
|
|
285
319
|
}
|
|
286
320
|
return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
|
|
287
|
-
}
|
|
288
|
-
var joinPaths =
|
|
321
|
+
};
|
|
322
|
+
var joinPaths = function(...segments) {
|
|
289
323
|
let path = "";
|
|
290
324
|
for (const seg of segments) {
|
|
291
325
|
if (!seg) {
|
|
@@ -305,7 +339,7 @@ var joinPaths = /* @__PURE__ */ __name(function(...segments) {
|
|
|
305
339
|
}
|
|
306
340
|
}
|
|
307
341
|
return correctPaths(path);
|
|
308
|
-
}
|
|
342
|
+
};
|
|
309
343
|
function normalizeString(path, allowAboveRoot) {
|
|
310
344
|
let res = "";
|
|
311
345
|
let lastSegmentLength = 0;
|
|
@@ -366,10 +400,9 @@ function normalizeString(path, allowAboveRoot) {
|
|
|
366
400
|
}
|
|
367
401
|
return res;
|
|
368
402
|
}
|
|
369
|
-
|
|
370
|
-
var isAbsolute = /* @__PURE__ */ __name(function(p) {
|
|
403
|
+
var isAbsolute = function(p) {
|
|
371
404
|
return _IS_ABSOLUTE_RE.test(p);
|
|
372
|
-
}
|
|
405
|
+
};
|
|
373
406
|
|
|
374
407
|
// ../config-tools/src/utilities/find-up.ts
|
|
375
408
|
import { existsSync } from "node:fs";
|
|
@@ -378,10 +411,14 @@ var MAX_PATH_SEARCH_DEPTH = 30;
|
|
|
378
411
|
var depth = 0;
|
|
379
412
|
function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
|
|
380
413
|
const _startPath = startPath ?? process.cwd();
|
|
381
|
-
if (endDirectoryNames.some(
|
|
414
|
+
if (endDirectoryNames.some(
|
|
415
|
+
(endDirName) => existsSync(join(_startPath, endDirName))
|
|
416
|
+
)) {
|
|
382
417
|
return _startPath;
|
|
383
418
|
}
|
|
384
|
-
if (endFileNames.some(
|
|
419
|
+
if (endFileNames.some(
|
|
420
|
+
(endFileName) => existsSync(join(_startPath, endFileName))
|
|
421
|
+
)) {
|
|
385
422
|
return _startPath;
|
|
386
423
|
}
|
|
387
424
|
if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
|
|
@@ -390,7 +427,6 @@ function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
|
|
|
390
427
|
}
|
|
391
428
|
return void 0;
|
|
392
429
|
}
|
|
393
|
-
__name(findFolderUp, "findFolderUp");
|
|
394
430
|
|
|
395
431
|
// ../config-tools/src/utilities/find-workspace-root.ts
|
|
396
432
|
var rootFiles = [
|
|
@@ -437,21 +473,31 @@ var rootDirectories = [
|
|
|
437
473
|
];
|
|
438
474
|
function findWorkspaceRootSafe(pathInsideMonorepo) {
|
|
439
475
|
if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) {
|
|
440
|
-
return correctPaths(
|
|
441
|
-
|
|
442
|
-
|
|
476
|
+
return correctPaths(
|
|
477
|
+
process.env.STORM_WORKSPACE_ROOT ?? process.env.NX_WORKSPACE_ROOT_PATH
|
|
478
|
+
);
|
|
479
|
+
}
|
|
480
|
+
return correctPaths(
|
|
481
|
+
findFolderUp(
|
|
482
|
+
pathInsideMonorepo ?? process.cwd(),
|
|
483
|
+
rootFiles,
|
|
484
|
+
rootDirectories
|
|
485
|
+
)
|
|
486
|
+
);
|
|
443
487
|
}
|
|
444
|
-
__name(findWorkspaceRootSafe, "findWorkspaceRootSafe");
|
|
445
488
|
function findWorkspaceRoot(pathInsideMonorepo) {
|
|
446
489
|
const result = findWorkspaceRootSafe(pathInsideMonorepo);
|
|
447
490
|
if (!result) {
|
|
448
|
-
throw new Error(
|
|
449
|
-
|
|
450
|
-
|
|
491
|
+
throw new Error(
|
|
492
|
+
`Cannot find workspace root upwards from known path. Files search list includes:
|
|
493
|
+
${rootFiles.join(
|
|
494
|
+
"\n"
|
|
495
|
+
)}
|
|
496
|
+
Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
|
|
497
|
+
);
|
|
451
498
|
}
|
|
452
499
|
return result;
|
|
453
500
|
}
|
|
454
|
-
__name(findWorkspaceRoot, "findWorkspaceRoot");
|
|
455
501
|
|
|
456
502
|
// ../config-tools/src/utilities/get-default-config.ts
|
|
457
503
|
var DEFAULT_COLOR_CONFIG = {
|
|
@@ -482,7 +528,7 @@ var DEFAULT_COLOR_CONFIG = {
|
|
|
482
528
|
negative: "#dc2626"
|
|
483
529
|
}
|
|
484
530
|
};
|
|
485
|
-
var getDefaultConfig =
|
|
531
|
+
var getDefaultConfig = async (root) => {
|
|
486
532
|
let license = STORM_DEFAULT_LICENSE;
|
|
487
533
|
let homepage = STORM_DEFAULT_HOMEPAGE;
|
|
488
534
|
let name = void 0;
|
|
@@ -490,7 +536,10 @@ var getDefaultConfig = /* @__PURE__ */ __name(async (root) => {
|
|
|
490
536
|
let repository = void 0;
|
|
491
537
|
const workspaceRoot = findWorkspaceRoot(root);
|
|
492
538
|
if (existsSync2(join2(workspaceRoot, "package.json"))) {
|
|
493
|
-
const file = await readFile(
|
|
539
|
+
const file = await readFile(
|
|
540
|
+
joinPaths(workspaceRoot, "package.json"),
|
|
541
|
+
"utf8"
|
|
542
|
+
);
|
|
494
543
|
if (file) {
|
|
495
544
|
const packageJson = JSON.parse(file);
|
|
496
545
|
if (packageJson.name) {
|
|
@@ -527,36 +576,36 @@ var getDefaultConfig = /* @__PURE__ */ __name(async (root) => {
|
|
|
527
576
|
url: `${homepage || STORM_DEFAULT_HOMEPAGE}/errors`
|
|
528
577
|
}
|
|
529
578
|
};
|
|
530
|
-
}
|
|
579
|
+
};
|
|
531
580
|
|
|
532
581
|
// ../config-tools/src/logger/chalk.ts
|
|
533
582
|
import chalk from "chalk";
|
|
534
583
|
var chalkDefault = {
|
|
535
|
-
hex:
|
|
536
|
-
bgHex:
|
|
537
|
-
whiteBright:
|
|
538
|
-
}),
|
|
539
|
-
whiteBright:
|
|
540
|
-
gray:
|
|
584
|
+
hex: (_) => (message) => message,
|
|
585
|
+
bgHex: (_) => ({
|
|
586
|
+
whiteBright: (message) => message
|
|
587
|
+
}),
|
|
588
|
+
whiteBright: (message) => message,
|
|
589
|
+
gray: (message) => message,
|
|
541
590
|
bold: {
|
|
542
|
-
hex:
|
|
543
|
-
bgHex:
|
|
544
|
-
whiteBright:
|
|
545
|
-
}),
|
|
546
|
-
whiteBright:
|
|
591
|
+
hex: (_) => (message) => message,
|
|
592
|
+
bgHex: (_) => ({
|
|
593
|
+
whiteBright: (message) => message
|
|
594
|
+
}),
|
|
595
|
+
whiteBright: (message) => message
|
|
547
596
|
},
|
|
548
597
|
dim: {
|
|
549
|
-
hex:
|
|
550
|
-
gray:
|
|
598
|
+
hex: (_) => (message) => message,
|
|
599
|
+
gray: (message) => message
|
|
551
600
|
}
|
|
552
601
|
};
|
|
553
|
-
var getChalk =
|
|
602
|
+
var getChalk = () => {
|
|
554
603
|
let _chalk = chalk;
|
|
555
604
|
if (!_chalk?.hex || !_chalk?.bold?.hex || !_chalk?.bgHex || !_chalk?.whiteBright) {
|
|
556
605
|
_chalk = chalkDefault;
|
|
557
606
|
}
|
|
558
607
|
return _chalk;
|
|
559
|
-
}
|
|
608
|
+
};
|
|
560
609
|
|
|
561
610
|
// ../config-tools/src/logger/is-unicode-supported.ts
|
|
562
611
|
function isUnicodeSupported() {
|
|
@@ -568,10 +617,9 @@ function isUnicodeSupported() {
|
|
|
568
617
|
process.env.ConEmuTask === "{cmd::Cmder}" || // ConEmu and cmder
|
|
569
618
|
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";
|
|
570
619
|
}
|
|
571
|
-
__name(isUnicodeSupported, "isUnicodeSupported");
|
|
572
620
|
|
|
573
621
|
// ../config-tools/src/logger/console-icons.ts
|
|
574
|
-
var useIcon =
|
|
622
|
+
var useIcon = (c, fallback) => isUnicodeSupported() ? c : fallback;
|
|
575
623
|
var CONSOLE_ICONS = {
|
|
576
624
|
[LogLevelLabel.ERROR]: useIcon("\u2718", "\xD7"),
|
|
577
625
|
[LogLevelLabel.FATAL]: useIcon("\u{1F480}", "\xD7"),
|
|
@@ -584,12 +632,12 @@ var CONSOLE_ICONS = {
|
|
|
584
632
|
};
|
|
585
633
|
|
|
586
634
|
// ../config-tools/src/logger/format-timestamp.ts
|
|
587
|
-
var formatTimestamp =
|
|
635
|
+
var formatTimestamp = (date = /* @__PURE__ */ new Date()) => {
|
|
588
636
|
return `${date.toLocaleDateString()} ${date.toLocaleTimeString()}`;
|
|
589
|
-
}
|
|
637
|
+
};
|
|
590
638
|
|
|
591
639
|
// ../config-tools/src/logger/get-log-level.ts
|
|
592
|
-
var getLogLevel =
|
|
640
|
+
var getLogLevel = (label) => {
|
|
593
641
|
switch (label) {
|
|
594
642
|
case "all":
|
|
595
643
|
return LogLevel.ALL;
|
|
@@ -610,8 +658,8 @@ var getLogLevel = /* @__PURE__ */ __name((label) => {
|
|
|
610
658
|
default:
|
|
611
659
|
return LogLevel.INFO;
|
|
612
660
|
}
|
|
613
|
-
}
|
|
614
|
-
var getLogLevelLabel =
|
|
661
|
+
};
|
|
662
|
+
var getLogLevelLabel = (logLevel = LogLevel.INFO) => {
|
|
615
663
|
if (logLevel >= LogLevel.ALL) {
|
|
616
664
|
return LogLevelLabel.ALL;
|
|
617
665
|
}
|
|
@@ -637,10 +685,10 @@ var getLogLevelLabel = /* @__PURE__ */ __name((logLevel = LogLevel.INFO) => {
|
|
|
637
685
|
return LogLevelLabel.SILENT;
|
|
638
686
|
}
|
|
639
687
|
return LogLevelLabel.INFO;
|
|
640
|
-
}
|
|
688
|
+
};
|
|
641
689
|
|
|
642
690
|
// ../config-tools/src/logger/console.ts
|
|
643
|
-
var getLogFn =
|
|
691
|
+
var getLogFn = (logLevel = LogLevel.INFO, config = {}, _chalk = getChalk()) => {
|
|
644
692
|
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;
|
|
645
693
|
const configLogLevel = config.logLevel || process.env.STORM_LOG_LEVEL || LogLevelLabel.INFO;
|
|
646
694
|
if (logLevel > getLogLevel(configLogLevel) || logLevel <= LogLevel.SILENT || getLogLevel(configLogLevel) <= LogLevel.SILENT) {
|
|
@@ -649,102 +697,122 @@ var getLogFn = /* @__PURE__ */ __name((logLevel = LogLevel.INFO, config = {}, _c
|
|
|
649
697
|
}
|
|
650
698
|
if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel) {
|
|
651
699
|
return (message) => {
|
|
652
|
-
console.error(
|
|
700
|
+
console.error(
|
|
701
|
+
`
|
|
653
702
|
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.fatal ?? "#7d1a1a")(`[${CONSOLE_ICONS[LogLevelLabel.FATAL]} Fatal] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
654
|
-
`
|
|
703
|
+
`
|
|
704
|
+
);
|
|
655
705
|
};
|
|
656
706
|
}
|
|
657
707
|
if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel) {
|
|
658
708
|
return (message) => {
|
|
659
|
-
console.error(
|
|
709
|
+
console.error(
|
|
710
|
+
`
|
|
660
711
|
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.danger ?? "#f85149")(`[${CONSOLE_ICONS[LogLevelLabel.ERROR]} Error] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
661
|
-
`
|
|
712
|
+
`
|
|
713
|
+
);
|
|
662
714
|
};
|
|
663
715
|
}
|
|
664
716
|
if (typeof logLevel === "number" && LogLevel.WARN >= logLevel) {
|
|
665
717
|
return (message) => {
|
|
666
|
-
console.warn(
|
|
718
|
+
console.warn(
|
|
719
|
+
`
|
|
667
720
|
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.warning ?? "#e3b341")(`[${CONSOLE_ICONS[LogLevelLabel.WARN]} Warn] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
668
|
-
`
|
|
721
|
+
`
|
|
722
|
+
);
|
|
669
723
|
};
|
|
670
724
|
}
|
|
671
725
|
if (typeof logLevel === "number" && LogLevel.SUCCESS >= logLevel) {
|
|
672
726
|
return (message) => {
|
|
673
|
-
console.info(
|
|
727
|
+
console.info(
|
|
728
|
+
`
|
|
674
729
|
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.success ?? "#56d364")(`[${CONSOLE_ICONS[LogLevelLabel.SUCCESS]} Success] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
675
|
-
`
|
|
730
|
+
`
|
|
731
|
+
);
|
|
676
732
|
};
|
|
677
733
|
}
|
|
678
734
|
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel) {
|
|
679
735
|
return (message) => {
|
|
680
|
-
console.info(
|
|
736
|
+
console.info(
|
|
737
|
+
`
|
|
681
738
|
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.info ?? "#58a6ff")(`[${CONSOLE_ICONS[LogLevelLabel.INFO]} Info] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
682
|
-
`
|
|
739
|
+
`
|
|
740
|
+
);
|
|
683
741
|
};
|
|
684
742
|
}
|
|
685
743
|
if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel) {
|
|
686
744
|
return (message) => {
|
|
687
|
-
console.debug(
|
|
745
|
+
console.debug(
|
|
746
|
+
`
|
|
688
747
|
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.brand ?? "#1fb2a6")(`[${CONSOLE_ICONS[LogLevelLabel.DEBUG]} Debug] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
689
|
-
`
|
|
748
|
+
`
|
|
749
|
+
);
|
|
690
750
|
};
|
|
691
751
|
}
|
|
692
752
|
if (typeof logLevel === "number" && LogLevel.TRACE >= logLevel) {
|
|
693
753
|
return (message) => {
|
|
694
|
-
console.debug(
|
|
754
|
+
console.debug(
|
|
755
|
+
`
|
|
695
756
|
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.brand ?? "#1fb2a6")(`[${CONSOLE_ICONS[LogLevelLabel.TRACE]} Trace] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
696
|
-
`
|
|
757
|
+
`
|
|
758
|
+
);
|
|
697
759
|
};
|
|
698
760
|
}
|
|
699
761
|
return (message) => {
|
|
700
|
-
console.log(
|
|
762
|
+
console.log(
|
|
763
|
+
`
|
|
701
764
|
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.brand ?? "#1fb2a6")(`[${CONSOLE_ICONS[LogLevelLabel.ALL]} System] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
702
|
-
`
|
|
765
|
+
`
|
|
766
|
+
);
|
|
703
767
|
};
|
|
704
|
-
}
|
|
705
|
-
var writeFatal =
|
|
706
|
-
var writeError =
|
|
707
|
-
var writeWarning =
|
|
708
|
-
var writeInfo =
|
|
709
|
-
var writeSuccess =
|
|
710
|
-
var writeDebug =
|
|
711
|
-
var writeTrace =
|
|
712
|
-
var getStopwatch =
|
|
768
|
+
};
|
|
769
|
+
var writeFatal = (message, config) => getLogFn(LogLevel.FATAL, config)(message);
|
|
770
|
+
var writeError = (message, config) => getLogFn(LogLevel.ERROR, config)(message);
|
|
771
|
+
var writeWarning = (message, config) => getLogFn(LogLevel.WARN, config)(message);
|
|
772
|
+
var writeInfo = (message, config) => getLogFn(LogLevel.INFO, config)(message);
|
|
773
|
+
var writeSuccess = (message, config) => getLogFn(LogLevel.SUCCESS, config)(message);
|
|
774
|
+
var writeDebug = (message, config) => getLogFn(LogLevel.DEBUG, config)(message);
|
|
775
|
+
var writeTrace = (message, config) => getLogFn(LogLevel.TRACE, config)(message);
|
|
776
|
+
var getStopwatch = (name) => {
|
|
713
777
|
const start = process.hrtime();
|
|
714
778
|
return () => {
|
|
715
779
|
const end = process.hrtime(start);
|
|
716
|
-
console.info(
|
|
717
|
-
|
|
718
|
-
`
|
|
780
|
+
console.info(
|
|
781
|
+
`
|
|
782
|
+
> \u23F1\uFE0F The${name ? ` ${name}` : ""} process took ${Math.round(
|
|
783
|
+
end[0] * 1e3 + end[1] / 1e6
|
|
784
|
+
)}ms to complete
|
|
785
|
+
`
|
|
786
|
+
);
|
|
719
787
|
};
|
|
720
|
-
}
|
|
788
|
+
};
|
|
721
789
|
var MAX_DEPTH = 4;
|
|
722
|
-
var formatLogMessage =
|
|
790
|
+
var formatLogMessage = (message, options = {}, depth2 = 0) => {
|
|
723
791
|
if (depth2 > MAX_DEPTH) {
|
|
724
792
|
return "<max depth>";
|
|
725
793
|
}
|
|
726
794
|
const prefix = options.prefix ?? "-";
|
|
727
795
|
const skip = options.skip ?? [];
|
|
728
796
|
return typeof message === "undefined" || message === null || !message && typeof message !== "boolean" ? "<none>" : typeof message === "string" ? message : Array.isArray(message) ? `
|
|
729
|
-
${message.map((item, index) => ` ${prefix}> #${index} = ${formatLogMessage(item, {
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
}
|
|
738
|
-
var _isFunction =
|
|
797
|
+
${message.map((item, index) => ` ${prefix}> #${index} = ${formatLogMessage(item, { prefix: `${prefix}-`, skip }, depth2 + 1)}`).join("\n")}` : typeof message === "object" ? `
|
|
798
|
+
${Object.keys(message).filter((key) => !skip.includes(key)).map(
|
|
799
|
+
(key) => ` ${prefix}> ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" ? formatLogMessage(
|
|
800
|
+
message[key],
|
|
801
|
+
{ prefix: `${prefix}-`, skip },
|
|
802
|
+
depth2 + 1
|
|
803
|
+
) : message[key]}`
|
|
804
|
+
).join("\n")}` : message;
|
|
805
|
+
};
|
|
806
|
+
var _isFunction = (value) => {
|
|
739
807
|
try {
|
|
740
808
|
return value instanceof Function || typeof value === "function" || !!(value?.constructor && value?.call && value?.apply);
|
|
741
809
|
} catch (e) {
|
|
742
810
|
return false;
|
|
743
811
|
}
|
|
744
|
-
}
|
|
812
|
+
};
|
|
745
813
|
|
|
746
814
|
// ../config-tools/src/utilities/apply-workspace-tokens.ts
|
|
747
|
-
var applyWorkspaceBaseTokens =
|
|
815
|
+
var applyWorkspaceBaseTokens = async (option, tokenParams) => {
|
|
748
816
|
let result = option;
|
|
749
817
|
if (!result) {
|
|
750
818
|
return result;
|
|
@@ -754,7 +822,10 @@ var applyWorkspaceBaseTokens = /* @__PURE__ */ __name(async (option, tokenParams
|
|
|
754
822
|
if (optionKeys.some((optionKey) => result.includes(`{${optionKey}}`))) {
|
|
755
823
|
for (const optionKey of optionKeys) {
|
|
756
824
|
if (result.includes(`{${optionKey}}`)) {
|
|
757
|
-
result = result.replaceAll(
|
|
825
|
+
result = result.replaceAll(
|
|
826
|
+
`{${optionKey}}`,
|
|
827
|
+
tokenParams?.[optionKey] || ""
|
|
828
|
+
);
|
|
758
829
|
}
|
|
759
830
|
}
|
|
760
831
|
}
|
|
@@ -764,40 +835,56 @@ var applyWorkspaceBaseTokens = /* @__PURE__ */ __name(async (option, tokenParams
|
|
|
764
835
|
if (configKeys.some((configKey) => result.includes(`{${configKey}}`))) {
|
|
765
836
|
for (const configKey of configKeys) {
|
|
766
837
|
if (result.includes(`{${configKey}}`)) {
|
|
767
|
-
result = result.replaceAll(
|
|
838
|
+
result = result.replaceAll(
|
|
839
|
+
`{${configKey}}`,
|
|
840
|
+
tokenParams.config[configKey] || ""
|
|
841
|
+
);
|
|
768
842
|
}
|
|
769
843
|
}
|
|
770
844
|
}
|
|
771
845
|
}
|
|
772
846
|
if (result.includes("{workspaceRoot}")) {
|
|
773
|
-
result = result.replaceAll(
|
|
847
|
+
result = result.replaceAll(
|
|
848
|
+
"{workspaceRoot}",
|
|
849
|
+
tokenParams.workspaceRoot ?? tokenParams.config?.workspaceRoot ?? findWorkspaceRoot()
|
|
850
|
+
);
|
|
774
851
|
}
|
|
775
852
|
return result;
|
|
776
|
-
}
|
|
777
|
-
var applyWorkspaceProjectTokens =
|
|
853
|
+
};
|
|
854
|
+
var applyWorkspaceProjectTokens = (option, tokenParams) => {
|
|
778
855
|
return applyWorkspaceBaseTokens(option, tokenParams);
|
|
779
|
-
}
|
|
780
|
-
var applyWorkspaceTokens =
|
|
856
|
+
};
|
|
857
|
+
var applyWorkspaceTokens = async (options, tokenParams, tokenizerFn) => {
|
|
781
858
|
if (!options) {
|
|
782
859
|
return {};
|
|
783
860
|
}
|
|
784
861
|
const result = {};
|
|
785
862
|
for (const option of Object.keys(options)) {
|
|
786
863
|
if (typeof options[option] === "string") {
|
|
787
|
-
result[option] = await Promise.resolve(
|
|
864
|
+
result[option] = await Promise.resolve(
|
|
865
|
+
tokenizerFn(options[option], tokenParams)
|
|
866
|
+
);
|
|
788
867
|
} else if (Array.isArray(options[option])) {
|
|
789
|
-
result[option] = await Promise.all(
|
|
868
|
+
result[option] = await Promise.all(
|
|
869
|
+
options[option].map(
|
|
870
|
+
async (item) => typeof item === "string" ? await Promise.resolve(tokenizerFn(item, tokenParams)) : item
|
|
871
|
+
)
|
|
872
|
+
);
|
|
790
873
|
} else if (typeof options[option] === "object") {
|
|
791
|
-
result[option] = await applyWorkspaceTokens(
|
|
874
|
+
result[option] = await applyWorkspaceTokens(
|
|
875
|
+
options[option],
|
|
876
|
+
tokenParams,
|
|
877
|
+
tokenizerFn
|
|
878
|
+
);
|
|
792
879
|
} else {
|
|
793
880
|
result[option] = options[option];
|
|
794
881
|
}
|
|
795
882
|
}
|
|
796
883
|
return result;
|
|
797
|
-
}
|
|
884
|
+
};
|
|
798
885
|
|
|
799
886
|
// ../config-tools/src/config-file/get-config-file.ts
|
|
800
|
-
var getConfigFileByName =
|
|
887
|
+
var getConfigFileByName = async (fileName, filePath, options = {}) => {
|
|
801
888
|
const workspacePath = filePath || findWorkspaceRoot(filePath);
|
|
802
889
|
const configs = await Promise.all([
|
|
803
890
|
loadConfig({
|
|
@@ -807,7 +894,10 @@ var getConfigFileByName = /* @__PURE__ */ __name(async (fileName, filePath, opti
|
|
|
807
894
|
envName: fileName?.toUpperCase(),
|
|
808
895
|
jitiOptions: {
|
|
809
896
|
debug: false,
|
|
810
|
-
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths(
|
|
897
|
+
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths(
|
|
898
|
+
process.env.STORM_CACHE_DIR || "node_modules/.cache/storm",
|
|
899
|
+
"jiti"
|
|
900
|
+
)
|
|
811
901
|
},
|
|
812
902
|
...options
|
|
813
903
|
}),
|
|
@@ -818,32 +908,45 @@ var getConfigFileByName = /* @__PURE__ */ __name(async (fileName, filePath, opti
|
|
|
818
908
|
envName: fileName?.toUpperCase(),
|
|
819
909
|
jitiOptions: {
|
|
820
910
|
debug: false,
|
|
821
|
-
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths(
|
|
911
|
+
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths(
|
|
912
|
+
process.env.STORM_CACHE_DIR || "node_modules/.cache/storm",
|
|
913
|
+
"jiti"
|
|
914
|
+
)
|
|
822
915
|
},
|
|
823
916
|
configFile: fileName,
|
|
824
917
|
...options
|
|
825
918
|
})
|
|
826
919
|
]);
|
|
827
920
|
return defu(configs[0] ?? {}, configs[1] ?? {});
|
|
828
|
-
}
|
|
829
|
-
var getConfigFile =
|
|
921
|
+
};
|
|
922
|
+
var getConfigFile = async (filePath, additionalFileNames = []) => {
|
|
830
923
|
const workspacePath = filePath ? filePath : findWorkspaceRoot(filePath);
|
|
831
924
|
const result = await getConfigFileByName("storm-workspace", workspacePath);
|
|
832
925
|
let config = result.config;
|
|
833
926
|
const configFile = result.configFile;
|
|
834
927
|
if (config && configFile && Object.keys(config).length > 0 && !config.skipConfigLogging) {
|
|
835
|
-
writeTrace(
|
|
836
|
-
|
|
837
|
-
|
|
928
|
+
writeTrace(
|
|
929
|
+
`Found Storm configuration file "${configFile.includes(`${workspacePath}/`) ? configFile.replace(`${workspacePath}/`, "") : configFile}" at "${workspacePath}"`,
|
|
930
|
+
{
|
|
931
|
+
logLevel: "all"
|
|
932
|
+
}
|
|
933
|
+
);
|
|
838
934
|
}
|
|
839
935
|
if (additionalFileNames && additionalFileNames.length > 0) {
|
|
840
|
-
const results = await Promise.all(
|
|
936
|
+
const results = await Promise.all(
|
|
937
|
+
additionalFileNames.map(
|
|
938
|
+
(fileName) => getConfigFileByName(fileName, workspacePath)
|
|
939
|
+
)
|
|
940
|
+
);
|
|
841
941
|
for (const result2 of results) {
|
|
842
942
|
if (result2?.config && result2?.configFile && Object.keys(result2.config).length > 0) {
|
|
843
943
|
if (!config.skipConfigLogging && !result2.config.skipConfigLogging) {
|
|
844
|
-
writeTrace(
|
|
845
|
-
|
|
846
|
-
|
|
944
|
+
writeTrace(
|
|
945
|
+
`Found alternative configuration file "${result2.configFile.includes(`${workspacePath}/`) ? result2.configFile.replace(`${workspacePath}/`, "") : result2.configFile}" at "${workspacePath}"`,
|
|
946
|
+
{
|
|
947
|
+
logLevel: "all"
|
|
948
|
+
}
|
|
949
|
+
);
|
|
847
950
|
}
|
|
848
951
|
config = defu(result2.config ?? {}, config ?? {});
|
|
849
952
|
}
|
|
@@ -854,23 +957,25 @@ var getConfigFile = /* @__PURE__ */ __name(async (filePath, additionalFileNames
|
|
|
854
957
|
}
|
|
855
958
|
config.configFile = configFile;
|
|
856
959
|
return config;
|
|
857
|
-
}
|
|
960
|
+
};
|
|
858
961
|
|
|
859
962
|
// ../config-tools/src/create-storm-config.ts
|
|
860
963
|
import defu2 from "defu";
|
|
861
964
|
|
|
862
965
|
// ../config-tools/src/env/get-env.ts
|
|
863
|
-
var getExtensionEnv =
|
|
966
|
+
var getExtensionEnv = (extensionName) => {
|
|
864
967
|
const prefix = `STORM_EXTENSION_${extensionName.toUpperCase()}_`;
|
|
865
968
|
return Object.keys(process.env).filter((key) => key.startsWith(prefix)).reduce((ret, key) => {
|
|
866
|
-
const name = key.replace(prefix, "").split("_").map(
|
|
969
|
+
const name = key.replace(prefix, "").split("_").map(
|
|
970
|
+
(i) => i.length > 0 ? i.trim().charAt(0).toUpperCase() + i.trim().slice(1) : ""
|
|
971
|
+
).join("");
|
|
867
972
|
if (name) {
|
|
868
973
|
ret[name] = process.env[key];
|
|
869
974
|
}
|
|
870
975
|
return ret;
|
|
871
976
|
}, {});
|
|
872
|
-
}
|
|
873
|
-
var getConfigEnv =
|
|
977
|
+
};
|
|
978
|
+
var getConfigEnv = () => {
|
|
874
979
|
const prefix = "STORM_";
|
|
875
980
|
let config = {
|
|
876
981
|
extends: process.env[`${prefix}EXTENDS`] || void 0,
|
|
@@ -938,14 +1043,25 @@ var getConfigEnv = /* @__PURE__ */ __name(() => {
|
|
|
938
1043
|
cyclone: process.env[`${prefix}REGISTRY_CYCLONE`] || void 0,
|
|
939
1044
|
container: process.env[`${prefix}REGISTRY_CONTAINER`] || void 0
|
|
940
1045
|
},
|
|
941
|
-
logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(
|
|
1046
|
+
logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(
|
|
1047
|
+
Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
|
|
1048
|
+
) ? getLogLevelLabel(
|
|
1049
|
+
Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
|
|
1050
|
+
) : process.env[`${prefix}LOG_LEVEL`] : void 0,
|
|
942
1051
|
skipConfigLogging: process.env[`${prefix}SKIP_CONFIG_LOGGING`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CONFIG_LOGGING`]) : void 0
|
|
943
1052
|
};
|
|
944
|
-
const themeNames = Object.keys(process.env).filter(
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
1053
|
+
const themeNames = Object.keys(process.env).filter(
|
|
1054
|
+
(envKey) => envKey.startsWith(`${prefix}COLOR_`) && COLOR_KEYS.every(
|
|
1055
|
+
(colorKey) => !envKey.startsWith(`${prefix}COLOR_LIGHT_${colorKey}`) && !envKey.startsWith(`${prefix}COLOR_DARK_${colorKey}`)
|
|
1056
|
+
)
|
|
1057
|
+
);
|
|
1058
|
+
config.colors = themeNames.length > 0 ? themeNames.reduce(
|
|
1059
|
+
(ret, themeName) => {
|
|
1060
|
+
ret[themeName] = getThemeColorConfigEnv(prefix, themeName);
|
|
1061
|
+
return ret;
|
|
1062
|
+
},
|
|
1063
|
+
{}
|
|
1064
|
+
) : getThemeColorConfigEnv(prefix);
|
|
949
1065
|
if (config.docs === STORM_DEFAULT_DOCS) {
|
|
950
1066
|
if (config.homepage === STORM_DEFAULT_HOMEPAGE) {
|
|
951
1067
|
config.docs = `${STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/docs`;
|
|
@@ -966,23 +1082,17 @@ var getConfigEnv = /* @__PURE__ */ __name(() => {
|
|
|
966
1082
|
config = {
|
|
967
1083
|
...config,
|
|
968
1084
|
...parsed,
|
|
969
|
-
colors: {
|
|
970
|
-
|
|
971
|
-
...parsed.colors
|
|
972
|
-
},
|
|
973
|
-
extensions: {
|
|
974
|
-
...config.extensions,
|
|
975
|
-
...parsed.extensions
|
|
976
|
-
}
|
|
1085
|
+
colors: { ...config.colors, ...parsed.colors },
|
|
1086
|
+
extensions: { ...config.extensions, ...parsed.extensions }
|
|
977
1087
|
};
|
|
978
1088
|
}
|
|
979
1089
|
return config;
|
|
980
|
-
}
|
|
981
|
-
var getThemeColorConfigEnv =
|
|
1090
|
+
};
|
|
1091
|
+
var getThemeColorConfigEnv = (prefix, theme) => {
|
|
982
1092
|
const themeName = `COLOR_${theme && theme !== "base" ? `${theme}_` : ""}`.toUpperCase();
|
|
983
1093
|
return process.env[`${prefix}${themeName}LIGHT_BRAND`] || process.env[`${prefix}${themeName}DARK_BRAND`] ? getMultiThemeColorConfigEnv(prefix + themeName) : getSingleThemeColorConfigEnv(prefix + themeName);
|
|
984
|
-
}
|
|
985
|
-
var getSingleThemeColorConfigEnv =
|
|
1094
|
+
};
|
|
1095
|
+
var getSingleThemeColorConfigEnv = (prefix) => {
|
|
986
1096
|
return {
|
|
987
1097
|
dark: process.env[`${prefix}DARK`],
|
|
988
1098
|
light: process.env[`${prefix}LIGHT`],
|
|
@@ -999,14 +1109,16 @@ var getSingleThemeColorConfigEnv = /* @__PURE__ */ __name((prefix) => {
|
|
|
999
1109
|
positive: process.env[`${prefix}POSITIVE`],
|
|
1000
1110
|
negative: process.env[`${prefix}NEGATIVE`]
|
|
1001
1111
|
};
|
|
1002
|
-
}
|
|
1003
|
-
var getMultiThemeColorConfigEnv =
|
|
1112
|
+
};
|
|
1113
|
+
var getMultiThemeColorConfigEnv = (prefix) => {
|
|
1004
1114
|
return {
|
|
1005
|
-
light: getBaseThemeColorConfigEnv(
|
|
1115
|
+
light: getBaseThemeColorConfigEnv(
|
|
1116
|
+
`${prefix}_LIGHT_`
|
|
1117
|
+
),
|
|
1006
1118
|
dark: getBaseThemeColorConfigEnv(`${prefix}_DARK_`)
|
|
1007
1119
|
};
|
|
1008
|
-
}
|
|
1009
|
-
var getBaseThemeColorConfigEnv =
|
|
1120
|
+
};
|
|
1121
|
+
var getBaseThemeColorConfigEnv = (prefix) => {
|
|
1010
1122
|
return {
|
|
1011
1123
|
foreground: process.env[`${prefix}FOREGROUND`],
|
|
1012
1124
|
background: process.env[`${prefix}BACKGROUND`],
|
|
@@ -1023,13 +1135,16 @@ var getBaseThemeColorConfigEnv = /* @__PURE__ */ __name((prefix) => {
|
|
|
1023
1135
|
positive: process.env[`${prefix}POSITIVE`],
|
|
1024
1136
|
negative: process.env[`${prefix}NEGATIVE`]
|
|
1025
1137
|
};
|
|
1026
|
-
}
|
|
1138
|
+
};
|
|
1027
1139
|
|
|
1028
1140
|
// ../config-tools/src/env/set-env.ts
|
|
1029
|
-
var setExtensionEnv =
|
|
1141
|
+
var setExtensionEnv = (extensionName, extension) => {
|
|
1030
1142
|
for (const key of Object.keys(extension ?? {})) {
|
|
1031
1143
|
if (extension[key]) {
|
|
1032
|
-
const result = key?.replace(
|
|
1144
|
+
const result = key?.replace(
|
|
1145
|
+
/([A-Z])+/g,
|
|
1146
|
+
(input) => input ? input[0]?.toUpperCase() + input.slice(1) : ""
|
|
1147
|
+
).split(/(?=[A-Z])|[.\-\s_]/).map((x) => x.toLowerCase()) ?? [];
|
|
1033
1148
|
let extensionKey;
|
|
1034
1149
|
if (result.length === 0) {
|
|
1035
1150
|
return;
|
|
@@ -1044,8 +1159,8 @@ var setExtensionEnv = /* @__PURE__ */ __name((extensionName, extension) => {
|
|
|
1044
1159
|
process.env[`STORM_EXTENSION_${extensionName.toUpperCase()}_${extensionKey.toUpperCase()}`] = extension[key];
|
|
1045
1160
|
}
|
|
1046
1161
|
}
|
|
1047
|
-
}
|
|
1048
|
-
var setConfigEnv =
|
|
1162
|
+
};
|
|
1163
|
+
var setConfigEnv = (config) => {
|
|
1049
1164
|
const prefix = "STORM_";
|
|
1050
1165
|
if (config.extends) {
|
|
1051
1166
|
process.env[`${prefix}EXTENDS`] = Array.isArray(config.extends) ? JSON.stringify(config.extends) : config.extends;
|
|
@@ -1134,7 +1249,9 @@ var setConfigEnv = /* @__PURE__ */ __name((config) => {
|
|
|
1134
1249
|
}
|
|
1135
1250
|
if (config.directories) {
|
|
1136
1251
|
if (!config.skipCache && config.directories.cache) {
|
|
1137
|
-
process.env[`${prefix}CACHE_DIR`] = correctPaths(
|
|
1252
|
+
process.env[`${prefix}CACHE_DIR`] = correctPaths(
|
|
1253
|
+
config.directories.cache
|
|
1254
|
+
);
|
|
1138
1255
|
process.env[`${prefix}CACHE_DIRECTORY`] = process.env[`${prefix}CACHE_DIR`];
|
|
1139
1256
|
}
|
|
1140
1257
|
if (config.directories.data) {
|
|
@@ -1142,7 +1259,9 @@ var setConfigEnv = /* @__PURE__ */ __name((config) => {
|
|
|
1142
1259
|
process.env[`${prefix}DATA_DIRECTORY`] = process.env[`${prefix}DATA_DIR`];
|
|
1143
1260
|
}
|
|
1144
1261
|
if (config.directories.config) {
|
|
1145
|
-
process.env[`${prefix}CONFIG_DIR`] = correctPaths(
|
|
1262
|
+
process.env[`${prefix}CONFIG_DIR`] = correctPaths(
|
|
1263
|
+
config.directories.config
|
|
1264
|
+
);
|
|
1146
1265
|
process.env[`${prefix}CONFIG_DIRECTORY`] = process.env[`${prefix}CONFIG_DIR`];
|
|
1147
1266
|
}
|
|
1148
1267
|
if (config.directories.temp) {
|
|
@@ -1154,7 +1273,9 @@ var setConfigEnv = /* @__PURE__ */ __name((config) => {
|
|
|
1154
1273
|
process.env[`${prefix}LOG_DIRECTORY`] = process.env[`${prefix}LOG_DIR`];
|
|
1155
1274
|
}
|
|
1156
1275
|
if (config.directories.build) {
|
|
1157
|
-
process.env[`${prefix}BUILD_DIR`] = correctPaths(
|
|
1276
|
+
process.env[`${prefix}BUILD_DIR`] = correctPaths(
|
|
1277
|
+
config.directories.build
|
|
1278
|
+
);
|
|
1158
1279
|
process.env[`${prefix}BUILD_DIRECTORY`] = process.env[`${prefix}BUILD_DIR`];
|
|
1159
1280
|
}
|
|
1160
1281
|
}
|
|
@@ -1175,7 +1296,10 @@ var setConfigEnv = /* @__PURE__ */ __name((config) => {
|
|
|
1175
1296
|
setThemeColorConfigEnv(`${prefix}COLOR_${key}_`, config.colors[key]);
|
|
1176
1297
|
}
|
|
1177
1298
|
} else {
|
|
1178
|
-
setThemeColorConfigEnv(
|
|
1299
|
+
setThemeColorConfigEnv(
|
|
1300
|
+
`${prefix}COLOR_`,
|
|
1301
|
+
config.colors
|
|
1302
|
+
);
|
|
1179
1303
|
}
|
|
1180
1304
|
if (config.repository) {
|
|
1181
1305
|
process.env[`${prefix}REPOSITORY`] = config.repository;
|
|
@@ -1187,7 +1311,9 @@ var setConfigEnv = /* @__PURE__ */ __name((config) => {
|
|
|
1187
1311
|
process.env[`${prefix}PRE_ID`] = String(config.preid);
|
|
1188
1312
|
}
|
|
1189
1313
|
if (config.externalPackagePatterns) {
|
|
1190
|
-
process.env[`${prefix}EXTERNAL_PACKAGE_PATTERNS`] = JSON.stringify(
|
|
1314
|
+
process.env[`${prefix}EXTERNAL_PACKAGE_PATTERNS`] = JSON.stringify(
|
|
1315
|
+
config.externalPackagePatterns
|
|
1316
|
+
);
|
|
1191
1317
|
}
|
|
1192
1318
|
if (config.registry) {
|
|
1193
1319
|
if (config.registry.github) {
|
|
@@ -1200,20 +1326,28 @@ var setConfigEnv = /* @__PURE__ */ __name((config) => {
|
|
|
1200
1326
|
process.env[`${prefix}REGISTRY_CARGO`] = String(config.registry.cargo);
|
|
1201
1327
|
}
|
|
1202
1328
|
if (config.registry.cyclone) {
|
|
1203
|
-
process.env[`${prefix}REGISTRY_CYCLONE`] = String(
|
|
1329
|
+
process.env[`${prefix}REGISTRY_CYCLONE`] = String(
|
|
1330
|
+
config.registry.cyclone
|
|
1331
|
+
);
|
|
1204
1332
|
}
|
|
1205
1333
|
if (config.registry.container) {
|
|
1206
|
-
process.env[`${prefix}REGISTRY_CONTAINER`] = String(
|
|
1334
|
+
process.env[`${prefix}REGISTRY_CONTAINER`] = String(
|
|
1335
|
+
config.registry.container
|
|
1336
|
+
);
|
|
1207
1337
|
}
|
|
1208
1338
|
}
|
|
1209
1339
|
if (config.logLevel) {
|
|
1210
1340
|
process.env[`${prefix}LOG_LEVEL`] = String(config.logLevel);
|
|
1211
1341
|
process.env.LOG_LEVEL = String(config.logLevel);
|
|
1212
|
-
process.env.NX_VERBOSE_LOGGING = String(
|
|
1342
|
+
process.env.NX_VERBOSE_LOGGING = String(
|
|
1343
|
+
getLogLevel(config.logLevel) >= LogLevel.DEBUG ? true : false
|
|
1344
|
+
);
|
|
1213
1345
|
process.env.RUST_BACKTRACE = getLogLevel(config.logLevel) >= LogLevel.DEBUG ? "full" : "none";
|
|
1214
1346
|
}
|
|
1215
1347
|
if (config.skipConfigLogging !== void 0) {
|
|
1216
|
-
process.env[`${prefix}SKIP_CONFIG_LOGGING`] = String(
|
|
1348
|
+
process.env[`${prefix}SKIP_CONFIG_LOGGING`] = String(
|
|
1349
|
+
config.skipConfigLogging
|
|
1350
|
+
);
|
|
1217
1351
|
}
|
|
1218
1352
|
process.env[`${prefix}CONFIG`] = JSON.stringify(config);
|
|
1219
1353
|
for (const key of Object.keys(config.extensions ?? {})) {
|
|
@@ -1221,11 +1355,11 @@ var setConfigEnv = /* @__PURE__ */ __name((config) => {
|
|
|
1221
1355
|
setExtensionEnv(key, config.extensions[key]);
|
|
1222
1356
|
}
|
|
1223
1357
|
}
|
|
1224
|
-
}
|
|
1225
|
-
var setThemeColorConfigEnv =
|
|
1358
|
+
};
|
|
1359
|
+
var setThemeColorConfigEnv = (prefix, config) => {
|
|
1226
1360
|
return config?.light?.brand || config?.dark?.brand ? setMultiThemeColorConfigEnv(prefix, config) : setSingleThemeColorConfigEnv(prefix, config);
|
|
1227
|
-
}
|
|
1228
|
-
var setSingleThemeColorConfigEnv =
|
|
1361
|
+
};
|
|
1362
|
+
var setSingleThemeColorConfigEnv = (prefix, config) => {
|
|
1229
1363
|
if (config.dark) {
|
|
1230
1364
|
process.env[`${prefix}DARK`] = config.dark;
|
|
1231
1365
|
}
|
|
@@ -1268,14 +1402,14 @@ var setSingleThemeColorConfigEnv = /* @__PURE__ */ __name((prefix, config) => {
|
|
|
1268
1402
|
if (config.negative) {
|
|
1269
1403
|
process.env[`${prefix}NEGATIVE`] = config.negative;
|
|
1270
1404
|
}
|
|
1271
|
-
}
|
|
1272
|
-
var setMultiThemeColorConfigEnv =
|
|
1405
|
+
};
|
|
1406
|
+
var setMultiThemeColorConfigEnv = (prefix, config) => {
|
|
1273
1407
|
return {
|
|
1274
1408
|
light: setBaseThemeColorConfigEnv(`${prefix}LIGHT_`, config.light),
|
|
1275
1409
|
dark: setBaseThemeColorConfigEnv(`${prefix}DARK_`, config.dark)
|
|
1276
1410
|
};
|
|
1277
|
-
}
|
|
1278
|
-
var setBaseThemeColorConfigEnv =
|
|
1411
|
+
};
|
|
1412
|
+
var setBaseThemeColorConfigEnv = (prefix, config) => {
|
|
1279
1413
|
if (config.foreground) {
|
|
1280
1414
|
process.env[`${prefix}FOREGROUND`] = config.foreground;
|
|
1281
1415
|
}
|
|
@@ -1318,12 +1452,12 @@ var setBaseThemeColorConfigEnv = /* @__PURE__ */ __name((prefix, config) => {
|
|
|
1318
1452
|
if (config.negative) {
|
|
1319
1453
|
process.env[`${prefix}NEGATIVE`] = config.negative;
|
|
1320
1454
|
}
|
|
1321
|
-
}
|
|
1455
|
+
};
|
|
1322
1456
|
|
|
1323
1457
|
// ../config-tools/src/create-storm-config.ts
|
|
1324
1458
|
var _extension_cache = /* @__PURE__ */ new WeakMap();
|
|
1325
1459
|
var _static_cache = void 0;
|
|
1326
|
-
var createStormWorkspaceConfig =
|
|
1460
|
+
var createStormWorkspaceConfig = async (extensionName, schema, workspaceRoot, skipLogs = false, useDefault = true) => {
|
|
1327
1461
|
let result;
|
|
1328
1462
|
if (!_static_cache?.data || !_static_cache?.timestamp || _static_cache.timestamp < Date.now() - 8e3) {
|
|
1329
1463
|
let _workspaceRoot = workspaceRoot;
|
|
@@ -1334,16 +1468,19 @@ var createStormWorkspaceConfig = /* @__PURE__ */ __name(async (extensionName, sc
|
|
|
1334
1468
|
const configFile = await getConfigFile(_workspaceRoot);
|
|
1335
1469
|
if (!configFile) {
|
|
1336
1470
|
if (!skipLogs) {
|
|
1337
|
-
writeWarning(
|
|
1338
|
-
|
|
1339
|
-
|
|
1471
|
+
writeWarning(
|
|
1472
|
+
"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",
|
|
1473
|
+
{ logLevel: "all" }
|
|
1474
|
+
);
|
|
1340
1475
|
}
|
|
1341
1476
|
if (useDefault === false) {
|
|
1342
1477
|
return void 0;
|
|
1343
1478
|
}
|
|
1344
1479
|
}
|
|
1345
1480
|
const defaultConfig = await getDefaultConfig(_workspaceRoot);
|
|
1346
|
-
result = await stormWorkspaceConfigSchema.parseAsync(
|
|
1481
|
+
result = await stormWorkspaceConfigSchema.parseAsync(
|
|
1482
|
+
defu2(configEnv, configFile, defaultConfig)
|
|
1483
|
+
);
|
|
1347
1484
|
result.workspaceRoot ??= _workspaceRoot;
|
|
1348
1485
|
} else {
|
|
1349
1486
|
result = _static_cache.data;
|
|
@@ -1359,11 +1496,9 @@ var createStormWorkspaceConfig = /* @__PURE__ */ __name(async (extensionName, sc
|
|
|
1359
1496
|
data: result
|
|
1360
1497
|
};
|
|
1361
1498
|
return result;
|
|
1362
|
-
}
|
|
1363
|
-
var createConfigExtension =
|
|
1364
|
-
const extension_cache_key = {
|
|
1365
|
-
extensionName
|
|
1366
|
-
};
|
|
1499
|
+
};
|
|
1500
|
+
var createConfigExtension = (extensionName, schema) => {
|
|
1501
|
+
const extension_cache_key = { extensionName };
|
|
1367
1502
|
if (_extension_cache.has(extension_cache_key)) {
|
|
1368
1503
|
return _extension_cache.get(extension_cache_key);
|
|
1369
1504
|
}
|
|
@@ -1373,38 +1508,49 @@ var createConfigExtension = /* @__PURE__ */ __name((extensionName, schema) => {
|
|
|
1373
1508
|
}
|
|
1374
1509
|
_extension_cache.set(extension_cache_key, extension);
|
|
1375
1510
|
return extension;
|
|
1376
|
-
}
|
|
1377
|
-
var loadStormWorkspaceConfig =
|
|
1378
|
-
const config = await createStormWorkspaceConfig(
|
|
1511
|
+
};
|
|
1512
|
+
var loadStormWorkspaceConfig = async (workspaceRoot, skipLogs = false) => {
|
|
1513
|
+
const config = await createStormWorkspaceConfig(
|
|
1514
|
+
void 0,
|
|
1515
|
+
void 0,
|
|
1516
|
+
workspaceRoot,
|
|
1517
|
+
skipLogs,
|
|
1518
|
+
true
|
|
1519
|
+
);
|
|
1379
1520
|
setConfigEnv(config);
|
|
1380
1521
|
if (!skipLogs && !config.skipConfigLogging) {
|
|
1381
|
-
writeTrace(
|
|
1382
|
-
|
|
1522
|
+
writeTrace(
|
|
1523
|
+
`\u2699\uFE0F Using Storm Workspace configuration:
|
|
1524
|
+
${formatLogMessage(config)}`,
|
|
1525
|
+
config
|
|
1526
|
+
);
|
|
1383
1527
|
}
|
|
1384
1528
|
return config;
|
|
1385
|
-
}
|
|
1529
|
+
};
|
|
1386
1530
|
|
|
1387
1531
|
// ../config-tools/src/get-config.ts
|
|
1388
|
-
var getConfig =
|
|
1532
|
+
var getConfig = (workspaceRoot, skipLogs = false) => {
|
|
1389
1533
|
return loadStormWorkspaceConfig(workspaceRoot, skipLogs);
|
|
1390
|
-
}
|
|
1391
|
-
var getWorkspaceConfig =
|
|
1534
|
+
};
|
|
1535
|
+
var getWorkspaceConfig = (skipLogs = false, options = {}) => {
|
|
1392
1536
|
let workspaceRoot = options.workspaceRoot;
|
|
1393
1537
|
if (!workspaceRoot) {
|
|
1394
1538
|
workspaceRoot = findWorkspaceRoot(options.cwd);
|
|
1395
1539
|
}
|
|
1396
1540
|
return getConfig(workspaceRoot, skipLogs);
|
|
1397
|
-
}
|
|
1541
|
+
};
|
|
1398
1542
|
|
|
1399
1543
|
// ../workspace-tools/src/base/base-executor.ts
|
|
1400
1544
|
import { defu as defu3 } from "defu";
|
|
1401
|
-
var withRunExecutor =
|
|
1545
|
+
var withRunExecutor = (name, executorFn, executorOptions = {}) => async (_options, context) => {
|
|
1402
1546
|
const stopwatch = getStopwatch(name);
|
|
1403
1547
|
let options = _options;
|
|
1404
1548
|
let config = {};
|
|
1405
1549
|
try {
|
|
1406
1550
|
if (!context.projectsConfigurations?.projects || !context.projectName || !context.projectsConfigurations.projects[context.projectName]) {
|
|
1407
|
-
throw new Error(
|
|
1551
|
+
throw new Error(
|
|
1552
|
+
"The Build process failed because the context is not valid. Please run this command from a workspace."
|
|
1553
|
+
);
|
|
1408
1554
|
}
|
|
1409
1555
|
const workspaceRoot = findWorkspaceRoot();
|
|
1410
1556
|
const projectRoot = context.projectsConfigurations.projects[context.projectName].root || workspaceRoot;
|
|
@@ -1413,35 +1559,50 @@ var withRunExecutor = /* @__PURE__ */ __name((name, executorFn, executorOptions
|
|
|
1413
1559
|
config.workspaceRoot = workspaceRoot;
|
|
1414
1560
|
writeInfo(`\u26A1 Running the ${name} executor for ${projectName} `, config);
|
|
1415
1561
|
if (!executorOptions.skipReadingConfig) {
|
|
1416
|
-
writeTrace(
|
|
1562
|
+
writeTrace(
|
|
1563
|
+
`Loading the Storm Config from environment variables and storm.config.js file...
|
|
1417
1564
|
- workspaceRoot: ${workspaceRoot}
|
|
1418
1565
|
- projectRoot: ${projectRoot}
|
|
1419
1566
|
- sourceRoot: ${sourceRoot}
|
|
1420
1567
|
- projectName: ${projectName}
|
|
1421
|
-
`,
|
|
1568
|
+
`,
|
|
1569
|
+
config
|
|
1570
|
+
);
|
|
1422
1571
|
config = await getConfig(workspaceRoot);
|
|
1423
1572
|
}
|
|
1424
1573
|
if (executorOptions?.hooks?.applyDefaultOptions) {
|
|
1425
1574
|
writeDebug("Running the applyDefaultOptions hook...", config);
|
|
1426
|
-
options = await Promise.resolve(
|
|
1575
|
+
options = await Promise.resolve(
|
|
1576
|
+
executorOptions.hooks.applyDefaultOptions(options, config)
|
|
1577
|
+
);
|
|
1427
1578
|
writeDebug("Completed the applyDefaultOptions hook", config);
|
|
1428
1579
|
}
|
|
1429
|
-
writeTrace(
|
|
1580
|
+
writeTrace(
|
|
1581
|
+
`Executor schema options \u2699\uFE0F
|
|
1430
1582
|
${formatLogMessage(options)}
|
|
1431
|
-
`,
|
|
1432
|
-
const tokenized = await applyWorkspaceTokens(options, defu3({
|
|
1433
|
-
workspaceRoot,
|
|
1434
|
-
projectRoot,
|
|
1435
|
-
sourceRoot,
|
|
1436
|
-
projectName,
|
|
1583
|
+
`,
|
|
1437
1584
|
config
|
|
1438
|
-
|
|
1439
|
-
|
|
1585
|
+
);
|
|
1586
|
+
const tokenized = await applyWorkspaceTokens(
|
|
1587
|
+
options,
|
|
1588
|
+
defu3(
|
|
1589
|
+
{ workspaceRoot, projectRoot, sourceRoot, projectName, config },
|
|
1590
|
+
config,
|
|
1591
|
+
context.projectsConfigurations.projects[context.projectName]
|
|
1592
|
+
),
|
|
1593
|
+
applyWorkspaceProjectTokens
|
|
1594
|
+
);
|
|
1595
|
+
writeTrace(
|
|
1596
|
+
`Executor schema tokenized options \u2699\uFE0F
|
|
1440
1597
|
${formatLogMessage(tokenized)}
|
|
1441
|
-
`,
|
|
1598
|
+
`,
|
|
1599
|
+
config
|
|
1600
|
+
);
|
|
1442
1601
|
if (executorOptions?.hooks?.preProcess) {
|
|
1443
1602
|
writeDebug("Running the preProcess hook...", config);
|
|
1444
|
-
await Promise.resolve(
|
|
1603
|
+
await Promise.resolve(
|
|
1604
|
+
executorOptions.hooks.preProcess(tokenized, config)
|
|
1605
|
+
);
|
|
1445
1606
|
writeDebug("Completed the preProcess hook", config);
|
|
1446
1607
|
}
|
|
1447
1608
|
const ret = executorFn(tokenized, context, config);
|
|
@@ -1451,10 +1612,15 @@ ${formatLogMessage(tokenized)}
|
|
|
1451
1612
|
void iter;
|
|
1452
1613
|
}
|
|
1453
1614
|
}
|
|
1454
|
-
const result = await Promise.resolve(
|
|
1615
|
+
const result = await Promise.resolve(
|
|
1616
|
+
ret
|
|
1617
|
+
);
|
|
1455
1618
|
if (result && (!result.success || result.error && result?.error?.message && typeof result?.error?.message === "string" && result?.error?.name && typeof result?.error?.name === "string")) {
|
|
1456
|
-
writeTrace(
|
|
1457
|
-
${
|
|
1619
|
+
writeTrace(
|
|
1620
|
+
`Failure determined by the ${name} executor
|
|
1621
|
+
${formatLogMessage(result)}`,
|
|
1622
|
+
config
|
|
1623
|
+
);
|
|
1458
1624
|
console.error(result);
|
|
1459
1625
|
throw new Error(`The ${name} executor failed to run`, {
|
|
1460
1626
|
cause: result?.error
|
|
@@ -1471,24 +1637,30 @@ ${formatLogMessage(result)}`, config);
|
|
|
1471
1637
|
success: true
|
|
1472
1638
|
};
|
|
1473
1639
|
} catch (error) {
|
|
1474
|
-
writeFatal(
|
|
1475
|
-
|
|
1640
|
+
writeFatal(
|
|
1641
|
+
"A fatal error occurred while running the executor - the process was forced to terminate",
|
|
1642
|
+
config
|
|
1643
|
+
);
|
|
1644
|
+
writeError(
|
|
1645
|
+
`An exception was thrown in the executor's process
|
|
1476
1646
|
- Details: ${error.message}
|
|
1477
|
-
- Stacktrace: ${error.stack}`,
|
|
1647
|
+
- Stacktrace: ${error.stack}`,
|
|
1648
|
+
config
|
|
1649
|
+
);
|
|
1478
1650
|
return {
|
|
1479
1651
|
success: false
|
|
1480
1652
|
};
|
|
1481
1653
|
} finally {
|
|
1482
1654
|
stopwatch();
|
|
1483
1655
|
}
|
|
1484
|
-
}
|
|
1485
|
-
var _isFunction2 =
|
|
1656
|
+
};
|
|
1657
|
+
var _isFunction2 = (value) => {
|
|
1486
1658
|
try {
|
|
1487
1659
|
return value instanceof Function || typeof value === "function" || !!(value?.constructor && value?.call && value?.apply);
|
|
1488
1660
|
} catch (e) {
|
|
1489
1661
|
return false;
|
|
1490
1662
|
}
|
|
1491
|
-
}
|
|
1663
|
+
};
|
|
1492
1664
|
|
|
1493
1665
|
export {
|
|
1494
1666
|
stormWorkspaceConfigSchema,
|