@storm-software/tsdown 0.24.13 → 0.24.15
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/build.cjs +3 -3
- package/dist/build.js +2 -2
- package/dist/{chunk-KB6FL5TT.js → chunk-EO2JNC24.js} +26 -15
- package/dist/{chunk-52NJUFUL.cjs → chunk-JXYBDFPK.cjs} +26 -15
- package/dist/{chunk-UXN3FUA7.js → chunk-PJF37ZAU.js} +46 -27
- package/dist/{chunk-CCP7YM3I.cjs → chunk-TFFKZFJG.cjs} +132 -113
- package/dist/clean.cjs +2 -2
- package/dist/clean.js +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ This package is part of the <b>⚡Storm-Ops</b> monorepo. The Storm-Ops packages
|
|
|
21
21
|
|
|
22
22
|
<h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
|
|
23
23
|
|
|
24
|
-
[](https://prettier.io/) [](http://nx.dev/) [](https://nextjs.org/) [](http://commitizen.github.io/cz-cli/)  [](https://fumadocs.vercel.app/) 
|
|
25
25
|
|
|
26
26
|
<!-- prettier-ignore-start -->
|
|
27
27
|
<!-- markdownlint-disable -->
|
package/dist/build.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('./chunk-
|
|
4
|
+
var _chunkTFFKZFJGcjs = require('./chunk-TFFKZFJG.cjs');
|
|
5
|
+
require('./chunk-JXYBDFPK.cjs');
|
|
6
6
|
require('./chunk-5KRF6IVW.cjs');
|
|
7
7
|
require('./chunk-USNT2KNT.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
exports.build =
|
|
11
|
+
exports.build = _chunkTFFKZFJGcjs.build; exports.cleanOutputPath = _chunkTFFKZFJGcjs.cleanOutputPath;
|
package/dist/build.js
CHANGED
|
@@ -130,7 +130,7 @@ var WorkspaceDirectoryConfigSchema = z.object({
|
|
|
130
130
|
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)")
|
|
131
131
|
}).describe("Various directories used by the workspace to store data, cache, and configuration files");
|
|
132
132
|
var StormConfigSchema = z.object({
|
|
133
|
-
$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"),
|
|
133
|
+
$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"),
|
|
134
134
|
extends: ExtendsSchema.optional(),
|
|
135
135
|
name: z.string().trim().toLowerCase().optional().describe("The name of the service/package/scope using this configuration"),
|
|
136
136
|
namespace: z.string().trim().toLowerCase().optional().describe("The namespace of the package"),
|
|
@@ -172,6 +172,7 @@ var StormConfigSchema = z.object({
|
|
|
172
172
|
"trace",
|
|
173
173
|
"all"
|
|
174
174
|
]).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`)."),
|
|
175
|
+
skipConfigLogging: z.boolean().optional().describe("Should the logging of the current Storm Workspace configuration be skipped?"),
|
|
175
176
|
registry: RegistryConfigSchema,
|
|
176
177
|
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."),
|
|
177
178
|
colors: ColorConfigSchema.or(ColorConfigMapSchema).describe("Storm theme config values used for styling various package elements"),
|
|
@@ -334,14 +335,17 @@ import { existsSync } from "node:fs";
|
|
|
334
335
|
import { join } from "node:path";
|
|
335
336
|
var MAX_PATH_SEARCH_DEPTH = 30;
|
|
336
337
|
var depth = 0;
|
|
337
|
-
function findFolderUp(startPath, endFileNames) {
|
|
338
|
+
function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
|
|
338
339
|
const _startPath = startPath ?? process.cwd();
|
|
340
|
+
if (endDirectoryNames.some((endDirName) => existsSync(join(_startPath, endDirName)))) {
|
|
341
|
+
return _startPath;
|
|
342
|
+
}
|
|
339
343
|
if (endFileNames.some((endFileName) => existsSync(join(_startPath, endFileName)))) {
|
|
340
344
|
return _startPath;
|
|
341
345
|
}
|
|
342
346
|
if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
|
|
343
347
|
const parent = join(_startPath, "..");
|
|
344
|
-
return findFolderUp(parent, endFileNames);
|
|
348
|
+
return findFolderUp(parent, endFileNames, endDirectoryNames);
|
|
345
349
|
}
|
|
346
350
|
return void 0;
|
|
347
351
|
}
|
|
@@ -349,17 +353,17 @@ __name(findFolderUp, "findFolderUp");
|
|
|
349
353
|
|
|
350
354
|
// ../config-tools/src/utilities/find-workspace-root.ts
|
|
351
355
|
var rootFiles = [
|
|
352
|
-
"storm.json",
|
|
353
|
-
"storm.json",
|
|
354
|
-
"storm.yaml",
|
|
355
|
-
"storm.yml",
|
|
356
|
-
"storm.js",
|
|
357
|
-
"storm.ts",
|
|
358
|
-
".storm.json",
|
|
359
|
-
".storm.yaml",
|
|
360
|
-
".storm.yml",
|
|
361
|
-
".storm.js",
|
|
362
|
-
".storm.ts",
|
|
356
|
+
"storm-workspace.json",
|
|
357
|
+
"storm-workspace.json",
|
|
358
|
+
"storm-workspace.yaml",
|
|
359
|
+
"storm-workspace.yml",
|
|
360
|
+
"storm-workspace.js",
|
|
361
|
+
"storm-workspace.ts",
|
|
362
|
+
".storm-workspace.json",
|
|
363
|
+
".storm-workspace.yaml",
|
|
364
|
+
".storm-workspace.yml",
|
|
365
|
+
".storm-workspace.js",
|
|
366
|
+
".storm-workspace.ts",
|
|
363
367
|
"lerna.json",
|
|
364
368
|
"nx.json",
|
|
365
369
|
"turbo.json",
|
|
@@ -383,11 +387,18 @@ var rootFiles = [
|
|
|
383
387
|
"pnpm-lock.yml",
|
|
384
388
|
"bun.lockb"
|
|
385
389
|
];
|
|
390
|
+
var rootDirectories = [
|
|
391
|
+
".storm-workspace",
|
|
392
|
+
".nx",
|
|
393
|
+
".github",
|
|
394
|
+
".vscode",
|
|
395
|
+
".verdaccio"
|
|
396
|
+
];
|
|
386
397
|
function findWorkspaceRootSafe(pathInsideMonorepo) {
|
|
387
398
|
if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) {
|
|
388
399
|
return correctPaths(process.env.STORM_WORKSPACE_ROOT ?? process.env.NX_WORKSPACE_ROOT_PATH);
|
|
389
400
|
}
|
|
390
|
-
return correctPaths(findFolderUp(pathInsideMonorepo ?? process.cwd(), rootFiles));
|
|
401
|
+
return correctPaths(findFolderUp(pathInsideMonorepo ?? process.cwd(), rootFiles, rootDirectories));
|
|
391
402
|
}
|
|
392
403
|
__name(findWorkspaceRootSafe, "findWorkspaceRootSafe");
|
|
393
404
|
function findWorkspaceRoot(pathInsideMonorepo) {
|
|
@@ -130,7 +130,7 @@ var WorkspaceDirectoryConfigSchema = _zod2.default.object({
|
|
|
130
130
|
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)")
|
|
131
131
|
}).describe("Various directories used by the workspace to store data, cache, and configuration files");
|
|
132
132
|
var StormConfigSchema = _zod2.default.object({
|
|
133
|
-
$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"),
|
|
133
|
+
$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"),
|
|
134
134
|
extends: ExtendsSchema.optional(),
|
|
135
135
|
name: _zod2.default.string().trim().toLowerCase().optional().describe("The name of the service/package/scope using this configuration"),
|
|
136
136
|
namespace: _zod2.default.string().trim().toLowerCase().optional().describe("The namespace of the package"),
|
|
@@ -172,6 +172,7 @@ var StormConfigSchema = _zod2.default.object({
|
|
|
172
172
|
"trace",
|
|
173
173
|
"all"
|
|
174
174
|
]).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`)."),
|
|
175
|
+
skipConfigLogging: _zod2.default.boolean().optional().describe("Should the logging of the current Storm Workspace configuration be skipped?"),
|
|
175
176
|
registry: RegistryConfigSchema,
|
|
176
177
|
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."),
|
|
177
178
|
colors: ColorConfigSchema.or(ColorConfigMapSchema).describe("Storm theme config values used for styling various package elements"),
|
|
@@ -334,14 +335,17 @@ var isAbsolute = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, function(
|
|
|
334
335
|
|
|
335
336
|
var MAX_PATH_SEARCH_DEPTH = 30;
|
|
336
337
|
var depth = 0;
|
|
337
|
-
function findFolderUp(startPath, endFileNames) {
|
|
338
|
+
function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
|
|
338
339
|
const _startPath = _nullishCoalesce(startPath, () => ( process.cwd()));
|
|
340
|
+
if (endDirectoryNames.some((endDirName) => _fs.existsSync.call(void 0, _path.join.call(void 0, _startPath, endDirName)))) {
|
|
341
|
+
return _startPath;
|
|
342
|
+
}
|
|
339
343
|
if (endFileNames.some((endFileName) => _fs.existsSync.call(void 0, _path.join.call(void 0, _startPath, endFileName)))) {
|
|
340
344
|
return _startPath;
|
|
341
345
|
}
|
|
342
346
|
if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
|
|
343
347
|
const parent = _path.join.call(void 0, _startPath, "..");
|
|
344
|
-
return findFolderUp(parent, endFileNames);
|
|
348
|
+
return findFolderUp(parent, endFileNames, endDirectoryNames);
|
|
345
349
|
}
|
|
346
350
|
return void 0;
|
|
347
351
|
}
|
|
@@ -349,17 +353,17 @@ _chunkUSNT2KNTcjs.__name.call(void 0, findFolderUp, "findFolderUp");
|
|
|
349
353
|
|
|
350
354
|
// ../config-tools/src/utilities/find-workspace-root.ts
|
|
351
355
|
var rootFiles = [
|
|
352
|
-
"storm.json",
|
|
353
|
-
"storm.json",
|
|
354
|
-
"storm.yaml",
|
|
355
|
-
"storm.yml",
|
|
356
|
-
"storm.js",
|
|
357
|
-
"storm.ts",
|
|
358
|
-
".storm.json",
|
|
359
|
-
".storm.yaml",
|
|
360
|
-
".storm.yml",
|
|
361
|
-
".storm.js",
|
|
362
|
-
".storm.ts",
|
|
356
|
+
"storm-workspace.json",
|
|
357
|
+
"storm-workspace.json",
|
|
358
|
+
"storm-workspace.yaml",
|
|
359
|
+
"storm-workspace.yml",
|
|
360
|
+
"storm-workspace.js",
|
|
361
|
+
"storm-workspace.ts",
|
|
362
|
+
".storm-workspace.json",
|
|
363
|
+
".storm-workspace.yaml",
|
|
364
|
+
".storm-workspace.yml",
|
|
365
|
+
".storm-workspace.js",
|
|
366
|
+
".storm-workspace.ts",
|
|
363
367
|
"lerna.json",
|
|
364
368
|
"nx.json",
|
|
365
369
|
"turbo.json",
|
|
@@ -383,11 +387,18 @@ var rootFiles = [
|
|
|
383
387
|
"pnpm-lock.yml",
|
|
384
388
|
"bun.lockb"
|
|
385
389
|
];
|
|
390
|
+
var rootDirectories = [
|
|
391
|
+
".storm-workspace",
|
|
392
|
+
".nx",
|
|
393
|
+
".github",
|
|
394
|
+
".vscode",
|
|
395
|
+
".verdaccio"
|
|
396
|
+
];
|
|
386
397
|
function findWorkspaceRootSafe(pathInsideMonorepo) {
|
|
387
398
|
if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) {
|
|
388
399
|
return correctPaths(_nullishCoalesce(process.env.STORM_WORKSPACE_ROOT, () => ( process.env.NX_WORKSPACE_ROOT_PATH)));
|
|
389
400
|
}
|
|
390
|
-
return correctPaths(findFolderUp(_nullishCoalesce(pathInsideMonorepo, () => ( process.cwd())), rootFiles));
|
|
401
|
+
return correctPaths(findFolderUp(_nullishCoalesce(pathInsideMonorepo, () => ( process.cwd())), rootFiles, rootDirectories));
|
|
391
402
|
}
|
|
392
403
|
_chunkUSNT2KNTcjs.__name.call(void 0, findWorkspaceRootSafe, "findWorkspaceRootSafe");
|
|
393
404
|
function findWorkspaceRoot(pathInsideMonorepo) {
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
writeSuccess,
|
|
21
21
|
writeTrace,
|
|
22
22
|
writeWarning
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-EO2JNC24.js";
|
|
24
24
|
import {
|
|
25
25
|
DEFAULT_BUILD_OPTIONS
|
|
26
26
|
} from "./chunk-UQLCBJOS.js";
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
} from "./chunk-SHUYVCID.js";
|
|
30
30
|
|
|
31
31
|
// src/build.ts
|
|
32
|
-
import { createProjectGraphAsync, readProjectsConfigurationFromProjectGraph, writeJsonFile } from "@nx/devkit";
|
|
32
|
+
import { createProjectGraphAsync, readProjectsConfigurationFromProjectGraph as readProjectsConfigurationFromProjectGraph2, writeJsonFile } from "@nx/devkit";
|
|
33
33
|
|
|
34
34
|
// ../build-tools/src/config.ts
|
|
35
35
|
var DEFAULT_ENVIRONMENT = "production";
|
|
@@ -107,11 +107,12 @@ ${footer && typeof footer === "string" ? footer.startsWith("//") ? footer : `//
|
|
|
107
107
|
// ../build-tools/src/utilities/generate-package-json.ts
|
|
108
108
|
import { calculateProjectBuildableDependencies } from "@nx/js/src/utils/buildable-libs-utils";
|
|
109
109
|
import { Glob } from "glob";
|
|
110
|
-
import { existsSync } from "node:fs";
|
|
110
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
111
111
|
import { readFile as readFile2 } from "node:fs/promises";
|
|
112
|
-
import { readCachedProjectGraph } from "nx/src/project-graph/project-graph";
|
|
112
|
+
import { readCachedProjectGraph, readProjectsConfigurationFromProjectGraph } from "nx/src/project-graph/project-graph";
|
|
113
113
|
var addPackageDependencies = /* @__PURE__ */ __name(async (workspaceRoot, projectRoot, projectName, packageJson) => {
|
|
114
|
-
const
|
|
114
|
+
const projectGraph = readCachedProjectGraph();
|
|
115
|
+
const projectDependencies = calculateProjectBuildableDependencies(void 0, projectGraph, workspaceRoot, projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
|
|
115
116
|
const localPackages = [];
|
|
116
117
|
for (const project of projectDependencies.dependencies.filter((dep) => dep.node.type === "lib" && dep.node.data.root !== projectRoot && dep.node.data.root !== workspaceRoot)) {
|
|
117
118
|
const projectNode = project.node;
|
|
@@ -128,26 +129,38 @@ var addPackageDependencies = /* @__PURE__ */ __name(async (workspaceRoot, projec
|
|
|
128
129
|
}
|
|
129
130
|
if (localPackages.length > 0) {
|
|
130
131
|
writeTrace(`\u{1F4E6} Adding local packages to package.json: ${localPackages.map((p) => p.name).join(", ")}`);
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
132
|
+
const projectJsonFile = await readFile2(joinPaths(projectRoot, "project.json"), "utf8");
|
|
133
|
+
const projectJson = JSON.parse(projectJsonFile);
|
|
134
|
+
const projectName2 = projectJson.name;
|
|
135
|
+
const projectConfigurations = readProjectsConfigurationFromProjectGraph(projectGraph);
|
|
136
|
+
if (!projectConfigurations?.projects?.[projectName2]) {
|
|
137
|
+
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.");
|
|
138
|
+
}
|
|
139
|
+
const implicitDependencies = projectConfigurations.projects?.[projectName2].implicitDependencies?.reduce((ret, dep) => {
|
|
140
|
+
if (projectConfigurations.projects?.[dep]) {
|
|
141
|
+
const depPackageJsonPath = joinPaths(workspaceRoot, projectConfigurations.projects[dep].root, "package.json");
|
|
142
|
+
if (existsSync(depPackageJsonPath)) {
|
|
143
|
+
const depPackageJsonContent = readFileSync(depPackageJsonPath, "utf8");
|
|
144
|
+
const depPackageJson = JSON.parse(depPackageJsonContent);
|
|
145
|
+
if (depPackageJson.private !== true && !ret.includes(depPackageJson.name)) {
|
|
146
|
+
ret.push(depPackageJson.name);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
134
149
|
}
|
|
135
150
|
return ret;
|
|
136
|
-
},
|
|
137
|
-
packageJson.
|
|
138
|
-
if (!ret[localPackage.name]) {
|
|
139
|
-
ret[localPackage.name] = {
|
|
140
|
-
optional: false
|
|
141
|
-
};
|
|
151
|
+
}, []);
|
|
152
|
+
packageJson.dependencies = localPackages.reduce((ret, localPackage) => {
|
|
153
|
+
if (!ret[localPackage.name] && !implicitDependencies?.includes(localPackage.name)) {
|
|
154
|
+
ret[localPackage.name] = `>=${localPackage.version || "0.0.1"}`;
|
|
142
155
|
}
|
|
143
156
|
return ret;
|
|
144
|
-
}, packageJson.
|
|
157
|
+
}, packageJson.dependencies ?? {});
|
|
145
158
|
packageJson.devDependencies = localPackages.reduce((ret, localPackage) => {
|
|
146
|
-
if (!ret[localPackage.name]) {
|
|
159
|
+
if (!ret[localPackage.name] && implicitDependencies?.includes(localPackage.name)) {
|
|
147
160
|
ret[localPackage.name] = localPackage.version || "0.0.1";
|
|
148
161
|
}
|
|
149
162
|
return ret;
|
|
150
|
-
}, packageJson.
|
|
163
|
+
}, packageJson.devDependencies ?? {});
|
|
151
164
|
} else {
|
|
152
165
|
writeTrace("\u{1F4E6} No local packages dependencies to add to package.json");
|
|
153
166
|
}
|
|
@@ -253,10 +266,10 @@ var getConfigFileByName = /* @__PURE__ */ __name(async (fileName, filePath, opti
|
|
|
253
266
|
}, "getConfigFileByName");
|
|
254
267
|
var getConfigFile = /* @__PURE__ */ __name(async (filePath, additionalFileNames = []) => {
|
|
255
268
|
const workspacePath = filePath ? filePath : findWorkspaceRoot(filePath);
|
|
256
|
-
const result = await getConfigFileByName("storm", workspacePath);
|
|
269
|
+
const result = await getConfigFileByName("storm-workspace", workspacePath);
|
|
257
270
|
let config = result.config;
|
|
258
271
|
const configFile = result.configFile;
|
|
259
|
-
if (config && configFile && Object.keys(config).length > 0) {
|
|
272
|
+
if (config && configFile && Object.keys(config).length > 0 && !config.skipConfigLogging) {
|
|
260
273
|
writeTrace(`Found Storm configuration file "${configFile.includes(`${workspacePath}/`) ? configFile.replace(`${workspacePath}/`, "") : configFile}" at "${workspacePath}"`, {
|
|
261
274
|
logLevel: "all"
|
|
262
275
|
});
|
|
@@ -265,9 +278,11 @@ var getConfigFile = /* @__PURE__ */ __name(async (filePath, additionalFileNames
|
|
|
265
278
|
const results = await Promise.all(additionalFileNames.map((fileName) => getConfigFileByName(fileName, workspacePath)));
|
|
266
279
|
for (const result2 of results) {
|
|
267
280
|
if (result2?.config && result2?.configFile && Object.keys(result2.config).length > 0) {
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
281
|
+
if (!config.skipConfigLogging && !result2.config.skipConfigLogging) {
|
|
282
|
+
writeTrace(`Found alternative configuration file "${result2.configFile.includes(`${workspacePath}/`) ? result2.configFile.replace(`${workspacePath}/`, "") : result2.configFile}" at "${workspacePath}"`, {
|
|
283
|
+
logLevel: "all"
|
|
284
|
+
});
|
|
285
|
+
}
|
|
271
286
|
config = defu(result2.config ?? {}, config ?? {});
|
|
272
287
|
}
|
|
273
288
|
}
|
|
@@ -343,7 +358,8 @@ var getConfigEnv = /* @__PURE__ */ __name(() => {
|
|
|
343
358
|
cyclone: process.env[`${prefix}REGISTRY_CYCLONE`] || void 0,
|
|
344
359
|
container: process.env[`${prefix}REGISTRY_CONTAINER`] || void 0
|
|
345
360
|
},
|
|
346
|
-
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
|
|
361
|
+
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,
|
|
362
|
+
skipConfigLogging: process.env[`${prefix}SKIP_CONFIG_LOGGING`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CONFIG_LOGGING`]) : void 0
|
|
347
363
|
};
|
|
348
364
|
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}`)));
|
|
349
365
|
config.colors = themeNames.length > 0 ? themeNames.reduce((ret, themeName) => {
|
|
@@ -578,6 +594,9 @@ var setConfigEnv = /* @__PURE__ */ __name((config) => {
|
|
|
578
594
|
process.env.NX_VERBOSE_LOGGING = String(getLogLevel(config.logLevel) >= LogLevel.DEBUG ? true : false);
|
|
579
595
|
process.env.RUST_BACKTRACE = getLogLevel(config.logLevel) >= LogLevel.DEBUG ? "full" : "none";
|
|
580
596
|
}
|
|
597
|
+
if (config.skipConfigLogging !== void 0) {
|
|
598
|
+
process.env[`${prefix}SKIP_CONFIG_LOGGING`] = String(config.skipConfigLogging);
|
|
599
|
+
}
|
|
581
600
|
process.env[`${prefix}CONFIG`] = JSON.stringify(config);
|
|
582
601
|
for (const key of Object.keys(config.extensions ?? {})) {
|
|
583
602
|
config.extensions[key] && Object.keys(config.extensions[key]) && setExtensionEnv(key, config.extensions[key]);
|
|
@@ -695,7 +714,7 @@ var createStormConfig = /* @__PURE__ */ __name(async (extensionName, schema, wor
|
|
|
695
714
|
const defaultConfig = await getDefaultConfig(_workspaceRoot);
|
|
696
715
|
const configFile = await getConfigFile(_workspaceRoot);
|
|
697
716
|
if (!configFile && !skipLogs) {
|
|
698
|
-
writeWarning("No Storm
|
|
717
|
+
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", {
|
|
699
718
|
logLevel: "all"
|
|
700
719
|
});
|
|
701
720
|
}
|
|
@@ -733,8 +752,8 @@ var createConfigExtension = /* @__PURE__ */ __name((extensionName, schema) => {
|
|
|
733
752
|
var loadStormConfig = /* @__PURE__ */ __name(async (workspaceRoot, skipLogs = false) => {
|
|
734
753
|
const config = await createStormConfig(void 0, void 0, workspaceRoot, skipLogs);
|
|
735
754
|
setConfigEnv(config);
|
|
736
|
-
if (!skipLogs) {
|
|
737
|
-
writeTrace(`\u2699\uFE0F Using Storm configuration:
|
|
755
|
+
if (!skipLogs && !config.skipConfigLogging) {
|
|
756
|
+
writeTrace(`\u2699\uFE0F Using Storm Workspace configuration:
|
|
738
757
|
${formatLogMessage(config)}`, config);
|
|
739
758
|
}
|
|
740
759
|
return config;
|
|
@@ -831,7 +850,7 @@ var resolveOptions = /* @__PURE__ */ __name(async (userOptions) => {
|
|
|
831
850
|
const projectJsonFile = await hf.readFile(projectJsonPath, "utf8");
|
|
832
851
|
const projectJson = JSON.parse(projectJsonFile);
|
|
833
852
|
const projectName = projectJson.name;
|
|
834
|
-
const projectConfigurations =
|
|
853
|
+
const projectConfigurations = readProjectsConfigurationFromProjectGraph2(projectGraph);
|
|
835
854
|
if (!projectConfigurations?.projects?.[projectName]) {
|
|
836
855
|
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.");
|
|
837
856
|
}
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
var
|
|
23
|
+
var _chunkJXYBDFPKcjs = require('./chunk-JXYBDFPK.cjs');
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
var _chunk5KRF6IVWcjs = require('./chunk-5KRF6IVW.cjs');
|
|
@@ -79,8 +79,8 @@ var copyAssets = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async (co
|
|
|
79
79
|
output: "src/"
|
|
80
80
|
});
|
|
81
81
|
}
|
|
82
|
-
|
|
83
|
-
${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${pendingAsset} -> ${outputPath}` : ` - ${pendingAsset.input}/${pendingAsset.glob} -> ${
|
|
82
|
+
_chunkJXYBDFPKcjs.writeTrace.call(void 0, `\u{1F4DD} Copying the following assets to the output directory:
|
|
83
|
+
${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${pendingAsset} -> ${outputPath}` : ` - ${pendingAsset.input}/${pendingAsset.glob} -> ${_chunkJXYBDFPKcjs.joinPaths.call(void 0, outputPath, pendingAsset.output)}`).join("\n")}`, config);
|
|
84
84
|
const assetHandler = new (0, _copyassetshandler.CopyAssetsHandler)({
|
|
85
85
|
projectDir: projectRoot,
|
|
86
86
|
rootDir: config.workspaceRoot,
|
|
@@ -89,12 +89,12 @@ ${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${p
|
|
|
89
89
|
});
|
|
90
90
|
await assetHandler.processAllAssetsOnce();
|
|
91
91
|
if (includeSrc === true) {
|
|
92
|
-
|
|
92
|
+
_chunkJXYBDFPKcjs.writeDebug.call(void 0, `\u{1F4DD} Adding banner and writing source files: ${_chunkJXYBDFPKcjs.joinPaths.call(void 0, outputPath, "src")}`, config);
|
|
93
93
|
const files = await _glob.glob.call(void 0, [
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
94
|
+
_chunkJXYBDFPKcjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.ts"),
|
|
95
|
+
_chunkJXYBDFPKcjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.tsx"),
|
|
96
|
+
_chunkJXYBDFPKcjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.js"),
|
|
97
|
+
_chunkJXYBDFPKcjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.jsx")
|
|
98
98
|
]);
|
|
99
99
|
await Promise.allSettled(files.map(async (file) => _promises.writeFile.call(void 0, file, `${banner && typeof banner === "string" ? banner.startsWith("//") ? banner : `// ${banner}` : ""}
|
|
100
100
|
|
|
@@ -111,12 +111,13 @@ var _buildablelibsutils = require('@nx/js/src/utils/buildable-libs-utils');
|
|
|
111
111
|
|
|
112
112
|
var _projectgraph = require('nx/src/project-graph/project-graph');
|
|
113
113
|
var addPackageDependencies = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async (workspaceRoot, projectRoot, projectName, packageJson) => {
|
|
114
|
-
const
|
|
114
|
+
const projectGraph = _projectgraph.readCachedProjectGraph.call(void 0, );
|
|
115
|
+
const projectDependencies = _buildablelibsutils.calculateProjectBuildableDependencies.call(void 0, void 0, projectGraph, workspaceRoot, projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
|
|
115
116
|
const localPackages = [];
|
|
116
117
|
for (const project of projectDependencies.dependencies.filter((dep) => dep.node.type === "lib" && dep.node.data.root !== projectRoot && dep.node.data.root !== workspaceRoot)) {
|
|
117
118
|
const projectNode = project.node;
|
|
118
119
|
if (projectNode.data.root) {
|
|
119
|
-
const projectPackageJsonPath =
|
|
120
|
+
const projectPackageJsonPath = _chunkJXYBDFPKcjs.joinPaths.call(void 0, workspaceRoot, projectNode.data.root, "package.json");
|
|
120
121
|
if (_fs.existsSync.call(void 0, projectPackageJsonPath)) {
|
|
121
122
|
const projectPackageJsonContent = await _promises.readFile.call(void 0, projectPackageJsonPath, "utf8");
|
|
122
123
|
const projectPackageJson = JSON.parse(projectPackageJsonContent);
|
|
@@ -127,35 +128,47 @@ var addPackageDependencies = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void
|
|
|
127
128
|
}
|
|
128
129
|
}
|
|
129
130
|
if (localPackages.length > 0) {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
131
|
+
_chunkJXYBDFPKcjs.writeTrace.call(void 0, `\u{1F4E6} Adding local packages to package.json: ${localPackages.map((p) => p.name).join(", ")}`);
|
|
132
|
+
const projectJsonFile = await _promises.readFile.call(void 0, _chunkJXYBDFPKcjs.joinPaths.call(void 0, projectRoot, "project.json"), "utf8");
|
|
133
|
+
const projectJson = JSON.parse(projectJsonFile);
|
|
134
|
+
const projectName2 = projectJson.name;
|
|
135
|
+
const projectConfigurations = _projectgraph.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
|
|
136
|
+
if (!_optionalChain([projectConfigurations, 'optionalAccess', _ => _.projects, 'optionalAccess', _2 => _2[projectName2]])) {
|
|
137
|
+
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.");
|
|
138
|
+
}
|
|
139
|
+
const implicitDependencies = _optionalChain([projectConfigurations, 'access', _3 => _3.projects, 'optionalAccess', _4 => _4[projectName2], 'access', _5 => _5.implicitDependencies, 'optionalAccess', _6 => _6.reduce, 'call', _7 => _7((ret, dep) => {
|
|
140
|
+
if (_optionalChain([projectConfigurations, 'access', _8 => _8.projects, 'optionalAccess', _9 => _9[dep]])) {
|
|
141
|
+
const depPackageJsonPath = _chunkJXYBDFPKcjs.joinPaths.call(void 0, workspaceRoot, projectConfigurations.projects[dep].root, "package.json");
|
|
142
|
+
if (_fs.existsSync.call(void 0, depPackageJsonPath)) {
|
|
143
|
+
const depPackageJsonContent = _fs.readFileSync.call(void 0, depPackageJsonPath, "utf8");
|
|
144
|
+
const depPackageJson = JSON.parse(depPackageJsonContent);
|
|
145
|
+
if (depPackageJson.private !== true && !ret.includes(depPackageJson.name)) {
|
|
146
|
+
ret.push(depPackageJson.name);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
134
149
|
}
|
|
135
150
|
return ret;
|
|
136
|
-
},
|
|
137
|
-
packageJson.
|
|
138
|
-
if (!ret[localPackage.name]) {
|
|
139
|
-
ret[localPackage.name] = {
|
|
140
|
-
optional: false
|
|
141
|
-
};
|
|
151
|
+
}, [])]);
|
|
152
|
+
packageJson.dependencies = localPackages.reduce((ret, localPackage) => {
|
|
153
|
+
if (!ret[localPackage.name] && !_optionalChain([implicitDependencies, 'optionalAccess', _10 => _10.includes, 'call', _11 => _11(localPackage.name)])) {
|
|
154
|
+
ret[localPackage.name] = `>=${localPackage.version || "0.0.1"}`;
|
|
142
155
|
}
|
|
143
156
|
return ret;
|
|
144
|
-
}, _nullishCoalesce(packageJson.
|
|
157
|
+
}, _nullishCoalesce(packageJson.dependencies, () => ( {})));
|
|
145
158
|
packageJson.devDependencies = localPackages.reduce((ret, localPackage) => {
|
|
146
|
-
if (!ret[localPackage.name]) {
|
|
159
|
+
if (!ret[localPackage.name] && _optionalChain([implicitDependencies, 'optionalAccess', _12 => _12.includes, 'call', _13 => _13(localPackage.name)])) {
|
|
147
160
|
ret[localPackage.name] = localPackage.version || "0.0.1";
|
|
148
161
|
}
|
|
149
162
|
return ret;
|
|
150
|
-
}, _nullishCoalesce(packageJson.
|
|
163
|
+
}, _nullishCoalesce(packageJson.devDependencies, () => ( {})));
|
|
151
164
|
} else {
|
|
152
|
-
|
|
165
|
+
_chunkJXYBDFPKcjs.writeTrace.call(void 0, "\u{1F4E6} No local packages dependencies to add to package.json");
|
|
153
166
|
}
|
|
154
167
|
return packageJson;
|
|
155
168
|
}, "addPackageDependencies");
|
|
156
169
|
var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async (config, projectRoot, sourceRoot, projectName, includeSrc = false, packageJson) => {
|
|
157
|
-
const workspaceRoot = config.workspaceRoot ? config.workspaceRoot :
|
|
158
|
-
const workspacePackageJsonContent = await _promises.readFile.call(void 0,
|
|
170
|
+
const workspaceRoot = config.workspaceRoot ? config.workspaceRoot : _chunkJXYBDFPKcjs.findWorkspaceRoot.call(void 0, );
|
|
171
|
+
const workspacePackageJsonContent = await _promises.readFile.call(void 0, _chunkJXYBDFPKcjs.joinPaths.call(void 0, workspaceRoot, "package.json"), "utf8");
|
|
159
172
|
const workspacePackageJson = JSON.parse(workspacePackageJsonContent);
|
|
160
173
|
packageJson.type ??= "module";
|
|
161
174
|
packageJson.sideEffects ??= false;
|
|
@@ -164,7 +177,7 @@ var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.cal
|
|
|
164
177
|
if (distSrc.startsWith("/")) {
|
|
165
178
|
distSrc = distSrc.substring(1);
|
|
166
179
|
}
|
|
167
|
-
packageJson.source ??= `${
|
|
180
|
+
packageJson.source ??= `${_chunkJXYBDFPKcjs.joinPaths.call(void 0, distSrc, "index.ts").replaceAll("\\", "/")}`;
|
|
168
181
|
}
|
|
169
182
|
packageJson.files ??= [
|
|
170
183
|
"dist/**/*"
|
|
@@ -195,7 +208,7 @@ var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.cal
|
|
|
195
208
|
];
|
|
196
209
|
}
|
|
197
210
|
packageJson.repository ??= workspacePackageJson.repository;
|
|
198
|
-
packageJson.repository.directory ??= projectRoot ? projectRoot :
|
|
211
|
+
packageJson.repository.directory ??= projectRoot ? projectRoot : _chunkJXYBDFPKcjs.joinPaths.call(void 0, "packages", projectName);
|
|
199
212
|
return packageJson;
|
|
200
213
|
}, "addWorkspacePackageJsonFields");
|
|
201
214
|
var addPackageJsonExport = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (file, type = "module", sourceRoot) => {
|
|
@@ -223,16 +236,16 @@ var addPackageJsonExport = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0,
|
|
|
223
236
|
var _c12 = require('c12');
|
|
224
237
|
var _defu = require('defu'); var _defu2 = _interopRequireDefault(_defu);
|
|
225
238
|
var getConfigFileByName = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async (fileName, filePath, options = {}) => {
|
|
226
|
-
const workspacePath = filePath ||
|
|
239
|
+
const workspacePath = filePath || _chunkJXYBDFPKcjs.findWorkspaceRoot.call(void 0, filePath);
|
|
227
240
|
const configs = await Promise.all([
|
|
228
241
|
_c12.loadConfig.call(void 0, {
|
|
229
242
|
cwd: workspacePath,
|
|
230
243
|
packageJson: true,
|
|
231
244
|
name: fileName,
|
|
232
|
-
envName: _optionalChain([fileName, 'optionalAccess',
|
|
245
|
+
envName: _optionalChain([fileName, 'optionalAccess', _14 => _14.toUpperCase, 'call', _15 => _15()]),
|
|
233
246
|
jitiOptions: {
|
|
234
247
|
debug: false,
|
|
235
|
-
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false :
|
|
248
|
+
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : _chunkJXYBDFPKcjs.joinPaths.call(void 0, process.env.STORM_CACHE_DIR || "node_modules/.cache/storm", "jiti")
|
|
236
249
|
},
|
|
237
250
|
...options
|
|
238
251
|
}),
|
|
@@ -240,10 +253,10 @@ var getConfigFileByName = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0,
|
|
|
240
253
|
cwd: workspacePath,
|
|
241
254
|
packageJson: true,
|
|
242
255
|
name: fileName,
|
|
243
|
-
envName: _optionalChain([fileName, 'optionalAccess',
|
|
256
|
+
envName: _optionalChain([fileName, 'optionalAccess', _16 => _16.toUpperCase, 'call', _17 => _17()]),
|
|
244
257
|
jitiOptions: {
|
|
245
258
|
debug: false,
|
|
246
|
-
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false :
|
|
259
|
+
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : _chunkJXYBDFPKcjs.joinPaths.call(void 0, process.env.STORM_CACHE_DIR || "node_modules/.cache/storm", "jiti")
|
|
247
260
|
},
|
|
248
261
|
configFile: fileName,
|
|
249
262
|
...options
|
|
@@ -252,22 +265,24 @@ var getConfigFileByName = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0,
|
|
|
252
265
|
return _defu2.default.call(void 0, _nullishCoalesce(configs[0], () => ( {})), _nullishCoalesce(configs[1], () => ( {})));
|
|
253
266
|
}, "getConfigFileByName");
|
|
254
267
|
var getConfigFile = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async (filePath, additionalFileNames = []) => {
|
|
255
|
-
const workspacePath = filePath ? filePath :
|
|
256
|
-
const result = await getConfigFileByName("storm", workspacePath);
|
|
268
|
+
const workspacePath = filePath ? filePath : _chunkJXYBDFPKcjs.findWorkspaceRoot.call(void 0, filePath);
|
|
269
|
+
const result = await getConfigFileByName("storm-workspace", workspacePath);
|
|
257
270
|
let config = result.config;
|
|
258
271
|
const configFile = result.configFile;
|
|
259
|
-
if (config && configFile && Object.keys(config).length > 0) {
|
|
260
|
-
|
|
272
|
+
if (config && configFile && Object.keys(config).length > 0 && !config.skipConfigLogging) {
|
|
273
|
+
_chunkJXYBDFPKcjs.writeTrace.call(void 0, `Found Storm configuration file "${configFile.includes(`${workspacePath}/`) ? configFile.replace(`${workspacePath}/`, "") : configFile}" at "${workspacePath}"`, {
|
|
261
274
|
logLevel: "all"
|
|
262
275
|
});
|
|
263
276
|
}
|
|
264
277
|
if (additionalFileNames && additionalFileNames.length > 0) {
|
|
265
278
|
const results = await Promise.all(additionalFileNames.map((fileName) => getConfigFileByName(fileName, workspacePath)));
|
|
266
279
|
for (const result2 of results) {
|
|
267
|
-
if (_optionalChain([result2, 'optionalAccess',
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
280
|
+
if (_optionalChain([result2, 'optionalAccess', _18 => _18.config]) && _optionalChain([result2, 'optionalAccess', _19 => _19.configFile]) && Object.keys(result2.config).length > 0) {
|
|
281
|
+
if (!config.skipConfigLogging && !result2.config.skipConfigLogging) {
|
|
282
|
+
_chunkJXYBDFPKcjs.writeTrace.call(void 0, `Found alternative configuration file "${result2.configFile.includes(`${workspacePath}/`) ? result2.configFile.replace(`${workspacePath}/`, "") : result2.configFile}" at "${workspacePath}"`, {
|
|
283
|
+
logLevel: "all"
|
|
284
|
+
});
|
|
285
|
+
}
|
|
271
286
|
config = _defu2.default.call(void 0, _nullishCoalesce(result2.config, () => ( {})), _nullishCoalesce(config, () => ( {})));
|
|
272
287
|
}
|
|
273
288
|
}
|
|
@@ -312,15 +327,15 @@ var getConfigEnv = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, () => {
|
|
|
312
327
|
licensing: process.env[`${prefix}LICENSING`] || void 0,
|
|
313
328
|
timezone: process.env[`${prefix}TIMEZONE`] || process.env.TZ || void 0,
|
|
314
329
|
locale: process.env[`${prefix}LOCALE`] || process.env.LOCALE || void 0,
|
|
315
|
-
configFile: process.env[`${prefix}CONFIG_FILE`] ?
|
|
316
|
-
workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`] ?
|
|
330
|
+
configFile: process.env[`${prefix}CONFIG_FILE`] ? _chunkJXYBDFPKcjs.correctPaths.call(void 0, process.env[`${prefix}CONFIG_FILE`]) : void 0,
|
|
331
|
+
workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`] ? _chunkJXYBDFPKcjs.correctPaths.call(void 0, process.env[`${prefix}WORKSPACE_ROOT`]) : void 0,
|
|
317
332
|
directories: {
|
|
318
|
-
cache: process.env[`${prefix}CACHE_DIR`] ?
|
|
319
|
-
data: process.env[`${prefix}DATA_DIR`] ?
|
|
320
|
-
config: process.env[`${prefix}CONFIG_DIR`] ?
|
|
321
|
-
temp: process.env[`${prefix}TEMP_DIR`] ?
|
|
322
|
-
log: process.env[`${prefix}LOG_DIR`] ?
|
|
323
|
-
build: process.env[`${prefix}BUILD_DIR`] ?
|
|
333
|
+
cache: process.env[`${prefix}CACHE_DIR`] ? _chunkJXYBDFPKcjs.correctPaths.call(void 0, process.env[`${prefix}CACHE_DIR`]) : void 0,
|
|
334
|
+
data: process.env[`${prefix}DATA_DIR`] ? _chunkJXYBDFPKcjs.correctPaths.call(void 0, process.env[`${prefix}DATA_DIR`]) : void 0,
|
|
335
|
+
config: process.env[`${prefix}CONFIG_DIR`] ? _chunkJXYBDFPKcjs.correctPaths.call(void 0, process.env[`${prefix}CONFIG_DIR`]) : void 0,
|
|
336
|
+
temp: process.env[`${prefix}TEMP_DIR`] ? _chunkJXYBDFPKcjs.correctPaths.call(void 0, process.env[`${prefix}TEMP_DIR`]) : void 0,
|
|
337
|
+
log: process.env[`${prefix}LOG_DIR`] ? _chunkJXYBDFPKcjs.correctPaths.call(void 0, process.env[`${prefix}LOG_DIR`]) : void 0,
|
|
338
|
+
build: process.env[`${prefix}BUILD_DIR`] ? _chunkJXYBDFPKcjs.correctPaths.call(void 0, process.env[`${prefix}BUILD_DIR`]) : void 0
|
|
324
339
|
},
|
|
325
340
|
skipCache: process.env[`${prefix}SKIP_CACHE`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CACHE`]) : void 0,
|
|
326
341
|
env: (_nullishCoalesce(_nullishCoalesce(process.env[`${prefix}ENV`], () => ( process.env.NODE_ENV)), () => ( process.env.ENVIRONMENT))) || void 0,
|
|
@@ -343,23 +358,24 @@ var getConfigEnv = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, () => {
|
|
|
343
358
|
cyclone: process.env[`${prefix}REGISTRY_CYCLONE`] || void 0,
|
|
344
359
|
container: process.env[`${prefix}REGISTRY_CONTAINER`] || void 0
|
|
345
360
|
},
|
|
346
|
-
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`])) ?
|
|
361
|
+
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`])) ? _chunkJXYBDFPKcjs.getLogLevelLabel.call(void 0, Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) : process.env[`${prefix}LOG_LEVEL`] : void 0,
|
|
362
|
+
skipConfigLogging: process.env[`${prefix}SKIP_CONFIG_LOGGING`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CONFIG_LOGGING`]) : void 0
|
|
347
363
|
};
|
|
348
|
-
const themeNames = Object.keys(process.env).filter((envKey) => envKey.startsWith(`${prefix}COLOR_`) &&
|
|
364
|
+
const themeNames = Object.keys(process.env).filter((envKey) => envKey.startsWith(`${prefix}COLOR_`) && _chunkJXYBDFPKcjs.COLOR_KEYS.every((colorKey) => !envKey.startsWith(`${prefix}COLOR_LIGHT_${colorKey}`) && !envKey.startsWith(`${prefix}COLOR_DARK_${colorKey}`)));
|
|
349
365
|
config.colors = themeNames.length > 0 ? themeNames.reduce((ret, themeName) => {
|
|
350
366
|
ret[themeName] = getThemeColorConfigEnv(prefix, themeName);
|
|
351
367
|
return ret;
|
|
352
368
|
}, {}) : getThemeColorConfigEnv(prefix);
|
|
353
|
-
if (config.docs ===
|
|
354
|
-
if (config.homepage ===
|
|
355
|
-
config.docs = `${
|
|
369
|
+
if (config.docs === _chunkJXYBDFPKcjs.STORM_DEFAULT_DOCS) {
|
|
370
|
+
if (config.homepage === _chunkJXYBDFPKcjs.STORM_DEFAULT_HOMEPAGE) {
|
|
371
|
+
config.docs = `${_chunkJXYBDFPKcjs.STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/docs`;
|
|
356
372
|
} else {
|
|
357
373
|
config.docs = `${config.homepage}/docs`;
|
|
358
374
|
}
|
|
359
375
|
}
|
|
360
|
-
if (config.licensing ===
|
|
361
|
-
if (config.homepage ===
|
|
362
|
-
config.licensing = `${
|
|
376
|
+
if (config.licensing === _chunkJXYBDFPKcjs.STORM_DEFAULT_LICENSING) {
|
|
377
|
+
if (config.homepage === _chunkJXYBDFPKcjs.STORM_DEFAULT_HOMEPAGE) {
|
|
378
|
+
config.licensing = `${_chunkJXYBDFPKcjs.STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/licensing`;
|
|
363
379
|
} else {
|
|
364
380
|
config.licensing = `${config.homepage}/docs`;
|
|
365
381
|
}
|
|
@@ -433,13 +449,13 @@ var getBaseThemeColorConfigEnv = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(v
|
|
|
433
449
|
var setExtensionEnv = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (extensionName, extension) => {
|
|
434
450
|
for (const key of Object.keys(_nullishCoalesce(extension, () => ( {})))) {
|
|
435
451
|
if (extension[key]) {
|
|
436
|
-
const result = _nullishCoalesce(_optionalChain([key, 'optionalAccess',
|
|
452
|
+
const result = _nullishCoalesce(_optionalChain([key, 'optionalAccess', _20 => _20.replace, 'call', _21 => _21(/([A-Z])+/g, (input) => input ? _optionalChain([input, 'access', _22 => _22[0], 'optionalAccess', _23 => _23.toUpperCase, 'call', _24 => _24()]) + input.slice(1) : ""), 'access', _25 => _25.split, 'call', _26 => _26(/(?=[A-Z])|[.\-\s_]/), 'access', _27 => _27.map, 'call', _28 => _28((x) => x.toLowerCase())]), () => ( []));
|
|
437
453
|
let extensionKey;
|
|
438
454
|
if (result.length === 0) {
|
|
439
455
|
return;
|
|
440
456
|
}
|
|
441
457
|
if (result.length === 1) {
|
|
442
|
-
extensionKey = _nullishCoalesce(_optionalChain([result, 'access',
|
|
458
|
+
extensionKey = _nullishCoalesce(_optionalChain([result, 'access', _29 => _29[0], 'optionalAccess', _30 => _30.toUpperCase, 'call', _31 => _31()]), () => ( ""));
|
|
443
459
|
} else {
|
|
444
460
|
extensionKey = result.reduce((ret, part) => {
|
|
445
461
|
return `${ret}_${part.toLowerCase()}`;
|
|
@@ -497,31 +513,31 @@ var setConfigEnv = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (config
|
|
|
497
513
|
process.env.LANG = config.locale ? `${config.locale.replaceAll("-", "_")}.UTF-8` : "en_US.UTF-8";
|
|
498
514
|
}
|
|
499
515
|
if (config.configFile) {
|
|
500
|
-
process.env[`${prefix}CONFIG_FILE`] =
|
|
516
|
+
process.env[`${prefix}CONFIG_FILE`] = _chunkJXYBDFPKcjs.correctPaths.call(void 0, config.configFile);
|
|
501
517
|
}
|
|
502
518
|
if (config.workspaceRoot) {
|
|
503
|
-
process.env[`${prefix}WORKSPACE_ROOT`] =
|
|
504
|
-
process.env.NX_WORKSPACE_ROOT =
|
|
505
|
-
process.env.NX_WORKSPACE_ROOT_PATH =
|
|
519
|
+
process.env[`${prefix}WORKSPACE_ROOT`] = _chunkJXYBDFPKcjs.correctPaths.call(void 0, config.workspaceRoot);
|
|
520
|
+
process.env.NX_WORKSPACE_ROOT = _chunkJXYBDFPKcjs.correctPaths.call(void 0, config.workspaceRoot);
|
|
521
|
+
process.env.NX_WORKSPACE_ROOT_PATH = _chunkJXYBDFPKcjs.correctPaths.call(void 0, config.workspaceRoot);
|
|
506
522
|
}
|
|
507
523
|
if (config.directories) {
|
|
508
524
|
if (!config.skipCache && config.directories.cache) {
|
|
509
|
-
process.env[`${prefix}CACHE_DIR`] =
|
|
525
|
+
process.env[`${prefix}CACHE_DIR`] = _chunkJXYBDFPKcjs.correctPaths.call(void 0, config.directories.cache);
|
|
510
526
|
}
|
|
511
527
|
if (config.directories.data) {
|
|
512
|
-
process.env[`${prefix}DATA_DIR`] =
|
|
528
|
+
process.env[`${prefix}DATA_DIR`] = _chunkJXYBDFPKcjs.correctPaths.call(void 0, config.directories.data);
|
|
513
529
|
}
|
|
514
530
|
if (config.directories.config) {
|
|
515
|
-
process.env[`${prefix}CONFIG_DIR`] =
|
|
531
|
+
process.env[`${prefix}CONFIG_DIR`] = _chunkJXYBDFPKcjs.correctPaths.call(void 0, config.directories.config);
|
|
516
532
|
}
|
|
517
533
|
if (config.directories.temp) {
|
|
518
|
-
process.env[`${prefix}TEMP_DIR`] =
|
|
534
|
+
process.env[`${prefix}TEMP_DIR`] = _chunkJXYBDFPKcjs.correctPaths.call(void 0, config.directories.temp);
|
|
519
535
|
}
|
|
520
536
|
if (config.directories.log) {
|
|
521
|
-
process.env[`${prefix}LOG_DIR`] =
|
|
537
|
+
process.env[`${prefix}LOG_DIR`] = _chunkJXYBDFPKcjs.correctPaths.call(void 0, config.directories.log);
|
|
522
538
|
}
|
|
523
539
|
if (config.directories.build) {
|
|
524
|
-
process.env[`${prefix}BUILD_DIR`] =
|
|
540
|
+
process.env[`${prefix}BUILD_DIR`] = _chunkJXYBDFPKcjs.correctPaths.call(void 0, config.directories.build);
|
|
525
541
|
}
|
|
526
542
|
}
|
|
527
543
|
if (config.skipCache !== void 0) {
|
|
@@ -536,7 +552,7 @@ var setConfigEnv = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (config
|
|
|
536
552
|
process.env.NODE_ENV = config.env;
|
|
537
553
|
process.env.ENVIRONMENT = config.env;
|
|
538
554
|
}
|
|
539
|
-
if (_optionalChain([config, 'access',
|
|
555
|
+
if (_optionalChain([config, 'access', _32 => _32.colors, 'optionalAccess', _33 => _33.base, 'optionalAccess', _34 => _34.light]) || _optionalChain([config, 'access', _35 => _35.colors, 'optionalAccess', _36 => _36.base, 'optionalAccess', _37 => _37.dark])) {
|
|
540
556
|
for (const key of Object.keys(config.colors)) {
|
|
541
557
|
setThemeColorConfigEnv(`${prefix}COLOR_${key}_`, config.colors[key]);
|
|
542
558
|
}
|
|
@@ -575,8 +591,11 @@ var setConfigEnv = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (config
|
|
|
575
591
|
if (config.logLevel) {
|
|
576
592
|
process.env[`${prefix}LOG_LEVEL`] = String(config.logLevel);
|
|
577
593
|
process.env.LOG_LEVEL = String(config.logLevel);
|
|
578
|
-
process.env.NX_VERBOSE_LOGGING = String(
|
|
579
|
-
process.env.RUST_BACKTRACE =
|
|
594
|
+
process.env.NX_VERBOSE_LOGGING = String(_chunkJXYBDFPKcjs.getLogLevel.call(void 0, config.logLevel) >= _chunkJXYBDFPKcjs.LogLevel.DEBUG ? true : false);
|
|
595
|
+
process.env.RUST_BACKTRACE = _chunkJXYBDFPKcjs.getLogLevel.call(void 0, config.logLevel) >= _chunkJXYBDFPKcjs.LogLevel.DEBUG ? "full" : "none";
|
|
596
|
+
}
|
|
597
|
+
if (config.skipConfigLogging !== void 0) {
|
|
598
|
+
process.env[`${prefix}SKIP_CONFIG_LOGGING`] = String(config.skipConfigLogging);
|
|
580
599
|
}
|
|
581
600
|
process.env[`${prefix}CONFIG`] = JSON.stringify(config);
|
|
582
601
|
for (const key of Object.keys(_nullishCoalesce(config.extensions, () => ( {})))) {
|
|
@@ -584,7 +603,7 @@ var setConfigEnv = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (config
|
|
|
584
603
|
}
|
|
585
604
|
}, "setConfigEnv");
|
|
586
605
|
var setThemeColorConfigEnv = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (prefix, config) => {
|
|
587
|
-
return _optionalChain([config, 'optionalAccess',
|
|
606
|
+
return _optionalChain([config, 'optionalAccess', _38 => _38.light, 'optionalAccess', _39 => _39.brand]) || _optionalChain([config, 'optionalAccess', _40 => _40.dark, 'optionalAccess', _41 => _41.brand]) ? setMultiThemeColorConfigEnv(prefix, config) : setSingleThemeColorConfigEnv(prefix, config);
|
|
588
607
|
}, "setThemeColorConfigEnv");
|
|
589
608
|
var setSingleThemeColorConfigEnv = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (prefix, config) => {
|
|
590
609
|
if (config.dark) {
|
|
@@ -686,20 +705,20 @@ var _extension_cache = /* @__PURE__ */ new WeakMap();
|
|
|
686
705
|
var _static_cache = void 0;
|
|
687
706
|
var createStormConfig = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async (extensionName, schema, workspaceRoot, skipLogs = false) => {
|
|
688
707
|
let result;
|
|
689
|
-
if (!_optionalChain([_static_cache, 'optionalAccess',
|
|
708
|
+
if (!_optionalChain([_static_cache, 'optionalAccess', _42 => _42.data]) || !_optionalChain([_static_cache, 'optionalAccess', _43 => _43.timestamp]) || _static_cache.timestamp < Date.now() - 8e3) {
|
|
690
709
|
let _workspaceRoot = workspaceRoot;
|
|
691
710
|
if (!_workspaceRoot) {
|
|
692
|
-
_workspaceRoot =
|
|
711
|
+
_workspaceRoot = _chunkJXYBDFPKcjs.findWorkspaceRoot.call(void 0, );
|
|
693
712
|
}
|
|
694
713
|
const configEnv = getConfigEnv();
|
|
695
|
-
const defaultConfig = await
|
|
714
|
+
const defaultConfig = await _chunkJXYBDFPKcjs.getDefaultConfig.call(void 0, _workspaceRoot);
|
|
696
715
|
const configFile = await getConfigFile(_workspaceRoot);
|
|
697
716
|
if (!configFile && !skipLogs) {
|
|
698
|
-
|
|
717
|
+
_chunkJXYBDFPKcjs.writeWarning.call(void 0, "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", {
|
|
699
718
|
logLevel: "all"
|
|
700
719
|
});
|
|
701
720
|
}
|
|
702
|
-
result = await
|
|
721
|
+
result = await _chunkJXYBDFPKcjs.StormConfigSchema.parseAsync(_defu2.default.call(void 0, configEnv, configFile, defaultConfig));
|
|
703
722
|
result.workspaceRoot ??= _workspaceRoot;
|
|
704
723
|
} else {
|
|
705
724
|
result = _static_cache.data;
|
|
@@ -733,9 +752,9 @@ var createConfigExtension = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0
|
|
|
733
752
|
var loadStormConfig = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async (workspaceRoot, skipLogs = false) => {
|
|
734
753
|
const config = await createStormConfig(void 0, void 0, workspaceRoot, skipLogs);
|
|
735
754
|
setConfigEnv(config);
|
|
736
|
-
if (!skipLogs) {
|
|
737
|
-
|
|
738
|
-
${
|
|
755
|
+
if (!skipLogs && !config.skipConfigLogging) {
|
|
756
|
+
_chunkJXYBDFPKcjs.writeTrace.call(void 0, `\u2699\uFE0F Using Storm Workspace configuration:
|
|
757
|
+
${_chunkJXYBDFPKcjs.formatLogMessage.call(void 0, config)}`, config);
|
|
739
758
|
}
|
|
740
759
|
return config;
|
|
741
760
|
}, "loadStormConfig");
|
|
@@ -748,7 +767,7 @@ var getConfig = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (workspace
|
|
|
748
767
|
// ../build-tools/src/utilities/get-entry-points.ts
|
|
749
768
|
|
|
750
769
|
var getEntryPoints = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async (config, projectRoot, sourceRoot, entry, emitOnAll = false) => {
|
|
751
|
-
const workspaceRoot = config.workspaceRoot ? config.workspaceRoot :
|
|
770
|
+
const workspaceRoot = config.workspaceRoot ? config.workspaceRoot : _chunkJXYBDFPKcjs.findWorkspaceRoot.call(void 0, );
|
|
752
771
|
const entryPoints = [];
|
|
753
772
|
if (entry) {
|
|
754
773
|
if (Array.isArray(entry)) {
|
|
@@ -760,7 +779,7 @@ var getEntryPoints = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async
|
|
|
760
779
|
}
|
|
761
780
|
}
|
|
762
781
|
if (emitOnAll) {
|
|
763
|
-
entryPoints.push(
|
|
782
|
+
entryPoints.push(_chunkJXYBDFPKcjs.joinPaths.call(void 0, workspaceRoot, sourceRoot || projectRoot, "**/*.{ts,tsx}"));
|
|
764
783
|
}
|
|
765
784
|
const results = [];
|
|
766
785
|
for (const entryPoint in entryPoints) {
|
|
@@ -769,9 +788,9 @@ var getEntryPoints = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async
|
|
|
769
788
|
withFileTypes: true
|
|
770
789
|
});
|
|
771
790
|
results.push(...files.reduce((ret, filePath) => {
|
|
772
|
-
const result =
|
|
791
|
+
const result = _chunkJXYBDFPKcjs.correctPaths.call(void 0, _chunkJXYBDFPKcjs.joinPaths.call(void 0, filePath.path, filePath.name).replaceAll(_chunkJXYBDFPKcjs.correctPaths.call(void 0, workspaceRoot), "").replaceAll(_chunkJXYBDFPKcjs.correctPaths.call(void 0, projectRoot), ""));
|
|
773
792
|
if (result) {
|
|
774
|
-
|
|
793
|
+
_chunkJXYBDFPKcjs.writeDebug.call(void 0, `Trying to add entry point ${result} at "${_chunkJXYBDFPKcjs.joinPaths.call(void 0, filePath.path, filePath.name)}"`, config);
|
|
775
794
|
if (!results.includes(result)) {
|
|
776
795
|
results.push(result);
|
|
777
796
|
}
|
|
@@ -819,12 +838,12 @@ var resolveOptions = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async
|
|
|
819
838
|
throw new Error("Cannot find Nx workspace root");
|
|
820
839
|
}
|
|
821
840
|
const config = await getConfig(workspaceRoot.dir);
|
|
822
|
-
|
|
823
|
-
const stopwatch =
|
|
841
|
+
_chunkJXYBDFPKcjs.writeDebug.call(void 0, " \u2699\uFE0F Resolving build options", config);
|
|
842
|
+
const stopwatch = _chunkJXYBDFPKcjs.getStopwatch.call(void 0, "Build options resolution");
|
|
824
843
|
const projectGraph = await _devkit.createProjectGraphAsync.call(void 0, {
|
|
825
844
|
exitOnError: true
|
|
826
845
|
});
|
|
827
|
-
const projectJsonPath =
|
|
846
|
+
const projectJsonPath = _chunkJXYBDFPKcjs.joinPaths.call(void 0, workspaceRoot.dir, projectRoot, "project.json");
|
|
828
847
|
if (!_fs.existsSync.call(void 0, projectJsonPath)) {
|
|
829
848
|
throw new Error("Cannot find project.json configuration");
|
|
830
849
|
}
|
|
@@ -832,13 +851,13 @@ var resolveOptions = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async
|
|
|
832
851
|
const projectJson = JSON.parse(projectJsonFile);
|
|
833
852
|
const projectName = projectJson.name;
|
|
834
853
|
const projectConfigurations = _devkit.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
|
|
835
|
-
if (!_optionalChain([projectConfigurations, 'optionalAccess',
|
|
854
|
+
if (!_optionalChain([projectConfigurations, 'optionalAccess', _44 => _44.projects, 'optionalAccess', _45 => _45[projectName]])) {
|
|
836
855
|
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.");
|
|
837
856
|
}
|
|
838
857
|
const options = _defu2.default.call(void 0, userOptions, _chunk5KRF6IVWcjs.DEFAULT_BUILD_OPTIONS);
|
|
839
858
|
options.name ??= `${projectName}-${options.format}`;
|
|
840
859
|
options.target ??= DEFAULT_TARGET;
|
|
841
|
-
const packageJsonPath =
|
|
860
|
+
const packageJsonPath = _chunkJXYBDFPKcjs.joinPaths.call(void 0, workspaceRoot.dir, options.projectRoot, "package.json");
|
|
842
861
|
if (!_fs.existsSync.call(void 0, packageJsonPath)) {
|
|
843
862
|
throw new Error("Cannot find package.json configuration");
|
|
844
863
|
}
|
|
@@ -847,20 +866,20 @@ var resolveOptions = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async
|
|
|
847
866
|
...options,
|
|
848
867
|
config,
|
|
849
868
|
...userOptions,
|
|
850
|
-
tsconfig:
|
|
869
|
+
tsconfig: _chunkJXYBDFPKcjs.joinPaths.call(void 0, projectRoot, userOptions.tsconfig ? userOptions.tsconfig.replace(projectRoot, "") : "tsconfig.json"),
|
|
851
870
|
format: options.format || "cjs",
|
|
852
871
|
entryPoints: await getEntryPoints(config, projectRoot, projectJson.sourceRoot, userOptions.entry || [
|
|
853
872
|
"./src/index.ts"
|
|
854
873
|
], userOptions.emitOnAll),
|
|
855
|
-
outdir: userOptions.outputPath ||
|
|
874
|
+
outdir: userOptions.outputPath || _chunkJXYBDFPKcjs.joinPaths.call(void 0, "dist", projectRoot),
|
|
856
875
|
plugins: [],
|
|
857
876
|
name: userOptions.name || projectName,
|
|
858
877
|
projectConfigurations,
|
|
859
878
|
projectName,
|
|
860
879
|
projectGraph,
|
|
861
|
-
sourceRoot: userOptions.sourceRoot || projectJson.sourceRoot ||
|
|
880
|
+
sourceRoot: userOptions.sourceRoot || projectJson.sourceRoot || _chunkJXYBDFPKcjs.joinPaths.call(void 0, projectRoot, "src"),
|
|
862
881
|
minify: userOptions.minify || !userOptions.debug,
|
|
863
|
-
verbose: userOptions.verbose ||
|
|
882
|
+
verbose: userOptions.verbose || _chunkJXYBDFPKcjs.isVerbose.call(void 0, ) || userOptions.debug === true,
|
|
864
883
|
includeSrc: userOptions.includeSrc === true,
|
|
865
884
|
metafile: userOptions.metafile !== false,
|
|
866
885
|
generatePackageJson: userOptions.generatePackageJson !== false,
|
|
@@ -894,14 +913,14 @@ var resolveOptions = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async
|
|
|
894
913
|
return result;
|
|
895
914
|
}, "resolveOptions");
|
|
896
915
|
async function generatePackageJson(options) {
|
|
897
|
-
if (options.generatePackageJson !== false && _fs.existsSync.call(void 0,
|
|
898
|
-
|
|
899
|
-
const stopwatch =
|
|
900
|
-
const packageJsonPath =
|
|
916
|
+
if (options.generatePackageJson !== false && _fs.existsSync.call(void 0, _chunkJXYBDFPKcjs.joinPaths.call(void 0, options.projectRoot, "package.json"))) {
|
|
917
|
+
_chunkJXYBDFPKcjs.writeDebug.call(void 0, " \u270D\uFE0F Writing package.json file", options.config);
|
|
918
|
+
const stopwatch = _chunkJXYBDFPKcjs.getStopwatch.call(void 0, "Write package.json file");
|
|
919
|
+
const packageJsonPath = _chunkJXYBDFPKcjs.joinPaths.call(void 0, options.projectRoot, "project.json");
|
|
901
920
|
if (!_fs.existsSync.call(void 0, packageJsonPath)) {
|
|
902
921
|
throw new Error("Cannot find package.json configuration");
|
|
903
922
|
}
|
|
904
|
-
const packageJsonFile = await _promises2.default.readFile(
|
|
923
|
+
const packageJsonFile = await _promises2.default.readFile(_chunkJXYBDFPKcjs.joinPaths.call(void 0, options.config.workspaceRoot, options.projectRoot, "package.json"), "utf8");
|
|
905
924
|
if (!packageJsonFile) {
|
|
906
925
|
throw new Error("Cannot find package.json configuration file");
|
|
907
926
|
}
|
|
@@ -940,15 +959,15 @@ async function generatePackageJson(options) {
|
|
|
940
959
|
}
|
|
941
960
|
return ret;
|
|
942
961
|
}, packageJson.exports);
|
|
943
|
-
await _devkit.writeJsonFile.call(void 0,
|
|
962
|
+
await _devkit.writeJsonFile.call(void 0, _chunkJXYBDFPKcjs.joinPaths.call(void 0, options.outdir, "package.json"), packageJson);
|
|
944
963
|
stopwatch();
|
|
945
964
|
}
|
|
946
965
|
return options;
|
|
947
966
|
}
|
|
948
967
|
_chunkUSNT2KNTcjs.__name.call(void 0, generatePackageJson, "generatePackageJson");
|
|
949
968
|
async function executeTSDown(options) {
|
|
950
|
-
|
|
951
|
-
const stopwatch =
|
|
969
|
+
_chunkJXYBDFPKcjs.writeDebug.call(void 0, ` \u{1F680} Running ${options.name} build`, options.config);
|
|
970
|
+
const stopwatch = _chunkJXYBDFPKcjs.getStopwatch.call(void 0, `${options.name} build`);
|
|
952
971
|
await _tsdown.build.call(void 0, {
|
|
953
972
|
...options,
|
|
954
973
|
entry: options.entryPoints,
|
|
@@ -960,30 +979,30 @@ async function executeTSDown(options) {
|
|
|
960
979
|
}
|
|
961
980
|
_chunkUSNT2KNTcjs.__name.call(void 0, executeTSDown, "executeTSDown");
|
|
962
981
|
async function copyBuildAssets(options) {
|
|
963
|
-
|
|
964
|
-
const stopwatch =
|
|
982
|
+
_chunkJXYBDFPKcjs.writeDebug.call(void 0, ` \u{1F4CB} Copying asset files to output directory: ${options.outdir}`, options.config);
|
|
983
|
+
const stopwatch = _chunkJXYBDFPKcjs.getStopwatch.call(void 0, `${options.name} asset copy`);
|
|
965
984
|
await copyAssets(options.config, _nullishCoalesce(options.assets, () => ( [])), options.outdir, options.projectRoot, options.sourceRoot, true, false);
|
|
966
985
|
stopwatch();
|
|
967
986
|
return options;
|
|
968
987
|
}
|
|
969
988
|
_chunkUSNT2KNTcjs.__name.call(void 0, copyBuildAssets, "copyBuildAssets");
|
|
970
989
|
async function reportResults(options) {
|
|
971
|
-
|
|
990
|
+
_chunkJXYBDFPKcjs.writeSuccess.call(void 0, ` \u{1F4E6} The ${options.name} build completed successfully`, options.config);
|
|
972
991
|
}
|
|
973
992
|
_chunkUSNT2KNTcjs.__name.call(void 0, reportResults, "reportResults");
|
|
974
993
|
async function cleanOutputPath(options) {
|
|
975
994
|
if (options.clean !== false && options.outdir) {
|
|
976
|
-
|
|
977
|
-
const stopwatch =
|
|
978
|
-
await
|
|
995
|
+
_chunkJXYBDFPKcjs.writeDebug.call(void 0, ` \u{1F9F9} Cleaning ${options.name} output path: ${options.outdir}`, options.config);
|
|
996
|
+
const stopwatch = _chunkJXYBDFPKcjs.getStopwatch.call(void 0, `${options.name} output clean`);
|
|
997
|
+
await _chunkJXYBDFPKcjs.cleanDirectories.call(void 0, options.name, options.outdir, options.config);
|
|
979
998
|
stopwatch();
|
|
980
999
|
}
|
|
981
1000
|
return options;
|
|
982
1001
|
}
|
|
983
1002
|
_chunkUSNT2KNTcjs.__name.call(void 0, cleanOutputPath, "cleanOutputPath");
|
|
984
1003
|
async function build(options) {
|
|
985
|
-
|
|
986
|
-
const stopwatch =
|
|
1004
|
+
_chunkJXYBDFPKcjs.writeDebug.call(void 0, ` \u26A1 Executing Storm TSDown pipeline`);
|
|
1005
|
+
const stopwatch = _chunkJXYBDFPKcjs.getStopwatch.call(void 0, "TSDown pipeline");
|
|
987
1006
|
try {
|
|
988
1007
|
const opts = Array.isArray(options) ? options : [
|
|
989
1008
|
options
|
|
@@ -1001,11 +1020,11 @@ async function build(options) {
|
|
|
1001
1020
|
await reportResults(opt);
|
|
1002
1021
|
}));
|
|
1003
1022
|
} else {
|
|
1004
|
-
|
|
1023
|
+
_chunkJXYBDFPKcjs.writeWarning.call(void 0, " \u{1F6A7} No options were passed to TSBuild. Please check the parameters passed to the `build` function.");
|
|
1005
1024
|
}
|
|
1006
|
-
|
|
1025
|
+
_chunkJXYBDFPKcjs.writeSuccess.call(void 0, " \u{1F3C1} TSDown pipeline build completed successfully");
|
|
1007
1026
|
} catch (error) {
|
|
1008
|
-
|
|
1027
|
+
_chunkJXYBDFPKcjs.writeFatal.call(void 0, " \u274C Fatal errors occurred during the build that could not be recovered from. The build process has been terminated.");
|
|
1009
1028
|
throw error;
|
|
1010
1029
|
} finally {
|
|
1011
1030
|
stopwatch();
|
package/dist/clean.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkJXYBDFPKcjs = require('./chunk-JXYBDFPK.cjs');
|
|
5
5
|
require('./chunk-USNT2KNT.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
exports.clean =
|
|
9
|
+
exports.clean = _chunkJXYBDFPKcjs.clean; exports.cleanDirectories = _chunkJXYBDFPKcjs.cleanDirectories;
|
package/dist/clean.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkTFFKZFJGcjs = require('./chunk-TFFKZFJG.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkJXYBDFPKcjs = require('./chunk-JXYBDFPK.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
var _chunk5KRF6IVWcjs = require('./chunk-5KRF6IVW.cjs');
|
|
@@ -17,4 +17,4 @@ require('./chunk-SFZRYJZ2.cjs');
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
exports.DEFAULT_BUILD_OPTIONS = _chunk5KRF6IVWcjs.DEFAULT_BUILD_OPTIONS; exports.build =
|
|
20
|
+
exports.DEFAULT_BUILD_OPTIONS = _chunk5KRF6IVWcjs.DEFAULT_BUILD_OPTIONS; exports.build = _chunkTFFKZFJGcjs.build; exports.clean = _chunkJXYBDFPKcjs.clean; exports.cleanDirectories = _chunkJXYBDFPKcjs.cleanDirectories; exports.cleanOutputPath = _chunkTFFKZFJGcjs.cleanOutputPath;
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
build,
|
|
3
3
|
cleanOutputPath
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-PJF37ZAU.js";
|
|
5
5
|
import {
|
|
6
6
|
clean,
|
|
7
7
|
cleanDirectories
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-EO2JNC24.js";
|
|
9
9
|
import {
|
|
10
10
|
DEFAULT_BUILD_OPTIONS
|
|
11
11
|
} from "./chunk-UQLCBJOS.js";
|