@storm-software/cloudflare-tools 0.49.1 → 0.50.0
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 +6 -0
- package/README.md +1 -1
- package/dist/{chunk-ZY7TM2TA.mjs → chunk-7KICJG4N.mjs} +4 -4
- package/dist/{chunk-ITLKTOIK.mjs → chunk-CYPHDXO4.mjs} +105 -136
- package/dist/{chunk-NPJPHEFP.js → chunk-FARER72T.js} +1 -1
- package/dist/{chunk-CR22PACK.mjs → chunk-FDWGGCRH.mjs} +1 -1
- package/dist/{chunk-YE4FHRXJ.js → chunk-FEVYI765.js} +4 -4
- package/dist/{chunk-WGOT27OY.js → chunk-GTCFSQI5.js} +114 -145
- package/dist/{chunk-W5J5EWQN.js → chunk-IF6J7SWP.js} +5 -5
- package/dist/{chunk-OARYMVO7.mjs → chunk-JJVEBF3V.mjs} +4 -4
- package/dist/{chunk-NKCR3FSU.js → chunk-RGEF6YBW.js} +4 -4
- package/dist/{chunk-VPT6GF3S.mjs → chunk-WWU5M5GO.mjs} +5 -5
- package/dist/executors.js +4 -4
- package/dist/executors.mjs +4 -4
- package/dist/generators.js +5 -5
- package/dist/generators.mjs +4 -4
- package/dist/index.js +12 -12
- package/dist/index.mjs +15 -15
- 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 +4 -4
- package/dist/src/executors/r2-upload-publish/executor.mjs +3 -3
- 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 +1 -1
package/CHANGELOG.md
CHANGED
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 -->
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
generator_default
|
|
3
|
-
} from "./chunk-CR22PACK.mjs";
|
|
4
1
|
import {
|
|
5
2
|
loadStormConfig
|
|
6
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-JJVEBF3V.mjs";
|
|
7
4
|
import {
|
|
8
5
|
findWorkspaceRoot,
|
|
9
6
|
getStopwatch,
|
|
@@ -13,6 +10,9 @@ import {
|
|
|
13
10
|
writeInfo,
|
|
14
11
|
writeTrace
|
|
15
12
|
} from "./chunk-NSLK6ZDO.mjs";
|
|
13
|
+
import {
|
|
14
|
+
generator_default
|
|
15
|
+
} from "./chunk-FDWGGCRH.mjs";
|
|
16
16
|
import {
|
|
17
17
|
__dirname,
|
|
18
18
|
__name
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-XU6MTFCV.mjs";
|
|
5
5
|
import {
|
|
6
6
|
loadStormConfig
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-JJVEBF3V.mjs";
|
|
8
8
|
import {
|
|
9
9
|
LogLevelLabel,
|
|
10
10
|
StormConfigSchema,
|
|
@@ -465,8 +465,8 @@ import https from "node:https";
|
|
|
465
465
|
var LARGE_BUFFER2 = 1024 * 1e6;
|
|
466
466
|
|
|
467
467
|
// ../esbuild/src/build.ts
|
|
468
|
-
import { hfs as
|
|
469
|
-
import { createProjectGraphAsync
|
|
468
|
+
import { hfs as hfs3 } from "@humanfs/node";
|
|
469
|
+
import { createProjectGraphAsync, readProjectsConfigurationFromProjectGraph as readProjectsConfigurationFromProjectGraph2, writeJsonFile } from "@nx/devkit";
|
|
470
470
|
|
|
471
471
|
// ../build-tools/src/config.ts
|
|
472
472
|
var DEFAULT_COMPILED_BANNER = `
|
|
@@ -493,13 +493,14 @@ import { stripIndents } from "@nx/devkit";
|
|
|
493
493
|
import { relative as relative2 } from "path";
|
|
494
494
|
|
|
495
495
|
// ../build-tools/src/utilities/copy-assets.ts
|
|
496
|
-
import {
|
|
497
|
-
import { createProjectGraphAsync, readProjectsConfigurationFromProjectGraph } from "@nx/devkit";
|
|
496
|
+
import { readCachedProjectGraph, readProjectsConfigurationFromProjectGraph } from "@nx/devkit";
|
|
498
497
|
import { copyAssets as copyAssetsBase } from "@nx/js";
|
|
499
498
|
import { glob } from "glob";
|
|
499
|
+
import { readFile as readFile2, writeFile } from "node:fs/promises";
|
|
500
500
|
|
|
501
501
|
// ../build-tools/src/utilities/read-nx-config.ts
|
|
502
|
-
import {
|
|
502
|
+
import { existsSync } from "node:fs";
|
|
503
|
+
import { readFile } from "node:fs/promises";
|
|
503
504
|
var readNxConfig = /* @__PURE__ */ __name(async (workspaceRoot3) => {
|
|
504
505
|
let rootDir = workspaceRoot3;
|
|
505
506
|
if (!rootDir) {
|
|
@@ -507,10 +508,11 @@ var readNxConfig = /* @__PURE__ */ __name(async (workspaceRoot3) => {
|
|
|
507
508
|
rootDir = config.workspaceRoot;
|
|
508
509
|
}
|
|
509
510
|
const nxJsonPath = joinPaths(rootDir, "nx.json");
|
|
510
|
-
if (!
|
|
511
|
+
if (!existsSync(nxJsonPath)) {
|
|
511
512
|
throw new Error("Cannot find project.json configuration");
|
|
512
513
|
}
|
|
513
|
-
|
|
514
|
+
const configContent = await readFile(nxJsonPath, "utf8");
|
|
515
|
+
return JSON.parse(configContent);
|
|
514
516
|
}, "readNxConfig");
|
|
515
517
|
|
|
516
518
|
// ../build-tools/src/utilities/copy-assets.ts
|
|
@@ -545,14 +547,12 @@ var copyAssets = /* @__PURE__ */ __name(async (config, assets, outputPath, proje
|
|
|
545
547
|
});
|
|
546
548
|
}
|
|
547
549
|
const nxJson = readNxConfig(config.workspaceRoot);
|
|
548
|
-
const projectGraph =
|
|
549
|
-
exitOnError: true
|
|
550
|
-
});
|
|
550
|
+
const projectGraph = readCachedProjectGraph();
|
|
551
551
|
const projectsConfigurations = readProjectsConfigurationFromProjectGraph(projectGraph);
|
|
552
552
|
if (!projectsConfigurations?.projects?.[projectName]) {
|
|
553
553
|
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.");
|
|
554
554
|
}
|
|
555
|
-
const buildTarget = projectsConfigurations.projects[projectName]
|
|
555
|
+
const buildTarget = projectsConfigurations.projects[projectName].targets?.build;
|
|
556
556
|
if (!buildTarget) {
|
|
557
557
|
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")}`);
|
|
558
558
|
}
|
|
@@ -582,42 +582,30 @@ var copyAssets = /* @__PURE__ */ __name(async (config, assets, outputPath, proje
|
|
|
582
582
|
joinPaths(config.workspaceRoot, outputPath, "src/**/*.js"),
|
|
583
583
|
joinPaths(config.workspaceRoot, outputPath, "src/**/*.jsx")
|
|
584
584
|
]);
|
|
585
|
-
await Promise.allSettled(files.map(async (file) =>
|
|
585
|
+
await Promise.allSettled(files.map(async (file) => writeFile(file, `${banner && typeof banner === "string" ? banner.startsWith("//") ? banner : `// ${banner}` : ""}
|
|
586
586
|
|
|
587
|
-
${await
|
|
587
|
+
${await readFile2(file, "utf8")}
|
|
588
588
|
|
|
589
589
|
${footer && typeof footer === "string" ? footer.startsWith("//") ? footer : `// ${footer}` : ""}`)));
|
|
590
590
|
}
|
|
591
591
|
}, "copyAssets");
|
|
592
592
|
|
|
593
593
|
// ../build-tools/src/utilities/generate-package-json.ts
|
|
594
|
-
import { hfs as hfs3 } from "@humanfs/node";
|
|
595
594
|
import { calculateProjectBuildableDependencies } from "@nx/js/src/utils/buildable-libs-utils";
|
|
596
595
|
import { Glob } from "glob";
|
|
597
|
-
import {
|
|
596
|
+
import { existsSync as existsSync2 } from "node:fs";
|
|
597
|
+
import { readFile as readFile3 } from "node:fs/promises";
|
|
598
|
+
import { readCachedProjectGraph as readCachedProjectGraph2 } from "nx/src/project-graph/project-graph";
|
|
598
599
|
var addPackageDependencies = /* @__PURE__ */ __name(async (workspaceRoot3, projectRoot, projectName, packageJson) => {
|
|
599
|
-
const
|
|
600
|
-
exitOnError: true
|
|
601
|
-
});
|
|
602
|
-
const projectConfigurations = readProjectsConfigurationFromProjectGraph2(projectGraph);
|
|
603
|
-
if (!projectConfigurations?.projects?.[projectName]) {
|
|
604
|
-
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.");
|
|
605
|
-
}
|
|
606
|
-
const projectJsonPath = joinPaths(workspaceRoot3, projectRoot, "project.json");
|
|
607
|
-
if (!await hfs3.isFile(projectJsonPath)) {
|
|
608
|
-
throw new Error("Cannot find project.json configuration");
|
|
609
|
-
}
|
|
610
|
-
if (!projectConfigurations?.projects?.[projectName]) {
|
|
611
|
-
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.");
|
|
612
|
-
}
|
|
613
|
-
const projectDependencies = calculateProjectBuildableDependencies(void 0, projectGraph, workspaceRoot3, projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
|
|
600
|
+
const projectDependencies = calculateProjectBuildableDependencies(void 0, readCachedProjectGraph2(), workspaceRoot3, projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
|
|
614
601
|
const localPackages = [];
|
|
615
602
|
for (const project of projectDependencies.dependencies.filter((dep) => dep.node.type === "lib" && dep.node.data.root !== projectRoot && dep.node.data.root !== workspaceRoot3)) {
|
|
616
603
|
const projectNode = project.node;
|
|
617
604
|
if (projectNode.data.root) {
|
|
618
605
|
const projectPackageJsonPath = joinPaths(workspaceRoot3, projectNode.data.root, "package.json");
|
|
619
|
-
if (
|
|
620
|
-
const
|
|
606
|
+
if (existsSync2(projectPackageJsonPath)) {
|
|
607
|
+
const projectPackageJsonContent = await readFile3(projectPackageJsonPath, "utf8");
|
|
608
|
+
const projectPackageJson = JSON.parse(projectPackageJsonContent);
|
|
621
609
|
if (projectPackageJson.private !== false) {
|
|
622
610
|
localPackages.push(projectPackageJson);
|
|
623
611
|
}
|
|
@@ -653,7 +641,8 @@ var addPackageDependencies = /* @__PURE__ */ __name(async (workspaceRoot3, proje
|
|
|
653
641
|
}, "addPackageDependencies");
|
|
654
642
|
var addWorkspacePackageJsonFields = /* @__PURE__ */ __name(async (config, projectRoot, sourceRoot, projectName, includeSrc = false, packageJson) => {
|
|
655
643
|
const workspaceRoot3 = config.workspaceRoot ? config.workspaceRoot : findWorkspaceRoot();
|
|
656
|
-
const
|
|
644
|
+
const workspacePackageJsonContent = await readFile3(joinPaths(workspaceRoot3, "package.json"), "utf8");
|
|
645
|
+
const workspacePackageJson = JSON.parse(workspacePackageJsonContent);
|
|
657
646
|
packageJson.type ??= "module";
|
|
658
647
|
packageJson.sideEffects ??= false;
|
|
659
648
|
if (includeSrc === true) {
|
|
@@ -974,11 +963,11 @@ var RendererEngine = class {
|
|
|
974
963
|
};
|
|
975
964
|
|
|
976
965
|
// ../esbuild/src/clean.ts
|
|
977
|
-
import { hfs
|
|
966
|
+
import { hfs } from "@humanfs/node";
|
|
978
967
|
async function clean(name = "ESBuild", directory, config) {
|
|
979
968
|
writeDebug(` \u{1F9F9} Cleaning ${name} output path: ${directory}`, config);
|
|
980
969
|
const stopwatch = getStopwatch(`${name} output clean`);
|
|
981
|
-
await
|
|
970
|
+
await hfs.deleteAll(directory);
|
|
982
971
|
stopwatch();
|
|
983
972
|
}
|
|
984
973
|
__name(clean, "clean");
|
|
@@ -1153,7 +1142,7 @@ var resolvePathsPlugin = /* @__PURE__ */ __name((options, resolvedOptions) => ({
|
|
|
1153
1142
|
}), "resolvePathsPlugin");
|
|
1154
1143
|
|
|
1155
1144
|
// ../esbuild/src/plugins/tsc.ts
|
|
1156
|
-
import { hfs as
|
|
1145
|
+
import { hfs as hfs2 } from "@humanfs/node";
|
|
1157
1146
|
import { Extractor, ExtractorConfig } from "@microsoft/api-extractor";
|
|
1158
1147
|
function bundleTypeDefinitions(filename, outfile, externals, options) {
|
|
1159
1148
|
const { dependencies, peerDependencies, devDependencies } = __require(joinPaths(options.projectRoot, "package.json"));
|
|
@@ -1227,18 +1216,18 @@ var tscPlugin = /* @__PURE__ */ __name((options, resolvedOptions) => ({
|
|
|
1227
1216
|
const entryPoint = resolvedOptions.entryPoints[0].replace(sourceRoot, "").replace(/\.ts$/, "");
|
|
1228
1217
|
const bundlePath = joinPaths(resolvedOptions.outdir, entryPoint);
|
|
1229
1218
|
let dtsPath;
|
|
1230
|
-
if (await
|
|
1219
|
+
if (await hfs2.isFile(joinPaths(resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint}.d.ts`))) {
|
|
1231
1220
|
dtsPath = joinPaths(resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint}.d.ts`);
|
|
1232
|
-
} else if (await
|
|
1221
|
+
} else if (await hfs2.isFile(joinPaths(resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint.replace(/^src\//, "")}.d.ts`))) {
|
|
1233
1222
|
dtsPath = joinPaths(resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint.replace(/^src\//, "")}.d.ts`);
|
|
1234
1223
|
}
|
|
1235
1224
|
const ext = resolvedOptions.outExtension.dts || resolvedOptions.format === "esm" ? "d.mts" : "d.ts";
|
|
1236
1225
|
if (process.env.WATCH !== "true" && process.env.DEV !== "true") {
|
|
1237
1226
|
bundleTypeDefinitions(dtsPath, bundlePath, resolvedOptions.external ?? [], resolvedOptions);
|
|
1238
|
-
const dtsContents = await
|
|
1239
|
-
await
|
|
1227
|
+
const dtsContents = await hfs2.text(`${bundlePath}.d.ts`);
|
|
1228
|
+
await hfs2.write(`${bundlePath}.${ext}`, dtsContents);
|
|
1240
1229
|
} else {
|
|
1241
|
-
await
|
|
1230
|
+
await hfs2.write(`${bundlePath}.${ext}`, `export * from './${entryPoint}'`);
|
|
1242
1231
|
}
|
|
1243
1232
|
}
|
|
1244
1233
|
});
|
|
@@ -1483,16 +1472,16 @@ var resolveOptions = /* @__PURE__ */ __name(async (userOptions) => {
|
|
|
1483
1472
|
const config = await loadStormConfig(workspaceRoot3.dir);
|
|
1484
1473
|
writeDebug(" \u2699\uFE0F Resolving build options", config);
|
|
1485
1474
|
const stopwatch = getStopwatch("Build options resolution");
|
|
1486
|
-
const projectGraph = await
|
|
1475
|
+
const projectGraph = await createProjectGraphAsync({
|
|
1487
1476
|
exitOnError: true
|
|
1488
1477
|
});
|
|
1489
1478
|
const projectJsonPath = joinPaths(workspaceRoot3.dir, projectRoot, "project.json");
|
|
1490
|
-
if (!await
|
|
1479
|
+
if (!await hfs3.isFile(projectJsonPath)) {
|
|
1491
1480
|
throw new Error("Cannot find project.json configuration");
|
|
1492
1481
|
}
|
|
1493
|
-
const projectJson = await
|
|
1482
|
+
const projectJson = await hfs3.json(projectJsonPath);
|
|
1494
1483
|
const projectName = projectJson.name;
|
|
1495
|
-
const projectConfigurations =
|
|
1484
|
+
const projectConfigurations = readProjectsConfigurationFromProjectGraph2(projectGraph);
|
|
1496
1485
|
if (!projectConfigurations?.projects?.[projectName]) {
|
|
1497
1486
|
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.");
|
|
1498
1487
|
}
|
|
@@ -1500,10 +1489,10 @@ var resolveOptions = /* @__PURE__ */ __name(async (userOptions) => {
|
|
|
1500
1489
|
options.name ??= `${projectName}-${options.format}`;
|
|
1501
1490
|
options.target ??= DEFAULT_TARGET;
|
|
1502
1491
|
const packageJsonPath = joinPaths(workspaceRoot3.dir, options.projectRoot, "package.json");
|
|
1503
|
-
if (!await
|
|
1492
|
+
if (!await hfs3.isFile(packageJsonPath)) {
|
|
1504
1493
|
throw new Error("Cannot find package.json configuration");
|
|
1505
1494
|
}
|
|
1506
|
-
const packageJson = await
|
|
1495
|
+
const packageJson = await hfs3.json(packageJsonPath);
|
|
1507
1496
|
const outExtension = getOutputExtensionMap(options, packageJson.type);
|
|
1508
1497
|
const env = getEnv("esbuild", options);
|
|
1509
1498
|
const result = {
|
|
@@ -1582,14 +1571,14 @@ var resolveOptions = /* @__PURE__ */ __name(async (userOptions) => {
|
|
|
1582
1571
|
return result;
|
|
1583
1572
|
}, "resolveOptions");
|
|
1584
1573
|
async function generatePackageJson(context2) {
|
|
1585
|
-
if (context2.options.generatePackageJson !== false && await
|
|
1574
|
+
if (context2.options.generatePackageJson !== false && await hfs3.isFile(joinPaths(context2.options.projectRoot, "package.json"))) {
|
|
1586
1575
|
writeDebug(" \u270D\uFE0F Writing package.json file", context2.options.config);
|
|
1587
1576
|
const stopwatch = getStopwatch("Write package.json file");
|
|
1588
1577
|
const packageJsonPath = joinPaths(context2.options.projectRoot, "project.json");
|
|
1589
|
-
if (!await
|
|
1578
|
+
if (!await hfs3.isFile(packageJsonPath)) {
|
|
1590
1579
|
throw new Error("Cannot find package.json configuration");
|
|
1591
1580
|
}
|
|
1592
|
-
let packageJson = await
|
|
1581
|
+
let packageJson = await hfs3.json(joinPaths(context2.options.config.workspaceRoot, context2.options.projectRoot, "package.json"));
|
|
1593
1582
|
if (!packageJson) {
|
|
1594
1583
|
throw new Error("Cannot find package.json configuration file");
|
|
1595
1584
|
}
|
|
@@ -1662,7 +1651,7 @@ async function executeEsBuild(context2) {
|
|
|
1662
1651
|
const result = await esbuild2.build(context2.options);
|
|
1663
1652
|
if (result.metafile) {
|
|
1664
1653
|
const metafilePath = `${context2.options.outdir}/${context2.options.name}.meta.json`;
|
|
1665
|
-
await
|
|
1654
|
+
await hfs3.write(metafilePath, JSON.stringify(result.metafile));
|
|
1666
1655
|
}
|
|
1667
1656
|
stopwatch();
|
|
1668
1657
|
return context2;
|
|
@@ -1812,8 +1801,8 @@ import { execSync as execSync4 } from "node:child_process";
|
|
|
1812
1801
|
import fs3 from "node:fs/promises";
|
|
1813
1802
|
|
|
1814
1803
|
// ../workspace-tools/src/utils/pnpm-deps-update.ts
|
|
1815
|
-
import { existsSync } from "node:fs";
|
|
1816
|
-
import { readFile, writeFile } from "node:fs/promises";
|
|
1804
|
+
import { existsSync as existsSync3 } from "node:fs";
|
|
1805
|
+
import { readFile as readFile4, writeFile as writeFile2 } from "node:fs/promises";
|
|
1817
1806
|
import readYamlFile from "read-yaml-file";
|
|
1818
1807
|
|
|
1819
1808
|
// ../workspace-tools/src/executors/npm-publish/executor.ts
|
|
@@ -1854,18 +1843,18 @@ var executor_default7 = withRunExecutor("Size-Limit Performance Test Executor",
|
|
|
1854
1843
|
});
|
|
1855
1844
|
|
|
1856
1845
|
// ../tsdown/src/build.ts
|
|
1857
|
-
import { hfs as
|
|
1858
|
-
import { createProjectGraphAsync as
|
|
1846
|
+
import { hfs as hfs5 } from "@humanfs/node";
|
|
1847
|
+
import { createProjectGraphAsync as createProjectGraphAsync2, readProjectsConfigurationFromProjectGraph as readProjectsConfigurationFromProjectGraph3, writeJsonFile as writeJsonFile2 } from "@nx/devkit";
|
|
1859
1848
|
import defu2 from "defu";
|
|
1860
1849
|
import { findWorkspaceRoot as findWorkspaceRoot3 } from "nx/src/utils/find-workspace-root";
|
|
1861
1850
|
import { build as tsdown } from "tsdown";
|
|
1862
1851
|
|
|
1863
1852
|
// ../tsdown/src/clean.ts
|
|
1864
|
-
import { hfs as
|
|
1853
|
+
import { hfs as hfs4 } from "@humanfs/node";
|
|
1865
1854
|
async function clean2(name = "ESBuild", directory, config) {
|
|
1866
1855
|
writeDebug(` \u{1F9F9} Cleaning ${name} output path: ${directory}`, config);
|
|
1867
1856
|
const stopwatch = getStopwatch(`${name} output clean`);
|
|
1868
|
-
await
|
|
1857
|
+
await hfs4.deleteAll(directory);
|
|
1869
1858
|
stopwatch();
|
|
1870
1859
|
}
|
|
1871
1860
|
__name(clean2, "clean");
|
|
@@ -1902,16 +1891,16 @@ var resolveOptions2 = /* @__PURE__ */ __name(async (userOptions) => {
|
|
|
1902
1891
|
const config = await loadStormConfig(workspaceRoot3.dir);
|
|
1903
1892
|
writeDebug(" \u2699\uFE0F Resolving build options", config);
|
|
1904
1893
|
const stopwatch = getStopwatch("Build options resolution");
|
|
1905
|
-
const projectGraph = await
|
|
1894
|
+
const projectGraph = await createProjectGraphAsync2({
|
|
1906
1895
|
exitOnError: true
|
|
1907
1896
|
});
|
|
1908
1897
|
const projectJsonPath = joinPaths(workspaceRoot3.dir, projectRoot, "project.json");
|
|
1909
|
-
if (!await
|
|
1898
|
+
if (!await hfs5.isFile(projectJsonPath)) {
|
|
1910
1899
|
throw new Error("Cannot find project.json configuration");
|
|
1911
1900
|
}
|
|
1912
|
-
const projectJson = await
|
|
1901
|
+
const projectJson = await hfs5.json(projectJsonPath);
|
|
1913
1902
|
const projectName = projectJson.name;
|
|
1914
|
-
const projectConfigurations =
|
|
1903
|
+
const projectConfigurations = readProjectsConfigurationFromProjectGraph3(projectGraph);
|
|
1915
1904
|
if (!projectConfigurations?.projects?.[projectName]) {
|
|
1916
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.");
|
|
1917
1906
|
}
|
|
@@ -1919,7 +1908,7 @@ var resolveOptions2 = /* @__PURE__ */ __name(async (userOptions) => {
|
|
|
1919
1908
|
options.name ??= `${projectName}-${options.format}`;
|
|
1920
1909
|
options.target ??= DEFAULT_TARGET;
|
|
1921
1910
|
const packageJsonPath = joinPaths(workspaceRoot3.dir, options.projectRoot, "package.json");
|
|
1922
|
-
if (!await
|
|
1911
|
+
if (!await hfs5.isFile(packageJsonPath)) {
|
|
1923
1912
|
throw new Error("Cannot find package.json configuration");
|
|
1924
1913
|
}
|
|
1925
1914
|
const env = getEnv("tsdown", options);
|
|
@@ -1974,14 +1963,14 @@ var resolveOptions2 = /* @__PURE__ */ __name(async (userOptions) => {
|
|
|
1974
1963
|
return result;
|
|
1975
1964
|
}, "resolveOptions");
|
|
1976
1965
|
async function generatePackageJson2(options) {
|
|
1977
|
-
if (options.generatePackageJson !== false && await
|
|
1966
|
+
if (options.generatePackageJson !== false && await hfs5.isFile(joinPaths(options.projectRoot, "package.json"))) {
|
|
1978
1967
|
writeDebug(" \u270D\uFE0F Writing package.json file", options.config);
|
|
1979
1968
|
const stopwatch = getStopwatch("Write package.json file");
|
|
1980
1969
|
const packageJsonPath = joinPaths(options.projectRoot, "project.json");
|
|
1981
|
-
if (!await
|
|
1970
|
+
if (!await hfs5.isFile(packageJsonPath)) {
|
|
1982
1971
|
throw new Error("Cannot find package.json configuration");
|
|
1983
1972
|
}
|
|
1984
|
-
let packageJson = await
|
|
1973
|
+
let packageJson = await hfs5.json(joinPaths(options.config.workspaceRoot, options.projectRoot, "package.json"));
|
|
1985
1974
|
if (!packageJson) {
|
|
1986
1975
|
throw new Error("Cannot find package.json configuration file");
|
|
1987
1976
|
}
|
|
@@ -2159,21 +2148,25 @@ var executor_default9 = withRunExecutor("Typia runtime validation generator", ty
|
|
|
2159
2148
|
});
|
|
2160
2149
|
|
|
2161
2150
|
// ../unbuild/src/build.ts
|
|
2162
|
-
import {
|
|
2163
|
-
import { createProjectGraphAsync as createProjectGraphAsync6, readProjectsConfigurationFromProjectGraph as readProjectsConfigurationFromProjectGraph5, writeJsonFile as writeJsonFile3 } from "@nx/devkit";
|
|
2151
|
+
import { readCachedProjectGraph as readCachedProjectGraph4, writeJsonFile as writeJsonFile3 } from "@nx/devkit";
|
|
2164
2152
|
import { getHelperDependency as getHelperDependency2, HelperDependency as HelperDependency2 } from "@nx/js";
|
|
2165
2153
|
import { calculateProjectBuildableDependencies as calculateProjectBuildableDependencies3 } from "@nx/js/src/utils/buildable-libs-utils";
|
|
2166
2154
|
import defu3 from "defu";
|
|
2155
|
+
import { existsSync as existsSync4 } from "node:fs";
|
|
2156
|
+
import { readFile as readFile5 } from "node:fs/promises";
|
|
2167
2157
|
import { relative as relative4 } from "node:path";
|
|
2168
2158
|
import { findWorkspaceRoot as findWorkspaceRoot4 } from "nx/src/utils/find-workspace-root";
|
|
2169
2159
|
import { build as unbuild } from "unbuild";
|
|
2170
2160
|
|
|
2171
2161
|
// ../unbuild/src/clean.ts
|
|
2172
|
-
import {
|
|
2162
|
+
import { rm } from "node:fs/promises";
|
|
2173
2163
|
async function clean3(name = "Unbuild", directory, config) {
|
|
2174
2164
|
writeDebug(` \u{1F9F9} Cleaning ${name} output path: ${directory}`, config);
|
|
2175
2165
|
const stopwatch = getStopwatch(`${name} output clean`);
|
|
2176
|
-
await
|
|
2166
|
+
await rm(directory, {
|
|
2167
|
+
recursive: true,
|
|
2168
|
+
force: true
|
|
2169
|
+
});
|
|
2177
2170
|
stopwatch();
|
|
2178
2171
|
}
|
|
2179
2172
|
__name(clean3, "clean");
|
|
@@ -2224,28 +2217,8 @@ ${error ? error.message : "Unknown build error"}
|
|
|
2224
2217
|
}
|
|
2225
2218
|
}), "onErrorPlugin");
|
|
2226
2219
|
|
|
2227
|
-
// ../unbuild/src/plugins/swc.ts
|
|
2228
|
-
var swcPlugin = /* @__PURE__ */ __name((options, resolvedOptions) => {
|
|
2229
|
-
const { transform: transform3 } = __require("@swc/core");
|
|
2230
|
-
return {
|
|
2231
|
-
name: "storm:swc",
|
|
2232
|
-
transform(code, filename) {
|
|
2233
|
-
return transform3(code, {
|
|
2234
|
-
filename,
|
|
2235
|
-
jsc: {
|
|
2236
|
-
transform: {
|
|
2237
|
-
react: {
|
|
2238
|
-
runtime: "automatic"
|
|
2239
|
-
}
|
|
2240
|
-
}
|
|
2241
|
-
}
|
|
2242
|
-
});
|
|
2243
|
-
}
|
|
2244
|
-
};
|
|
2245
|
-
}, "swcPlugin");
|
|
2246
|
-
|
|
2247
2220
|
// ../unbuild/src/plugins/tsc.ts
|
|
2248
|
-
import {
|
|
2221
|
+
import { readCachedProjectGraph as readCachedProjectGraph3 } from "@nx/devkit";
|
|
2249
2222
|
import { calculateProjectBuildableDependencies as calculateProjectBuildableDependencies2 } from "@nx/js/src/utils/buildable-libs-utils";
|
|
2250
2223
|
import { getHelperDependency, HelperDependency } from "@nx/js/src/utils/compiler-helper-dependency";
|
|
2251
2224
|
import ts2Plugin from "rollup-plugin-typescript2";
|
|
@@ -2278,9 +2251,7 @@ __name(createTsCompilerOptions, "createTsCompilerOptions");
|
|
|
2278
2251
|
|
|
2279
2252
|
// ../unbuild/src/plugins/tsc.ts
|
|
2280
2253
|
var tscPlugin2 = /* @__PURE__ */ __name(async (options, resolvedOptions) => {
|
|
2281
|
-
const projectGraph =
|
|
2282
|
-
exitOnError: true
|
|
2283
|
-
});
|
|
2254
|
+
const projectGraph = readCachedProjectGraph3();
|
|
2284
2255
|
const result = calculateProjectBuildableDependencies2(void 0, projectGraph, resolvedOptions.config.workspaceRoot, resolvedOptions.projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
|
|
2285
2256
|
let dependencies = result.dependencies;
|
|
2286
2257
|
const tsLibDependency = getHelperDependency(HelperDependency.tsc, resolvedOptions.tsconfig, dependencies, projectGraph, true);
|
|
@@ -2299,37 +2270,39 @@ var tscPlugin2 = /* @__PURE__ */ __name(async (options, resolvedOptions) => {
|
|
|
2299
2270
|
|
|
2300
2271
|
// ../unbuild/src/plugins/type-definitions.ts
|
|
2301
2272
|
import { relative as relative3 } from "node:path";
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
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 = relative3(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 ? `
|
|
2315
2287
|
export * from ${relativeSourceDtsName};
|
|
2316
2288
|
export { default } from ${relativeSourceDtsName};
|
|
2317
2289
|
` : `export * from ${relativeSourceDtsName};
|
|
2318
2290
|
`;
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2291
|
+
this.emitFile({
|
|
2292
|
+
type: "asset",
|
|
2293
|
+
fileName: dtsFileName,
|
|
2294
|
+
source: dtsFileSource
|
|
2295
|
+
});
|
|
2296
|
+
}
|
|
2324
2297
|
}
|
|
2325
|
-
}
|
|
2326
|
-
}
|
|
2298
|
+
};
|
|
2299
|
+
}
|
|
2300
|
+
__name(typeDefinitions, "typeDefinitions");
|
|
2327
2301
|
|
|
2328
2302
|
// ../unbuild/src/config.ts
|
|
2329
2303
|
var getDefaultBuildPlugins2 = /* @__PURE__ */ __name(async (options, resolvedOptions) => Promise.all([
|
|
2330
2304
|
analyzePlugin(options, resolvedOptions),
|
|
2331
|
-
|
|
2332
|
-
typeDefinitions(options, resolvedOptions),
|
|
2305
|
+
typeDefinitions(resolvedOptions.projectRoot),
|
|
2333
2306
|
tscPlugin2(options, resolvedOptions),
|
|
2334
2307
|
onErrorPlugin2(options, resolvedOptions)
|
|
2335
2308
|
].map((plugin) => Promise.resolve(plugin))), "getDefaultBuildPlugins");
|
|
@@ -2354,38 +2327,34 @@ async function resolveOptions3(options) {
|
|
|
2354
2327
|
options = defu3(options, configFile);
|
|
2355
2328
|
}
|
|
2356
2329
|
}
|
|
2357
|
-
const projectGraph =
|
|
2358
|
-
exitOnError: true
|
|
2359
|
-
});
|
|
2330
|
+
const projectGraph = readCachedProjectGraph4();
|
|
2360
2331
|
const projectJsonPath = joinPaths(config.workspaceRoot, projectRoot, "project.json");
|
|
2361
|
-
if (!
|
|
2332
|
+
if (!existsSync4(projectJsonPath)) {
|
|
2362
2333
|
throw new Error("Cannot find project.json configuration");
|
|
2363
2334
|
}
|
|
2364
|
-
const
|
|
2335
|
+
const projectJsonContent = await readFile5(projectJsonPath, "utf8");
|
|
2336
|
+
const projectJson = JSON.parse(projectJsonContent);
|
|
2365
2337
|
const projectName = projectJson.name;
|
|
2366
2338
|
const packageJsonPath = joinPaths(workspaceRoot3.dir, projectRoot, "package.json");
|
|
2367
|
-
if (!
|
|
2339
|
+
if (!existsSync4(packageJsonPath)) {
|
|
2368
2340
|
throw new Error("Cannot find package.json configuration");
|
|
2369
2341
|
}
|
|
2370
|
-
const
|
|
2342
|
+
const packageJsonContent = await readFile5(packageJsonPath, "utf8");
|
|
2343
|
+
const packageJson = JSON.parse(packageJsonContent);
|
|
2371
2344
|
let tsconfig = options.tsconfig;
|
|
2372
2345
|
if (!tsconfig) {
|
|
2373
2346
|
tsconfig = joinPaths(workspaceRoot3.dir, projectRoot, "tsconfig.json");
|
|
2374
2347
|
}
|
|
2375
|
-
if (!
|
|
2348
|
+
if (!existsSync4(tsconfig)) {
|
|
2376
2349
|
throw new Error("Cannot find tsconfig.json configuration");
|
|
2377
2350
|
}
|
|
2378
2351
|
let sourceRoot = projectJson.sourceRoot;
|
|
2379
2352
|
if (!sourceRoot) {
|
|
2380
2353
|
sourceRoot = joinPaths(projectRoot, "src");
|
|
2381
2354
|
}
|
|
2382
|
-
if (!
|
|
2355
|
+
if (!existsSync4(sourceRoot)) {
|
|
2383
2356
|
throw new Error("Cannot find sourceRoot directory");
|
|
2384
2357
|
}
|
|
2385
|
-
const projectConfigurations = readProjectsConfigurationFromProjectGraph5(projectGraph);
|
|
2386
|
-
if (!projectConfigurations?.projects?.[projectName]) {
|
|
2387
|
-
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.");
|
|
2388
|
-
}
|
|
2389
2358
|
const result = calculateProjectBuildableDependencies3(void 0, projectGraph, workspaceRoot3.dir, projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
|
|
2390
2359
|
let dependencies = result.dependencies;
|
|
2391
2360
|
const tsLibDependency = getHelperDependency2(HelperDependency2.tsc, tsconfig, dependencies, projectGraph, true);
|
|
@@ -2506,21 +2475,21 @@ async function resolveOptions3(options) {
|
|
|
2506
2475
|
}
|
|
2507
2476
|
__name(resolveOptions3, "resolveOptions");
|
|
2508
2477
|
async function generatePackageJson3(options) {
|
|
2509
|
-
if (options.generatePackageJson !== false &&
|
|
2478
|
+
if (options.generatePackageJson !== false && existsSync4(joinPaths(options.projectRoot, "package.json"))) {
|
|
2510
2479
|
writeDebug(" \u270D\uFE0F Writing package.json file", options.config);
|
|
2511
2480
|
const stopwatch = getStopwatch("Write package.json file");
|
|
2512
2481
|
const packageJsonPath = joinPaths(options.projectRoot, "project.json");
|
|
2513
|
-
if (!
|
|
2482
|
+
if (!existsSync4(packageJsonPath)) {
|
|
2514
2483
|
throw new Error("Cannot find package.json configuration");
|
|
2515
2484
|
}
|
|
2516
|
-
let
|
|
2517
|
-
if (!
|
|
2485
|
+
let packageJsonContent = await readFile5(joinPaths(options.config.workspaceRoot, options.projectRoot, "package.json"), "utf8");
|
|
2486
|
+
if (!packageJsonContent) {
|
|
2518
2487
|
throw new Error("Cannot find package.json configuration file");
|
|
2519
2488
|
}
|
|
2489
|
+
let packageJson = JSON.parse(packageJsonContent);
|
|
2520
2490
|
packageJson = await addPackageDependencies(options.config.workspaceRoot, options.projectRoot, options.projectName, packageJson);
|
|
2521
2491
|
packageJson = await addWorkspacePackageJsonFields(options.config, options.projectRoot, options.sourceRoot, options.projectName, false, packageJson);
|
|
2522
|
-
|
|
2523
|
-
await writeJsonFile3(joinPaths(options.outDir, "package.json"), packageJson);
|
|
2492
|
+
await writeJsonFile3(joinPaths(options.outDir, "package.json"), await addPackageJsonExports(options.sourceRoot, packageJson));
|
|
2524
2493
|
stopwatch();
|
|
2525
2494
|
}
|
|
2526
2495
|
return options;
|
|
@@ -4021,7 +3990,7 @@ var typescript_library_generator_untyped_default = defineUntypedSchema5({
|
|
|
4021
3990
|
import { retrieveProjectConfigurationsWithoutPluginInference } from "nx/src/project-graph/utils/retrieve-workspace-files";
|
|
4022
3991
|
|
|
4023
3992
|
// ../workspace-tools/src/utils/lock-file.ts
|
|
4024
|
-
import { existsSync as
|
|
3993
|
+
import { existsSync as existsSync5 } from "node:fs";
|
|
4025
3994
|
import { join as join2 } from "node:path";
|
|
4026
3995
|
import { output as output2, readJsonFile, workspaceRoot as workspaceRoot2 } from "nx/src/devkit-exports";
|
|
4027
3996
|
import { getNpmLockfileDependencies, getNpmLockfileNodes } from "nx/src/plugins/js/lock-file/npm-parser";
|
|
@@ -8,7 +8,7 @@ var require_package = _chunkJ5SB6L2Ljs.__commonJS.call(void 0, {
|
|
|
8
8
|
"package.json"(exports, module) {
|
|
9
9
|
module.exports = {
|
|
10
10
|
name: "@storm-software/cloudflare-tools",
|
|
11
|
-
version: "0.
|
|
11
|
+
version: "0.50.0",
|
|
12
12
|
description: "A Nx plugin package that contains various executors, generators, and utilities that assist in managing Cloudflare services.",
|
|
13
13
|
repository: {
|
|
14
14
|
type: "github",
|
|
@@ -8,7 +8,7 @@ var require_package = __commonJS({
|
|
|
8
8
|
"package.json"(exports, module) {
|
|
9
9
|
module.exports = {
|
|
10
10
|
name: "@storm-software/cloudflare-tools",
|
|
11
|
-
version: "0.
|
|
11
|
+
version: "0.50.0",
|
|
12
12
|
description: "A Nx plugin package that contains various executors, generators, and utilities that assist in managing Cloudflare services.",
|
|
13
13
|
repository: {
|
|
14
14
|
type: "github",
|
|
@@ -27,26 +27,26 @@ var _c12 = require('c12');
|
|
|
27
27
|
|
|
28
28
|
var getConfigFileByName = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (fileName, filePath, options = {}) => {
|
|
29
29
|
const workspacePath = filePath || _chunkRCE3CC76js.findWorkspaceRoot.call(void 0, filePath);
|
|
30
|
-
let config = _c12.loadConfig.call(void 0, {
|
|
30
|
+
let config = await _c12.loadConfig.call(void 0, {
|
|
31
31
|
cwd: workspacePath,
|
|
32
32
|
packageJson: true,
|
|
33
33
|
name: fileName,
|
|
34
34
|
envName: _optionalChain([fileName, 'optionalAccess', _ => _.toUpperCase, 'call', _2 => _2()]),
|
|
35
35
|
jitiOptions: {
|
|
36
36
|
debug: false,
|
|
37
|
-
|
|
37
|
+
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : _chunkRCE3CC76js.joinPaths.call(void 0, process.env.STORM_CACHE_DIR || "node_modules/.cache/storm", "config")
|
|
38
38
|
},
|
|
39
39
|
...options
|
|
40
40
|
});
|
|
41
41
|
if (!config || Object.keys(config).length === 0) {
|
|
42
|
-
config = _c12.loadConfig.call(void 0, {
|
|
42
|
+
config = await _c12.loadConfig.call(void 0, {
|
|
43
43
|
cwd: workspacePath,
|
|
44
44
|
packageJson: true,
|
|
45
45
|
name: fileName,
|
|
46
46
|
envName: _optionalChain([fileName, 'optionalAccess', _3 => _3.toUpperCase, 'call', _4 => _4()]),
|
|
47
47
|
jitiOptions: {
|
|
48
48
|
debug: false,
|
|
49
|
-
|
|
49
|
+
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : _chunkRCE3CC76js.joinPaths.call(void 0, process.env.STORM_CACHE_DIR || "node_modules/.cache/storm", "config")
|
|
50
50
|
},
|
|
51
51
|
configFile: fileName,
|
|
52
52
|
...options
|