@storm-software/tsdown 0.19.0 → 0.20.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/build.cjs +3 -3
- package/dist/build.js +2 -2
- package/dist/{chunk-QYOK2QJA.cjs → chunk-3RSRST47.cjs} +9 -8
- package/dist/{chunk-D42RFSA4.js → chunk-4WO7ZRQL.js} +9 -8
- package/dist/{chunk-6NMTPFXQ.js → chunk-FWJ4AMBZ.js} +35 -48
- package/dist/{chunk-TEQW7DKT.cjs → chunk-WRVVU7ZB.cjs} +105 -118
- 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 +188 -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,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var _chunkWRVVU7ZBcjs = require('./chunk-WRVVU7ZB.cjs');
|
|
4
|
+
require('./chunk-3RSRST47.cjs');
|
|
5
5
|
require('./chunk-5KRF6IVW.cjs');
|
|
6
6
|
require('./chunk-USNT2KNT.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
exports.build =
|
|
9
|
+
exports.build = _chunkWRVVU7ZBcjs.build;
|
package/dist/build.js
CHANGED
|
@@ -416,7 +416,8 @@ var CONSOLE_ICONS = {
|
|
|
416
416
|
[LogLevelLabel.INFO]: useIcon("\u2139", "i"),
|
|
417
417
|
[LogLevelLabel.SUCCESS]: useIcon("\u2714", "\u221A"),
|
|
418
418
|
[LogLevelLabel.DEBUG]: useIcon("\u{1F6E0}", "D"),
|
|
419
|
-
[LogLevelLabel.TRACE]: useIcon("\
|
|
419
|
+
[LogLevelLabel.TRACE]: useIcon("\u{1F6E0}", "T"),
|
|
420
|
+
[LogLevelLabel.ALL]: useIcon("\u2709", "\u2192")
|
|
420
421
|
};
|
|
421
422
|
|
|
422
423
|
// ../config-tools/src/logger/format-timestamp.ts
|
|
@@ -491,48 +492,48 @@ var getLogFn = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (logLevel =
|
|
|
491
492
|
if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel || typeof logLevel === "string" && LogLevel.FATAL >= getLogLevel(logLevel)) {
|
|
492
493
|
return (message) => {
|
|
493
494
|
console.error(`
|
|
494
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.
|
|
495
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.fatal, () => ( "#7d1a1a")))(`[${CONSOLE_ICONS[LogLevelLabel.FATAL]} Fatal]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
495
496
|
`);
|
|
496
497
|
};
|
|
497
498
|
}
|
|
498
499
|
if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel || typeof logLevel === "string" && LogLevel.ERROR >= getLogLevel(logLevel)) {
|
|
499
500
|
return (message) => {
|
|
500
501
|
console.error(`
|
|
501
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.
|
|
502
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.danger, () => ( "#f85149")))(`[${CONSOLE_ICONS[LogLevelLabel.ERROR]} Error]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
502
503
|
`);
|
|
503
504
|
};
|
|
504
505
|
}
|
|
505
506
|
if (typeof logLevel === "number" && LogLevel.WARN >= logLevel || typeof logLevel === "string" && LogLevel.WARN >= getLogLevel(logLevel)) {
|
|
506
507
|
return (message) => {
|
|
507
508
|
console.warn(`
|
|
508
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.
|
|
509
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.warning, () => ( "#e3b341")))(`[${CONSOLE_ICONS[LogLevelLabel.WARN]} Warn]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
509
510
|
`);
|
|
510
511
|
};
|
|
511
512
|
}
|
|
512
513
|
if (typeof logLevel === "number" && LogLevel.SUCCESS >= logLevel || typeof logLevel === "string" && LogLevel.SUCCESS >= getLogLevel(logLevel)) {
|
|
513
514
|
return (message) => {
|
|
514
515
|
console.info(`
|
|
515
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.
|
|
516
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.success, () => ( "#56d364")))(`[${CONSOLE_ICONS[LogLevelLabel.SUCCESS]} Success]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
516
517
|
`);
|
|
517
518
|
};
|
|
518
519
|
}
|
|
519
520
|
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
|
|
520
521
|
return (message) => {
|
|
521
522
|
console.info(`
|
|
522
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.
|
|
523
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.info, () => ( "#58a6ff")))(`[${CONSOLE_ICONS[LogLevelLabel.INFO]} Info]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
523
524
|
`);
|
|
524
525
|
};
|
|
525
526
|
}
|
|
526
527
|
if (typeof logLevel === "number" && LogLevel.TRACE >= logLevel || typeof logLevel === "string" && LogLevel.TRACE >= getLogLevel(logLevel)) {
|
|
527
528
|
return (message) => {
|
|
528
529
|
console.debug(`
|
|
529
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.
|
|
530
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.brand, () => ( "#1fb2a6")))(`[${CONSOLE_ICONS[LogLevelLabel.DEBUG]} Debug]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
530
531
|
`);
|
|
531
532
|
};
|
|
532
533
|
}
|
|
533
534
|
return (message) => {
|
|
534
535
|
console.log(`
|
|
535
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.
|
|
536
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.brand, () => ( "#1fb2a6")))(`[${CONSOLE_ICONS[LogLevelLabel.ALL]} System]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
536
537
|
`);
|
|
537
538
|
};
|
|
538
539
|
}, "getLogFn");
|
|
@@ -416,7 +416,8 @@ var CONSOLE_ICONS = {
|
|
|
416
416
|
[LogLevelLabel.INFO]: useIcon("\u2139", "i"),
|
|
417
417
|
[LogLevelLabel.SUCCESS]: useIcon("\u2714", "\u221A"),
|
|
418
418
|
[LogLevelLabel.DEBUG]: useIcon("\u{1F6E0}", "D"),
|
|
419
|
-
[LogLevelLabel.TRACE]: useIcon("\
|
|
419
|
+
[LogLevelLabel.TRACE]: useIcon("\u{1F6E0}", "T"),
|
|
420
|
+
[LogLevelLabel.ALL]: useIcon("\u2709", "\u2192")
|
|
420
421
|
};
|
|
421
422
|
|
|
422
423
|
// ../config-tools/src/logger/format-timestamp.ts
|
|
@@ -491,48 +492,48 @@ var getLogFn = /* @__PURE__ */ __name((logLevel = LogLevel.INFO, config = {}) =>
|
|
|
491
492
|
if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel || typeof logLevel === "string" && LogLevel.FATAL >= getLogLevel(logLevel)) {
|
|
492
493
|
return (message) => {
|
|
493
494
|
console.error(`
|
|
494
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.
|
|
495
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.fatal ?? "#7d1a1a")(`[${CONSOLE_ICONS[LogLevelLabel.FATAL]} Fatal]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
495
496
|
`);
|
|
496
497
|
};
|
|
497
498
|
}
|
|
498
499
|
if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel || typeof logLevel === "string" && LogLevel.ERROR >= getLogLevel(logLevel)) {
|
|
499
500
|
return (message) => {
|
|
500
501
|
console.error(`
|
|
501
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.
|
|
502
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.danger ?? "#f85149")(`[${CONSOLE_ICONS[LogLevelLabel.ERROR]} Error]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
502
503
|
`);
|
|
503
504
|
};
|
|
504
505
|
}
|
|
505
506
|
if (typeof logLevel === "number" && LogLevel.WARN >= logLevel || typeof logLevel === "string" && LogLevel.WARN >= getLogLevel(logLevel)) {
|
|
506
507
|
return (message) => {
|
|
507
508
|
console.warn(`
|
|
508
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.
|
|
509
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.warning ?? "#e3b341")(`[${CONSOLE_ICONS[LogLevelLabel.WARN]} Warn]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
509
510
|
`);
|
|
510
511
|
};
|
|
511
512
|
}
|
|
512
513
|
if (typeof logLevel === "number" && LogLevel.SUCCESS >= logLevel || typeof logLevel === "string" && LogLevel.SUCCESS >= getLogLevel(logLevel)) {
|
|
513
514
|
return (message) => {
|
|
514
515
|
console.info(`
|
|
515
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.
|
|
516
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.success ?? "#56d364")(`[${CONSOLE_ICONS[LogLevelLabel.SUCCESS]} Success]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
516
517
|
`);
|
|
517
518
|
};
|
|
518
519
|
}
|
|
519
520
|
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
|
|
520
521
|
return (message) => {
|
|
521
522
|
console.info(`
|
|
522
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.
|
|
523
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.info ?? "#58a6ff")(`[${CONSOLE_ICONS[LogLevelLabel.INFO]} Info]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
523
524
|
`);
|
|
524
525
|
};
|
|
525
526
|
}
|
|
526
527
|
if (typeof logLevel === "number" && LogLevel.TRACE >= logLevel || typeof logLevel === "string" && LogLevel.TRACE >= getLogLevel(logLevel)) {
|
|
527
528
|
return (message) => {
|
|
528
529
|
console.debug(`
|
|
529
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.
|
|
530
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.brand ?? "#1fb2a6")(`[${CONSOLE_ICONS[LogLevelLabel.DEBUG]} Debug]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
530
531
|
`);
|
|
531
532
|
};
|
|
532
533
|
}
|
|
533
534
|
return (message) => {
|
|
534
535
|
console.log(`
|
|
535
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.
|
|
536
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.brand ?? "#1fb2a6")(`[${CONSOLE_ICONS[LogLevelLabel.ALL]} System]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
536
537
|
`);
|
|
537
538
|
};
|
|
538
539
|
}, "getLogFn");
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
writeSystem,
|
|
21
21
|
writeTrace,
|
|
22
22
|
writeWarning
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-4WO7ZRQL.js";
|
|
24
24
|
import {
|
|
25
25
|
DEFAULT_BUILD_OPTIONS
|
|
26
26
|
} from "./chunk-UQLCBJOS.js";
|
|
@@ -29,8 +29,8 @@ import {
|
|
|
29
29
|
} from "./chunk-SHUYVCID.js";
|
|
30
30
|
|
|
31
31
|
// src/build.ts
|
|
32
|
-
import { hfs
|
|
33
|
-
import { createProjectGraphAsync
|
|
32
|
+
import { hfs } from "@humanfs/node";
|
|
33
|
+
import { createProjectGraphAsync, readProjectsConfigurationFromProjectGraph as readProjectsConfigurationFromProjectGraph2, writeJsonFile } from "@nx/devkit";
|
|
34
34
|
|
|
35
35
|
// ../build-tools/src/config.ts
|
|
36
36
|
var DEFAULT_ENVIRONMENT = "production";
|
|
@@ -51,39 +51,36 @@ import { stripIndents } from "@nx/devkit";
|
|
|
51
51
|
import { relative } from "path";
|
|
52
52
|
|
|
53
53
|
// ../build-tools/src/utilities/copy-assets.ts
|
|
54
|
-
import {
|
|
55
|
-
import { createProjectGraphAsync, readProjectsConfigurationFromProjectGraph } from "@nx/devkit";
|
|
54
|
+
import { readCachedProjectGraph, readProjectsConfigurationFromProjectGraph } from "@nx/devkit";
|
|
56
55
|
import { copyAssets as copyAssetsBase } from "@nx/js";
|
|
57
56
|
import { glob } from "glob";
|
|
58
|
-
|
|
59
|
-
// ../build-tools/src/utilities/read-nx-config.ts
|
|
60
|
-
import { hfs } from "@humanfs/node";
|
|
57
|
+
import { readFile as readFile2, writeFile } from "node:fs/promises";
|
|
61
58
|
|
|
62
59
|
// ../config-tools/src/config-file/get-config-file.ts
|
|
63
60
|
import { loadConfig } from "c12";
|
|
64
61
|
import defu from "defu";
|
|
65
62
|
var getConfigFileByName = /* @__PURE__ */ __name(async (fileName, filePath, options = {}) => {
|
|
66
63
|
const workspacePath = filePath || findWorkspaceRoot(filePath);
|
|
67
|
-
let config = loadConfig({
|
|
64
|
+
let config = await loadConfig({
|
|
68
65
|
cwd: workspacePath,
|
|
69
66
|
packageJson: true,
|
|
70
67
|
name: fileName,
|
|
71
68
|
envName: fileName?.toUpperCase(),
|
|
72
69
|
jitiOptions: {
|
|
73
70
|
debug: false,
|
|
74
|
-
|
|
71
|
+
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths(process.env.STORM_CACHE_DIR || "node_modules/.cache/storm", "jiti")
|
|
75
72
|
},
|
|
76
73
|
...options
|
|
77
74
|
});
|
|
78
75
|
if (!config || Object.keys(config).length === 0) {
|
|
79
|
-
config = loadConfig({
|
|
76
|
+
config = await loadConfig({
|
|
80
77
|
cwd: workspacePath,
|
|
81
78
|
packageJson: true,
|
|
82
79
|
name: fileName,
|
|
83
80
|
envName: fileName?.toUpperCase(),
|
|
84
81
|
jitiOptions: {
|
|
85
82
|
debug: false,
|
|
86
|
-
|
|
83
|
+
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : joinPaths(process.env.STORM_CACHE_DIR || "node_modules/.cache/storm", "jiti")
|
|
87
84
|
},
|
|
88
85
|
configFile: fileName,
|
|
89
86
|
...options
|
|
@@ -537,6 +534,8 @@ ${formatLogMessage(config)}`, config);
|
|
|
537
534
|
}, "loadStormConfig");
|
|
538
535
|
|
|
539
536
|
// ../build-tools/src/utilities/read-nx-config.ts
|
|
537
|
+
import { existsSync } from "node:fs";
|
|
538
|
+
import { readFile } from "node:fs/promises";
|
|
540
539
|
var readNxConfig = /* @__PURE__ */ __name(async (workspaceRoot) => {
|
|
541
540
|
let rootDir = workspaceRoot;
|
|
542
541
|
if (!rootDir) {
|
|
@@ -544,10 +543,11 @@ var readNxConfig = /* @__PURE__ */ __name(async (workspaceRoot) => {
|
|
|
544
543
|
rootDir = config.workspaceRoot;
|
|
545
544
|
}
|
|
546
545
|
const nxJsonPath = joinPaths(rootDir, "nx.json");
|
|
547
|
-
if (!
|
|
546
|
+
if (!existsSync(nxJsonPath)) {
|
|
548
547
|
throw new Error("Cannot find project.json configuration");
|
|
549
548
|
}
|
|
550
|
-
|
|
549
|
+
const configContent = await readFile(nxJsonPath, "utf8");
|
|
550
|
+
return JSON.parse(configContent);
|
|
551
551
|
}, "readNxConfig");
|
|
552
552
|
|
|
553
553
|
// ../build-tools/src/utilities/copy-assets.ts
|
|
@@ -582,14 +582,12 @@ var copyAssets = /* @__PURE__ */ __name(async (config, assets, outputPath, proje
|
|
|
582
582
|
});
|
|
583
583
|
}
|
|
584
584
|
const nxJson = readNxConfig(config.workspaceRoot);
|
|
585
|
-
const projectGraph =
|
|
586
|
-
exitOnError: true
|
|
587
|
-
});
|
|
585
|
+
const projectGraph = readCachedProjectGraph();
|
|
588
586
|
const projectsConfigurations = readProjectsConfigurationFromProjectGraph(projectGraph);
|
|
589
587
|
if (!projectsConfigurations?.projects?.[projectName]) {
|
|
590
588
|
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.");
|
|
591
589
|
}
|
|
592
|
-
const buildTarget = projectsConfigurations.projects[projectName]
|
|
590
|
+
const buildTarget = projectsConfigurations.projects[projectName].targets?.build;
|
|
593
591
|
if (!buildTarget) {
|
|
594
592
|
throw new Error(`The Build process failed because the project does not have a valid build target in the project.json file. Check if the file exists in the root of the project at ${joinPaths(projectRoot, "project.json")}`);
|
|
595
593
|
}
|
|
@@ -619,42 +617,30 @@ var copyAssets = /* @__PURE__ */ __name(async (config, assets, outputPath, proje
|
|
|
619
617
|
joinPaths(config.workspaceRoot, outputPath, "src/**/*.js"),
|
|
620
618
|
joinPaths(config.workspaceRoot, outputPath, "src/**/*.jsx")
|
|
621
619
|
]);
|
|
622
|
-
await Promise.allSettled(files.map(async (file) =>
|
|
620
|
+
await Promise.allSettled(files.map(async (file) => writeFile(file, `${banner && typeof banner === "string" ? banner.startsWith("//") ? banner : `// ${banner}` : ""}
|
|
623
621
|
|
|
624
|
-
${await
|
|
622
|
+
${await readFile2(file, "utf8")}
|
|
625
623
|
|
|
626
624
|
${footer && typeof footer === "string" ? footer.startsWith("//") ? footer : `// ${footer}` : ""}`)));
|
|
627
625
|
}
|
|
628
626
|
}, "copyAssets");
|
|
629
627
|
|
|
630
628
|
// ../build-tools/src/utilities/generate-package-json.ts
|
|
631
|
-
import { hfs as hfs3 } from "@humanfs/node";
|
|
632
629
|
import { calculateProjectBuildableDependencies } from "@nx/js/src/utils/buildable-libs-utils";
|
|
633
630
|
import { Glob } from "glob";
|
|
634
|
-
import {
|
|
631
|
+
import { existsSync as existsSync2 } from "node:fs";
|
|
632
|
+
import { readFile as readFile3 } from "node:fs/promises";
|
|
633
|
+
import { readCachedProjectGraph as readCachedProjectGraph2 } from "nx/src/project-graph/project-graph";
|
|
635
634
|
var addPackageDependencies = /* @__PURE__ */ __name(async (workspaceRoot, projectRoot, projectName, packageJson) => {
|
|
636
|
-
const
|
|
637
|
-
exitOnError: true
|
|
638
|
-
});
|
|
639
|
-
const projectConfigurations = readProjectsConfigurationFromProjectGraph2(projectGraph);
|
|
640
|
-
if (!projectConfigurations?.projects?.[projectName]) {
|
|
641
|
-
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.");
|
|
642
|
-
}
|
|
643
|
-
const projectJsonPath = joinPaths(workspaceRoot, projectRoot, "project.json");
|
|
644
|
-
if (!await hfs3.isFile(projectJsonPath)) {
|
|
645
|
-
throw new Error("Cannot find project.json configuration");
|
|
646
|
-
}
|
|
647
|
-
if (!projectConfigurations?.projects?.[projectName]) {
|
|
648
|
-
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.");
|
|
649
|
-
}
|
|
650
|
-
const projectDependencies = calculateProjectBuildableDependencies(void 0, projectGraph, workspaceRoot, projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
|
|
635
|
+
const projectDependencies = calculateProjectBuildableDependencies(void 0, readCachedProjectGraph2(), workspaceRoot, projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
|
|
651
636
|
const localPackages = [];
|
|
652
637
|
for (const project of projectDependencies.dependencies.filter((dep) => dep.node.type === "lib" && dep.node.data.root !== projectRoot && dep.node.data.root !== workspaceRoot)) {
|
|
653
638
|
const projectNode = project.node;
|
|
654
639
|
if (projectNode.data.root) {
|
|
655
640
|
const projectPackageJsonPath = joinPaths(workspaceRoot, projectNode.data.root, "package.json");
|
|
656
|
-
if (
|
|
657
|
-
const
|
|
641
|
+
if (existsSync2(projectPackageJsonPath)) {
|
|
642
|
+
const projectPackageJsonContent = await readFile3(projectPackageJsonPath, "utf8");
|
|
643
|
+
const projectPackageJson = JSON.parse(projectPackageJsonContent);
|
|
658
644
|
if (projectPackageJson.private !== false) {
|
|
659
645
|
localPackages.push(projectPackageJson);
|
|
660
646
|
}
|
|
@@ -690,7 +676,8 @@ var addPackageDependencies = /* @__PURE__ */ __name(async (workspaceRoot, projec
|
|
|
690
676
|
}, "addPackageDependencies");
|
|
691
677
|
var addWorkspacePackageJsonFields = /* @__PURE__ */ __name(async (config, projectRoot, sourceRoot, projectName, includeSrc = false, packageJson) => {
|
|
692
678
|
const workspaceRoot = config.workspaceRoot ? config.workspaceRoot : findWorkspaceRoot();
|
|
693
|
-
const
|
|
679
|
+
const workspacePackageJsonContent = await readFile3(joinPaths(workspaceRoot, "package.json"), "utf8");
|
|
680
|
+
const workspacePackageJson = JSON.parse(workspacePackageJsonContent);
|
|
694
681
|
packageJson.type ??= "module";
|
|
695
682
|
packageJson.sideEffects ??= false;
|
|
696
683
|
if (includeSrc === true) {
|
|
@@ -823,16 +810,16 @@ var resolveOptions = /* @__PURE__ */ __name(async (userOptions) => {
|
|
|
823
810
|
const config = await loadStormConfig(workspaceRoot.dir);
|
|
824
811
|
writeDebug(" \u2699\uFE0F Resolving build options", config);
|
|
825
812
|
const stopwatch = getStopwatch("Build options resolution");
|
|
826
|
-
const projectGraph = await
|
|
813
|
+
const projectGraph = await createProjectGraphAsync({
|
|
827
814
|
exitOnError: true
|
|
828
815
|
});
|
|
829
816
|
const projectJsonPath = joinPaths(workspaceRoot.dir, projectRoot, "project.json");
|
|
830
|
-
if (!await
|
|
817
|
+
if (!await hfs.isFile(projectJsonPath)) {
|
|
831
818
|
throw new Error("Cannot find project.json configuration");
|
|
832
819
|
}
|
|
833
|
-
const projectJson = await
|
|
820
|
+
const projectJson = await hfs.json(projectJsonPath);
|
|
834
821
|
const projectName = projectJson.name;
|
|
835
|
-
const projectConfigurations =
|
|
822
|
+
const projectConfigurations = readProjectsConfigurationFromProjectGraph2(projectGraph);
|
|
836
823
|
if (!projectConfigurations?.projects?.[projectName]) {
|
|
837
824
|
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.");
|
|
838
825
|
}
|
|
@@ -840,7 +827,7 @@ var resolveOptions = /* @__PURE__ */ __name(async (userOptions) => {
|
|
|
840
827
|
options.name ??= `${projectName}-${options.format}`;
|
|
841
828
|
options.target ??= DEFAULT_TARGET;
|
|
842
829
|
const packageJsonPath = joinPaths(workspaceRoot.dir, options.projectRoot, "package.json");
|
|
843
|
-
if (!await
|
|
830
|
+
if (!await hfs.isFile(packageJsonPath)) {
|
|
844
831
|
throw new Error("Cannot find package.json configuration");
|
|
845
832
|
}
|
|
846
833
|
const env = getEnv("tsdown", options);
|
|
@@ -895,14 +882,14 @@ var resolveOptions = /* @__PURE__ */ __name(async (userOptions) => {
|
|
|
895
882
|
return result;
|
|
896
883
|
}, "resolveOptions");
|
|
897
884
|
async function generatePackageJson(options) {
|
|
898
|
-
if (options.generatePackageJson !== false && await
|
|
885
|
+
if (options.generatePackageJson !== false && await hfs.isFile(joinPaths(options.projectRoot, "package.json"))) {
|
|
899
886
|
writeDebug(" \u270D\uFE0F Writing package.json file", options.config);
|
|
900
887
|
const stopwatch = getStopwatch("Write package.json file");
|
|
901
888
|
const packageJsonPath = joinPaths(options.projectRoot, "project.json");
|
|
902
|
-
if (!await
|
|
889
|
+
if (!await hfs.isFile(packageJsonPath)) {
|
|
903
890
|
throw new Error("Cannot find package.json configuration");
|
|
904
891
|
}
|
|
905
|
-
let packageJson = await
|
|
892
|
+
let packageJson = await hfs.json(joinPaths(options.config.workspaceRoot, options.projectRoot, "package.json"));
|
|
906
893
|
if (!packageJson) {
|
|
907
894
|
throw new Error("Cannot find package.json configuration file");
|
|
908
895
|
}
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
var
|
|
23
|
+
var _chunk3RSRST47cjs = require('./chunk-3RSRST47.cjs');
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
var _chunk5KRF6IVWcjs = require('./chunk-5KRF6IVW.cjs');
|
|
@@ -52,38 +52,35 @@ var _resolve2 = require('resolve'); var _resolve3 = _interopRequireDefault(_reso
|
|
|
52
52
|
|
|
53
53
|
// ../build-tools/src/utilities/copy-assets.ts
|
|
54
54
|
|
|
55
|
-
|
|
56
55
|
var _js = require('@nx/js');
|
|
57
56
|
var _glob = require('glob');
|
|
58
|
-
|
|
59
|
-
// ../build-tools/src/utilities/read-nx-config.ts
|
|
60
|
-
|
|
57
|
+
var _promises = require('fs/promises');
|
|
61
58
|
|
|
62
59
|
// ../config-tools/src/config-file/get-config-file.ts
|
|
63
60
|
var _c12 = require('c12');
|
|
64
61
|
var _defu = require('defu'); var _defu2 = _interopRequireDefault(_defu);
|
|
65
62
|
var getConfigFileByName = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async (fileName, filePath, options = {}) => {
|
|
66
|
-
const workspacePath = filePath ||
|
|
67
|
-
let config = _c12.loadConfig.call(void 0, {
|
|
63
|
+
const workspacePath = filePath || _chunk3RSRST47cjs.findWorkspaceRoot.call(void 0, filePath);
|
|
64
|
+
let config = await _c12.loadConfig.call(void 0, {
|
|
68
65
|
cwd: workspacePath,
|
|
69
66
|
packageJson: true,
|
|
70
67
|
name: fileName,
|
|
71
68
|
envName: _optionalChain([fileName, 'optionalAccess', _ => _.toUpperCase, 'call', _2 => _2()]),
|
|
72
69
|
jitiOptions: {
|
|
73
70
|
debug: false,
|
|
74
|
-
|
|
71
|
+
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : _chunk3RSRST47cjs.joinPaths.call(void 0, process.env.STORM_CACHE_DIR || "node_modules/.cache/storm", "jiti")
|
|
75
72
|
},
|
|
76
73
|
...options
|
|
77
74
|
});
|
|
78
75
|
if (!config || Object.keys(config).length === 0) {
|
|
79
|
-
config = _c12.loadConfig.call(void 0, {
|
|
76
|
+
config = await _c12.loadConfig.call(void 0, {
|
|
80
77
|
cwd: workspacePath,
|
|
81
78
|
packageJson: true,
|
|
82
79
|
name: fileName,
|
|
83
80
|
envName: _optionalChain([fileName, 'optionalAccess', _3 => _3.toUpperCase, 'call', _4 => _4()]),
|
|
84
81
|
jitiOptions: {
|
|
85
82
|
debug: false,
|
|
86
|
-
|
|
83
|
+
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : _chunk3RSRST47cjs.joinPaths.call(void 0, process.env.STORM_CACHE_DIR || "node_modules/.cache/storm", "jiti")
|
|
87
84
|
},
|
|
88
85
|
configFile: fileName,
|
|
89
86
|
...options
|
|
@@ -92,12 +89,12 @@ var getConfigFileByName = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0,
|
|
|
92
89
|
return config;
|
|
93
90
|
}, "getConfigFileByName");
|
|
94
91
|
var getConfigFile = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async (filePath, additionalFileNames = []) => {
|
|
95
|
-
const workspacePath = filePath ? filePath :
|
|
92
|
+
const workspacePath = filePath ? filePath : _chunk3RSRST47cjs.findWorkspaceRoot.call(void 0, filePath);
|
|
96
93
|
const result = await getConfigFileByName("storm", workspacePath);
|
|
97
94
|
let config = result.config;
|
|
98
95
|
const configFile = result.configFile;
|
|
99
96
|
if (config && configFile && Object.keys(config).length > 0) {
|
|
100
|
-
|
|
97
|
+
_chunk3RSRST47cjs.writeSystem.call(void 0, `Found Storm configuration file "${configFile.includes(`${workspacePath}/`) ? configFile.replace(`${workspacePath}/`, "") : configFile}" at "${workspacePath}"`, {
|
|
101
98
|
logLevel: "all"
|
|
102
99
|
});
|
|
103
100
|
}
|
|
@@ -105,7 +102,7 @@ var getConfigFile = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async
|
|
|
105
102
|
const results = await Promise.all(additionalFileNames.map((fileName) => getConfigFileByName(fileName, workspacePath)));
|
|
106
103
|
for (const result2 of results) {
|
|
107
104
|
if (_optionalChain([result2, 'optionalAccess', _5 => _5.config]) && _optionalChain([result2, 'optionalAccess', _6 => _6.configFile]) && Object.keys(result2.config).length > 0) {
|
|
108
|
-
|
|
105
|
+
_chunk3RSRST47cjs.writeSystem.call(void 0, `Found alternative configuration file "${result2.configFile.includes(`${workspacePath}/`) ? result2.configFile.replace(`${workspacePath}/`, "") : result2.configFile}" at "${workspacePath}"`, {
|
|
109
106
|
logLevel: "all"
|
|
110
107
|
});
|
|
111
108
|
config = _defu2.default.call(void 0, _nullishCoalesce(result2.config, () => ( {})), _nullishCoalesce(config, () => ( {})));
|
|
@@ -142,15 +139,15 @@ var getConfigEnv = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, () => {
|
|
|
142
139
|
licensing: process.env[`${prefix}LICENSING`] || void 0,
|
|
143
140
|
timezone: process.env[`${prefix}TIMEZONE`] || process.env.TZ || void 0,
|
|
144
141
|
locale: process.env[`${prefix}LOCALE`] || process.env.LOCALE || void 0,
|
|
145
|
-
configFile: process.env[`${prefix}CONFIG_FILE`] ?
|
|
146
|
-
workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`] ?
|
|
142
|
+
configFile: process.env[`${prefix}CONFIG_FILE`] ? _chunk3RSRST47cjs.correctPaths.call(void 0, process.env[`${prefix}CONFIG_FILE`]) : void 0,
|
|
143
|
+
workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`] ? _chunk3RSRST47cjs.correctPaths.call(void 0, process.env[`${prefix}WORKSPACE_ROOT`]) : void 0,
|
|
147
144
|
directories: {
|
|
148
|
-
cache: process.env[`${prefix}CACHE_DIR`] ?
|
|
149
|
-
data: process.env[`${prefix}DATA_DIR`] ?
|
|
150
|
-
config: process.env[`${prefix}CONFIG_DIR`] ?
|
|
151
|
-
temp: process.env[`${prefix}TEMP_DIR`] ?
|
|
152
|
-
log: process.env[`${prefix}LOG_DIR`] ?
|
|
153
|
-
build: process.env[`${prefix}BUILD_DIR`] ?
|
|
145
|
+
cache: process.env[`${prefix}CACHE_DIR`] ? _chunk3RSRST47cjs.correctPaths.call(void 0, process.env[`${prefix}CACHE_DIR`]) : void 0,
|
|
146
|
+
data: process.env[`${prefix}DATA_DIR`] ? _chunk3RSRST47cjs.correctPaths.call(void 0, process.env[`${prefix}DATA_DIR`]) : void 0,
|
|
147
|
+
config: process.env[`${prefix}CONFIG_DIR`] ? _chunk3RSRST47cjs.correctPaths.call(void 0, process.env[`${prefix}CONFIG_DIR`]) : void 0,
|
|
148
|
+
temp: process.env[`${prefix}TEMP_DIR`] ? _chunk3RSRST47cjs.correctPaths.call(void 0, process.env[`${prefix}TEMP_DIR`]) : void 0,
|
|
149
|
+
log: process.env[`${prefix}LOG_DIR`] ? _chunk3RSRST47cjs.correctPaths.call(void 0, process.env[`${prefix}LOG_DIR`]) : void 0,
|
|
150
|
+
build: process.env[`${prefix}BUILD_DIR`] ? _chunk3RSRST47cjs.correctPaths.call(void 0, process.env[`${prefix}BUILD_DIR`]) : void 0
|
|
154
151
|
},
|
|
155
152
|
skipCache: process.env[`${prefix}SKIP_CACHE`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CACHE`]) : void 0,
|
|
156
153
|
env: (_nullishCoalesce(_nullishCoalesce(process.env[`${prefix}ENV`], () => ( process.env.NODE_ENV)), () => ( process.env.ENVIRONMENT))) || void 0,
|
|
@@ -173,23 +170,23 @@ var getConfigEnv = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, () => {
|
|
|
173
170
|
cyclone: process.env[`${prefix}REGISTRY_CYCLONE`] || void 0,
|
|
174
171
|
container: process.env[`${prefix}REGISTRY_CONTAINER`] || void 0
|
|
175
172
|
},
|
|
176
|
-
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`])) ?
|
|
173
|
+
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`])) ? _chunk3RSRST47cjs.getLogLevelLabel.call(void 0, Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) : process.env[`${prefix}LOG_LEVEL`] : void 0
|
|
177
174
|
};
|
|
178
|
-
const themeNames = Object.keys(process.env).filter((envKey) => envKey.startsWith(`${prefix}COLOR_`) &&
|
|
175
|
+
const themeNames = Object.keys(process.env).filter((envKey) => envKey.startsWith(`${prefix}COLOR_`) && _chunk3RSRST47cjs.COLOR_KEYS.every((colorKey) => !envKey.startsWith(`${prefix}COLOR_LIGHT_${colorKey}`) && !envKey.startsWith(`${prefix}COLOR_DARK_${colorKey}`)));
|
|
179
176
|
config.colors = themeNames.length > 0 ? themeNames.reduce((ret, themeName) => {
|
|
180
177
|
ret[themeName] = getThemeColorConfigEnv(prefix, themeName);
|
|
181
178
|
return ret;
|
|
182
179
|
}, {}) : getThemeColorConfigEnv(prefix);
|
|
183
|
-
if (config.docs ===
|
|
184
|
-
if (config.homepage ===
|
|
185
|
-
config.docs = `${
|
|
180
|
+
if (config.docs === _chunk3RSRST47cjs.STORM_DEFAULT_DOCS) {
|
|
181
|
+
if (config.homepage === _chunk3RSRST47cjs.STORM_DEFAULT_HOMEPAGE) {
|
|
182
|
+
config.docs = `${_chunk3RSRST47cjs.STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/docs`;
|
|
186
183
|
} else {
|
|
187
184
|
config.docs = `${config.homepage}/docs`;
|
|
188
185
|
}
|
|
189
186
|
}
|
|
190
|
-
if (config.licensing ===
|
|
191
|
-
if (config.homepage ===
|
|
192
|
-
config.licensing = `${
|
|
187
|
+
if (config.licensing === _chunk3RSRST47cjs.STORM_DEFAULT_LICENSING) {
|
|
188
|
+
if (config.homepage === _chunk3RSRST47cjs.STORM_DEFAULT_HOMEPAGE) {
|
|
189
|
+
config.licensing = `${_chunk3RSRST47cjs.STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/licensing`;
|
|
193
190
|
} else {
|
|
194
191
|
config.licensing = `${config.homepage}/docs`;
|
|
195
192
|
}
|
|
@@ -327,31 +324,31 @@ var setConfigEnv = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (config
|
|
|
327
324
|
process.env.LANG = config.locale ? `${config.locale.replaceAll("-", "_")}.UTF-8` : "en_US.UTF-8";
|
|
328
325
|
}
|
|
329
326
|
if (config.configFile) {
|
|
330
|
-
process.env[`${prefix}CONFIG_FILE`] =
|
|
327
|
+
process.env[`${prefix}CONFIG_FILE`] = _chunk3RSRST47cjs.correctPaths.call(void 0, config.configFile);
|
|
331
328
|
}
|
|
332
329
|
if (config.workspaceRoot) {
|
|
333
|
-
process.env[`${prefix}WORKSPACE_ROOT`] =
|
|
334
|
-
process.env.NX_WORKSPACE_ROOT =
|
|
335
|
-
process.env.NX_WORKSPACE_ROOT_PATH =
|
|
330
|
+
process.env[`${prefix}WORKSPACE_ROOT`] = _chunk3RSRST47cjs.correctPaths.call(void 0, config.workspaceRoot);
|
|
331
|
+
process.env.NX_WORKSPACE_ROOT = _chunk3RSRST47cjs.correctPaths.call(void 0, config.workspaceRoot);
|
|
332
|
+
process.env.NX_WORKSPACE_ROOT_PATH = _chunk3RSRST47cjs.correctPaths.call(void 0, config.workspaceRoot);
|
|
336
333
|
}
|
|
337
334
|
if (config.directories) {
|
|
338
335
|
if (!config.skipCache && config.directories.cache) {
|
|
339
|
-
process.env[`${prefix}CACHE_DIR`] =
|
|
336
|
+
process.env[`${prefix}CACHE_DIR`] = _chunk3RSRST47cjs.correctPaths.call(void 0, config.directories.cache);
|
|
340
337
|
}
|
|
341
338
|
if (config.directories.data) {
|
|
342
|
-
process.env[`${prefix}DATA_DIR`] =
|
|
339
|
+
process.env[`${prefix}DATA_DIR`] = _chunk3RSRST47cjs.correctPaths.call(void 0, config.directories.data);
|
|
343
340
|
}
|
|
344
341
|
if (config.directories.config) {
|
|
345
|
-
process.env[`${prefix}CONFIG_DIR`] =
|
|
342
|
+
process.env[`${prefix}CONFIG_DIR`] = _chunk3RSRST47cjs.correctPaths.call(void 0, config.directories.config);
|
|
346
343
|
}
|
|
347
344
|
if (config.directories.temp) {
|
|
348
|
-
process.env[`${prefix}TEMP_DIR`] =
|
|
345
|
+
process.env[`${prefix}TEMP_DIR`] = _chunk3RSRST47cjs.correctPaths.call(void 0, config.directories.temp);
|
|
349
346
|
}
|
|
350
347
|
if (config.directories.log) {
|
|
351
|
-
process.env[`${prefix}LOG_DIR`] =
|
|
348
|
+
process.env[`${prefix}LOG_DIR`] = _chunk3RSRST47cjs.correctPaths.call(void 0, config.directories.log);
|
|
352
349
|
}
|
|
353
350
|
if (config.directories.build) {
|
|
354
|
-
process.env[`${prefix}BUILD_DIR`] =
|
|
351
|
+
process.env[`${prefix}BUILD_DIR`] = _chunk3RSRST47cjs.correctPaths.call(void 0, config.directories.build);
|
|
355
352
|
}
|
|
356
353
|
}
|
|
357
354
|
if (config.skipCache !== void 0) {
|
|
@@ -405,8 +402,8 @@ var setConfigEnv = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (config
|
|
|
405
402
|
if (config.logLevel) {
|
|
406
403
|
process.env[`${prefix}LOG_LEVEL`] = String(config.logLevel);
|
|
407
404
|
process.env.LOG_LEVEL = String(config.logLevel);
|
|
408
|
-
process.env.NX_VERBOSE_LOGGING = String(
|
|
409
|
-
process.env.RUST_BACKTRACE =
|
|
405
|
+
process.env.NX_VERBOSE_LOGGING = String(_chunk3RSRST47cjs.getLogLevel.call(void 0, config.logLevel) >= _chunk3RSRST47cjs.LogLevel.DEBUG ? true : false);
|
|
406
|
+
process.env.RUST_BACKTRACE = _chunk3RSRST47cjs.getLogLevel.call(void 0, config.logLevel) >= _chunk3RSRST47cjs.LogLevel.DEBUG ? "full" : "none";
|
|
410
407
|
}
|
|
411
408
|
process.env[`${prefix}CONFIG`] = JSON.stringify(config);
|
|
412
409
|
for (const key of Object.keys(_nullishCoalesce(config.extensions, () => ( {})))) {
|
|
@@ -516,38 +513,41 @@ var _static_cache = void 0;
|
|
|
516
513
|
var loadStormConfig = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async (workspaceRoot) => {
|
|
517
514
|
let config = {};
|
|
518
515
|
if (_optionalChain([_static_cache, 'optionalAccess', _29 => _29.data]) && _optionalChain([_static_cache, 'optionalAccess', _30 => _30.timestamp]) && _static_cache.timestamp >= Date.now() + 3e4) {
|
|
519
|
-
|
|
516
|
+
_chunk3RSRST47cjs.writeTrace.call(void 0, `Configuration cache hit - ${_static_cache.timestamp}`, _static_cache.data);
|
|
520
517
|
return _static_cache.data;
|
|
521
518
|
}
|
|
522
519
|
let _workspaceRoot = workspaceRoot;
|
|
523
520
|
if (!_workspaceRoot) {
|
|
524
|
-
_workspaceRoot =
|
|
521
|
+
_workspaceRoot = _chunk3RSRST47cjs.findWorkspaceRoot.call(void 0, );
|
|
525
522
|
}
|
|
526
523
|
const configFile = await getConfigFile(_workspaceRoot);
|
|
527
524
|
if (!configFile) {
|
|
528
|
-
|
|
525
|
+
_chunk3RSRST47cjs.writeWarning.call(void 0, "No Storm config file found in the current workspace. Please ensure this is the expected behavior - you can add a `storm.json` file to the root of your workspace if it is not.\n", {
|
|
529
526
|
logLevel: "all"
|
|
530
527
|
});
|
|
531
528
|
}
|
|
532
|
-
config = _defu2.default.call(void 0, getConfigEnv(), configFile,
|
|
529
|
+
config = _defu2.default.call(void 0, getConfigEnv(), configFile, _chunk3RSRST47cjs.getDefaultConfig.call(void 0, _workspaceRoot));
|
|
533
530
|
setConfigEnv(config);
|
|
534
|
-
|
|
535
|
-
${
|
|
531
|
+
_chunk3RSRST47cjs.writeTrace.call(void 0, `\u2699\uFE0F Using Storm configuration:
|
|
532
|
+
${_chunk3RSRST47cjs.formatLogMessage.call(void 0, config)}`, config);
|
|
536
533
|
return config;
|
|
537
534
|
}, "loadStormConfig");
|
|
538
535
|
|
|
539
536
|
// ../build-tools/src/utilities/read-nx-config.ts
|
|
537
|
+
|
|
538
|
+
|
|
540
539
|
var readNxConfig = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async (workspaceRoot) => {
|
|
541
540
|
let rootDir = workspaceRoot;
|
|
542
541
|
if (!rootDir) {
|
|
543
542
|
const config = await loadStormConfig();
|
|
544
543
|
rootDir = config.workspaceRoot;
|
|
545
544
|
}
|
|
546
|
-
const nxJsonPath =
|
|
547
|
-
if (!
|
|
545
|
+
const nxJsonPath = _chunk3RSRST47cjs.joinPaths.call(void 0, rootDir, "nx.json");
|
|
546
|
+
if (!_fs.existsSync.call(void 0, nxJsonPath)) {
|
|
548
547
|
throw new Error("Cannot find project.json configuration");
|
|
549
548
|
}
|
|
550
|
-
|
|
549
|
+
const configContent = await _promises.readFile.call(void 0, nxJsonPath, "utf8");
|
|
550
|
+
return JSON.parse(configContent);
|
|
551
551
|
}, "readNxConfig");
|
|
552
552
|
|
|
553
553
|
// ../build-tools/src/utilities/copy-assets.ts
|
|
@@ -582,16 +582,14 @@ var copyAssets = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async (co
|
|
|
582
582
|
});
|
|
583
583
|
}
|
|
584
584
|
const nxJson = readNxConfig(config.workspaceRoot);
|
|
585
|
-
const projectGraph =
|
|
586
|
-
exitOnError: true
|
|
587
|
-
});
|
|
585
|
+
const projectGraph = _devkit.readCachedProjectGraph.call(void 0, );
|
|
588
586
|
const projectsConfigurations = _devkit.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
|
|
589
587
|
if (!_optionalChain([projectsConfigurations, 'optionalAccess', _37 => _37.projects, 'optionalAccess', _38 => _38[projectName]])) {
|
|
590
588
|
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.");
|
|
591
589
|
}
|
|
592
|
-
const buildTarget = _optionalChain([projectsConfigurations, 'access', _39 => _39.projects, 'access', _40 => _40[projectName], '
|
|
590
|
+
const buildTarget = _optionalChain([projectsConfigurations, 'access', _39 => _39.projects, 'access', _40 => _40[projectName], 'access', _41 => _41.targets, 'optionalAccess', _42 => _42.build]);
|
|
593
591
|
if (!buildTarget) {
|
|
594
|
-
throw new Error(`The Build process failed because the project does not have a valid build target in the project.json file. Check if the file exists in the root of the project at ${
|
|
592
|
+
throw new Error(`The Build process failed because the project does not have a valid build target in the project.json file. Check if the file exists in the root of the project at ${_chunk3RSRST47cjs.joinPaths.call(void 0, projectRoot, "project.json")}`);
|
|
595
593
|
}
|
|
596
594
|
const result = await _js.copyAssets.call(void 0, {
|
|
597
595
|
assets,
|
|
@@ -606,55 +604,43 @@ var copyAssets = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async (co
|
|
|
606
604
|
projectsConfigurations,
|
|
607
605
|
nxJsonConfiguration: nxJson,
|
|
608
606
|
cwd: config.workspaceRoot,
|
|
609
|
-
isVerbose:
|
|
607
|
+
isVerbose: _chunk3RSRST47cjs.isVerbose.call(void 0, config.logLevel)
|
|
610
608
|
});
|
|
611
609
|
if (!result.success) {
|
|
612
610
|
throw new Error("The Build process failed trying to copy assets");
|
|
613
611
|
}
|
|
614
612
|
if (includeSrc === true) {
|
|
615
|
-
|
|
613
|
+
_chunk3RSRST47cjs.writeDebug.call(void 0, `\u{1F4DD} Adding banner and writing source files: ${_chunk3RSRST47cjs.joinPaths.call(void 0, outputPath, "src")}`, config);
|
|
616
614
|
const files = await _glob.glob.call(void 0, [
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
615
|
+
_chunk3RSRST47cjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.ts"),
|
|
616
|
+
_chunk3RSRST47cjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.tsx"),
|
|
617
|
+
_chunk3RSRST47cjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.js"),
|
|
618
|
+
_chunk3RSRST47cjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.jsx")
|
|
621
619
|
]);
|
|
622
|
-
await Promise.allSettled(files.map(async (file) =>
|
|
620
|
+
await Promise.allSettled(files.map(async (file) => _promises.writeFile.call(void 0, file, `${banner && typeof banner === "string" ? banner.startsWith("//") ? banner : `// ${banner}` : ""}
|
|
623
621
|
|
|
624
|
-
${await
|
|
622
|
+
${await _promises.readFile.call(void 0, file, "utf8")}
|
|
625
623
|
|
|
626
624
|
${footer && typeof footer === "string" ? footer.startsWith("//") ? footer : `// ${footer}` : ""}`)));
|
|
627
625
|
}
|
|
628
626
|
}, "copyAssets");
|
|
629
627
|
|
|
630
628
|
// ../build-tools/src/utilities/generate-package-json.ts
|
|
631
|
-
|
|
632
629
|
var _buildablelibsutils = require('@nx/js/src/utils/buildable-libs-utils');
|
|
633
630
|
|
|
631
|
+
|
|
632
|
+
|
|
634
633
|
var _projectgraph = require('nx/src/project-graph/project-graph');
|
|
635
634
|
var addPackageDependencies = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async (workspaceRoot, projectRoot, projectName, packageJson) => {
|
|
636
|
-
const
|
|
637
|
-
exitOnError: true
|
|
638
|
-
});
|
|
639
|
-
const projectConfigurations = _projectgraph.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
|
|
640
|
-
if (!_optionalChain([projectConfigurations, 'optionalAccess', _43 => _43.projects, 'optionalAccess', _44 => _44[projectName]])) {
|
|
641
|
-
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.");
|
|
642
|
-
}
|
|
643
|
-
const projectJsonPath = _chunkQYOK2QJAcjs.joinPaths.call(void 0, workspaceRoot, projectRoot, "project.json");
|
|
644
|
-
if (!await _node.hfs.isFile(projectJsonPath)) {
|
|
645
|
-
throw new Error("Cannot find project.json configuration");
|
|
646
|
-
}
|
|
647
|
-
if (!_optionalChain([projectConfigurations, 'optionalAccess', _45 => _45.projects, 'optionalAccess', _46 => _46[projectName]])) {
|
|
648
|
-
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.");
|
|
649
|
-
}
|
|
650
|
-
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);
|
|
635
|
+
const projectDependencies = _buildablelibsutils.calculateProjectBuildableDependencies.call(void 0, void 0, _projectgraph.readCachedProjectGraph.call(void 0, ), workspaceRoot, projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
|
|
651
636
|
const localPackages = [];
|
|
652
637
|
for (const project of projectDependencies.dependencies.filter((dep) => dep.node.type === "lib" && dep.node.data.root !== projectRoot && dep.node.data.root !== workspaceRoot)) {
|
|
653
638
|
const projectNode = project.node;
|
|
654
639
|
if (projectNode.data.root) {
|
|
655
|
-
const projectPackageJsonPath =
|
|
656
|
-
if (
|
|
657
|
-
const
|
|
640
|
+
const projectPackageJsonPath = _chunk3RSRST47cjs.joinPaths.call(void 0, workspaceRoot, projectNode.data.root, "package.json");
|
|
641
|
+
if (_fs.existsSync.call(void 0, projectPackageJsonPath)) {
|
|
642
|
+
const projectPackageJsonContent = await _promises.readFile.call(void 0, projectPackageJsonPath, "utf8");
|
|
643
|
+
const projectPackageJson = JSON.parse(projectPackageJsonContent);
|
|
658
644
|
if (projectPackageJson.private !== false) {
|
|
659
645
|
localPackages.push(projectPackageJson);
|
|
660
646
|
}
|
|
@@ -662,7 +648,7 @@ var addPackageDependencies = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void
|
|
|
662
648
|
}
|
|
663
649
|
}
|
|
664
650
|
if (localPackages.length > 0) {
|
|
665
|
-
|
|
651
|
+
_chunk3RSRST47cjs.writeTrace.call(void 0, `\u{1F4E6} Adding local packages to package.json: ${localPackages.map((p) => p.name).join(", ")}`);
|
|
666
652
|
packageJson.peerDependencies = localPackages.reduce((ret, localPackage) => {
|
|
667
653
|
if (!ret[localPackage.name]) {
|
|
668
654
|
ret[localPackage.name] = `>=${localPackage.version || "0.0.1"}`;
|
|
@@ -684,13 +670,14 @@ var addPackageDependencies = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void
|
|
|
684
670
|
return ret;
|
|
685
671
|
}, _nullishCoalesce(packageJson.peerDependencies, () => ( {})));
|
|
686
672
|
} else {
|
|
687
|
-
|
|
673
|
+
_chunk3RSRST47cjs.writeTrace.call(void 0, "\u{1F4E6} No local packages dependencies to add to package.json");
|
|
688
674
|
}
|
|
689
675
|
return packageJson;
|
|
690
676
|
}, "addPackageDependencies");
|
|
691
677
|
var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async (config, projectRoot, sourceRoot, projectName, includeSrc = false, packageJson) => {
|
|
692
|
-
const workspaceRoot = config.workspaceRoot ? config.workspaceRoot :
|
|
693
|
-
const
|
|
678
|
+
const workspaceRoot = config.workspaceRoot ? config.workspaceRoot : _chunk3RSRST47cjs.findWorkspaceRoot.call(void 0, );
|
|
679
|
+
const workspacePackageJsonContent = await _promises.readFile.call(void 0, _chunk3RSRST47cjs.joinPaths.call(void 0, workspaceRoot, "package.json"), "utf8");
|
|
680
|
+
const workspacePackageJson = JSON.parse(workspacePackageJsonContent);
|
|
694
681
|
packageJson.type ??= "module";
|
|
695
682
|
packageJson.sideEffects ??= false;
|
|
696
683
|
if (includeSrc === true) {
|
|
@@ -698,7 +685,7 @@ var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.cal
|
|
|
698
685
|
if (distSrc.startsWith("/")) {
|
|
699
686
|
distSrc = distSrc.substring(1);
|
|
700
687
|
}
|
|
701
|
-
packageJson.source ??= `${
|
|
688
|
+
packageJson.source ??= `${_chunk3RSRST47cjs.joinPaths.call(void 0, distSrc, "index.ts").replaceAll("\\", "/")}`;
|
|
702
689
|
}
|
|
703
690
|
packageJson.files ??= [
|
|
704
691
|
"dist/**/*"
|
|
@@ -729,7 +716,7 @@ var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.cal
|
|
|
729
716
|
];
|
|
730
717
|
}
|
|
731
718
|
packageJson.repository ??= workspacePackageJson.repository;
|
|
732
|
-
packageJson.repository.directory ??= projectRoot ? projectRoot :
|
|
719
|
+
packageJson.repository.directory ??= projectRoot ? projectRoot : _chunk3RSRST47cjs.joinPaths.call(void 0, "packages", projectName);
|
|
733
720
|
return packageJson;
|
|
734
721
|
}, "addWorkspacePackageJsonFields");
|
|
735
722
|
var addPackageJsonExport = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, (file, type = "module", sourceRoot) => {
|
|
@@ -756,7 +743,7 @@ var addPackageJsonExport = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0,
|
|
|
756
743
|
// ../build-tools/src/utilities/get-entry-points.ts
|
|
757
744
|
|
|
758
745
|
var getEntryPoints = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async (config, projectRoot, sourceRoot, entry, emitOnAll = false) => {
|
|
759
|
-
const workspaceRoot = config.workspaceRoot ? config.workspaceRoot :
|
|
746
|
+
const workspaceRoot = config.workspaceRoot ? config.workspaceRoot : _chunk3RSRST47cjs.findWorkspaceRoot.call(void 0, );
|
|
760
747
|
const entryPoints = [];
|
|
761
748
|
if (entry) {
|
|
762
749
|
if (Array.isArray(entry)) {
|
|
@@ -768,7 +755,7 @@ var getEntryPoints = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async
|
|
|
768
755
|
}
|
|
769
756
|
}
|
|
770
757
|
if (emitOnAll) {
|
|
771
|
-
entryPoints.push(
|
|
758
|
+
entryPoints.push(_chunk3RSRST47cjs.joinPaths.call(void 0, workspaceRoot, sourceRoot || projectRoot, "**/*.{ts,tsx}"));
|
|
772
759
|
}
|
|
773
760
|
const results = [];
|
|
774
761
|
for (const entryPoint in entryPoints) {
|
|
@@ -777,9 +764,9 @@ var getEntryPoints = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async
|
|
|
777
764
|
withFileTypes: true
|
|
778
765
|
});
|
|
779
766
|
results.push(...files.reduce((ret, filePath) => {
|
|
780
|
-
const result =
|
|
767
|
+
const result = _chunk3RSRST47cjs.correctPaths.call(void 0, _chunk3RSRST47cjs.joinPaths.call(void 0, filePath.path, filePath.name).replaceAll(_chunk3RSRST47cjs.correctPaths.call(void 0, workspaceRoot), "").replaceAll(_chunk3RSRST47cjs.correctPaths.call(void 0, projectRoot), ""));
|
|
781
768
|
if (result) {
|
|
782
|
-
|
|
769
|
+
_chunk3RSRST47cjs.writeDebug.call(void 0, `Trying to add entry point ${result} at "${_chunk3RSRST47cjs.joinPaths.call(void 0, filePath.path, filePath.name)}"`, config);
|
|
783
770
|
if (!results.includes(result)) {
|
|
784
771
|
results.push(result);
|
|
785
772
|
}
|
|
@@ -821,25 +808,25 @@ var resolveOptions = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async
|
|
|
821
808
|
throw new Error("Cannot find Nx workspace root");
|
|
822
809
|
}
|
|
823
810
|
const config = await loadStormConfig(workspaceRoot.dir);
|
|
824
|
-
|
|
825
|
-
const stopwatch =
|
|
811
|
+
_chunk3RSRST47cjs.writeDebug.call(void 0, " \u2699\uFE0F Resolving build options", config);
|
|
812
|
+
const stopwatch = _chunk3RSRST47cjs.getStopwatch.call(void 0, "Build options resolution");
|
|
826
813
|
const projectGraph = await _devkit.createProjectGraphAsync.call(void 0, {
|
|
827
814
|
exitOnError: true
|
|
828
815
|
});
|
|
829
|
-
const projectJsonPath =
|
|
816
|
+
const projectJsonPath = _chunk3RSRST47cjs.joinPaths.call(void 0, workspaceRoot.dir, projectRoot, "project.json");
|
|
830
817
|
if (!await _node.hfs.isFile(projectJsonPath)) {
|
|
831
818
|
throw new Error("Cannot find project.json configuration");
|
|
832
819
|
}
|
|
833
820
|
const projectJson = await _node.hfs.json(projectJsonPath);
|
|
834
821
|
const projectName = projectJson.name;
|
|
835
822
|
const projectConfigurations = _devkit.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
|
|
836
|
-
if (!_optionalChain([projectConfigurations, 'optionalAccess',
|
|
823
|
+
if (!_optionalChain([projectConfigurations, 'optionalAccess', _43 => _43.projects, 'optionalAccess', _44 => _44[projectName]])) {
|
|
837
824
|
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.");
|
|
838
825
|
}
|
|
839
826
|
const options = _defu2.default.call(void 0, userOptions, _chunk5KRF6IVWcjs.DEFAULT_BUILD_OPTIONS);
|
|
840
827
|
options.name ??= `${projectName}-${options.format}`;
|
|
841
828
|
options.target ??= DEFAULT_TARGET;
|
|
842
|
-
const packageJsonPath =
|
|
829
|
+
const packageJsonPath = _chunk3RSRST47cjs.joinPaths.call(void 0, workspaceRoot.dir, options.projectRoot, "package.json");
|
|
843
830
|
if (!await _node.hfs.isFile(packageJsonPath)) {
|
|
844
831
|
throw new Error("Cannot find package.json configuration");
|
|
845
832
|
}
|
|
@@ -848,20 +835,20 @@ var resolveOptions = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async
|
|
|
848
835
|
...options,
|
|
849
836
|
config,
|
|
850
837
|
...userOptions,
|
|
851
|
-
tsconfig:
|
|
838
|
+
tsconfig: _chunk3RSRST47cjs.joinPaths.call(void 0, projectRoot, userOptions.tsconfig ? userOptions.tsconfig.replace(projectRoot, "") : "tsconfig.json"),
|
|
852
839
|
format: options.format || "cjs",
|
|
853
840
|
entryPoints: await getEntryPoints(config, projectRoot, projectJson.sourceRoot, userOptions.entry || [
|
|
854
841
|
"./src/index.ts"
|
|
855
842
|
], userOptions.emitOnAll),
|
|
856
|
-
outdir: userOptions.outputPath ||
|
|
843
|
+
outdir: userOptions.outputPath || _chunk3RSRST47cjs.joinPaths.call(void 0, "dist", projectRoot),
|
|
857
844
|
plugins: [],
|
|
858
845
|
name: userOptions.name || projectName,
|
|
859
846
|
projectConfigurations,
|
|
860
847
|
projectName,
|
|
861
848
|
projectGraph,
|
|
862
|
-
sourceRoot: userOptions.sourceRoot || projectJson.sourceRoot ||
|
|
849
|
+
sourceRoot: userOptions.sourceRoot || projectJson.sourceRoot || _chunk3RSRST47cjs.joinPaths.call(void 0, projectRoot, "src"),
|
|
863
850
|
minify: userOptions.minify || !userOptions.debug,
|
|
864
|
-
verbose: userOptions.verbose ||
|
|
851
|
+
verbose: userOptions.verbose || _chunk3RSRST47cjs.isVerbose.call(void 0, ) || userOptions.debug === true,
|
|
865
852
|
includeSrc: userOptions.includeSrc === true,
|
|
866
853
|
metafile: userOptions.metafile !== false,
|
|
867
854
|
generatePackageJson: userOptions.generatePackageJson !== false,
|
|
@@ -895,14 +882,14 @@ var resolveOptions = /* @__PURE__ */ _chunkUSNT2KNTcjs.__name.call(void 0, async
|
|
|
895
882
|
return result;
|
|
896
883
|
}, "resolveOptions");
|
|
897
884
|
async function generatePackageJson(options) {
|
|
898
|
-
if (options.generatePackageJson !== false && await _node.hfs.isFile(
|
|
899
|
-
|
|
900
|
-
const stopwatch =
|
|
901
|
-
const packageJsonPath =
|
|
885
|
+
if (options.generatePackageJson !== false && await _node.hfs.isFile(_chunk3RSRST47cjs.joinPaths.call(void 0, options.projectRoot, "package.json"))) {
|
|
886
|
+
_chunk3RSRST47cjs.writeDebug.call(void 0, " \u270D\uFE0F Writing package.json file", options.config);
|
|
887
|
+
const stopwatch = _chunk3RSRST47cjs.getStopwatch.call(void 0, "Write package.json file");
|
|
888
|
+
const packageJsonPath = _chunk3RSRST47cjs.joinPaths.call(void 0, options.projectRoot, "project.json");
|
|
902
889
|
if (!await _node.hfs.isFile(packageJsonPath)) {
|
|
903
890
|
throw new Error("Cannot find package.json configuration");
|
|
904
891
|
}
|
|
905
|
-
let packageJson = await _node.hfs.json(
|
|
892
|
+
let packageJson = await _node.hfs.json(_chunk3RSRST47cjs.joinPaths.call(void 0, options.config.workspaceRoot, options.projectRoot, "package.json"));
|
|
906
893
|
if (!packageJson) {
|
|
907
894
|
throw new Error("Cannot find package.json configuration file");
|
|
908
895
|
}
|
|
@@ -940,15 +927,15 @@ async function generatePackageJson(options) {
|
|
|
940
927
|
}
|
|
941
928
|
return ret;
|
|
942
929
|
}, packageJson.exports);
|
|
943
|
-
await _devkit.writeJsonFile.call(void 0,
|
|
930
|
+
await _devkit.writeJsonFile.call(void 0, _chunk3RSRST47cjs.joinPaths.call(void 0, options.outdir, "package.json"), packageJson);
|
|
944
931
|
stopwatch();
|
|
945
932
|
}
|
|
946
933
|
return options;
|
|
947
934
|
}
|
|
948
935
|
_chunkUSNT2KNTcjs.__name.call(void 0, generatePackageJson, "generatePackageJson");
|
|
949
936
|
async function executeTSDown(options) {
|
|
950
|
-
|
|
951
|
-
const stopwatch =
|
|
937
|
+
_chunk3RSRST47cjs.writeDebug.call(void 0, ` \u{1F680} Running ${options.name} build`, options.config);
|
|
938
|
+
const stopwatch = _chunk3RSRST47cjs.getStopwatch.call(void 0, `${options.name} build`);
|
|
952
939
|
await _tsdown.build.call(void 0, {
|
|
953
940
|
...options,
|
|
954
941
|
entry: options.entryPoints,
|
|
@@ -960,27 +947,27 @@ async function executeTSDown(options) {
|
|
|
960
947
|
}
|
|
961
948
|
_chunkUSNT2KNTcjs.__name.call(void 0, executeTSDown, "executeTSDown");
|
|
962
949
|
async function copyBuildAssets(options) {
|
|
963
|
-
|
|
964
|
-
const stopwatch =
|
|
950
|
+
_chunk3RSRST47cjs.writeDebug.call(void 0, ` \u{1F4CB} Copying asset files to output directory: ${options.outdir}`, options.config);
|
|
951
|
+
const stopwatch = _chunk3RSRST47cjs.getStopwatch.call(void 0, `${options.name} asset copy`);
|
|
965
952
|
await copyAssets(options.config, _nullishCoalesce(options.assets, () => ( [])), options.outdir, options.projectRoot, options.projectName, options.sourceRoot, true, false);
|
|
966
953
|
stopwatch();
|
|
967
954
|
return options;
|
|
968
955
|
}
|
|
969
956
|
_chunkUSNT2KNTcjs.__name.call(void 0, copyBuildAssets, "copyBuildAssets");
|
|
970
957
|
async function reportResults(options) {
|
|
971
|
-
|
|
958
|
+
_chunk3RSRST47cjs.writeSuccess.call(void 0, ` \u{1F4E6} The ${options.name} build completed successfully`, options.config);
|
|
972
959
|
}
|
|
973
960
|
_chunkUSNT2KNTcjs.__name.call(void 0, reportResults, "reportResults");
|
|
974
961
|
async function cleanOutputPath(options) {
|
|
975
962
|
if (options.clean !== false && options.outdir) {
|
|
976
|
-
await
|
|
963
|
+
await _chunk3RSRST47cjs.clean.call(void 0, options.name, options.outdir, options.config);
|
|
977
964
|
}
|
|
978
965
|
return options;
|
|
979
966
|
}
|
|
980
967
|
_chunkUSNT2KNTcjs.__name.call(void 0, cleanOutputPath, "cleanOutputPath");
|
|
981
968
|
async function build(options) {
|
|
982
|
-
|
|
983
|
-
const stopwatch =
|
|
969
|
+
_chunk3RSRST47cjs.writeDebug.call(void 0, ` \u26A1 Executing Storm TSDown pipeline`);
|
|
970
|
+
const stopwatch = _chunk3RSRST47cjs.getStopwatch.call(void 0, "TSDown pipeline");
|
|
984
971
|
try {
|
|
985
972
|
const opts = Array.isArray(options) ? options : [
|
|
986
973
|
options
|
|
@@ -998,11 +985,11 @@ async function build(options) {
|
|
|
998
985
|
await reportResults(opt);
|
|
999
986
|
}));
|
|
1000
987
|
} else {
|
|
1001
|
-
|
|
988
|
+
_chunk3RSRST47cjs.writeWarning.call(void 0, " \u{1F6A7} No options were passed to TSBuild. Please check the parameters passed to the `build` function.");
|
|
1002
989
|
}
|
|
1003
|
-
|
|
990
|
+
_chunk3RSRST47cjs.writeSuccess.call(void 0, " \u{1F3C1} TSDown pipeline build completed successfully");
|
|
1004
991
|
} catch (error) {
|
|
1005
|
-
|
|
992
|
+
_chunk3RSRST47cjs.writeFatal.call(void 0, " \u274C Fatal errors occurred during the build that could not be recovered from. The build process has been terminated.");
|
|
1006
993
|
throw error;
|
|
1007
994
|
} finally {
|
|
1008
995
|
stopwatch();
|
package/dist/clean.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk3RSRST47cjs = require('./chunk-3RSRST47.cjs');
|
|
4
4
|
require('./chunk-USNT2KNT.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
exports.clean =
|
|
7
|
+
exports.clean = _chunk3RSRST47cjs.clean;
|
package/dist/clean.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkWRVVU7ZBcjs = require('./chunk-WRVVU7ZB.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunk3RSRST47cjs = require('./chunk-3RSRST47.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _chunk5KRF6IVWcjs = require('./chunk-5KRF6IVW.cjs');
|
|
@@ -13,4 +13,4 @@ require('./chunk-SFZRYJZ2.cjs');
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
exports.DEFAULT_BUILD_OPTIONS = _chunk5KRF6IVWcjs.DEFAULT_BUILD_OPTIONS; exports.build =
|
|
16
|
+
exports.DEFAULT_BUILD_OPTIONS = _chunk5KRF6IVWcjs.DEFAULT_BUILD_OPTIONS; exports.build = _chunkWRVVU7ZBcjs.build; exports.clean = _chunk3RSRST47cjs.clean;
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1 +1,188 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"name": "@storm-software/tsdown",
|
|
3
|
+
"version": "0.20.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "A package containing `tsdown` utilities for building Storm Software libraries and applications",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "github",
|
|
8
|
+
"url": "https://github.com/storm-software/storm-ops.git",
|
|
9
|
+
"directory": "packages/tsdown"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://stormsoftware.com",
|
|
12
|
+
"bugs": "https://github.com/storm-software/storm-ops/issues",
|
|
13
|
+
"author": {
|
|
14
|
+
"name": "Storm Software",
|
|
15
|
+
"email": "contact@stormsoftware.com",
|
|
16
|
+
"url": "https://stormsoftware.com"
|
|
17
|
+
},
|
|
18
|
+
"maintainers": [
|
|
19
|
+
{
|
|
20
|
+
"name": "Storm Software",
|
|
21
|
+
"email": "contact@stormsoftware.com",
|
|
22
|
+
"url": "https://stormsoftware.com"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"name": "Pat Sullivan",
|
|
26
|
+
"email": "admin@stormsoftware.com",
|
|
27
|
+
"url": "https://patsullivan.org"
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
"contributors": [
|
|
31
|
+
{
|
|
32
|
+
"name": "Storm Software",
|
|
33
|
+
"email": "contact@stormsoftware.com",
|
|
34
|
+
"url": "https://stormsoftware.com"
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
"funding": {
|
|
38
|
+
"type": "github",
|
|
39
|
+
"url": "https://github.com/sponsors/storm-software"
|
|
40
|
+
},
|
|
41
|
+
"license": "Apache-2.0",
|
|
42
|
+
"private": false,
|
|
43
|
+
"packageManager": "pnpm@9.15.2",
|
|
44
|
+
"engines": { "node": ">=22.4.0", "pnpm": ">=9.15.2" },
|
|
45
|
+
"bin": {
|
|
46
|
+
"storm-tsdown": "./bin/storm-tsdown.js",
|
|
47
|
+
"storm-tsdown-cjs": "./bin/storm-tsdown.cjs",
|
|
48
|
+
"storm-tsdown-esm": "./bin/storm-tsdown.js"
|
|
49
|
+
},
|
|
50
|
+
"main": "./dist/index.cjs",
|
|
51
|
+
"module": "./dist/index.js",
|
|
52
|
+
"exports": {
|
|
53
|
+
"./package.json": "./package.json",
|
|
54
|
+
"./types": {
|
|
55
|
+
"import": { "types": "./dist/types.d.ts", "default": "./dist/types.js" },
|
|
56
|
+
"require": {
|
|
57
|
+
"types": "./dist/types.d.cts",
|
|
58
|
+
"default": "./dist/types.cjs"
|
|
59
|
+
},
|
|
60
|
+
"default": { "types": "./dist/types.d.ts", "default": "./dist/types.js" }
|
|
61
|
+
},
|
|
62
|
+
"./index": {
|
|
63
|
+
"import": { "types": "./dist/index.d.ts", "default": "./dist/index.js" },
|
|
64
|
+
"require": {
|
|
65
|
+
"types": "./dist/index.d.cts",
|
|
66
|
+
"default": "./dist/index.cjs"
|
|
67
|
+
},
|
|
68
|
+
"default": { "types": "./dist/index.d.ts", "default": "./dist/index.js" }
|
|
69
|
+
},
|
|
70
|
+
".": {
|
|
71
|
+
"import": { "types": "./dist/index.d.ts", "default": "./dist/index.js" },
|
|
72
|
+
"require": {
|
|
73
|
+
"types": "./dist/index.d.cts",
|
|
74
|
+
"default": "./dist/index.cjs"
|
|
75
|
+
},
|
|
76
|
+
"default": { "types": "./dist/index.d.ts", "default": "./dist/index.js" }
|
|
77
|
+
},
|
|
78
|
+
"./config": {
|
|
79
|
+
"import": {
|
|
80
|
+
"types": "./dist/config.d.ts",
|
|
81
|
+
"default": "./dist/config.js"
|
|
82
|
+
},
|
|
83
|
+
"require": {
|
|
84
|
+
"types": "./dist/config.d.cts",
|
|
85
|
+
"default": "./dist/config.cjs"
|
|
86
|
+
},
|
|
87
|
+
"default": {
|
|
88
|
+
"types": "./dist/config.d.ts",
|
|
89
|
+
"default": "./dist/config.js"
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
"./clean": {
|
|
93
|
+
"import": { "types": "./dist/clean.d.ts", "default": "./dist/clean.js" },
|
|
94
|
+
"require": {
|
|
95
|
+
"types": "./dist/clean.d.cts",
|
|
96
|
+
"default": "./dist/clean.cjs"
|
|
97
|
+
},
|
|
98
|
+
"default": { "types": "./dist/clean.d.ts", "default": "./dist/clean.js" }
|
|
99
|
+
},
|
|
100
|
+
"./build": {
|
|
101
|
+
"import": {
|
|
102
|
+
"types": "./dist/build/index.d.ts",
|
|
103
|
+
"default": "./dist/build/index.js"
|
|
104
|
+
},
|
|
105
|
+
"require": {
|
|
106
|
+
"types": "./dist/build/index.d.cts",
|
|
107
|
+
"default": "./dist/build/index.cjs"
|
|
108
|
+
},
|
|
109
|
+
"default": {
|
|
110
|
+
"types": "./dist/build/index.d.ts",
|
|
111
|
+
"default": "./dist/build/index.js"
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
"./plugins/*": {
|
|
115
|
+
"import": {
|
|
116
|
+
"types": "./dist/plugins/*.d.ts",
|
|
117
|
+
"default": "./dist/plugins/*.js"
|
|
118
|
+
},
|
|
119
|
+
"require": {
|
|
120
|
+
"types": "./dist/plugins/*.d.cts",
|
|
121
|
+
"default": "./dist/plugins/*.cjs"
|
|
122
|
+
},
|
|
123
|
+
"default": {
|
|
124
|
+
"types": "./dist/plugins/*.d.ts",
|
|
125
|
+
"default": "./dist/plugins/*.js"
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"types": "./dist/index.d.ts",
|
|
130
|
+
"files": ["dist/**/*"],
|
|
131
|
+
"keywords": [
|
|
132
|
+
"acidic",
|
|
133
|
+
"cyclone-ui",
|
|
134
|
+
"tsdown",
|
|
135
|
+
"monorepo",
|
|
136
|
+
"storm",
|
|
137
|
+
"storm-ops",
|
|
138
|
+
"storm-stack",
|
|
139
|
+
"sullivanpj"
|
|
140
|
+
],
|
|
141
|
+
"peerDependencies": {
|
|
142
|
+
"@microsoft/api-extractor": "^7.48.1",
|
|
143
|
+
"@nx/devkit": "^20.3.1",
|
|
144
|
+
"@nx/js": "^20.3.1",
|
|
145
|
+
"@storm-software/build-tools": "workspace:*",
|
|
146
|
+
"@storm-software/config-tools": "workspace:*",
|
|
147
|
+
"spdx-exceptions": "^2.5.0",
|
|
148
|
+
"spdx-license-ids": "^3.0.20",
|
|
149
|
+
"tsdown": "0.5.3"
|
|
150
|
+
},
|
|
151
|
+
"peerDependenciesMeta": {
|
|
152
|
+
"@microsoft/api-extractor": { "optional": true },
|
|
153
|
+
"@nx/devkit": { "optional": false },
|
|
154
|
+
"@nx/js": { "optional": false },
|
|
155
|
+
"@storm-software/build-tools": { "optional": false },
|
|
156
|
+
"@storm-software/config-tools": { "optional": false },
|
|
157
|
+
"spdx-exceptions": { "optional": true },
|
|
158
|
+
"spdx-license-ids": { "optional": true },
|
|
159
|
+
"tsdown": { "optional": false }
|
|
160
|
+
},
|
|
161
|
+
"dependencies": {
|
|
162
|
+
"@humanfs/node": "^0.16.6",
|
|
163
|
+
"chokidar": "^4.0.3",
|
|
164
|
+
"commander": "^12.1.0",
|
|
165
|
+
"es-toolkit": "^1.30.1",
|
|
166
|
+
"globby": "^14.0.2",
|
|
167
|
+
"nx": "^20.3.1",
|
|
168
|
+
"rolldown": "1.0.0-beta.1",
|
|
169
|
+
"source-map": "0.7.4",
|
|
170
|
+
"tsup": "8.3.5"
|
|
171
|
+
},
|
|
172
|
+
"devDependencies": {
|
|
173
|
+
"@microsoft/api-extractor": "^7.48.1",
|
|
174
|
+
"@nx/devkit": "^20.3.1",
|
|
175
|
+
"@nx/js": "^20.3.1",
|
|
176
|
+
"@storm-software/build-tools": "0.129.0",
|
|
177
|
+
"@storm-software/config": "1.96.1",
|
|
178
|
+
"@storm-software/config-tools": "1.136.2",
|
|
179
|
+
"@types/node": "^22.10.2",
|
|
180
|
+
"defu": "6.1.4",
|
|
181
|
+
"rollup": "4.29.1",
|
|
182
|
+
"spdx-exceptions": "^2.5.0",
|
|
183
|
+
"spdx-license-ids": "^3.0.20",
|
|
184
|
+
"tsdown": "0.5.3"
|
|
185
|
+
},
|
|
186
|
+
"publishConfig": { "access": "public" },
|
|
187
|
+
"sideEffects": false
|
|
188
|
+
}
|