@storm-software/cloudflare-tools 0.49.1 → 0.50.2
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/CHANGELOG.md +18 -0
- package/README.md +1 -1
- package/dist/{chunk-ZY7TM2TA.mjs → chunk-4AK2RSE7.mjs} +2 -2
- package/dist/{chunk-OARYMVO7.mjs → chunk-4AMWR76J.mjs} +4 -4
- package/dist/{chunk-CR22PACK.mjs → chunk-6RM4MALM.mjs} +1 -1
- package/dist/{chunk-NPJPHEFP.js → chunk-7VU6EPB4.js} +1 -1
- package/dist/{chunk-VPT6GF3S.mjs → chunk-HPCGVJ7R.mjs} +1 -1
- package/dist/{chunk-YE4FHRXJ.js → chunk-IUVV2SM4.js} +4 -4
- package/dist/{chunk-W5J5EWQN.js → chunk-MH545KJZ.js} +4 -4
- package/dist/{chunk-NKCR3FSU.js → chunk-SUASGTND.js} +2 -2
- package/dist/{chunk-ITLKTOIK.mjs → chunk-T6VDL633.mjs} +132 -143
- package/dist/{chunk-WGOT27OY.js → chunk-ULTJPRDX.js} +141 -152
- package/dist/executors.js +4 -4
- package/dist/executors.mjs +4 -4
- package/dist/generators.js +4 -4
- package/dist/generators.mjs +3 -3
- package/dist/index.js +7 -7
- package/dist/index.mjs +6 -6
- package/dist/src/executors/cloudflare-publish/executor.js +2 -2
- package/dist/src/executors/cloudflare-publish/executor.mjs +2 -2
- package/dist/src/executors/r2-upload-publish/executor.js +3 -3
- package/dist/src/executors/r2-upload-publish/executor.mjs +2 -2
- package/dist/src/executors/serve/executor.js +3 -3
- package/dist/src/executors/serve/executor.mjs +2 -2
- package/dist/src/generators/init/generator.js +2 -2
- package/dist/src/generators/init/generator.mjs +1 -1
- package/dist/src/generators/worker/generator.js +4 -4
- package/dist/src/generators/worker/generator.mjs +3 -3
- package/package.json +150 -1
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
var _chunkVTHBMY4Bjs = require('./chunk-VTHBMY4B.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkIUVV2SM4js = require('./chunk-IUVV2SM4.js');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
@@ -168,7 +168,7 @@ var withRunExecutor = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (name
|
|
|
168
168
|
- sourceRoot: ${sourceRoot}
|
|
169
169
|
- projectName: ${projectName}
|
|
170
170
|
`, config);
|
|
171
|
-
config = await
|
|
171
|
+
config = await _chunkIUVV2SM4js.loadStormConfig.call(void 0, workspaceRoot3);
|
|
172
172
|
}
|
|
173
173
|
if (_optionalChain([executorOptions, 'optionalAccess', _21 => _21.hooks, 'optionalAccess', _22 => _22.applyDefaultOptions])) {
|
|
174
174
|
_chunkRCE3CC76js.writeDebug.call(void 0, "Running the applyDefaultOptions hook...", config);
|
|
@@ -493,23 +493,25 @@ var _resolve2 = require('resolve'); var _resolve3 = _interopRequireDefault(_reso
|
|
|
493
493
|
|
|
494
494
|
// ../build-tools/src/utilities/copy-assets.ts
|
|
495
495
|
|
|
496
|
-
|
|
497
496
|
var _js = require('@nx/js');
|
|
498
497
|
var _glob = require('glob');
|
|
498
|
+
var _promises = require('fs/promises'); var _promises2 = _interopRequireDefault(_promises);
|
|
499
499
|
|
|
500
500
|
// ../build-tools/src/utilities/read-nx-config.ts
|
|
501
501
|
|
|
502
|
+
|
|
502
503
|
var readNxConfig = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (workspaceRoot3) => {
|
|
503
504
|
let rootDir = workspaceRoot3;
|
|
504
505
|
if (!rootDir) {
|
|
505
|
-
const config = await
|
|
506
|
+
const config = await _chunkIUVV2SM4js.loadStormConfig.call(void 0, );
|
|
506
507
|
rootDir = config.workspaceRoot;
|
|
507
508
|
}
|
|
508
509
|
const nxJsonPath = _chunkRCE3CC76js.joinPaths.call(void 0, rootDir, "nx.json");
|
|
509
|
-
if (!
|
|
510
|
+
if (!_fs.existsSync.call(void 0, nxJsonPath)) {
|
|
510
511
|
throw new Error("Cannot find project.json configuration");
|
|
511
512
|
}
|
|
512
|
-
|
|
513
|
+
const configContent = await _promises.readFile.call(void 0, nxJsonPath, "utf8");
|
|
514
|
+
return JSON.parse(configContent);
|
|
513
515
|
}, "readNxConfig");
|
|
514
516
|
|
|
515
517
|
// ../build-tools/src/utilities/copy-assets.ts
|
|
@@ -544,14 +546,12 @@ var copyAssets = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (con
|
|
|
544
546
|
});
|
|
545
547
|
}
|
|
546
548
|
const nxJson = readNxConfig(config.workspaceRoot);
|
|
547
|
-
const projectGraph =
|
|
548
|
-
exitOnError: true
|
|
549
|
-
});
|
|
549
|
+
const projectGraph = _devkit.readCachedProjectGraph.call(void 0, );
|
|
550
550
|
const projectsConfigurations = _devkit.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
|
|
551
551
|
if (!_optionalChain([projectsConfigurations, 'optionalAccess', _49 => _49.projects, 'optionalAccess', _50 => _50[projectName]])) {
|
|
552
552
|
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.");
|
|
553
553
|
}
|
|
554
|
-
const buildTarget = _optionalChain([projectsConfigurations, 'access', _51 => _51.projects, 'access', _52 => _52[projectName], '
|
|
554
|
+
const buildTarget = _optionalChain([projectsConfigurations, 'access', _51 => _51.projects, 'access', _52 => _52[projectName], 'access', _53 => _53.targets, 'optionalAccess', _54 => _54.build]);
|
|
555
555
|
if (!buildTarget) {
|
|
556
556
|
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 ${_chunkRCE3CC76js.joinPaths.call(void 0, projectRoot, "project.json")}`);
|
|
557
557
|
}
|
|
@@ -581,42 +581,30 @@ var copyAssets = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (con
|
|
|
581
581
|
_chunkRCE3CC76js.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.js"),
|
|
582
582
|
_chunkRCE3CC76js.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.jsx")
|
|
583
583
|
]);
|
|
584
|
-
await Promise.allSettled(files.map(async (file) =>
|
|
584
|
+
await Promise.allSettled(files.map(async (file) => _promises.writeFile.call(void 0, file, `${banner && typeof banner === "string" ? banner.startsWith("//") ? banner : `// ${banner}` : ""}
|
|
585
585
|
|
|
586
|
-
${await
|
|
586
|
+
${await _promises.readFile.call(void 0, file, "utf8")}
|
|
587
587
|
|
|
588
588
|
${footer && typeof footer === "string" ? footer.startsWith("//") ? footer : `// ${footer}` : ""}`)));
|
|
589
589
|
}
|
|
590
590
|
}, "copyAssets");
|
|
591
591
|
|
|
592
592
|
// ../build-tools/src/utilities/generate-package-json.ts
|
|
593
|
-
|
|
594
593
|
var _buildablelibsutils = require('@nx/js/src/utils/buildable-libs-utils');
|
|
595
594
|
|
|
595
|
+
|
|
596
|
+
|
|
596
597
|
var _projectgraph = require('nx/src/project-graph/project-graph');
|
|
597
598
|
var addPackageDependencies = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (workspaceRoot3, projectRoot, projectName, packageJson) => {
|
|
598
|
-
const
|
|
599
|
-
exitOnError: true
|
|
600
|
-
});
|
|
601
|
-
const projectConfigurations = _projectgraph.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
|
|
602
|
-
if (!_optionalChain([projectConfigurations, 'optionalAccess', _55 => _55.projects, 'optionalAccess', _56 => _56[projectName]])) {
|
|
603
|
-
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.");
|
|
604
|
-
}
|
|
605
|
-
const projectJsonPath = _chunkRCE3CC76js.joinPaths.call(void 0, workspaceRoot3, projectRoot, "project.json");
|
|
606
|
-
if (!await _node.hfs.isFile(projectJsonPath)) {
|
|
607
|
-
throw new Error("Cannot find project.json configuration");
|
|
608
|
-
}
|
|
609
|
-
if (!_optionalChain([projectConfigurations, 'optionalAccess', _57 => _57.projects, 'optionalAccess', _58 => _58[projectName]])) {
|
|
610
|
-
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.");
|
|
611
|
-
}
|
|
612
|
-
const projectDependencies = _buildablelibsutils.calculateProjectBuildableDependencies.call(void 0, void 0, projectGraph, workspaceRoot3, projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
|
|
599
|
+
const projectDependencies = _buildablelibsutils.calculateProjectBuildableDependencies.call(void 0, void 0, _projectgraph.readCachedProjectGraph.call(void 0, ), workspaceRoot3, projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
|
|
613
600
|
const localPackages = [];
|
|
614
601
|
for (const project of projectDependencies.dependencies.filter((dep) => dep.node.type === "lib" && dep.node.data.root !== projectRoot && dep.node.data.root !== workspaceRoot3)) {
|
|
615
602
|
const projectNode = project.node;
|
|
616
603
|
if (projectNode.data.root) {
|
|
617
604
|
const projectPackageJsonPath = _chunkRCE3CC76js.joinPaths.call(void 0, workspaceRoot3, projectNode.data.root, "package.json");
|
|
618
|
-
if (
|
|
619
|
-
const
|
|
605
|
+
if (_fs.existsSync.call(void 0, projectPackageJsonPath)) {
|
|
606
|
+
const projectPackageJsonContent = await _promises.readFile.call(void 0, projectPackageJsonPath, "utf8");
|
|
607
|
+
const projectPackageJson = JSON.parse(projectPackageJsonContent);
|
|
620
608
|
if (projectPackageJson.private !== false) {
|
|
621
609
|
localPackages.push(projectPackageJson);
|
|
622
610
|
}
|
|
@@ -652,7 +640,8 @@ var addPackageDependencies = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0
|
|
|
652
640
|
}, "addPackageDependencies");
|
|
653
641
|
var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (config, projectRoot, sourceRoot, projectName, includeSrc = false, packageJson) => {
|
|
654
642
|
const workspaceRoot3 = config.workspaceRoot ? config.workspaceRoot : _chunkRCE3CC76js.findWorkspaceRoot.call(void 0, );
|
|
655
|
-
const
|
|
643
|
+
const workspacePackageJsonContent = await _promises.readFile.call(void 0, _chunkRCE3CC76js.joinPaths.call(void 0, workspaceRoot3, "package.json"), "utf8");
|
|
644
|
+
const workspacePackageJson = JSON.parse(workspacePackageJsonContent);
|
|
656
645
|
packageJson.type ??= "module";
|
|
657
646
|
packageJson.sideEffects ??= false;
|
|
658
647
|
if (includeSrc === true) {
|
|
@@ -798,18 +787,18 @@ var getEnv = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (builder, opti
|
|
|
798
787
|
}, "getEnv");
|
|
799
788
|
|
|
800
789
|
// ../build-tools/src/utilities/get-out-extension.ts
|
|
801
|
-
function getOutExtension(
|
|
790
|
+
function getOutExtension(format2, pkgType) {
|
|
802
791
|
let jsExtension = ".js";
|
|
803
792
|
let dtsExtension = ".d.ts";
|
|
804
|
-
if (pkgType === "module" &&
|
|
793
|
+
if (pkgType === "module" && format2 === "cjs") {
|
|
805
794
|
jsExtension = ".cjs";
|
|
806
795
|
dtsExtension = ".d.cts";
|
|
807
796
|
}
|
|
808
|
-
if (pkgType !== "module" &&
|
|
797
|
+
if (pkgType !== "module" && format2 === "esm") {
|
|
809
798
|
jsExtension = ".mjs";
|
|
810
799
|
dtsExtension = ".d.mts";
|
|
811
800
|
}
|
|
812
|
-
if (
|
|
801
|
+
if (format2 === "iife") {
|
|
813
802
|
jsExtension = ".global.js";
|
|
814
803
|
}
|
|
815
804
|
return {
|
|
@@ -897,15 +886,15 @@ var RendererEngine = class {
|
|
|
897
886
|
if (!relativePath.startsWith("\\\\?\\")) {
|
|
898
887
|
relativePath = relativePath.replace(/\\/g, "/");
|
|
899
888
|
}
|
|
900
|
-
const meta = _optionalChain([metafile, 'optionalAccess',
|
|
889
|
+
const meta = _optionalChain([metafile, 'optionalAccess', _55 => _55.outputs, 'access', _56 => _56[relativePath]]);
|
|
901
890
|
return {
|
|
902
891
|
type: "chunk",
|
|
903
892
|
path: file.path,
|
|
904
893
|
code: file.text,
|
|
905
|
-
map: _optionalChain([outputFiles, 'access',
|
|
906
|
-
entryPoint: _optionalChain([meta, 'optionalAccess',
|
|
907
|
-
exports: _optionalChain([meta, 'optionalAccess',
|
|
908
|
-
imports: _optionalChain([meta, 'optionalAccess',
|
|
894
|
+
map: _optionalChain([outputFiles, 'access', _57 => _57.find, 'call', _58 => _58((f) => f.path === `${file.path}.map`), 'optionalAccess', _59 => _59.text]),
|
|
895
|
+
entryPoint: _optionalChain([meta, 'optionalAccess', _60 => _60.entryPoint]),
|
|
896
|
+
exports: _optionalChain([meta, 'optionalAccess', _61 => _61.exports]),
|
|
897
|
+
imports: _optionalChain([meta, 'optionalAccess', _62 => _62.imports])
|
|
909
898
|
};
|
|
910
899
|
} else {
|
|
911
900
|
return {
|
|
@@ -988,7 +977,7 @@ var esmSplitCodeToCjsPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void
|
|
|
988
977
|
name: "storm:esm-split-code-to-cjs",
|
|
989
978
|
setup(build6) {
|
|
990
979
|
build6.onEnd(async (result) => {
|
|
991
|
-
const outFiles = Object.keys(_nullishCoalesce(_optionalChain([result, 'access',
|
|
980
|
+
const outFiles = Object.keys(_nullishCoalesce(_optionalChain([result, 'access', _63 => _63.metafile, 'optionalAccess', _64 => _64.outputs]), () => ( {})));
|
|
992
981
|
const jsFiles = outFiles.filter((f) => f.endsWith("js"));
|
|
993
982
|
await esbuild.build({
|
|
994
983
|
outdir: resolvedOptions.outdir,
|
|
@@ -1110,7 +1099,7 @@ ${result.errors.map((error) => error.text).join("\n")}
|
|
|
1110
1099
|
// ../esbuild/src/plugins/resolve-paths.ts
|
|
1111
1100
|
|
|
1112
1101
|
function resolvePathsConfig(options, cwd) {
|
|
1113
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
1102
|
+
if (_optionalChain([options, 'optionalAccess', _65 => _65.compilerOptions, 'optionalAccess', _66 => _66.paths])) {
|
|
1114
1103
|
const paths = Object.entries(options.compilerOptions.paths);
|
|
1115
1104
|
const resolvedPaths = paths.map(([key, paths2]) => {
|
|
1116
1105
|
return [
|
|
@@ -1138,7 +1127,7 @@ var resolvePathsPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (o
|
|
|
1138
1127
|
build6.onResolve({
|
|
1139
1128
|
filter: packagesRegex
|
|
1140
1129
|
}, (args) => {
|
|
1141
|
-
if (_optionalChain([build6, 'access',
|
|
1130
|
+
if (_optionalChain([build6, 'access', _67 => _67.initialOptions, 'access', _68 => _68.external, 'optionalAccess', _69 => _69.includes, 'call', _70 => _70(args.path)])) {
|
|
1142
1131
|
return {
|
|
1143
1132
|
path: args.path,
|
|
1144
1133
|
external: true
|
|
@@ -1246,7 +1235,7 @@ var tscPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (options, r
|
|
|
1246
1235
|
function getTypeDependencyPackageName(npmPackage) {
|
|
1247
1236
|
if (npmPackage.startsWith("@")) {
|
|
1248
1237
|
const [scope, name] = npmPackage.split("/");
|
|
1249
|
-
return `@types/${_optionalChain([scope, 'optionalAccess',
|
|
1238
|
+
return `@types/${_optionalChain([scope, 'optionalAccess', _71 => _71.slice, 'call', _72 => _72(1)])}__${name}`;
|
|
1250
1239
|
}
|
|
1251
1240
|
return `@types/${npmPackage}`;
|
|
1252
1241
|
}
|
|
@@ -1453,7 +1442,7 @@ function pipeSync(fn, ...fns) {
|
|
|
1453
1442
|
return (...args) => {
|
|
1454
1443
|
let result = fn(...args);
|
|
1455
1444
|
for (let i = 0; result !== skip && i < fns.length; ++i) {
|
|
1456
|
-
result = _optionalChain([fns, 'access',
|
|
1445
|
+
result = _optionalChain([fns, 'access', _73 => _73[i], 'optionalCall', _74 => _74(result)]);
|
|
1457
1446
|
}
|
|
1458
1447
|
return result;
|
|
1459
1448
|
};
|
|
@@ -1463,7 +1452,7 @@ function pipeAsync(fn, ...fns) {
|
|
|
1463
1452
|
return async (...args) => {
|
|
1464
1453
|
let result = await fn(...args);
|
|
1465
1454
|
for (let i = 0; result !== skip && i < fns.length; ++i) {
|
|
1466
|
-
result = await _optionalChain([fns, 'access',
|
|
1455
|
+
result = await _optionalChain([fns, 'access', _75 => _75[i], 'optionalCall', _76 => _76(result)]);
|
|
1467
1456
|
}
|
|
1468
1457
|
return result;
|
|
1469
1458
|
};
|
|
@@ -1479,7 +1468,7 @@ var resolveOptions = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
1479
1468
|
if (!workspaceRoot3) {
|
|
1480
1469
|
throw new Error("Cannot find Nx workspace root");
|
|
1481
1470
|
}
|
|
1482
|
-
const config = await
|
|
1471
|
+
const config = await _chunkIUVV2SM4js.loadStormConfig.call(void 0, workspaceRoot3.dir);
|
|
1483
1472
|
_chunkRCE3CC76js.writeDebug.call(void 0, " \u2699\uFE0F Resolving build options", config);
|
|
1484
1473
|
const stopwatch = _chunkRCE3CC76js.getStopwatch.call(void 0, "Build options resolution");
|
|
1485
1474
|
const projectGraph = await _devkit.createProjectGraphAsync.call(void 0, {
|
|
@@ -1492,7 +1481,7 @@ var resolveOptions = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
1492
1481
|
const projectJson = await _node.hfs.json(projectJsonPath);
|
|
1493
1482
|
const projectName = projectJson.name;
|
|
1494
1483
|
const projectConfigurations = _devkit.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
|
|
1495
|
-
if (!_optionalChain([projectConfigurations, 'optionalAccess',
|
|
1484
|
+
if (!_optionalChain([projectConfigurations, 'optionalAccess', _77 => _77.projects, 'optionalAccess', _78 => _78[projectName]])) {
|
|
1496
1485
|
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.");
|
|
1497
1486
|
}
|
|
1498
1487
|
const options = _defu2.default.call(void 0, userOptions, DEFAULT_BUILD_OPTIONS);
|
|
@@ -1668,7 +1657,7 @@ async function executeEsBuild(context2) {
|
|
|
1668
1657
|
}
|
|
1669
1658
|
_chunkJ5SB6L2Ljs.__name.call(void 0, executeEsBuild, "executeEsBuild");
|
|
1670
1659
|
async function copyBuildAssets(context2) {
|
|
1671
|
-
if (_optionalChain([context2, 'access',
|
|
1660
|
+
if (_optionalChain([context2, 'access', _79 => _79.result, 'optionalAccess', _80 => _80.errors, 'access', _81 => _81.length]) === 0) {
|
|
1672
1661
|
_chunkRCE3CC76js.writeDebug.call(void 0, ` \u{1F4CB} Copying asset files to output directory: ${context2.options.outdir}`, context2.options.config);
|
|
1673
1662
|
const stopwatch = _chunkRCE3CC76js.getStopwatch.call(void 0, `${context2.options.name} asset copy`);
|
|
1674
1663
|
await copyAssets(context2.options.config, _nullishCoalesce(context2.options.assets, () => ( [])), context2.options.outdir, context2.options.projectRoot, context2.options.projectName, context2.options.sourceRoot, true, false);
|
|
@@ -1678,7 +1667,7 @@ async function copyBuildAssets(context2) {
|
|
|
1678
1667
|
}
|
|
1679
1668
|
_chunkJ5SB6L2Ljs.__name.call(void 0, copyBuildAssets, "copyBuildAssets");
|
|
1680
1669
|
async function reportResults(context2) {
|
|
1681
|
-
if (_optionalChain([context2, 'access',
|
|
1670
|
+
if (_optionalChain([context2, 'access', _82 => _82.result, 'optionalAccess', _83 => _83.errors, 'access', _84 => _84.length]) === 0) {
|
|
1682
1671
|
if (context2.result.warnings.length > 0) {
|
|
1683
1672
|
_chunkRCE3CC76js.writeWarning.call(void 0, ` \u{1F6A7} The following warnings occurred during the build: ${context2.result.warnings.map((warning) => warning.text).join("\n")}`, context2.options.config);
|
|
1684
1673
|
}
|
|
@@ -1776,14 +1765,14 @@ var watch = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (context2, opti
|
|
|
1776
1765
|
// ../workspace-tools/src/executors/esbuild/executor.ts
|
|
1777
1766
|
async function esbuildExecutorFn(options, context2, config) {
|
|
1778
1767
|
_chunkRCE3CC76js.writeInfo.call(void 0, "\u{1F4E6} Running Storm ESBuild executor on the workspace", config);
|
|
1779
|
-
if (!_optionalChain([context2, 'access',
|
|
1768
|
+
if (!_optionalChain([context2, 'access', _85 => _85.projectsConfigurations, 'optionalAccess', _86 => _86.projects]) || !context2.projectName || !context2.projectsConfigurations.projects[context2.projectName] || !_optionalChain([context2, 'access', _87 => _87.projectsConfigurations, 'access', _88 => _88.projects, 'access', _89 => _89[context2.projectName], 'optionalAccess', _90 => _90.root])) {
|
|
1780
1769
|
throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace.");
|
|
1781
1770
|
}
|
|
1782
1771
|
await build3({
|
|
1783
1772
|
...options,
|
|
1784
|
-
projectRoot: _optionalChain([context2, 'access',
|
|
1773
|
+
projectRoot: _optionalChain([context2, 'access', _91 => _91.projectsConfigurations, 'access', _92 => _92.projects, 'optionalAccess', _93 => _93[context2.projectName], 'access', _94 => _94.root]),
|
|
1785
1774
|
projectName: context2.projectName,
|
|
1786
|
-
sourceRoot: _optionalChain([context2, 'access',
|
|
1775
|
+
sourceRoot: _optionalChain([context2, 'access', _95 => _95.projectsConfigurations, 'access', _96 => _96.projects, 'optionalAccess', _97 => _97[context2.projectName], 'optionalAccess', _98 => _98.sourceRoot]),
|
|
1787
1776
|
format: options.format,
|
|
1788
1777
|
platform: options.format
|
|
1789
1778
|
});
|
|
@@ -1808,11 +1797,12 @@ var executor_default6 = withRunExecutor("Storm ESBuild build", esbuildExecutorFn
|
|
|
1808
1797
|
|
|
1809
1798
|
// ../workspace-tools/src/executors/npm-publish/executor.ts
|
|
1810
1799
|
|
|
1811
|
-
|
|
1800
|
+
|
|
1812
1801
|
|
|
1813
1802
|
// ../workspace-tools/src/utils/pnpm-deps-update.ts
|
|
1814
1803
|
|
|
1815
1804
|
|
|
1805
|
+
var _prettier = require('prettier');
|
|
1816
1806
|
var _readyamlfile = require('read-yaml-file'); var _readyamlfile2 = _interopRequireDefault(_readyamlfile);
|
|
1817
1807
|
|
|
1818
1808
|
// ../workspace-tools/src/executors/npm-publish/executor.ts
|
|
@@ -1825,7 +1815,7 @@ var _esbuildwhy = require('@size-limit/esbuild-why'); var _esbuildwhy2 = _intero
|
|
|
1825
1815
|
var _file = require('@size-limit/file'); var _file2 = _interopRequireDefault(_file);
|
|
1826
1816
|
var _sizelimit = require('size-limit'); var _sizelimit2 = _interopRequireDefault(_sizelimit);
|
|
1827
1817
|
async function sizeLimitExecutorFn(options, context2, config) {
|
|
1828
|
-
if (!_optionalChain([context2, 'optionalAccess',
|
|
1818
|
+
if (!_optionalChain([context2, 'optionalAccess', _99 => _99.projectName]) || !_optionalChain([context2, 'access', _100 => _100.projectsConfigurations, 'optionalAccess', _101 => _101.projects]) || !context2.projectsConfigurations.projects[context2.projectName]) {
|
|
1829
1819
|
throw new Error("The Size-Limit process failed because the context is not valid. Please run this command from a workspace.");
|
|
1830
1820
|
}
|
|
1831
1821
|
_chunkRCE3CC76js.writeInfo.call(void 0, `\u{1F4CF} Running Size-Limit on ${context2.projectName}`, config);
|
|
@@ -1834,7 +1824,7 @@ async function sizeLimitExecutorFn(options, context2, config) {
|
|
|
1834
1824
|
_esbuild3.default,
|
|
1835
1825
|
_esbuildwhy2.default
|
|
1836
1826
|
], {
|
|
1837
|
-
checks: _nullishCoalesce(_nullishCoalesce(options.entry, () => ( _optionalChain([context2, 'access',
|
|
1827
|
+
checks: _nullishCoalesce(_nullishCoalesce(options.entry, () => ( _optionalChain([context2, 'access', _102 => _102.projectsConfigurations, 'access', _103 => _103.projects, 'access', _104 => _104[context2.projectName], 'optionalAccess', _105 => _105.sourceRoot]))), () => ( _devkit.joinPathFragments.call(void 0, _nullishCoalesce(_optionalChain([context2, 'access', _106 => _106.projectsConfigurations, 'access', _107 => _107.projects, 'access', _108 => _108[context2.projectName], 'optionalAccess', _109 => _109.root]), () => ( "./")), "src")))
|
|
1838
1828
|
}).then((result) => {
|
|
1839
1829
|
_chunkRCE3CC76js.writeInfo.call(void 0, `\u{1F4CF} ${context2.projectName} Size-Limit result: ${JSON.stringify(result)}`, config);
|
|
1840
1830
|
});
|
|
@@ -1898,7 +1888,7 @@ var resolveOptions2 = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
1898
1888
|
if (!workspaceRoot3) {
|
|
1899
1889
|
throw new Error("Cannot find Nx workspace root");
|
|
1900
1890
|
}
|
|
1901
|
-
const config = await
|
|
1891
|
+
const config = await _chunkIUVV2SM4js.loadStormConfig.call(void 0, workspaceRoot3.dir);
|
|
1902
1892
|
_chunkRCE3CC76js.writeDebug.call(void 0, " \u2699\uFE0F Resolving build options", config);
|
|
1903
1893
|
const stopwatch = _chunkRCE3CC76js.getStopwatch.call(void 0, "Build options resolution");
|
|
1904
1894
|
const projectGraph = await _devkit.createProjectGraphAsync.call(void 0, {
|
|
@@ -1911,7 +1901,7 @@ var resolveOptions2 = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
1911
1901
|
const projectJson = await _node.hfs.json(projectJsonPath);
|
|
1912
1902
|
const projectName = projectJson.name;
|
|
1913
1903
|
const projectConfigurations = _devkit.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
|
|
1914
|
-
if (!_optionalChain([projectConfigurations, 'optionalAccess',
|
|
1904
|
+
if (!_optionalChain([projectConfigurations, 'optionalAccess', _110 => _110.projects, 'optionalAccess', _111 => _111[projectName]])) {
|
|
1915
1905
|
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.");
|
|
1916
1906
|
}
|
|
1917
1907
|
const options = _defu2.default.call(void 0, userOptions, DEFAULT_BUILD_OPTIONS2);
|
|
@@ -2091,14 +2081,14 @@ _chunkJ5SB6L2Ljs.__name.call(void 0, build4, "build");
|
|
|
2091
2081
|
// ../workspace-tools/src/executors/tsdown/executor.ts
|
|
2092
2082
|
async function tsdownExecutorFn(options, context2, config) {
|
|
2093
2083
|
_chunkRCE3CC76js.writeInfo.call(void 0, "\u{1F4E6} Running Storm TSDown build executor on the workspace", config);
|
|
2094
|
-
if (!_optionalChain([context2, 'access',
|
|
2084
|
+
if (!_optionalChain([context2, 'access', _112 => _112.projectsConfigurations, 'optionalAccess', _113 => _113.projects]) || !context2.projectName || !context2.projectsConfigurations.projects[context2.projectName] || !_optionalChain([context2, 'access', _114 => _114.projectsConfigurations, 'access', _115 => _115.projects, 'access', _116 => _116[context2.projectName], 'optionalAccess', _117 => _117.root])) {
|
|
2095
2085
|
throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace.");
|
|
2096
2086
|
}
|
|
2097
2087
|
await build4({
|
|
2098
2088
|
...options,
|
|
2099
|
-
projectRoot: _optionalChain([context2, 'access',
|
|
2089
|
+
projectRoot: _optionalChain([context2, 'access', _118 => _118.projectsConfigurations, 'access', _119 => _119.projects, 'optionalAccess', _120 => _120[context2.projectName], 'access', _121 => _121.root]),
|
|
2100
2090
|
projectName: context2.projectName,
|
|
2101
|
-
sourceRoot: _optionalChain([context2, 'access',
|
|
2091
|
+
sourceRoot: _optionalChain([context2, 'access', _122 => _122.projectsConfigurations, 'access', _123 => _123.projects, 'optionalAccess', _124 => _124[context2.projectName], 'optionalAccess', _125 => _125.sourceRoot]),
|
|
2102
2092
|
format: options.format,
|
|
2103
2093
|
platform: options.platform
|
|
2104
2094
|
});
|
|
@@ -2162,17 +2152,21 @@ var executor_default9 = withRunExecutor("Typia runtime validation generator", ty
|
|
|
2162
2152
|
|
|
2163
2153
|
|
|
2164
2154
|
|
|
2155
|
+
var _jiti = require('jiti');
|
|
2156
|
+
|
|
2165
2157
|
|
|
2166
2158
|
|
|
2167
2159
|
|
|
2168
|
-
var _unbuild = require('unbuild');
|
|
2169
2160
|
|
|
2170
2161
|
// ../unbuild/src/clean.ts
|
|
2171
2162
|
|
|
2172
2163
|
async function clean3(name = "Unbuild", directory, config) {
|
|
2173
2164
|
_chunkRCE3CC76js.writeDebug.call(void 0, ` \u{1F9F9} Cleaning ${name} output path: ${directory}`, config);
|
|
2174
2165
|
const stopwatch = _chunkRCE3CC76js.getStopwatch.call(void 0, `${name} output clean`);
|
|
2175
|
-
await
|
|
2166
|
+
await _promises.rm.call(void 0, directory, {
|
|
2167
|
+
recursive: true,
|
|
2168
|
+
force: true
|
|
2169
|
+
});
|
|
2176
2170
|
stopwatch();
|
|
2177
2171
|
}
|
|
2178
2172
|
_chunkJ5SB6L2Ljs.__name.call(void 0, clean3, "clean");
|
|
@@ -2223,26 +2217,6 @@ ${error ? error.message : "Unknown build error"}
|
|
|
2223
2217
|
}
|
|
2224
2218
|
}), "onErrorPlugin");
|
|
2225
2219
|
|
|
2226
|
-
// ../unbuild/src/plugins/swc.ts
|
|
2227
|
-
var swcPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (options, resolvedOptions) => {
|
|
2228
|
-
const { transform: transform3 } = _chunkJ5SB6L2Ljs.__require.call(void 0, "@swc/core");
|
|
2229
|
-
return {
|
|
2230
|
-
name: "storm:swc",
|
|
2231
|
-
transform(code, filename) {
|
|
2232
|
-
return transform3(code, {
|
|
2233
|
-
filename,
|
|
2234
|
-
jsc: {
|
|
2235
|
-
transform: {
|
|
2236
|
-
react: {
|
|
2237
|
-
runtime: "automatic"
|
|
2238
|
-
}
|
|
2239
|
-
}
|
|
2240
|
-
}
|
|
2241
|
-
});
|
|
2242
|
-
}
|
|
2243
|
-
};
|
|
2244
|
-
}, "swcPlugin");
|
|
2245
|
-
|
|
2246
2220
|
// ../unbuild/src/plugins/tsc.ts
|
|
2247
2221
|
|
|
2248
2222
|
|
|
@@ -2277,9 +2251,7 @@ _chunkJ5SB6L2Ljs.__name.call(void 0, createTsCompilerOptions, "createTsCompilerO
|
|
|
2277
2251
|
|
|
2278
2252
|
// ../unbuild/src/plugins/tsc.ts
|
|
2279
2253
|
var tscPlugin2 = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (options, resolvedOptions) => {
|
|
2280
|
-
const projectGraph =
|
|
2281
|
-
exitOnError: true
|
|
2282
|
-
});
|
|
2254
|
+
const projectGraph = _devkit.readCachedProjectGraph.call(void 0, );
|
|
2283
2255
|
const result = _buildablelibsutils.calculateProjectBuildableDependencies.call(void 0, void 0, projectGraph, resolvedOptions.config.workspaceRoot, resolvedOptions.projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
|
|
2284
2256
|
let dependencies = result.dependencies;
|
|
2285
2257
|
const tsLibDependency = _compilerhelperdependency.getHelperDependency.call(void 0, _compilerhelperdependency.HelperDependency.tsc, resolvedOptions.tsconfig, dependencies, projectGraph, true);
|
|
@@ -2298,37 +2270,39 @@ var tscPlugin2 = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (opt
|
|
|
2298
2270
|
|
|
2299
2271
|
// ../unbuild/src/plugins/type-definitions.ts
|
|
2300
2272
|
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2273
|
+
function typeDefinitions(projectRoot) {
|
|
2274
|
+
return {
|
|
2275
|
+
name: "storm:dts-bundle",
|
|
2276
|
+
async generateBundle(_opts, bundle) {
|
|
2277
|
+
for (const file of Object.values(bundle)) {
|
|
2278
|
+
if (file.type === "asset" || !file.isEntry || file.facadeModuleId == null) {
|
|
2279
|
+
continue;
|
|
2280
|
+
}
|
|
2281
|
+
const hasDefaultExport = file.exports.includes("default");
|
|
2282
|
+
const entrySourceFileName = _path.relative.call(void 0, projectRoot, file.facadeModuleId);
|
|
2283
|
+
const entrySourceDtsName = entrySourceFileName.replace(/\.[cm]?[jt]sx?$/, "");
|
|
2284
|
+
const dtsFileName = file.fileName.replace(/\.[cm]?js$/, ".d.ts");
|
|
2285
|
+
const relativeSourceDtsName = JSON.stringify("./" + entrySourceDtsName);
|
|
2286
|
+
const dtsFileSource = hasDefaultExport ? `
|
|
2314
2287
|
export * from ${relativeSourceDtsName};
|
|
2315
2288
|
export { default } from ${relativeSourceDtsName};
|
|
2316
2289
|
` : `export * from ${relativeSourceDtsName};
|
|
2317
2290
|
`;
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2291
|
+
this.emitFile({
|
|
2292
|
+
type: "asset",
|
|
2293
|
+
fileName: dtsFileName,
|
|
2294
|
+
source: dtsFileSource
|
|
2295
|
+
});
|
|
2296
|
+
}
|
|
2323
2297
|
}
|
|
2324
|
-
}
|
|
2325
|
-
}
|
|
2298
|
+
};
|
|
2299
|
+
}
|
|
2300
|
+
_chunkJ5SB6L2Ljs.__name.call(void 0, typeDefinitions, "typeDefinitions");
|
|
2326
2301
|
|
|
2327
2302
|
// ../unbuild/src/config.ts
|
|
2328
2303
|
var getDefaultBuildPlugins2 = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (options, resolvedOptions) => Promise.all([
|
|
2329
2304
|
analyzePlugin(options, resolvedOptions),
|
|
2330
|
-
|
|
2331
|
-
typeDefinitions(options, resolvedOptions),
|
|
2305
|
+
typeDefinitions(resolvedOptions.projectRoot),
|
|
2332
2306
|
tscPlugin2(options, resolvedOptions),
|
|
2333
2307
|
onErrorPlugin2(options, resolvedOptions)
|
|
2334
2308
|
].map((plugin) => Promise.resolve(plugin))), "getDefaultBuildPlugins");
|
|
@@ -2344,7 +2318,7 @@ async function resolveOptions3(options) {
|
|
|
2344
2318
|
if (!workspaceRoot3) {
|
|
2345
2319
|
throw new Error("Cannot find workspace root");
|
|
2346
2320
|
}
|
|
2347
|
-
const config = await
|
|
2321
|
+
const config = await _chunkIUVV2SM4js.loadStormConfig.call(void 0, workspaceRoot3.dir);
|
|
2348
2322
|
_chunkRCE3CC76js.writeDebug.call(void 0, " \u2699\uFE0F Resolving build options", config);
|
|
2349
2323
|
const stopwatch = _chunkRCE3CC76js.getStopwatch.call(void 0, "Build options resolution");
|
|
2350
2324
|
if (options.configPath) {
|
|
@@ -2353,38 +2327,34 @@ async function resolveOptions3(options) {
|
|
|
2353
2327
|
options = _defu2.default.call(void 0, options, configFile);
|
|
2354
2328
|
}
|
|
2355
2329
|
}
|
|
2356
|
-
const projectGraph =
|
|
2357
|
-
exitOnError: true
|
|
2358
|
-
});
|
|
2330
|
+
const projectGraph = _devkit.readCachedProjectGraph.call(void 0, );
|
|
2359
2331
|
const projectJsonPath = _chunkRCE3CC76js.joinPaths.call(void 0, config.workspaceRoot, projectRoot, "project.json");
|
|
2360
|
-
if (!
|
|
2332
|
+
if (!_fs.existsSync.call(void 0, projectJsonPath)) {
|
|
2361
2333
|
throw new Error("Cannot find project.json configuration");
|
|
2362
2334
|
}
|
|
2363
|
-
const
|
|
2335
|
+
const projectJsonContent = await _promises.readFile.call(void 0, projectJsonPath, "utf8");
|
|
2336
|
+
const projectJson = JSON.parse(projectJsonContent);
|
|
2364
2337
|
const projectName = projectJson.name;
|
|
2365
2338
|
const packageJsonPath = _chunkRCE3CC76js.joinPaths.call(void 0, workspaceRoot3.dir, projectRoot, "package.json");
|
|
2366
|
-
if (!
|
|
2339
|
+
if (!_fs.existsSync.call(void 0, packageJsonPath)) {
|
|
2367
2340
|
throw new Error("Cannot find package.json configuration");
|
|
2368
2341
|
}
|
|
2369
|
-
const
|
|
2342
|
+
const packageJsonContent = await _promises.readFile.call(void 0, packageJsonPath, "utf8");
|
|
2343
|
+
const packageJson = JSON.parse(packageJsonContent);
|
|
2370
2344
|
let tsconfig = options.tsconfig;
|
|
2371
2345
|
if (!tsconfig) {
|
|
2372
2346
|
tsconfig = _chunkRCE3CC76js.joinPaths.call(void 0, workspaceRoot3.dir, projectRoot, "tsconfig.json");
|
|
2373
2347
|
}
|
|
2374
|
-
if (!
|
|
2348
|
+
if (!_fs.existsSync.call(void 0, tsconfig)) {
|
|
2375
2349
|
throw new Error("Cannot find tsconfig.json configuration");
|
|
2376
2350
|
}
|
|
2377
2351
|
let sourceRoot = projectJson.sourceRoot;
|
|
2378
2352
|
if (!sourceRoot) {
|
|
2379
2353
|
sourceRoot = _chunkRCE3CC76js.joinPaths.call(void 0, projectRoot, "src");
|
|
2380
2354
|
}
|
|
2381
|
-
if (!
|
|
2355
|
+
if (!_fs.existsSync.call(void 0, sourceRoot)) {
|
|
2382
2356
|
throw new Error("Cannot find sourceRoot directory");
|
|
2383
2357
|
}
|
|
2384
|
-
const projectConfigurations = _devkit.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
|
|
2385
|
-
if (!_optionalChain([projectConfigurations, 'optionalAccess', _130 => _130.projects, 'optionalAccess', _131 => _131[projectName]])) {
|
|
2386
|
-
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.");
|
|
2387
|
-
}
|
|
2388
2358
|
const result = _buildablelibsutils.calculateProjectBuildableDependencies.call(void 0, void 0, projectGraph, workspaceRoot3.dir, projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
|
|
2389
2359
|
let dependencies = result.dependencies;
|
|
2390
2360
|
const tsLibDependency = _js.getHelperDependency.call(void 0, _js.HelperDependency.tsc, tsconfig, dependencies, projectGraph, true);
|
|
@@ -2392,6 +2362,11 @@ async function resolveOptions3(options) {
|
|
|
2392
2362
|
dependencies = dependencies.filter((deps) => deps.name !== tsLibDependency.name);
|
|
2393
2363
|
dependencies.push(tsLibDependency);
|
|
2394
2364
|
}
|
|
2365
|
+
const jiti = _jiti.createJiti.call(void 0, config.workspaceRoot, {
|
|
2366
|
+
cache: true,
|
|
2367
|
+
fsCache: config.skipCache ? false : _chunkRCE3CC76js.joinPaths.call(void 0, config.directories.cache || "node_modules/.cache/storm", "jiti"),
|
|
2368
|
+
interopDefault: true
|
|
2369
|
+
});
|
|
2395
2370
|
const resolvedOptions = {
|
|
2396
2371
|
name: projectName,
|
|
2397
2372
|
config,
|
|
@@ -2399,6 +2374,7 @@ async function resolveOptions3(options) {
|
|
|
2399
2374
|
sourceRoot,
|
|
2400
2375
|
projectName,
|
|
2401
2376
|
tsconfig,
|
|
2377
|
+
jiti,
|
|
2402
2378
|
clean: false,
|
|
2403
2379
|
entries: [
|
|
2404
2380
|
{
|
|
@@ -2465,7 +2441,7 @@ async function resolveOptions3(options) {
|
|
|
2465
2441
|
]
|
|
2466
2442
|
},
|
|
2467
2443
|
esbuild: {
|
|
2468
|
-
minify:
|
|
2444
|
+
minify: options.minify !== false,
|
|
2469
2445
|
splitting: options.splitting !== false,
|
|
2470
2446
|
treeShaking: options.treeShaking !== false,
|
|
2471
2447
|
color: true,
|
|
@@ -2505,31 +2481,44 @@ async function resolveOptions3(options) {
|
|
|
2505
2481
|
}
|
|
2506
2482
|
_chunkJ5SB6L2Ljs.__name.call(void 0, resolveOptions3, "resolveOptions");
|
|
2507
2483
|
async function generatePackageJson3(options) {
|
|
2508
|
-
if (options.generatePackageJson !== false &&
|
|
2484
|
+
if (options.generatePackageJson !== false && _fs.existsSync.call(void 0, _chunkRCE3CC76js.joinPaths.call(void 0, options.projectRoot, "package.json"))) {
|
|
2509
2485
|
_chunkRCE3CC76js.writeDebug.call(void 0, " \u270D\uFE0F Writing package.json file", options.config);
|
|
2510
2486
|
const stopwatch = _chunkRCE3CC76js.getStopwatch.call(void 0, "Write package.json file");
|
|
2511
2487
|
const packageJsonPath = _chunkRCE3CC76js.joinPaths.call(void 0, options.projectRoot, "project.json");
|
|
2512
|
-
if (!
|
|
2488
|
+
if (!_fs.existsSync.call(void 0, packageJsonPath)) {
|
|
2513
2489
|
throw new Error("Cannot find package.json configuration");
|
|
2514
2490
|
}
|
|
2515
|
-
let
|
|
2516
|
-
if (!
|
|
2491
|
+
let packageJsonContent = await _promises.readFile.call(void 0, _chunkRCE3CC76js.joinPaths.call(void 0, options.config.workspaceRoot, options.projectRoot, "package.json"), "utf8");
|
|
2492
|
+
if (!packageJsonContent) {
|
|
2517
2493
|
throw new Error("Cannot find package.json configuration file");
|
|
2518
2494
|
}
|
|
2495
|
+
let packageJson = JSON.parse(packageJsonContent);
|
|
2519
2496
|
packageJson = await addPackageDependencies(options.config.workspaceRoot, options.projectRoot, options.projectName, packageJson);
|
|
2520
2497
|
packageJson = await addWorkspacePackageJsonFields(options.config, options.projectRoot, options.sourceRoot, options.projectName, false, packageJson);
|
|
2521
|
-
|
|
2522
|
-
await _devkit.writeJsonFile.call(void 0, _chunkRCE3CC76js.joinPaths.call(void 0, options.outDir, "package.json"), packageJson);
|
|
2498
|
+
await _devkit.writeJsonFile.call(void 0, _chunkRCE3CC76js.joinPaths.call(void 0, options.outDir, "package.json"), await addPackageJsonExports(options.sourceRoot, packageJson));
|
|
2523
2499
|
stopwatch();
|
|
2524
2500
|
}
|
|
2525
2501
|
return options;
|
|
2526
2502
|
}
|
|
2527
2503
|
_chunkJ5SB6L2Ljs.__name.call(void 0, generatePackageJson3, "generatePackageJson");
|
|
2504
|
+
async function resolveUnbuild(options) {
|
|
2505
|
+
_chunkRCE3CC76js.writeTrace.call(void 0, `Resolving Unbuild package with Jiti`, options.config);
|
|
2506
|
+
try {
|
|
2507
|
+
return options.jiti.import("unbuild");
|
|
2508
|
+
} catch (error) {
|
|
2509
|
+
_chunkRCE3CC76js.writeError.call(void 0, " \u274C An error occurred while resolving the Unbuild package", options.config);
|
|
2510
|
+
throw new Error("An error occurred while resolving the Unbuild package", {
|
|
2511
|
+
cause: error
|
|
2512
|
+
});
|
|
2513
|
+
}
|
|
2514
|
+
}
|
|
2515
|
+
_chunkJ5SB6L2Ljs.__name.call(void 0, resolveUnbuild, "resolveUnbuild");
|
|
2528
2516
|
async function executeUnbuild(options) {
|
|
2529
2517
|
_chunkRCE3CC76js.writeDebug.call(void 0, ` \u{1F680} Running ${options.name} (${options.projectRoot}) build`, options.config);
|
|
2530
2518
|
const stopwatch = _chunkRCE3CC76js.getStopwatch.call(void 0, `${options.name} (${options.projectRoot}) build`);
|
|
2531
2519
|
try {
|
|
2532
|
-
await
|
|
2520
|
+
const unbuild = await resolveUnbuild(options);
|
|
2521
|
+
await unbuild.build(options.projectRoot, false, {
|
|
2533
2522
|
...options,
|
|
2534
2523
|
rootDir: options.projectRoot
|
|
2535
2524
|
});
|
|
@@ -2577,14 +2566,14 @@ _chunkJ5SB6L2Ljs.__name.call(void 0, build5, "build");
|
|
|
2577
2566
|
|
|
2578
2567
|
async function unbuildExecutorFn(options, context2, config) {
|
|
2579
2568
|
_chunkRCE3CC76js.writeInfo.call(void 0, "\u{1F4E6} Running Storm Unbuild executor on the workspace", config);
|
|
2580
|
-
if (!_optionalChain([context2, 'access',
|
|
2569
|
+
if (!_optionalChain([context2, 'access', _126 => _126.projectsConfigurations, 'optionalAccess', _127 => _127.projects]) || !context2.projectName || !context2.projectsConfigurations.projects[context2.projectName] || !_optionalChain([context2, 'access', _128 => _128.projectsConfigurations, 'access', _129 => _129.projects, 'access', _130 => _130[context2.projectName], 'optionalAccess', _131 => _131.root])) {
|
|
2581
2570
|
throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace.");
|
|
2582
2571
|
}
|
|
2583
2572
|
await build5(_defu.defu.call(void 0, {
|
|
2584
2573
|
...options,
|
|
2585
|
-
projectRoot: _optionalChain([context2, 'access',
|
|
2574
|
+
projectRoot: _optionalChain([context2, 'access', _132 => _132.projectsConfigurations, 'access', _133 => _133.projects, 'optionalAccess', _134 => _134[context2.projectName], 'access', _135 => _135.root]),
|
|
2586
2575
|
projectName: context2.projectName,
|
|
2587
|
-
sourceRoot: _optionalChain([context2, 'access',
|
|
2576
|
+
sourceRoot: _optionalChain([context2, 'access', _136 => _136.projectsConfigurations, 'access', _137 => _137.projects, 'optionalAccess', _138 => _138[context2.projectName], 'optionalAccess', _139 => _139.sourceRoot]),
|
|
2588
2577
|
platform: options.platform,
|
|
2589
2578
|
name: context2.projectName
|
|
2590
2579
|
}, {
|
|
@@ -2651,9 +2640,9 @@ var withRunGenerator = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (nam
|
|
|
2651
2640
|
if (!generatorOptions.skipReadingConfig) {
|
|
2652
2641
|
_chunkRCE3CC76js.writeDebug.call(void 0, `Loading the Storm Config from environment variables and storm.config.js file...
|
|
2653
2642
|
- workspaceRoot: ${workspaceRoot3}`, config);
|
|
2654
|
-
config = await
|
|
2643
|
+
config = await _chunkIUVV2SM4js.loadStormConfig.call(void 0, workspaceRoot3);
|
|
2655
2644
|
}
|
|
2656
|
-
if (_optionalChain([generatorOptions, 'optionalAccess',
|
|
2645
|
+
if (_optionalChain([generatorOptions, 'optionalAccess', _140 => _140.hooks, 'optionalAccess', _141 => _141.applyDefaultOptions])) {
|
|
2657
2646
|
_chunkRCE3CC76js.writeDebug.call(void 0, "Running the applyDefaultOptions hook...", config);
|
|
2658
2647
|
options = await Promise.resolve(generatorOptions.hooks.applyDefaultOptions(options, config));
|
|
2659
2648
|
_chunkRCE3CC76js.writeDebug.call(void 0, "Completed the applyDefaultOptions hook", config);
|
|
@@ -2664,22 +2653,22 @@ ${Object.keys(_nullishCoalesce(options, () => ( {}))).map((key) => ` - ${key}=${
|
|
|
2664
2653
|
workspaceRoot: tree.root,
|
|
2665
2654
|
config
|
|
2666
2655
|
}, applyWorkspaceBaseTokens);
|
|
2667
|
-
if (_optionalChain([generatorOptions, 'optionalAccess',
|
|
2656
|
+
if (_optionalChain([generatorOptions, 'optionalAccess', _142 => _142.hooks, 'optionalAccess', _143 => _143.preProcess])) {
|
|
2668
2657
|
_chunkRCE3CC76js.writeDebug.call(void 0, "Running the preProcess hook...", config);
|
|
2669
2658
|
await Promise.resolve(generatorOptions.hooks.preProcess(tokenized, config));
|
|
2670
2659
|
_chunkRCE3CC76js.writeDebug.call(void 0, "Completed the preProcess hook", config);
|
|
2671
2660
|
}
|
|
2672
2661
|
const result = await Promise.resolve(generatorFn(tree, tokenized, config));
|
|
2673
2662
|
if (result) {
|
|
2674
|
-
if (result.success === false || result.error && _optionalChain([result, 'optionalAccess',
|
|
2663
|
+
if (result.success === false || result.error && _optionalChain([result, 'optionalAccess', _144 => _144.error, 'optionalAccess', _145 => _145.message]) && typeof _optionalChain([result, 'optionalAccess', _146 => _146.error, 'optionalAccess', _147 => _147.message]) === "string" && _optionalChain([result, 'optionalAccess', _148 => _148.error, 'optionalAccess', _149 => _149.name]) && typeof _optionalChain([result, 'optionalAccess', _150 => _150.error, 'optionalAccess', _151 => _151.name]) === "string") {
|
|
2675
2664
|
throw new Error(`The ${name} generator failed to run`, {
|
|
2676
|
-
cause: _optionalChain([result, 'optionalAccess',
|
|
2665
|
+
cause: _optionalChain([result, 'optionalAccess', _152 => _152.error])
|
|
2677
2666
|
});
|
|
2678
2667
|
} else if (result.success && result.data) {
|
|
2679
2668
|
return result;
|
|
2680
2669
|
}
|
|
2681
2670
|
}
|
|
2682
|
-
if (_optionalChain([generatorOptions, 'optionalAccess',
|
|
2671
|
+
if (_optionalChain([generatorOptions, 'optionalAccess', _153 => _153.hooks, 'optionalAccess', _154 => _154.postProcess])) {
|
|
2683
2672
|
_chunkRCE3CC76js.writeDebug.call(void 0, "Running the postProcess hook...", config);
|
|
2684
2673
|
await Promise.resolve(generatorOptions.hooks.postProcess(config));
|
|
2685
2674
|
_chunkRCE3CC76js.writeDebug.call(void 0, "Completed the postProcess hook", config);
|
|
@@ -2789,15 +2778,15 @@ async function typeScriptLibraryGeneratorFn(tree, schema, config) {
|
|
|
2789
2778
|
_devkit.addProjectConfiguration.call(void 0, tree, options.name, projectConfig);
|
|
2790
2779
|
let repository = {
|
|
2791
2780
|
type: "github",
|
|
2792
|
-
url: _optionalChain([config, 'optionalAccess',
|
|
2781
|
+
url: _optionalChain([config, 'optionalAccess', _155 => _155.repository]) || `https://github.com/${_optionalChain([config, 'optionalAccess', _156 => _156.organization]) || "storm-software"}/${_optionalChain([config, 'optionalAccess', _157 => _157.namespace]) || _optionalChain([config, 'optionalAccess', _158 => _158.name]) || "repository"}.git`
|
|
2793
2782
|
};
|
|
2794
2783
|
let description = schema.description || "A package developed by Storm Software used to create modern, scalable web applications.";
|
|
2795
2784
|
if (tree.exists("package.json")) {
|
|
2796
2785
|
const packageJson = _devkit.readJson.call(void 0, tree, "package.json");
|
|
2797
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
2786
|
+
if (_optionalChain([packageJson, 'optionalAccess', _159 => _159.repository])) {
|
|
2798
2787
|
repository = packageJson.repository;
|
|
2799
2788
|
}
|
|
2800
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
2789
|
+
if (_optionalChain([packageJson, 'optionalAccess', _160 => _160.description])) {
|
|
2801
2790
|
description = packageJson.description;
|
|
2802
2791
|
}
|
|
2803
2792
|
}
|
|
@@ -2852,9 +2841,9 @@ async function typeScriptLibraryGeneratorFn(tree, schema, config) {
|
|
|
2852
2841
|
_devkit.updateJson.call(void 0, tree, "package.json", (json) => ({
|
|
2853
2842
|
...json,
|
|
2854
2843
|
pnpm: {
|
|
2855
|
-
..._optionalChain([json, 'optionalAccess',
|
|
2844
|
+
..._optionalChain([json, 'optionalAccess', _161 => _161.pnpm]),
|
|
2856
2845
|
overrides: {
|
|
2857
|
-
..._optionalChain([json, 'optionalAccess',
|
|
2846
|
+
..._optionalChain([json, 'optionalAccess', _162 => _162.pnpm, 'optionalAccess', _163 => _163.overrides]),
|
|
2858
2847
|
[_nullishCoalesce(options.importPath, () => ( ""))]: "workspace:*"
|
|
2859
2848
|
}
|
|
2860
2849
|
}
|
|
@@ -2868,10 +2857,10 @@ async function typeScriptLibraryGeneratorFn(tree, schema, config) {
|
|
|
2868
2857
|
]);
|
|
2869
2858
|
if (tree.exists("package.json")) {
|
|
2870
2859
|
const packageJson = _devkit.readJson.call(void 0, tree, "package.json");
|
|
2871
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
2860
|
+
if (_optionalChain([packageJson, 'optionalAccess', _164 => _164.repository])) {
|
|
2872
2861
|
repository = packageJson.repository;
|
|
2873
2862
|
}
|
|
2874
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
2863
|
+
if (_optionalChain([packageJson, 'optionalAccess', _165 => _165.description])) {
|
|
2875
2864
|
description = packageJson.description;
|
|
2876
2865
|
}
|
|
2877
2866
|
}
|
|
@@ -2919,24 +2908,24 @@ _chunkJ5SB6L2Ljs.__name.call(void 0, getOutputPath, "getOutputPath");
|
|
|
2919
2908
|
function createProjectTsConfigJson(tree, options) {
|
|
2920
2909
|
const tsconfig = {
|
|
2921
2910
|
extends: options.rootProject ? void 0 : _js.getRelativePathToRootTsConfig.call(void 0, tree, options.projectRoot),
|
|
2922
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
2911
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _166 => _166.tsconfigOptions]), () => ( {})),
|
|
2923
2912
|
compilerOptions: {
|
|
2924
2913
|
...options.rootProject ? _js.tsConfigBaseOptions : {},
|
|
2925
2914
|
outDir: _chunkRCE3CC76js.joinPaths.call(void 0, _devkit.offsetFromRoot.call(void 0, options.projectRoot), "dist/out-tsc"),
|
|
2926
2915
|
noEmit: true,
|
|
2927
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
2916
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _167 => _167.tsconfigOptions, 'optionalAccess', _168 => _168.compilerOptions]), () => ( {}))
|
|
2928
2917
|
},
|
|
2929
2918
|
files: [
|
|
2930
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
2919
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _169 => _169.tsconfigOptions, 'optionalAccess', _170 => _170.files]), () => ( []))
|
|
2931
2920
|
],
|
|
2932
2921
|
include: [
|
|
2933
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
2922
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _171 => _171.tsconfigOptions, 'optionalAccess', _172 => _172.include]), () => ( [])),
|
|
2934
2923
|
"src/**/*.ts",
|
|
2935
2924
|
"src/**/*.js",
|
|
2936
2925
|
"bin/**/*"
|
|
2937
2926
|
],
|
|
2938
2927
|
exclude: [
|
|
2939
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
2928
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _173 => _173.tsconfigOptions, 'optionalAccess', _174 => _174.exclude]), () => ( [])),
|
|
2940
2929
|
"jest.config.ts",
|
|
2941
2930
|
"src/**/*.spec.ts",
|
|
2942
2931
|
"src/**/*.test.ts"
|
|
@@ -3074,7 +3063,7 @@ async function configSchemaGeneratorFn(tree, options, config) {
|
|
|
3074
3063
|
name: "StormWorkspaceConfiguration"
|
|
3075
3064
|
});
|
|
3076
3065
|
_chunkRCE3CC76js.writeTrace.call(void 0, jsonSchema, config);
|
|
3077
|
-
const outputPath = options.outputFile.replaceAll("{workspaceRoot}", "").replaceAll(_nullishCoalesce(_optionalChain([config, 'optionalAccess',
|
|
3066
|
+
const outputPath = options.outputFile.replaceAll("{workspaceRoot}", "").replaceAll(_nullishCoalesce(_optionalChain([config, 'optionalAccess', _175 => _175.workspaceRoot]), () => ( _chunkRCE3CC76js.findWorkspaceRoot.call(void 0, ))), _optionalChain([options, 'access', _176 => _176.outputFile, 'optionalAccess', _177 => _177.startsWith, 'call', _178 => _178("./")]) ? "" : "./");
|
|
3078
3067
|
_chunkRCE3CC76js.writeTrace.call(void 0, `\u{1F4DD} Writing Storm Configuration JSON Schema to "${outputPath}"`, config);
|
|
3079
3068
|
_devkit.writeJson.call(void 0, tree, outputPath, jsonSchema, {
|
|
3080
3069
|
spaces: 2
|