@storm-software/tsdown 0.24.12 → 0.24.14
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-UXN3FUA7.js → chunk-CRCK2NCN.js} +16 -10
- package/dist/{chunk-KB6FL5TT.js → chunk-EO2JNC24.js} +26 -15
- package/dist/{chunk-52NJUFUL.cjs → chunk-JXYBDFPK.cjs} +26 -15
- package/dist/{chunk-CCP7YM3I.cjs → chunk-QOJUBCJR.cjs} +97 -91
- 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 _chunkQOJUBCJRcjs = require('./chunk-QOJUBCJR.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 = _chunkQOJUBCJRcjs.build; exports.cleanOutputPath = _chunkQOJUBCJRcjs.cleanOutputPath;
|
package/dist/build.js
CHANGED
|
@@ -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";
|
|
@@ -253,10 +253,10 @@ var getConfigFileByName = /* @__PURE__ */ __name(async (fileName, filePath, opti
|
|
|
253
253
|
}, "getConfigFileByName");
|
|
254
254
|
var getConfigFile = /* @__PURE__ */ __name(async (filePath, additionalFileNames = []) => {
|
|
255
255
|
const workspacePath = filePath ? filePath : findWorkspaceRoot(filePath);
|
|
256
|
-
const result = await getConfigFileByName("storm", workspacePath);
|
|
256
|
+
const result = await getConfigFileByName("storm-workspace", workspacePath);
|
|
257
257
|
let config = result.config;
|
|
258
258
|
const configFile = result.configFile;
|
|
259
|
-
if (config && configFile && Object.keys(config).length > 0) {
|
|
259
|
+
if (config && configFile && Object.keys(config).length > 0 && !config.skipConfigLogging) {
|
|
260
260
|
writeTrace(`Found Storm configuration file "${configFile.includes(`${workspacePath}/`) ? configFile.replace(`${workspacePath}/`, "") : configFile}" at "${workspacePath}"`, {
|
|
261
261
|
logLevel: "all"
|
|
262
262
|
});
|
|
@@ -265,9 +265,11 @@ var getConfigFile = /* @__PURE__ */ __name(async (filePath, additionalFileNames
|
|
|
265
265
|
const results = await Promise.all(additionalFileNames.map((fileName) => getConfigFileByName(fileName, workspacePath)));
|
|
266
266
|
for (const result2 of results) {
|
|
267
267
|
if (result2?.config && result2?.configFile && Object.keys(result2.config).length > 0) {
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
268
|
+
if (!config.skipConfigLogging && !result2.config.skipConfigLogging) {
|
|
269
|
+
writeTrace(`Found alternative configuration file "${result2.configFile.includes(`${workspacePath}/`) ? result2.configFile.replace(`${workspacePath}/`, "") : result2.configFile}" at "${workspacePath}"`, {
|
|
270
|
+
logLevel: "all"
|
|
271
|
+
});
|
|
272
|
+
}
|
|
271
273
|
config = defu(result2.config ?? {}, config ?? {});
|
|
272
274
|
}
|
|
273
275
|
}
|
|
@@ -343,7 +345,8 @@ var getConfigEnv = /* @__PURE__ */ __name(() => {
|
|
|
343
345
|
cyclone: process.env[`${prefix}REGISTRY_CYCLONE`] || void 0,
|
|
344
346
|
container: process.env[`${prefix}REGISTRY_CONTAINER`] || void 0
|
|
345
347
|
},
|
|
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
|
|
348
|
+
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,
|
|
349
|
+
skipConfigLogging: process.env[`${prefix}SKIP_CONFIG_LOGGING`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CONFIG_LOGGING`]) : void 0
|
|
347
350
|
};
|
|
348
351
|
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
352
|
config.colors = themeNames.length > 0 ? themeNames.reduce((ret, themeName) => {
|
|
@@ -578,6 +581,9 @@ var setConfigEnv = /* @__PURE__ */ __name((config) => {
|
|
|
578
581
|
process.env.NX_VERBOSE_LOGGING = String(getLogLevel(config.logLevel) >= LogLevel.DEBUG ? true : false);
|
|
579
582
|
process.env.RUST_BACKTRACE = getLogLevel(config.logLevel) >= LogLevel.DEBUG ? "full" : "none";
|
|
580
583
|
}
|
|
584
|
+
if (config.skipConfigLogging !== void 0) {
|
|
585
|
+
process.env[`${prefix}SKIP_CONFIG_LOGGING`] = String(config.skipConfigLogging);
|
|
586
|
+
}
|
|
581
587
|
process.env[`${prefix}CONFIG`] = JSON.stringify(config);
|
|
582
588
|
for (const key of Object.keys(config.extensions ?? {})) {
|
|
583
589
|
config.extensions[key] && Object.keys(config.extensions[key]) && setExtensionEnv(key, config.extensions[key]);
|
|
@@ -695,7 +701,7 @@ var createStormConfig = /* @__PURE__ */ __name(async (extensionName, schema, wor
|
|
|
695
701
|
const defaultConfig = await getDefaultConfig(_workspaceRoot);
|
|
696
702
|
const configFile = await getConfigFile(_workspaceRoot);
|
|
697
703
|
if (!configFile && !skipLogs) {
|
|
698
|
-
writeWarning("No Storm
|
|
704
|
+
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
705
|
logLevel: "all"
|
|
700
706
|
});
|
|
701
707
|
}
|
|
@@ -733,8 +739,8 @@ var createConfigExtension = /* @__PURE__ */ __name((extensionName, schema) => {
|
|
|
733
739
|
var loadStormConfig = /* @__PURE__ */ __name(async (workspaceRoot, skipLogs = false) => {
|
|
734
740
|
const config = await createStormConfig(void 0, void 0, workspaceRoot, skipLogs);
|
|
735
741
|
setConfigEnv(config);
|
|
736
|
-
if (!skipLogs) {
|
|
737
|
-
writeTrace(`\u2699\uFE0F Using Storm configuration:
|
|
742
|
+
if (!skipLogs && !config.skipConfigLogging) {
|
|
743
|
+
writeTrace(`\u2699\uFE0F Using Storm Workspace configuration:
|
|
738
744
|
${formatLogMessage(config)}`, config);
|
|
739
745
|
}
|
|
740
746
|
return config;
|
|
@@ -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 @@
|
|
|
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
|
|
|
@@ -116,7 +116,7 @@ var addPackageDependencies = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void
|
|
|
116
116
|
for (const project of projectDependencies.dependencies.filter((dep) => dep.node.type === "lib" && dep.node.data.root !== projectRoot && dep.node.data.root !== workspaceRoot)) {
|
|
117
117
|
const projectNode = project.node;
|
|
118
118
|
if (projectNode.data.root) {
|
|
119
|
-
const projectPackageJsonPath =
|
|
119
|
+
const projectPackageJsonPath = _chunkJXYBDFPKcjs.joinPaths.call(void 0, workspaceRoot, projectNode.data.root, "package.json");
|
|
120
120
|
if (_fs.existsSync.call(void 0, projectPackageJsonPath)) {
|
|
121
121
|
const projectPackageJsonContent = await _promises.readFile.call(void 0, projectPackageJsonPath, "utf8");
|
|
122
122
|
const projectPackageJson = JSON.parse(projectPackageJsonContent);
|
|
@@ -127,7 +127,7 @@ var addPackageDependencies = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void
|
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
if (localPackages.length > 0) {
|
|
130
|
-
|
|
130
|
+
_chunkJXYBDFPKcjs.writeTrace.call(void 0, `\u{1F4E6} Adding local packages to package.json: ${localPackages.map((p) => p.name).join(", ")}`);
|
|
131
131
|
packageJson.peerDependencies = localPackages.reduce((ret, localPackage) => {
|
|
132
132
|
if (!ret[localPackage.name]) {
|
|
133
133
|
ret[localPackage.name] = `>=${localPackage.version || "0.0.1"}`;
|
|
@@ -149,13 +149,13 @@ var addPackageDependencies = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void
|
|
|
149
149
|
return ret;
|
|
150
150
|
}, _nullishCoalesce(packageJson.peerDependencies, () => ( {})));
|
|
151
151
|
} else {
|
|
152
|
-
|
|
152
|
+
_chunkJXYBDFPKcjs.writeTrace.call(void 0, "\u{1F4E6} No local packages dependencies to add to package.json");
|
|
153
153
|
}
|
|
154
154
|
return packageJson;
|
|
155
155
|
}, "addPackageDependencies");
|
|
156
156
|
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,
|
|
157
|
+
const workspaceRoot = config.workspaceRoot ? config.workspaceRoot : _chunkJXYBDFPKcjs.findWorkspaceRoot.call(void 0, );
|
|
158
|
+
const workspacePackageJsonContent = await _promises.readFile.call(void 0, _chunkJXYBDFPKcjs.joinPaths.call(void 0, workspaceRoot, "package.json"), "utf8");
|
|
159
159
|
const workspacePackageJson = JSON.parse(workspacePackageJsonContent);
|
|
160
160
|
packageJson.type ??= "module";
|
|
161
161
|
packageJson.sideEffects ??= false;
|
|
@@ -164,7 +164,7 @@ var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.cal
|
|
|
164
164
|
if (distSrc.startsWith("/")) {
|
|
165
165
|
distSrc = distSrc.substring(1);
|
|
166
166
|
}
|
|
167
|
-
packageJson.source ??= `${
|
|
167
|
+
packageJson.source ??= `${_chunkJXYBDFPKcjs.joinPaths.call(void 0, distSrc, "index.ts").replaceAll("\\", "/")}`;
|
|
168
168
|
}
|
|
169
169
|
packageJson.files ??= [
|
|
170
170
|
"dist/**/*"
|
|
@@ -195,7 +195,7 @@ var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.cal
|
|
|
195
195
|
];
|
|
196
196
|
}
|
|
197
197
|
packageJson.repository ??= workspacePackageJson.repository;
|
|
198
|
-
packageJson.repository.directory ??= projectRoot ? projectRoot :
|
|
198
|
+
packageJson.repository.directory ??= projectRoot ? projectRoot : _chunkJXYBDFPKcjs.joinPaths.call(void 0, "packages", projectName);
|
|
199
199
|
return packageJson;
|
|
200
200
|
}, "addWorkspacePackageJsonFields");
|
|
201
201
|
var addPackageJsonExport = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (file, type = "module", sourceRoot) => {
|
|
@@ -223,7 +223,7 @@ var addPackageJsonExport = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0,
|
|
|
223
223
|
var _c12 = require('c12');
|
|
224
224
|
var _defu = require('defu'); var _defu2 = _interopRequireDefault(_defu);
|
|
225
225
|
var getConfigFileByName = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async (fileName, filePath, options = {}) => {
|
|
226
|
-
const workspacePath = filePath ||
|
|
226
|
+
const workspacePath = filePath || _chunkJXYBDFPKcjs.findWorkspaceRoot.call(void 0, filePath);
|
|
227
227
|
const configs = await Promise.all([
|
|
228
228
|
_c12.loadConfig.call(void 0, {
|
|
229
229
|
cwd: workspacePath,
|
|
@@ -232,7 +232,7 @@ var getConfigFileByName = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0,
|
|
|
232
232
|
envName: _optionalChain([fileName, 'optionalAccess', _ => _.toUpperCase, 'call', _2 => _2()]),
|
|
233
233
|
jitiOptions: {
|
|
234
234
|
debug: false,
|
|
235
|
-
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false :
|
|
235
|
+
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : _chunkJXYBDFPKcjs.joinPaths.call(void 0, process.env.STORM_CACHE_DIR || "node_modules/.cache/storm", "jiti")
|
|
236
236
|
},
|
|
237
237
|
...options
|
|
238
238
|
}),
|
|
@@ -243,7 +243,7 @@ var getConfigFileByName = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0,
|
|
|
243
243
|
envName: _optionalChain([fileName, 'optionalAccess', _3 => _3.toUpperCase, 'call', _4 => _4()]),
|
|
244
244
|
jitiOptions: {
|
|
245
245
|
debug: false,
|
|
246
|
-
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false :
|
|
246
|
+
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : _chunkJXYBDFPKcjs.joinPaths.call(void 0, process.env.STORM_CACHE_DIR || "node_modules/.cache/storm", "jiti")
|
|
247
247
|
},
|
|
248
248
|
configFile: fileName,
|
|
249
249
|
...options
|
|
@@ -252,12 +252,12 @@ var getConfigFileByName = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0,
|
|
|
252
252
|
return _defu2.default.call(void 0, _nullishCoalesce(configs[0], () => ( {})), _nullishCoalesce(configs[1], () => ( {})));
|
|
253
253
|
}, "getConfigFileByName");
|
|
254
254
|
var getConfigFile = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async (filePath, additionalFileNames = []) => {
|
|
255
|
-
const workspacePath = filePath ? filePath :
|
|
256
|
-
const result = await getConfigFileByName("storm", workspacePath);
|
|
255
|
+
const workspacePath = filePath ? filePath : _chunkJXYBDFPKcjs.findWorkspaceRoot.call(void 0, filePath);
|
|
256
|
+
const result = await getConfigFileByName("storm-workspace", workspacePath);
|
|
257
257
|
let config = result.config;
|
|
258
258
|
const configFile = result.configFile;
|
|
259
|
-
if (config && configFile && Object.keys(config).length > 0) {
|
|
260
|
-
|
|
259
|
+
if (config && configFile && Object.keys(config).length > 0 && !config.skipConfigLogging) {
|
|
260
|
+
_chunkJXYBDFPKcjs.writeTrace.call(void 0, `Found Storm configuration file "${configFile.includes(`${workspacePath}/`) ? configFile.replace(`${workspacePath}/`, "") : configFile}" at "${workspacePath}"`, {
|
|
261
261
|
logLevel: "all"
|
|
262
262
|
});
|
|
263
263
|
}
|
|
@@ -265,9 +265,11 @@ var getConfigFile = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async
|
|
|
265
265
|
const results = await Promise.all(additionalFileNames.map((fileName) => getConfigFileByName(fileName, workspacePath)));
|
|
266
266
|
for (const result2 of results) {
|
|
267
267
|
if (_optionalChain([result2, 'optionalAccess', _5 => _5.config]) && _optionalChain([result2, 'optionalAccess', _6 => _6.configFile]) && Object.keys(result2.config).length > 0) {
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
268
|
+
if (!config.skipConfigLogging && !result2.config.skipConfigLogging) {
|
|
269
|
+
_chunkJXYBDFPKcjs.writeTrace.call(void 0, `Found alternative configuration file "${result2.configFile.includes(`${workspacePath}/`) ? result2.configFile.replace(`${workspacePath}/`, "") : result2.configFile}" at "${workspacePath}"`, {
|
|
270
|
+
logLevel: "all"
|
|
271
|
+
});
|
|
272
|
+
}
|
|
271
273
|
config = _defu2.default.call(void 0, _nullishCoalesce(result2.config, () => ( {})), _nullishCoalesce(config, () => ( {})));
|
|
272
274
|
}
|
|
273
275
|
}
|
|
@@ -312,15 +314,15 @@ var getConfigEnv = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, () => {
|
|
|
312
314
|
licensing: process.env[`${prefix}LICENSING`] || void 0,
|
|
313
315
|
timezone: process.env[`${prefix}TIMEZONE`] || process.env.TZ || void 0,
|
|
314
316
|
locale: process.env[`${prefix}LOCALE`] || process.env.LOCALE || void 0,
|
|
315
|
-
configFile: process.env[`${prefix}CONFIG_FILE`] ?
|
|
316
|
-
workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`] ?
|
|
317
|
+
configFile: process.env[`${prefix}CONFIG_FILE`] ? _chunkJXYBDFPKcjs.correctPaths.call(void 0, process.env[`${prefix}CONFIG_FILE`]) : void 0,
|
|
318
|
+
workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`] ? _chunkJXYBDFPKcjs.correctPaths.call(void 0, process.env[`${prefix}WORKSPACE_ROOT`]) : void 0,
|
|
317
319
|
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`] ?
|
|
320
|
+
cache: process.env[`${prefix}CACHE_DIR`] ? _chunkJXYBDFPKcjs.correctPaths.call(void 0, process.env[`${prefix}CACHE_DIR`]) : void 0,
|
|
321
|
+
data: process.env[`${prefix}DATA_DIR`] ? _chunkJXYBDFPKcjs.correctPaths.call(void 0, process.env[`${prefix}DATA_DIR`]) : void 0,
|
|
322
|
+
config: process.env[`${prefix}CONFIG_DIR`] ? _chunkJXYBDFPKcjs.correctPaths.call(void 0, process.env[`${prefix}CONFIG_DIR`]) : void 0,
|
|
323
|
+
temp: process.env[`${prefix}TEMP_DIR`] ? _chunkJXYBDFPKcjs.correctPaths.call(void 0, process.env[`${prefix}TEMP_DIR`]) : void 0,
|
|
324
|
+
log: process.env[`${prefix}LOG_DIR`] ? _chunkJXYBDFPKcjs.correctPaths.call(void 0, process.env[`${prefix}LOG_DIR`]) : void 0,
|
|
325
|
+
build: process.env[`${prefix}BUILD_DIR`] ? _chunkJXYBDFPKcjs.correctPaths.call(void 0, process.env[`${prefix}BUILD_DIR`]) : void 0
|
|
324
326
|
},
|
|
325
327
|
skipCache: process.env[`${prefix}SKIP_CACHE`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CACHE`]) : void 0,
|
|
326
328
|
env: (_nullishCoalesce(_nullishCoalesce(process.env[`${prefix}ENV`], () => ( process.env.NODE_ENV)), () => ( process.env.ENVIRONMENT))) || void 0,
|
|
@@ -343,23 +345,24 @@ var getConfigEnv = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, () => {
|
|
|
343
345
|
cyclone: process.env[`${prefix}REGISTRY_CYCLONE`] || void 0,
|
|
344
346
|
container: process.env[`${prefix}REGISTRY_CONTAINER`] || void 0
|
|
345
347
|
},
|
|
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`])) ?
|
|
348
|
+
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,
|
|
349
|
+
skipConfigLogging: process.env[`${prefix}SKIP_CONFIG_LOGGING`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CONFIG_LOGGING`]) : void 0
|
|
347
350
|
};
|
|
348
|
-
const themeNames = Object.keys(process.env).filter((envKey) => envKey.startsWith(`${prefix}COLOR_`) &&
|
|
351
|
+
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
352
|
config.colors = themeNames.length > 0 ? themeNames.reduce((ret, themeName) => {
|
|
350
353
|
ret[themeName] = getThemeColorConfigEnv(prefix, themeName);
|
|
351
354
|
return ret;
|
|
352
355
|
}, {}) : getThemeColorConfigEnv(prefix);
|
|
353
|
-
if (config.docs ===
|
|
354
|
-
if (config.homepage ===
|
|
355
|
-
config.docs = `${
|
|
356
|
+
if (config.docs === _chunkJXYBDFPKcjs.STORM_DEFAULT_DOCS) {
|
|
357
|
+
if (config.homepage === _chunkJXYBDFPKcjs.STORM_DEFAULT_HOMEPAGE) {
|
|
358
|
+
config.docs = `${_chunkJXYBDFPKcjs.STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/docs`;
|
|
356
359
|
} else {
|
|
357
360
|
config.docs = `${config.homepage}/docs`;
|
|
358
361
|
}
|
|
359
362
|
}
|
|
360
|
-
if (config.licensing ===
|
|
361
|
-
if (config.homepage ===
|
|
362
|
-
config.licensing = `${
|
|
363
|
+
if (config.licensing === _chunkJXYBDFPKcjs.STORM_DEFAULT_LICENSING) {
|
|
364
|
+
if (config.homepage === _chunkJXYBDFPKcjs.STORM_DEFAULT_HOMEPAGE) {
|
|
365
|
+
config.licensing = `${_chunkJXYBDFPKcjs.STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/licensing`;
|
|
363
366
|
} else {
|
|
364
367
|
config.licensing = `${config.homepage}/docs`;
|
|
365
368
|
}
|
|
@@ -497,31 +500,31 @@ var setConfigEnv = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (config
|
|
|
497
500
|
process.env.LANG = config.locale ? `${config.locale.replaceAll("-", "_")}.UTF-8` : "en_US.UTF-8";
|
|
498
501
|
}
|
|
499
502
|
if (config.configFile) {
|
|
500
|
-
process.env[`${prefix}CONFIG_FILE`] =
|
|
503
|
+
process.env[`${prefix}CONFIG_FILE`] = _chunkJXYBDFPKcjs.correctPaths.call(void 0, config.configFile);
|
|
501
504
|
}
|
|
502
505
|
if (config.workspaceRoot) {
|
|
503
|
-
process.env[`${prefix}WORKSPACE_ROOT`] =
|
|
504
|
-
process.env.NX_WORKSPACE_ROOT =
|
|
505
|
-
process.env.NX_WORKSPACE_ROOT_PATH =
|
|
506
|
+
process.env[`${prefix}WORKSPACE_ROOT`] = _chunkJXYBDFPKcjs.correctPaths.call(void 0, config.workspaceRoot);
|
|
507
|
+
process.env.NX_WORKSPACE_ROOT = _chunkJXYBDFPKcjs.correctPaths.call(void 0, config.workspaceRoot);
|
|
508
|
+
process.env.NX_WORKSPACE_ROOT_PATH = _chunkJXYBDFPKcjs.correctPaths.call(void 0, config.workspaceRoot);
|
|
506
509
|
}
|
|
507
510
|
if (config.directories) {
|
|
508
511
|
if (!config.skipCache && config.directories.cache) {
|
|
509
|
-
process.env[`${prefix}CACHE_DIR`] =
|
|
512
|
+
process.env[`${prefix}CACHE_DIR`] = _chunkJXYBDFPKcjs.correctPaths.call(void 0, config.directories.cache);
|
|
510
513
|
}
|
|
511
514
|
if (config.directories.data) {
|
|
512
|
-
process.env[`${prefix}DATA_DIR`] =
|
|
515
|
+
process.env[`${prefix}DATA_DIR`] = _chunkJXYBDFPKcjs.correctPaths.call(void 0, config.directories.data);
|
|
513
516
|
}
|
|
514
517
|
if (config.directories.config) {
|
|
515
|
-
process.env[`${prefix}CONFIG_DIR`] =
|
|
518
|
+
process.env[`${prefix}CONFIG_DIR`] = _chunkJXYBDFPKcjs.correctPaths.call(void 0, config.directories.config);
|
|
516
519
|
}
|
|
517
520
|
if (config.directories.temp) {
|
|
518
|
-
process.env[`${prefix}TEMP_DIR`] =
|
|
521
|
+
process.env[`${prefix}TEMP_DIR`] = _chunkJXYBDFPKcjs.correctPaths.call(void 0, config.directories.temp);
|
|
519
522
|
}
|
|
520
523
|
if (config.directories.log) {
|
|
521
|
-
process.env[`${prefix}LOG_DIR`] =
|
|
524
|
+
process.env[`${prefix}LOG_DIR`] = _chunkJXYBDFPKcjs.correctPaths.call(void 0, config.directories.log);
|
|
522
525
|
}
|
|
523
526
|
if (config.directories.build) {
|
|
524
|
-
process.env[`${prefix}BUILD_DIR`] =
|
|
527
|
+
process.env[`${prefix}BUILD_DIR`] = _chunkJXYBDFPKcjs.correctPaths.call(void 0, config.directories.build);
|
|
525
528
|
}
|
|
526
529
|
}
|
|
527
530
|
if (config.skipCache !== void 0) {
|
|
@@ -575,8 +578,11 @@ var setConfigEnv = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (config
|
|
|
575
578
|
if (config.logLevel) {
|
|
576
579
|
process.env[`${prefix}LOG_LEVEL`] = String(config.logLevel);
|
|
577
580
|
process.env.LOG_LEVEL = String(config.logLevel);
|
|
578
|
-
process.env.NX_VERBOSE_LOGGING = String(
|
|
579
|
-
process.env.RUST_BACKTRACE =
|
|
581
|
+
process.env.NX_VERBOSE_LOGGING = String(_chunkJXYBDFPKcjs.getLogLevel.call(void 0, config.logLevel) >= _chunkJXYBDFPKcjs.LogLevel.DEBUG ? true : false);
|
|
582
|
+
process.env.RUST_BACKTRACE = _chunkJXYBDFPKcjs.getLogLevel.call(void 0, config.logLevel) >= _chunkJXYBDFPKcjs.LogLevel.DEBUG ? "full" : "none";
|
|
583
|
+
}
|
|
584
|
+
if (config.skipConfigLogging !== void 0) {
|
|
585
|
+
process.env[`${prefix}SKIP_CONFIG_LOGGING`] = String(config.skipConfigLogging);
|
|
580
586
|
}
|
|
581
587
|
process.env[`${prefix}CONFIG`] = JSON.stringify(config);
|
|
582
588
|
for (const key of Object.keys(_nullishCoalesce(config.extensions, () => ( {})))) {
|
|
@@ -689,17 +695,17 @@ var createStormConfig = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, as
|
|
|
689
695
|
if (!_optionalChain([_static_cache, 'optionalAccess', _29 => _29.data]) || !_optionalChain([_static_cache, 'optionalAccess', _30 => _30.timestamp]) || _static_cache.timestamp < Date.now() - 8e3) {
|
|
690
696
|
let _workspaceRoot = workspaceRoot;
|
|
691
697
|
if (!_workspaceRoot) {
|
|
692
|
-
_workspaceRoot =
|
|
698
|
+
_workspaceRoot = _chunkJXYBDFPKcjs.findWorkspaceRoot.call(void 0, );
|
|
693
699
|
}
|
|
694
700
|
const configEnv = getConfigEnv();
|
|
695
|
-
const defaultConfig = await
|
|
701
|
+
const defaultConfig = await _chunkJXYBDFPKcjs.getDefaultConfig.call(void 0, _workspaceRoot);
|
|
696
702
|
const configFile = await getConfigFile(_workspaceRoot);
|
|
697
703
|
if (!configFile && !skipLogs) {
|
|
698
|
-
|
|
704
|
+
_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
705
|
logLevel: "all"
|
|
700
706
|
});
|
|
701
707
|
}
|
|
702
|
-
result = await
|
|
708
|
+
result = await _chunkJXYBDFPKcjs.StormConfigSchema.parseAsync(_defu2.default.call(void 0, configEnv, configFile, defaultConfig));
|
|
703
709
|
result.workspaceRoot ??= _workspaceRoot;
|
|
704
710
|
} else {
|
|
705
711
|
result = _static_cache.data;
|
|
@@ -733,9 +739,9 @@ var createConfigExtension = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0
|
|
|
733
739
|
var loadStormConfig = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async (workspaceRoot, skipLogs = false) => {
|
|
734
740
|
const config = await createStormConfig(void 0, void 0, workspaceRoot, skipLogs);
|
|
735
741
|
setConfigEnv(config);
|
|
736
|
-
if (!skipLogs) {
|
|
737
|
-
|
|
738
|
-
${
|
|
742
|
+
if (!skipLogs && !config.skipConfigLogging) {
|
|
743
|
+
_chunkJXYBDFPKcjs.writeTrace.call(void 0, `\u2699\uFE0F Using Storm Workspace configuration:
|
|
744
|
+
${_chunkJXYBDFPKcjs.formatLogMessage.call(void 0, config)}`, config);
|
|
739
745
|
}
|
|
740
746
|
return config;
|
|
741
747
|
}, "loadStormConfig");
|
|
@@ -748,7 +754,7 @@ var getConfig = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (workspace
|
|
|
748
754
|
// ../build-tools/src/utilities/get-entry-points.ts
|
|
749
755
|
|
|
750
756
|
var getEntryPoints = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async (config, projectRoot, sourceRoot, entry, emitOnAll = false) => {
|
|
751
|
-
const workspaceRoot = config.workspaceRoot ? config.workspaceRoot :
|
|
757
|
+
const workspaceRoot = config.workspaceRoot ? config.workspaceRoot : _chunkJXYBDFPKcjs.findWorkspaceRoot.call(void 0, );
|
|
752
758
|
const entryPoints = [];
|
|
753
759
|
if (entry) {
|
|
754
760
|
if (Array.isArray(entry)) {
|
|
@@ -760,7 +766,7 @@ var getEntryPoints = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async
|
|
|
760
766
|
}
|
|
761
767
|
}
|
|
762
768
|
if (emitOnAll) {
|
|
763
|
-
entryPoints.push(
|
|
769
|
+
entryPoints.push(_chunkJXYBDFPKcjs.joinPaths.call(void 0, workspaceRoot, sourceRoot || projectRoot, "**/*.{ts,tsx}"));
|
|
764
770
|
}
|
|
765
771
|
const results = [];
|
|
766
772
|
for (const entryPoint in entryPoints) {
|
|
@@ -769,9 +775,9 @@ var getEntryPoints = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async
|
|
|
769
775
|
withFileTypes: true
|
|
770
776
|
});
|
|
771
777
|
results.push(...files.reduce((ret, filePath) => {
|
|
772
|
-
const result =
|
|
778
|
+
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
779
|
if (result) {
|
|
774
|
-
|
|
780
|
+
_chunkJXYBDFPKcjs.writeDebug.call(void 0, `Trying to add entry point ${result} at "${_chunkJXYBDFPKcjs.joinPaths.call(void 0, filePath.path, filePath.name)}"`, config);
|
|
775
781
|
if (!results.includes(result)) {
|
|
776
782
|
results.push(result);
|
|
777
783
|
}
|
|
@@ -819,12 +825,12 @@ var resolveOptions = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async
|
|
|
819
825
|
throw new Error("Cannot find Nx workspace root");
|
|
820
826
|
}
|
|
821
827
|
const config = await getConfig(workspaceRoot.dir);
|
|
822
|
-
|
|
823
|
-
const stopwatch =
|
|
828
|
+
_chunkJXYBDFPKcjs.writeDebug.call(void 0, " \u2699\uFE0F Resolving build options", config);
|
|
829
|
+
const stopwatch = _chunkJXYBDFPKcjs.getStopwatch.call(void 0, "Build options resolution");
|
|
824
830
|
const projectGraph = await _devkit.createProjectGraphAsync.call(void 0, {
|
|
825
831
|
exitOnError: true
|
|
826
832
|
});
|
|
827
|
-
const projectJsonPath =
|
|
833
|
+
const projectJsonPath = _chunkJXYBDFPKcjs.joinPaths.call(void 0, workspaceRoot.dir, projectRoot, "project.json");
|
|
828
834
|
if (!_fs.existsSync.call(void 0, projectJsonPath)) {
|
|
829
835
|
throw new Error("Cannot find project.json configuration");
|
|
830
836
|
}
|
|
@@ -838,7 +844,7 @@ var resolveOptions = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async
|
|
|
838
844
|
const options = _defu2.default.call(void 0, userOptions, _chunk5KRF6IVWcjs.DEFAULT_BUILD_OPTIONS);
|
|
839
845
|
options.name ??= `${projectName}-${options.format}`;
|
|
840
846
|
options.target ??= DEFAULT_TARGET;
|
|
841
|
-
const packageJsonPath =
|
|
847
|
+
const packageJsonPath = _chunkJXYBDFPKcjs.joinPaths.call(void 0, workspaceRoot.dir, options.projectRoot, "package.json");
|
|
842
848
|
if (!_fs.existsSync.call(void 0, packageJsonPath)) {
|
|
843
849
|
throw new Error("Cannot find package.json configuration");
|
|
844
850
|
}
|
|
@@ -847,20 +853,20 @@ var resolveOptions = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async
|
|
|
847
853
|
...options,
|
|
848
854
|
config,
|
|
849
855
|
...userOptions,
|
|
850
|
-
tsconfig:
|
|
856
|
+
tsconfig: _chunkJXYBDFPKcjs.joinPaths.call(void 0, projectRoot, userOptions.tsconfig ? userOptions.tsconfig.replace(projectRoot, "") : "tsconfig.json"),
|
|
851
857
|
format: options.format || "cjs",
|
|
852
858
|
entryPoints: await getEntryPoints(config, projectRoot, projectJson.sourceRoot, userOptions.entry || [
|
|
853
859
|
"./src/index.ts"
|
|
854
860
|
], userOptions.emitOnAll),
|
|
855
|
-
outdir: userOptions.outputPath ||
|
|
861
|
+
outdir: userOptions.outputPath || _chunkJXYBDFPKcjs.joinPaths.call(void 0, "dist", projectRoot),
|
|
856
862
|
plugins: [],
|
|
857
863
|
name: userOptions.name || projectName,
|
|
858
864
|
projectConfigurations,
|
|
859
865
|
projectName,
|
|
860
866
|
projectGraph,
|
|
861
|
-
sourceRoot: userOptions.sourceRoot || projectJson.sourceRoot ||
|
|
867
|
+
sourceRoot: userOptions.sourceRoot || projectJson.sourceRoot || _chunkJXYBDFPKcjs.joinPaths.call(void 0, projectRoot, "src"),
|
|
862
868
|
minify: userOptions.minify || !userOptions.debug,
|
|
863
|
-
verbose: userOptions.verbose ||
|
|
869
|
+
verbose: userOptions.verbose || _chunkJXYBDFPKcjs.isVerbose.call(void 0, ) || userOptions.debug === true,
|
|
864
870
|
includeSrc: userOptions.includeSrc === true,
|
|
865
871
|
metafile: userOptions.metafile !== false,
|
|
866
872
|
generatePackageJson: userOptions.generatePackageJson !== false,
|
|
@@ -894,14 +900,14 @@ var resolveOptions = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async
|
|
|
894
900
|
return result;
|
|
895
901
|
}, "resolveOptions");
|
|
896
902
|
async function generatePackageJson(options) {
|
|
897
|
-
if (options.generatePackageJson !== false && _fs.existsSync.call(void 0,
|
|
898
|
-
|
|
899
|
-
const stopwatch =
|
|
900
|
-
const packageJsonPath =
|
|
903
|
+
if (options.generatePackageJson !== false && _fs.existsSync.call(void 0, _chunkJXYBDFPKcjs.joinPaths.call(void 0, options.projectRoot, "package.json"))) {
|
|
904
|
+
_chunkJXYBDFPKcjs.writeDebug.call(void 0, " \u270D\uFE0F Writing package.json file", options.config);
|
|
905
|
+
const stopwatch = _chunkJXYBDFPKcjs.getStopwatch.call(void 0, "Write package.json file");
|
|
906
|
+
const packageJsonPath = _chunkJXYBDFPKcjs.joinPaths.call(void 0, options.projectRoot, "project.json");
|
|
901
907
|
if (!_fs.existsSync.call(void 0, packageJsonPath)) {
|
|
902
908
|
throw new Error("Cannot find package.json configuration");
|
|
903
909
|
}
|
|
904
|
-
const packageJsonFile = await _promises2.default.readFile(
|
|
910
|
+
const packageJsonFile = await _promises2.default.readFile(_chunkJXYBDFPKcjs.joinPaths.call(void 0, options.config.workspaceRoot, options.projectRoot, "package.json"), "utf8");
|
|
905
911
|
if (!packageJsonFile) {
|
|
906
912
|
throw new Error("Cannot find package.json configuration file");
|
|
907
913
|
}
|
|
@@ -940,15 +946,15 @@ async function generatePackageJson(options) {
|
|
|
940
946
|
}
|
|
941
947
|
return ret;
|
|
942
948
|
}, packageJson.exports);
|
|
943
|
-
await _devkit.writeJsonFile.call(void 0,
|
|
949
|
+
await _devkit.writeJsonFile.call(void 0, _chunkJXYBDFPKcjs.joinPaths.call(void 0, options.outdir, "package.json"), packageJson);
|
|
944
950
|
stopwatch();
|
|
945
951
|
}
|
|
946
952
|
return options;
|
|
947
953
|
}
|
|
948
954
|
_chunkUSNT2KNTcjs.__name.call(void 0, generatePackageJson, "generatePackageJson");
|
|
949
955
|
async function executeTSDown(options) {
|
|
950
|
-
|
|
951
|
-
const stopwatch =
|
|
956
|
+
_chunkJXYBDFPKcjs.writeDebug.call(void 0, ` \u{1F680} Running ${options.name} build`, options.config);
|
|
957
|
+
const stopwatch = _chunkJXYBDFPKcjs.getStopwatch.call(void 0, `${options.name} build`);
|
|
952
958
|
await _tsdown.build.call(void 0, {
|
|
953
959
|
...options,
|
|
954
960
|
entry: options.entryPoints,
|
|
@@ -960,30 +966,30 @@ async function executeTSDown(options) {
|
|
|
960
966
|
}
|
|
961
967
|
_chunkUSNT2KNTcjs.__name.call(void 0, executeTSDown, "executeTSDown");
|
|
962
968
|
async function copyBuildAssets(options) {
|
|
963
|
-
|
|
964
|
-
const stopwatch =
|
|
969
|
+
_chunkJXYBDFPKcjs.writeDebug.call(void 0, ` \u{1F4CB} Copying asset files to output directory: ${options.outdir}`, options.config);
|
|
970
|
+
const stopwatch = _chunkJXYBDFPKcjs.getStopwatch.call(void 0, `${options.name} asset copy`);
|
|
965
971
|
await copyAssets(options.config, _nullishCoalesce(options.assets, () => ( [])), options.outdir, options.projectRoot, options.sourceRoot, true, false);
|
|
966
972
|
stopwatch();
|
|
967
973
|
return options;
|
|
968
974
|
}
|
|
969
975
|
_chunkUSNT2KNTcjs.__name.call(void 0, copyBuildAssets, "copyBuildAssets");
|
|
970
976
|
async function reportResults(options) {
|
|
971
|
-
|
|
977
|
+
_chunkJXYBDFPKcjs.writeSuccess.call(void 0, ` \u{1F4E6} The ${options.name} build completed successfully`, options.config);
|
|
972
978
|
}
|
|
973
979
|
_chunkUSNT2KNTcjs.__name.call(void 0, reportResults, "reportResults");
|
|
974
980
|
async function cleanOutputPath(options) {
|
|
975
981
|
if (options.clean !== false && options.outdir) {
|
|
976
|
-
|
|
977
|
-
const stopwatch =
|
|
978
|
-
await
|
|
982
|
+
_chunkJXYBDFPKcjs.writeDebug.call(void 0, ` \u{1F9F9} Cleaning ${options.name} output path: ${options.outdir}`, options.config);
|
|
983
|
+
const stopwatch = _chunkJXYBDFPKcjs.getStopwatch.call(void 0, `${options.name} output clean`);
|
|
984
|
+
await _chunkJXYBDFPKcjs.cleanDirectories.call(void 0, options.name, options.outdir, options.config);
|
|
979
985
|
stopwatch();
|
|
980
986
|
}
|
|
981
987
|
return options;
|
|
982
988
|
}
|
|
983
989
|
_chunkUSNT2KNTcjs.__name.call(void 0, cleanOutputPath, "cleanOutputPath");
|
|
984
990
|
async function build(options) {
|
|
985
|
-
|
|
986
|
-
const stopwatch =
|
|
991
|
+
_chunkJXYBDFPKcjs.writeDebug.call(void 0, ` \u26A1 Executing Storm TSDown pipeline`);
|
|
992
|
+
const stopwatch = _chunkJXYBDFPKcjs.getStopwatch.call(void 0, "TSDown pipeline");
|
|
987
993
|
try {
|
|
988
994
|
const opts = Array.isArray(options) ? options : [
|
|
989
995
|
options
|
|
@@ -1001,11 +1007,11 @@ async function build(options) {
|
|
|
1001
1007
|
await reportResults(opt);
|
|
1002
1008
|
}));
|
|
1003
1009
|
} else {
|
|
1004
|
-
|
|
1010
|
+
_chunkJXYBDFPKcjs.writeWarning.call(void 0, " \u{1F6A7} No options were passed to TSBuild. Please check the parameters passed to the `build` function.");
|
|
1005
1011
|
}
|
|
1006
|
-
|
|
1012
|
+
_chunkJXYBDFPKcjs.writeSuccess.call(void 0, " \u{1F3C1} TSDown pipeline build completed successfully");
|
|
1007
1013
|
} catch (error) {
|
|
1008
|
-
|
|
1014
|
+
_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
1015
|
throw error;
|
|
1010
1016
|
} finally {
|
|
1011
1017
|
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 _chunkQOJUBCJRcjs = require('./chunk-QOJUBCJR.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 = _chunkQOJUBCJRcjs.build; exports.clean = _chunkJXYBDFPKcjs.clean; exports.cleanDirectories = _chunkJXYBDFPKcjs.cleanDirectories; exports.cleanOutputPath = _chunkQOJUBCJRcjs.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-CRCK2NCN.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";
|