@storm-software/unbuild 0.35.2 → 0.36.1
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/bin/unbuild.cjs +67 -37
- package/bin/unbuild.js +69 -39
- package/dist/build.cjs +7 -7
- package/dist/build.js +6 -6
- package/dist/{chunk-KXDOKQLW.js → chunk-4VAP3O4T.js} +48 -29
- package/dist/{chunk-3HGUCQU6.cjs → chunk-5XTLMOFH.cjs} +3 -3
- package/dist/{chunk-5FQVMM7I.cjs → chunk-A45F3XCO.cjs} +26 -15
- package/dist/{chunk-PLJQK2VX.js → chunk-A7ULBMR4.js} +26 -15
- package/dist/{chunk-Y7PS2HJA.cjs → chunk-AI7YECRT.cjs} +3 -3
- package/dist/{chunk-ZPWH22ZM.cjs → chunk-BZELKGMN.cjs} +2 -2
- package/dist/{chunk-2E6P5U5P.js → chunk-FLMNRVR2.js} +1 -1
- package/dist/{chunk-3M7GEZDL.js → chunk-FRURXT64.js} +1 -1
- package/dist/{chunk-N5KR37LU.cjs → chunk-MXG2QBLK.cjs} +2 -2
- package/dist/{chunk-RFEZKCMQ.js → chunk-R6HJQ5XB.js} +1 -1
- package/dist/{chunk-44QVHNBQ.cjs → chunk-WIBRZ6QG.cjs} +142 -123
- package/dist/{chunk-L3WYWYD4.js → chunk-XRMMVXZP.js} +1 -1
- package/dist/clean.cjs +3 -3
- package/dist/clean.js +2 -2
- package/dist/index.cjs +7 -7
- package/dist/index.js +6 -6
- package/dist/plugins/analyze.cjs +3 -3
- package/dist/plugins/analyze.js +2 -2
- package/dist/plugins/on-error.cjs +3 -3
- package/dist/plugins/on-error.js +2 -2
- package/dist/plugins/tsc.cjs +3 -3
- package/dist/plugins/tsc.js +2 -2
- package/package.json +1 -1
|
@@ -3,17 +3,17 @@ import {
|
|
|
3
3
|
} from "./chunk-RBYYB7X2.js";
|
|
4
4
|
import {
|
|
5
5
|
cleanDirectories
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-FLMNRVR2.js";
|
|
7
7
|
import {
|
|
8
8
|
analyzePlugin
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-XRMMVXZP.js";
|
|
10
10
|
import {
|
|
11
11
|
onErrorPlugin
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-R6HJQ5XB.js";
|
|
13
13
|
import {
|
|
14
14
|
loadConfig,
|
|
15
15
|
tscPlugin
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-FRURXT64.js";
|
|
17
17
|
import {
|
|
18
18
|
COLOR_KEYS,
|
|
19
19
|
LogLevel,
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
writeSuccess,
|
|
37
37
|
writeTrace,
|
|
38
38
|
writeWarning
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-A7ULBMR4.js";
|
|
40
40
|
import {
|
|
41
41
|
__name
|
|
42
42
|
} from "./chunk-3GQAWCBQ.js";
|
|
@@ -117,11 +117,12 @@ ${footer && typeof footer === "string" ? footer.startsWith("//") ? footer : `//
|
|
|
117
117
|
// ../build-tools/src/utilities/generate-package-json.ts
|
|
118
118
|
import { calculateProjectBuildableDependencies } from "@nx/js/src/utils/buildable-libs-utils";
|
|
119
119
|
import { Glob } from "glob";
|
|
120
|
-
import { existsSync } from "node:fs";
|
|
120
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
121
121
|
import { readFile as readFile2 } from "node:fs/promises";
|
|
122
|
-
import { readCachedProjectGraph } from "nx/src/project-graph/project-graph";
|
|
122
|
+
import { readCachedProjectGraph, readProjectsConfigurationFromProjectGraph } from "nx/src/project-graph/project-graph";
|
|
123
123
|
var addPackageDependencies = /* @__PURE__ */ __name(async (workspaceRoot, projectRoot, projectName, packageJson) => {
|
|
124
|
-
const
|
|
124
|
+
const projectGraph = readCachedProjectGraph();
|
|
125
|
+
const projectDependencies = calculateProjectBuildableDependencies(void 0, projectGraph, workspaceRoot, projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
|
|
125
126
|
const localPackages = [];
|
|
126
127
|
for (const project of projectDependencies.dependencies.filter((dep) => dep.node.type === "lib" && dep.node.data.root !== projectRoot && dep.node.data.root !== workspaceRoot)) {
|
|
127
128
|
const projectNode = project.node;
|
|
@@ -138,26 +139,38 @@ var addPackageDependencies = /* @__PURE__ */ __name(async (workspaceRoot, projec
|
|
|
138
139
|
}
|
|
139
140
|
if (localPackages.length > 0) {
|
|
140
141
|
writeTrace(`\u{1F4E6} Adding local packages to package.json: ${localPackages.map((p) => p.name).join(", ")}`);
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
142
|
+
const projectJsonFile = await readFile2(joinPaths(projectRoot, "project.json"), "utf8");
|
|
143
|
+
const projectJson = JSON.parse(projectJsonFile);
|
|
144
|
+
const projectName2 = projectJson.name;
|
|
145
|
+
const projectConfigurations = readProjectsConfigurationFromProjectGraph(projectGraph);
|
|
146
|
+
if (!projectConfigurations?.projects?.[projectName2]) {
|
|
147
|
+
throw new Error("The Build process failed because the project does not have a valid configuration in the project.json file. Check if the file exists in the root of the project.");
|
|
148
|
+
}
|
|
149
|
+
const implicitDependencies = projectConfigurations.projects?.[projectName2].implicitDependencies?.reduce((ret, dep) => {
|
|
150
|
+
if (projectConfigurations.projects?.[dep]) {
|
|
151
|
+
const depPackageJsonPath = joinPaths(workspaceRoot, projectConfigurations.projects[dep].root, "package.json");
|
|
152
|
+
if (existsSync(depPackageJsonPath)) {
|
|
153
|
+
const depPackageJsonContent = readFileSync(depPackageJsonPath, "utf8");
|
|
154
|
+
const depPackageJson = JSON.parse(depPackageJsonContent);
|
|
155
|
+
if (depPackageJson.private !== true && !ret.includes(depPackageJson.name)) {
|
|
156
|
+
ret.push(depPackageJson.name);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
144
159
|
}
|
|
145
160
|
return ret;
|
|
146
|
-
},
|
|
147
|
-
packageJson.
|
|
148
|
-
if (!ret[localPackage.name]) {
|
|
149
|
-
ret[localPackage.name] = {
|
|
150
|
-
optional: false
|
|
151
|
-
};
|
|
161
|
+
}, []);
|
|
162
|
+
packageJson.dependencies = localPackages.reduce((ret, localPackage) => {
|
|
163
|
+
if (!ret[localPackage.name] && !implicitDependencies?.includes(localPackage.name)) {
|
|
164
|
+
ret[localPackage.name] = `>=${localPackage.version || "0.0.1"}`;
|
|
152
165
|
}
|
|
153
166
|
return ret;
|
|
154
|
-
}, packageJson.
|
|
167
|
+
}, packageJson.dependencies ?? {});
|
|
155
168
|
packageJson.devDependencies = localPackages.reduce((ret, localPackage) => {
|
|
156
|
-
if (!ret[localPackage.name]) {
|
|
169
|
+
if (!ret[localPackage.name] && implicitDependencies?.includes(localPackage.name)) {
|
|
157
170
|
ret[localPackage.name] = localPackage.version || "0.0.1";
|
|
158
171
|
}
|
|
159
172
|
return ret;
|
|
160
|
-
}, packageJson.
|
|
173
|
+
}, packageJson.devDependencies ?? {});
|
|
161
174
|
} else {
|
|
162
175
|
writeTrace("\u{1F4E6} No local packages dependencies to add to package.json");
|
|
163
176
|
}
|
|
@@ -243,10 +256,10 @@ var getConfigFileByName = /* @__PURE__ */ __name(async (fileName, filePath, opti
|
|
|
243
256
|
}, "getConfigFileByName");
|
|
244
257
|
var getConfigFile = /* @__PURE__ */ __name(async (filePath, additionalFileNames = []) => {
|
|
245
258
|
const workspacePath = filePath ? filePath : findWorkspaceRoot(filePath);
|
|
246
|
-
const result = await getConfigFileByName("storm", workspacePath);
|
|
259
|
+
const result = await getConfigFileByName("storm-workspace", workspacePath);
|
|
247
260
|
let config = result.config;
|
|
248
261
|
const configFile = result.configFile;
|
|
249
|
-
if (config && configFile && Object.keys(config).length > 0) {
|
|
262
|
+
if (config && configFile && Object.keys(config).length > 0 && !config.skipConfigLogging) {
|
|
250
263
|
writeTrace(`Found Storm configuration file "${configFile.includes(`${workspacePath}/`) ? configFile.replace(`${workspacePath}/`, "") : configFile}" at "${workspacePath}"`, {
|
|
251
264
|
logLevel: "all"
|
|
252
265
|
});
|
|
@@ -255,9 +268,11 @@ var getConfigFile = /* @__PURE__ */ __name(async (filePath, additionalFileNames
|
|
|
255
268
|
const results = await Promise.all(additionalFileNames.map((fileName) => getConfigFileByName(fileName, workspacePath)));
|
|
256
269
|
for (const result2 of results) {
|
|
257
270
|
if (result2?.config && result2?.configFile && Object.keys(result2.config).length > 0) {
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
271
|
+
if (!config.skipConfigLogging && !result2.config.skipConfigLogging) {
|
|
272
|
+
writeTrace(`Found alternative configuration file "${result2.configFile.includes(`${workspacePath}/`) ? result2.configFile.replace(`${workspacePath}/`, "") : result2.configFile}" at "${workspacePath}"`, {
|
|
273
|
+
logLevel: "all"
|
|
274
|
+
});
|
|
275
|
+
}
|
|
261
276
|
config = defu(result2.config ?? {}, config ?? {});
|
|
262
277
|
}
|
|
263
278
|
}
|
|
@@ -333,7 +348,8 @@ var getConfigEnv = /* @__PURE__ */ __name(() => {
|
|
|
333
348
|
cyclone: process.env[`${prefix}REGISTRY_CYCLONE`] || void 0,
|
|
334
349
|
container: process.env[`${prefix}REGISTRY_CONTAINER`] || void 0
|
|
335
350
|
},
|
|
336
|
-
logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) ? getLogLevelLabel(Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) : process.env[`${prefix}LOG_LEVEL`] : void 0
|
|
351
|
+
logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) ? getLogLevelLabel(Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) : process.env[`${prefix}LOG_LEVEL`] : void 0,
|
|
352
|
+
skipConfigLogging: process.env[`${prefix}SKIP_CONFIG_LOGGING`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CONFIG_LOGGING`]) : void 0
|
|
337
353
|
};
|
|
338
354
|
const themeNames = Object.keys(process.env).filter((envKey) => envKey.startsWith(`${prefix}COLOR_`) && COLOR_KEYS.every((colorKey) => !envKey.startsWith(`${prefix}COLOR_LIGHT_${colorKey}`) && !envKey.startsWith(`${prefix}COLOR_DARK_${colorKey}`)));
|
|
339
355
|
config.colors = themeNames.length > 0 ? themeNames.reduce((ret, themeName) => {
|
|
@@ -568,6 +584,9 @@ var setConfigEnv = /* @__PURE__ */ __name((config) => {
|
|
|
568
584
|
process.env.NX_VERBOSE_LOGGING = String(getLogLevel(config.logLevel) >= LogLevel.DEBUG ? true : false);
|
|
569
585
|
process.env.RUST_BACKTRACE = getLogLevel(config.logLevel) >= LogLevel.DEBUG ? "full" : "none";
|
|
570
586
|
}
|
|
587
|
+
if (config.skipConfigLogging !== void 0) {
|
|
588
|
+
process.env[`${prefix}SKIP_CONFIG_LOGGING`] = String(config.skipConfigLogging);
|
|
589
|
+
}
|
|
571
590
|
process.env[`${prefix}CONFIG`] = JSON.stringify(config);
|
|
572
591
|
for (const key of Object.keys(config.extensions ?? {})) {
|
|
573
592
|
config.extensions[key] && Object.keys(config.extensions[key]) && setExtensionEnv(key, config.extensions[key]);
|
|
@@ -685,7 +704,7 @@ var createStormConfig = /* @__PURE__ */ __name(async (extensionName, schema, wor
|
|
|
685
704
|
const defaultConfig = await getDefaultConfig(_workspaceRoot);
|
|
686
705
|
const configFile = await getConfigFile(_workspaceRoot);
|
|
687
706
|
if (!configFile && !skipLogs) {
|
|
688
|
-
writeWarning("No Storm
|
|
707
|
+
writeWarning("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", {
|
|
689
708
|
logLevel: "all"
|
|
690
709
|
});
|
|
691
710
|
}
|
|
@@ -723,8 +742,8 @@ var createConfigExtension = /* @__PURE__ */ __name((extensionName, schema) => {
|
|
|
723
742
|
var loadStormConfig = /* @__PURE__ */ __name(async (workspaceRoot, skipLogs = false) => {
|
|
724
743
|
const config = await createStormConfig(void 0, void 0, workspaceRoot, skipLogs);
|
|
725
744
|
setConfigEnv(config);
|
|
726
|
-
if (!skipLogs) {
|
|
727
|
-
writeTrace(`\u2699\uFE0F Using Storm configuration:
|
|
745
|
+
if (!skipLogs && !config.skipConfigLogging) {
|
|
746
|
+
writeTrace(`\u2699\uFE0F Using Storm Workspace configuration:
|
|
728
747
|
${formatLogMessage(config)}`, config);
|
|
729
748
|
}
|
|
730
749
|
return config;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkA45F3XCOcjs = require('./chunk-A45F3XCO.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _chunkBGYQAVKQcjs = require('./chunk-BGYQAVKQ.cjs');
|
|
@@ -9,8 +9,8 @@ var _chunkBGYQAVKQcjs = require('./chunk-BGYQAVKQ.cjs');
|
|
|
9
9
|
// src/clean.ts
|
|
10
10
|
var _promises = require('fs/promises');
|
|
11
11
|
async function clean(name = "Unbuild", directory, config) {
|
|
12
|
-
|
|
13
|
-
const stopwatch =
|
|
12
|
+
_chunkA45F3XCOcjs.writeDebug.call(void 0, ` \u{1F9F9} Cleaning ${name} output path: ${directory}`, config);
|
|
13
|
+
const stopwatch = _chunkA45F3XCOcjs.getStopwatch.call(void 0, `${name} output clean`);
|
|
14
14
|
await cleanDirectories(name, directory, config);
|
|
15
15
|
stopwatch();
|
|
16
16
|
}
|
|
@@ -312,7 +312,7 @@ var WorkspaceDirectoryConfigSchema = _zod2.default.object({
|
|
|
312
312
|
build: _zod2.default.string().trim().default("dist").describe("The directory used to store the workspace's distributable files after a build (relative to the workspace root)")
|
|
313
313
|
}).describe("Various directories used by the workspace to store data, cache, and configuration files");
|
|
314
314
|
var StormConfigSchema = _zod2.default.object({
|
|
315
|
-
$schema: _zod2.default.string().trim().default("https://cdn.jsdelivr.net/npm/@storm-software/config/schemas/storm.schema.json").optional().nullish().describe("The URL to the JSON schema file that describes the Storm configuration file"),
|
|
315
|
+
$schema: _zod2.default.string().trim().default("https://cdn.jsdelivr.net/npm/@storm-software/config/schemas/storm-workspace.schema.json").optional().nullish().describe("The URL to the JSON schema file that describes the Storm configuration file"),
|
|
316
316
|
extends: ExtendsSchema.optional(),
|
|
317
317
|
name: _zod2.default.string().trim().toLowerCase().optional().describe("The name of the service/package/scope using this configuration"),
|
|
318
318
|
namespace: _zod2.default.string().trim().toLowerCase().optional().describe("The namespace of the package"),
|
|
@@ -354,6 +354,7 @@ var StormConfigSchema = _zod2.default.object({
|
|
|
354
354
|
"trace",
|
|
355
355
|
"all"
|
|
356
356
|
]).default("info").describe("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`)."),
|
|
357
|
+
skipConfigLogging: _zod2.default.boolean().optional().describe("Should the logging of the current Storm Workspace configuration be skipped?"),
|
|
357
358
|
registry: RegistryConfigSchema,
|
|
358
359
|
configFile: _zod2.default.string().trim().nullable().default(null).describe("The filepath of the Storm config. When this field is null, no config file was found in the current workspace."),
|
|
359
360
|
colors: ColorConfigSchema.or(ColorConfigMapSchema).describe("Storm theme config values used for styling various package elements"),
|
|
@@ -389,14 +390,17 @@ var _path = require('path');
|
|
|
389
390
|
|
|
390
391
|
var MAX_PATH_SEARCH_DEPTH = 30;
|
|
391
392
|
var depth = 0;
|
|
392
|
-
function findFolderUp(startPath, endFileNames) {
|
|
393
|
+
function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
|
|
393
394
|
const _startPath = _nullishCoalesce(startPath, () => ( process.cwd()));
|
|
395
|
+
if (endDirectoryNames.some((endDirName) => _fs.existsSync.call(void 0, _path.join.call(void 0, _startPath, endDirName)))) {
|
|
396
|
+
return _startPath;
|
|
397
|
+
}
|
|
394
398
|
if (endFileNames.some((endFileName) => _fs.existsSync.call(void 0, _path.join.call(void 0, _startPath, endFileName)))) {
|
|
395
399
|
return _startPath;
|
|
396
400
|
}
|
|
397
401
|
if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
|
|
398
402
|
const parent = _path.join.call(void 0, _startPath, "..");
|
|
399
|
-
return findFolderUp(parent, endFileNames);
|
|
403
|
+
return findFolderUp(parent, endFileNames, endDirectoryNames);
|
|
400
404
|
}
|
|
401
405
|
return void 0;
|
|
402
406
|
}
|
|
@@ -404,17 +408,17 @@ _chunkBGYQAVKQcjs.__name.call(void 0, findFolderUp, "findFolderUp");
|
|
|
404
408
|
|
|
405
409
|
// ../config-tools/src/utilities/find-workspace-root.ts
|
|
406
410
|
var rootFiles = [
|
|
407
|
-
"storm.json",
|
|
408
|
-
"storm.json",
|
|
409
|
-
"storm.yaml",
|
|
410
|
-
"storm.yml",
|
|
411
|
-
"storm.js",
|
|
412
|
-
"storm.ts",
|
|
413
|
-
".storm.json",
|
|
414
|
-
".storm.yaml",
|
|
415
|
-
".storm.yml",
|
|
416
|
-
".storm.js",
|
|
417
|
-
".storm.ts",
|
|
411
|
+
"storm-workspace.json",
|
|
412
|
+
"storm-workspace.json",
|
|
413
|
+
"storm-workspace.yaml",
|
|
414
|
+
"storm-workspace.yml",
|
|
415
|
+
"storm-workspace.js",
|
|
416
|
+
"storm-workspace.ts",
|
|
417
|
+
".storm-workspace.json",
|
|
418
|
+
".storm-workspace.yaml",
|
|
419
|
+
".storm-workspace.yml",
|
|
420
|
+
".storm-workspace.js",
|
|
421
|
+
".storm-workspace.ts",
|
|
418
422
|
"lerna.json",
|
|
419
423
|
"nx.json",
|
|
420
424
|
"turbo.json",
|
|
@@ -438,11 +442,18 @@ var rootFiles = [
|
|
|
438
442
|
"pnpm-lock.yml",
|
|
439
443
|
"bun.lockb"
|
|
440
444
|
];
|
|
445
|
+
var rootDirectories = [
|
|
446
|
+
".storm-workspace",
|
|
447
|
+
".nx",
|
|
448
|
+
".github",
|
|
449
|
+
".vscode",
|
|
450
|
+
".verdaccio"
|
|
451
|
+
];
|
|
441
452
|
function findWorkspaceRootSafe(pathInsideMonorepo) {
|
|
442
453
|
if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) {
|
|
443
454
|
return correctPaths(_nullishCoalesce(process.env.STORM_WORKSPACE_ROOT, () => ( process.env.NX_WORKSPACE_ROOT_PATH)));
|
|
444
455
|
}
|
|
445
|
-
return correctPaths(findFolderUp(_nullishCoalesce(pathInsideMonorepo, () => ( process.cwd())), rootFiles));
|
|
456
|
+
return correctPaths(findFolderUp(_nullishCoalesce(pathInsideMonorepo, () => ( process.cwd())), rootFiles, rootDirectories));
|
|
446
457
|
}
|
|
447
458
|
_chunkBGYQAVKQcjs.__name.call(void 0, findWorkspaceRootSafe, "findWorkspaceRootSafe");
|
|
448
459
|
function findWorkspaceRoot(pathInsideMonorepo) {
|
|
@@ -312,7 +312,7 @@ var WorkspaceDirectoryConfigSchema = z.object({
|
|
|
312
312
|
build: z.string().trim().default("dist").describe("The directory used to store the workspace's distributable files after a build (relative to the workspace root)")
|
|
313
313
|
}).describe("Various directories used by the workspace to store data, cache, and configuration files");
|
|
314
314
|
var StormConfigSchema = z.object({
|
|
315
|
-
$schema: z.string().trim().default("https://cdn.jsdelivr.net/npm/@storm-software/config/schemas/storm.schema.json").optional().nullish().describe("The URL to the JSON schema file that describes the Storm configuration file"),
|
|
315
|
+
$schema: z.string().trim().default("https://cdn.jsdelivr.net/npm/@storm-software/config/schemas/storm-workspace.schema.json").optional().nullish().describe("The URL to the JSON schema file that describes the Storm configuration file"),
|
|
316
316
|
extends: ExtendsSchema.optional(),
|
|
317
317
|
name: z.string().trim().toLowerCase().optional().describe("The name of the service/package/scope using this configuration"),
|
|
318
318
|
namespace: z.string().trim().toLowerCase().optional().describe("The namespace of the package"),
|
|
@@ -354,6 +354,7 @@ var StormConfigSchema = z.object({
|
|
|
354
354
|
"trace",
|
|
355
355
|
"all"
|
|
356
356
|
]).default("info").describe("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`)."),
|
|
357
|
+
skipConfigLogging: z.boolean().optional().describe("Should the logging of the current Storm Workspace configuration be skipped?"),
|
|
357
358
|
registry: RegistryConfigSchema,
|
|
358
359
|
configFile: z.string().trim().nullable().default(null).describe("The filepath of the Storm config. When this field is null, no config file was found in the current workspace."),
|
|
359
360
|
colors: ColorConfigSchema.or(ColorConfigMapSchema).describe("Storm theme config values used for styling various package elements"),
|
|
@@ -389,14 +390,17 @@ import { existsSync } from "node:fs";
|
|
|
389
390
|
import { join } from "node:path";
|
|
390
391
|
var MAX_PATH_SEARCH_DEPTH = 30;
|
|
391
392
|
var depth = 0;
|
|
392
|
-
function findFolderUp(startPath, endFileNames) {
|
|
393
|
+
function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
|
|
393
394
|
const _startPath = startPath ?? process.cwd();
|
|
395
|
+
if (endDirectoryNames.some((endDirName) => existsSync(join(_startPath, endDirName)))) {
|
|
396
|
+
return _startPath;
|
|
397
|
+
}
|
|
394
398
|
if (endFileNames.some((endFileName) => existsSync(join(_startPath, endFileName)))) {
|
|
395
399
|
return _startPath;
|
|
396
400
|
}
|
|
397
401
|
if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
|
|
398
402
|
const parent = join(_startPath, "..");
|
|
399
|
-
return findFolderUp(parent, endFileNames);
|
|
403
|
+
return findFolderUp(parent, endFileNames, endDirectoryNames);
|
|
400
404
|
}
|
|
401
405
|
return void 0;
|
|
402
406
|
}
|
|
@@ -404,17 +408,17 @@ __name(findFolderUp, "findFolderUp");
|
|
|
404
408
|
|
|
405
409
|
// ../config-tools/src/utilities/find-workspace-root.ts
|
|
406
410
|
var rootFiles = [
|
|
407
|
-
"storm.json",
|
|
408
|
-
"storm.json",
|
|
409
|
-
"storm.yaml",
|
|
410
|
-
"storm.yml",
|
|
411
|
-
"storm.js",
|
|
412
|
-
"storm.ts",
|
|
413
|
-
".storm.json",
|
|
414
|
-
".storm.yaml",
|
|
415
|
-
".storm.yml",
|
|
416
|
-
".storm.js",
|
|
417
|
-
".storm.ts",
|
|
411
|
+
"storm-workspace.json",
|
|
412
|
+
"storm-workspace.json",
|
|
413
|
+
"storm-workspace.yaml",
|
|
414
|
+
"storm-workspace.yml",
|
|
415
|
+
"storm-workspace.js",
|
|
416
|
+
"storm-workspace.ts",
|
|
417
|
+
".storm-workspace.json",
|
|
418
|
+
".storm-workspace.yaml",
|
|
419
|
+
".storm-workspace.yml",
|
|
420
|
+
".storm-workspace.js",
|
|
421
|
+
".storm-workspace.ts",
|
|
418
422
|
"lerna.json",
|
|
419
423
|
"nx.json",
|
|
420
424
|
"turbo.json",
|
|
@@ -438,11 +442,18 @@ var rootFiles = [
|
|
|
438
442
|
"pnpm-lock.yml",
|
|
439
443
|
"bun.lockb"
|
|
440
444
|
];
|
|
445
|
+
var rootDirectories = [
|
|
446
|
+
".storm-workspace",
|
|
447
|
+
".nx",
|
|
448
|
+
".github",
|
|
449
|
+
".vscode",
|
|
450
|
+
".verdaccio"
|
|
451
|
+
];
|
|
441
452
|
function findWorkspaceRootSafe(pathInsideMonorepo) {
|
|
442
453
|
if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) {
|
|
443
454
|
return correctPaths(process.env.STORM_WORKSPACE_ROOT ?? process.env.NX_WORKSPACE_ROOT_PATH);
|
|
444
455
|
}
|
|
445
|
-
return correctPaths(findFolderUp(pathInsideMonorepo ?? process.cwd(), rootFiles));
|
|
456
|
+
return correctPaths(findFolderUp(pathInsideMonorepo ?? process.cwd(), rootFiles, rootDirectories));
|
|
446
457
|
}
|
|
447
458
|
__name(findWorkspaceRootSafe, "findWorkspaceRootSafe");
|
|
448
459
|
function findWorkspaceRoot(pathInsideMonorepo) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkA45F3XCOcjs = require('./chunk-A45F3XCO.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkBGYQAVKQcjs = require('./chunk-BGYQAVKQ.cjs');
|
|
@@ -10,7 +10,7 @@ var onErrorPlugin = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (optio
|
|
|
10
10
|
name: "storm:on-error",
|
|
11
11
|
buildEnd(error) {
|
|
12
12
|
if (error) {
|
|
13
|
-
|
|
13
|
+
_chunkA45F3XCOcjs.writeError.call(void 0, `The following errors occurred during the build:
|
|
14
14
|
${error ? error.message : "Unknown build error"}
|
|
15
15
|
|
|
16
16
|
`, options.config);
|
|
@@ -18,7 +18,7 @@ ${error ? error.message : "Unknown build error"}
|
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
renderError(error) {
|
|
21
|
-
|
|
21
|
+
_chunkA45F3XCOcjs.writeError.call(void 0, `The following errors occurred during the build:
|
|
22
22
|
${error ? error.message : "Unknown build error"}
|
|
23
23
|
|
|
24
24
|
`, options.config);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkA45F3XCOcjs = require('./chunk-A45F3XCO.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkBGYQAVKQcjs = require('./chunk-BGYQAVKQ.cjs');
|
|
@@ -32,7 +32,7 @@ async function createTsCompilerOptions(config, tsConfigPath, projectRoot, depend
|
|
|
32
32
|
declaration: true,
|
|
33
33
|
paths: _buildablelibsutils.computeCompilerOptionsPaths.call(void 0, tsConfig, _nullishCoalesce(dependencies, () => ( [])))
|
|
34
34
|
};
|
|
35
|
-
|
|
35
|
+
_chunkA45F3XCOcjs.writeTrace.call(void 0, compilerOptions, config);
|
|
36
36
|
return compilerOptions;
|
|
37
37
|
}
|
|
38
38
|
_chunkBGYQAVKQcjs.__name.call(void 0, createTsCompilerOptions, "createTsCompilerOptions");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkA45F3XCOcjs = require('./chunk-A45F3XCO.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkBGYQAVKQcjs = require('./chunk-BGYQAVKQ.cjs');
|
|
@@ -25,7 +25,7 @@ var analyzePlugin = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (optio
|
|
|
25
25
|
renderChunk(source, chunk) {
|
|
26
26
|
const sourceBytes = formatBytes(source.length);
|
|
27
27
|
const fileName = chunk.fileName;
|
|
28
|
-
|
|
28
|
+
_chunkA45F3XCOcjs.writeInfo.call(void 0, ` - ${fileName} ${sourceBytes}`, options.config);
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
}, "analyzePlugin");
|