@storm-software/build-tools 0.144.19 → 0.144.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/README.md +1 -1
- package/dist/{chunk-6KESXKM3.mjs → chunk-2IACGL5A.mjs} +69 -34
- package/dist/{chunk-XLAPHZPX.mjs → chunk-3VZVP5XV.mjs} +0 -5
- package/dist/{chunk-MY55IIR6.js → chunk-673CAI2G.js} +5 -14
- package/dist/{chunk-M5AC3COW.mjs → chunk-7NL4YIH3.mjs} +4 -13
- package/dist/{chunk-LCPSDCDB.mjs → chunk-7YKXR5JJ.mjs} +1 -8
- package/dist/{chunk-F7WSCB6H.js → chunk-A75DEKU5.js} +1 -6
- package/dist/{chunk-H2MR24BL.mjs → chunk-BKMDH7XQ.mjs} +10 -16
- package/dist/chunk-D7ZBIHS7.mjs +76 -0
- package/dist/{chunk-STJ5NLSZ.mjs → chunk-DLSOQQ2X.mjs} +24 -11
- package/dist/{chunk-LWYVLXCJ.js → chunk-ECGZDTG2.js} +72 -37
- package/dist/{chunk-NSNKG4UV.js → chunk-EGKFW7BM.js} +168 -114
- package/dist/{chunk-T2R2KKTW.mjs → chunk-HGTDDXA5.mjs} +2 -5
- package/dist/{chunk-2TV7ZJSK.js → chunk-HQD5ZBIU.js} +2 -9
- package/dist/{chunk-A6F6NNS6.mjs → chunk-JJQN3HTQ.mjs} +183 -119
- package/dist/{chunk-CNURHK3D.mjs → chunk-KUEYIH7W.mjs} +2 -6
- package/dist/{chunk-Y3HRAWPU.js → chunk-N7HP2YYE.js} +9 -8
- package/dist/chunk-ODQKLK6L.mjs +69 -0
- package/dist/{chunk-CNKJQMCL.js → chunk-TABRPMJB.js} +28 -15
- package/dist/{chunk-JP4YIUPA.js → chunk-TQIOTV5X.js} +25 -21
- package/dist/{chunk-4Y7DUAMQ.js → chunk-TSUTFOQG.js} +17 -23
- package/dist/{chunk-PBTSVWXL.js → chunk-UHJ5ACWH.js} +3 -7
- package/dist/chunk-UNY7ZVZF.js +76 -0
- package/dist/{chunk-VQUREEMI.mjs → chunk-VGLIZ2H3.mjs} +8 -7
- package/dist/{chunk-QKEUU3L3.mjs → chunk-VWJLKDCB.mjs} +141 -87
- package/dist/{chunk-5HOBE4TZ.js → chunk-WLW3DA6X.js} +2 -5
- package/dist/{chunk-VSAQXEXD.js → chunk-WNMPQTPH.js} +39 -31
- package/dist/{chunk-QCTHJR6E.js → chunk-XXESPGZP.js} +184 -120
- package/dist/{chunk-67VZRCF5.mjs → chunk-YZ6ZTM5M.mjs} +27 -23
- package/dist/config.js +0 -1
- package/dist/config.mjs +0 -1
- package/dist/index.js +16 -17
- package/dist/index.mjs +15 -16
- package/dist/plugins/analyze.js +3 -4
- package/dist/plugins/analyze.mjs +2 -3
- package/dist/plugins/index.js +6 -7
- package/dist/plugins/index.mjs +5 -6
- package/dist/plugins/swc.js +2 -3
- package/dist/plugins/swc.mjs +1 -2
- package/dist/plugins/ts-resolve.js +3 -4
- package/dist/plugins/ts-resolve.mjs +2 -3
- package/dist/plugins/type-definitions.js +2 -3
- package/dist/plugins/type-definitions.mjs +1 -2
- package/dist/types.js +1 -1
- package/dist/types.mjs +1 -1
- package/dist/utilities/copy-assets.js +3 -4
- package/dist/utilities/copy-assets.mjs +2 -3
- package/dist/utilities/generate-package-json.js +3 -4
- package/dist/utilities/generate-package-json.mjs +2 -3
- package/dist/utilities/get-entry-points.js +3 -4
- package/dist/utilities/get-entry-points.mjs +2 -3
- package/dist/utilities/get-env.js +2 -3
- package/dist/utilities/get-env.mjs +1 -2
- package/dist/utilities/get-file-banner.js +2 -3
- package/dist/utilities/get-file-banner.mjs +1 -2
- package/dist/utilities/get-out-extension.js +2 -3
- package/dist/utilities/get-out-extension.mjs +1 -2
- package/dist/utilities/get-project-deps.js +2 -3
- package/dist/utilities/get-project-deps.mjs +1 -2
- package/dist/utilities/index.js +11 -12
- package/dist/utilities/index.mjs +10 -11
- package/dist/utilities/read-nx-config.js +3 -4
- package/dist/utilities/read-nx-config.mjs +2 -3
- package/dist/utilities/task-graph.js +2 -3
- package/dist/utilities/task-graph.mjs +1 -2
- package/package.json +1 -1
- package/dist/chunk-O6YSETKJ.mjs +0 -6
- package/dist/chunk-S5V4ROWC.js +0 -67
- package/dist/chunk-S7LT43EW.mjs +0 -67
- package/dist/chunk-SHUYVCID.js +0 -6
- package/dist/chunk-ZW5JWBA4.mjs +0 -61
- /package/dist/{chunk-GGNOJ77I.js → chunk-6F4PWJZI.js} +0 -0
- /package/dist/{chunk-WAXGOBY2.mjs → chunk-WBQAMGXK.mjs} +0 -0
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__name
|
|
3
|
-
} from "./chunk-O6YSETKJ.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,87 +691,103 @@ 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 writeWarning =
|
|
700
|
-
var writeInfo =
|
|
701
|
-
var writeDebug =
|
|
702
|
-
var writeTrace =
|
|
762
|
+
};
|
|
763
|
+
var writeWarning = (message, config) => getLogFn(LogLevel.WARN, config)(message);
|
|
764
|
+
var writeInfo = (message, config) => getLogFn(LogLevel.INFO, config)(message);
|
|
765
|
+
var writeDebug = (message, config) => getLogFn(LogLevel.DEBUG, config)(message);
|
|
766
|
+
var writeTrace = (message, config) => getLogFn(LogLevel.TRACE, config)(message);
|
|
703
767
|
var MAX_DEPTH = 4;
|
|
704
|
-
var formatLogMessage =
|
|
768
|
+
var formatLogMessage = (message, options = {}, depth2 = 0) => {
|
|
705
769
|
if (depth2 > MAX_DEPTH) {
|
|
706
770
|
return "<max depth>";
|
|
707
771
|
}
|
|
708
772
|
const prefix = options.prefix ?? "-";
|
|
709
773
|
const skip = options.skip ?? [];
|
|
710
774
|
return typeof message === "undefined" || message === null || !message && typeof message !== "boolean" ? "<none>" : typeof message === "string" ? message : Array.isArray(message) ? `
|
|
711
|
-
${message.map((item, index) => ` ${prefix}> #${index} = ${formatLogMessage(item, {
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
}
|
|
720
|
-
var _isFunction =
|
|
775
|
+
${message.map((item, index) => ` ${prefix}> #${index} = ${formatLogMessage(item, { prefix: `${prefix}-`, skip }, depth2 + 1)}`).join("\n")}` : typeof message === "object" ? `
|
|
776
|
+
${Object.keys(message).filter((key) => !skip.includes(key)).map(
|
|
777
|
+
(key) => ` ${prefix}> ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" ? formatLogMessage(
|
|
778
|
+
message[key],
|
|
779
|
+
{ prefix: `${prefix}-`, skip },
|
|
780
|
+
depth2 + 1
|
|
781
|
+
) : message[key]}`
|
|
782
|
+
).join("\n")}` : message;
|
|
783
|
+
};
|
|
784
|
+
var _isFunction = (value) => {
|
|
721
785
|
try {
|
|
722
786
|
return value instanceof Function || typeof value === "function" || !!(value?.constructor && value?.call && value?.apply);
|
|
723
787
|
} catch (e) {
|
|
724
788
|
return false;
|
|
725
789
|
}
|
|
726
|
-
}
|
|
790
|
+
};
|
|
727
791
|
|
|
728
792
|
export {
|
|
729
793
|
LogLevel,
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__name
|
|
3
|
-
} from "./chunk-O6YSETKJ.mjs";
|
|
4
|
-
|
|
5
1
|
// src/utilities/get-file-banner.ts
|
|
6
|
-
var getFileBanner =
|
|
2
|
+
var getFileBanner = (name, commentStart = "//") => {
|
|
7
3
|
let padding = "";
|
|
8
4
|
while (name.length + padding.length < 12) {
|
|
9
5
|
padding += " ";
|
|
@@ -37,7 +33,7 @@ ${commentStart} ----------------------------------------------------------------
|
|
|
37
33
|
|
|
38
34
|
|
|
39
35
|
`;
|
|
40
|
-
}
|
|
36
|
+
};
|
|
41
37
|
|
|
42
38
|
export {
|
|
43
39
|
getFileBanner
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true})
|
|
2
|
-
|
|
3
|
-
var _chunkSHUYVCIDjs = require('./chunk-SHUYVCID.js');
|
|
4
|
-
|
|
5
|
-
// src/plugins/type-definitions.ts
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/plugins/type-definitions.ts
|
|
6
2
|
var _devkit = require('@nx/devkit');
|
|
7
3
|
var _path = require('path');
|
|
8
4
|
function typeDefinitions(options) {
|
|
@@ -14,8 +10,14 @@ function typeDefinitions(options) {
|
|
|
14
10
|
continue;
|
|
15
11
|
}
|
|
16
12
|
const hasDefaultExport = file.exports.includes("default");
|
|
17
|
-
const entrySourceFileName = _path.relative.call(void 0,
|
|
18
|
-
|
|
13
|
+
const entrySourceFileName = _path.relative.call(void 0,
|
|
14
|
+
options.projectRoot,
|
|
15
|
+
file.facadeModuleId
|
|
16
|
+
);
|
|
17
|
+
const entrySourceDtsName = entrySourceFileName.replace(
|
|
18
|
+
/\.[cm]?[jt]sx?$/,
|
|
19
|
+
""
|
|
20
|
+
);
|
|
19
21
|
const dtsFileName = file.fileName.replace(/\.[cm]?js$/, ".d.ts");
|
|
20
22
|
const relativeSourceDtsName = JSON.stringify("./" + entrySourceDtsName);
|
|
21
23
|
const dtsFileSource = hasDefaultExport ? _devkit.stripIndents`
|
|
@@ -32,7 +34,6 @@ function typeDefinitions(options) {
|
|
|
32
34
|
}
|
|
33
35
|
};
|
|
34
36
|
}
|
|
35
|
-
_chunkSHUYVCIDjs.__name.call(void 0, typeDefinitions, "typeDefinitions");
|
|
36
37
|
|
|
37
38
|
|
|
38
39
|
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// src/utilities/get-project-deps.ts
|
|
2
|
+
function getExtraDependencies(projectName, graph) {
|
|
3
|
+
const deps = /* @__PURE__ */ new Map();
|
|
4
|
+
recur(projectName);
|
|
5
|
+
function recur(currProjectName) {
|
|
6
|
+
const allDeps = graph.dependencies[currProjectName];
|
|
7
|
+
const externalDeps = allDeps?.reduce(
|
|
8
|
+
(acc, node) => {
|
|
9
|
+
const found = graph.externalNodes?.[node.target];
|
|
10
|
+
if (found) {
|
|
11
|
+
acc.push(found);
|
|
12
|
+
}
|
|
13
|
+
return acc;
|
|
14
|
+
},
|
|
15
|
+
[]
|
|
16
|
+
) ?? [];
|
|
17
|
+
const internalDeps = allDeps?.reduce(
|
|
18
|
+
(acc, node) => {
|
|
19
|
+
const found = graph.nodes[node.target];
|
|
20
|
+
if (found) acc.push(found);
|
|
21
|
+
return acc;
|
|
22
|
+
},
|
|
23
|
+
[]
|
|
24
|
+
) ?? [];
|
|
25
|
+
for (const externalDep of externalDeps) {
|
|
26
|
+
deps.set(externalDep.name, {
|
|
27
|
+
name: externalDep.name,
|
|
28
|
+
outputs: [],
|
|
29
|
+
node: externalDep
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
for (const internalDep of internalDeps) {
|
|
33
|
+
recur(internalDep.name);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return Array.from(deps.values());
|
|
37
|
+
}
|
|
38
|
+
function getInternalDependencies(projectName, graph) {
|
|
39
|
+
const allDeps = graph.dependencies[projectName] ?? [];
|
|
40
|
+
return Array.from(
|
|
41
|
+
allDeps.reduce(
|
|
42
|
+
(acc, node) => {
|
|
43
|
+
const found = graph.nodes[node.target];
|
|
44
|
+
if (found) acc.push(found);
|
|
45
|
+
return acc;
|
|
46
|
+
},
|
|
47
|
+
[]
|
|
48
|
+
)
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
function getExternalDependencies(projectName, graph) {
|
|
52
|
+
const allDeps = graph.dependencies[projectName];
|
|
53
|
+
return Array.from(
|
|
54
|
+
allDeps?.reduce(
|
|
55
|
+
(acc, node) => {
|
|
56
|
+
const found = graph.externalNodes?.[node.target];
|
|
57
|
+
if (found) acc.push(found);
|
|
58
|
+
return acc;
|
|
59
|
+
},
|
|
60
|
+
[]
|
|
61
|
+
) ?? []
|
|
62
|
+
) ?? [];
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export {
|
|
66
|
+
getExtraDependencies,
|
|
67
|
+
getInternalDependencies,
|
|
68
|
+
getExternalDependencies
|
|
69
|
+
};
|