@storm-software/workspace-tools 1.267.19 → 1.267.21
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 +24 -0
- package/README.md +1 -1
- package/dist/chunk-22UY7NFX.js +41 -0
- package/dist/chunk-23BZQTB2.mjs +425 -0
- package/dist/{chunk-7O34DHUG.js → chunk-2AVWFUXP.js} +4 -19
- package/dist/{chunk-VW3PZOJ4.mjs → chunk-2M22JVJQ.mjs} +307 -192
- package/dist/{chunk-5RJOBRYL.mjs → chunk-3EDSGFA5.mjs} +63 -54
- package/dist/chunk-3RG5ZIWI.js +10 -0
- package/dist/{chunk-AC5SI4YZ.js → chunk-3TYXXJKV.js} +11 -8
- package/dist/{chunk-QSB5SLZS.mjs → chunk-3ZBMLG4D.mjs} +17 -14
- package/dist/chunk-437WGH2M.mjs +32 -0
- package/dist/{chunk-ULBTYC2B.js → chunk-4BECJRPP.js} +13 -42
- package/dist/chunk-4QRA66TH.mjs +379 -0
- package/dist/chunk-4S66IYQF.mjs +31 -0
- package/dist/{chunk-4JOIS7WW.js → chunk-4WHSR4FK.js} +24 -14
- package/dist/{chunk-JTAXCQX6.js → chunk-53DNHF7B.js} +7 -13
- package/dist/{chunk-GGGO542M.js → chunk-54FVHKCU.js} +36 -24
- package/dist/{chunk-B67R3JAF.mjs → chunk-5HUW3BTP.mjs} +37 -21
- package/dist/{chunk-GWYZDAH6.mjs → chunk-5LB2F3L4.mjs} +80 -65
- package/dist/{chunk-UF6KFXG5.js → chunk-5VY5IBBQ.js} +20 -17
- package/dist/{chunk-6QO3KMZA.js → chunk-5ZFTWEKB.js} +2 -16
- package/dist/chunk-6EMYX25V.js +7 -0
- package/dist/chunk-6QZSAZZ3.mjs +64 -0
- package/dist/{chunk-2JA7WAH7.mjs → chunk-7AN4JMFC.mjs} +2 -16
- package/dist/{chunk-N7XIQOHR.mjs → chunk-7HWV6U3E.mjs} +33 -18
- package/dist/{chunk-GKL4BY2Y.js → chunk-A5CKB6IJ.js} +7 -8
- package/dist/{chunk-Y5WKYMQB.mjs → chunk-ABE7UOMX.mjs} +24 -21
- package/dist/{chunk-L3WQZ3LY.mjs → chunk-AHLKRK7D.mjs} +33 -18
- package/dist/{chunk-6CGAYKQL.js → chunk-AJ3C2EDW.js} +69 -44
- package/dist/chunk-AMW7VHFM.mjs +52 -0
- package/dist/chunk-AOFWKOAI.js +31 -0
- package/dist/{chunk-7YRW5HNX.js → chunk-AX3RSZT7.js} +42 -31
- package/dist/chunk-BFD7HHVZ.mjs +32 -0
- package/dist/{chunk-ZMFVKBRM.js → chunk-BWGJVRAS.js} +2 -13
- package/dist/{chunk-M6NHJNGU.js → chunk-CWBHZBTN.js} +277 -169
- package/dist/{chunk-VGE6EHYW.mjs → chunk-EKWR7TBP.mjs} +36 -24
- package/dist/chunk-EU6N7QT3.js +32 -0
- package/dist/chunk-EYXDS7SG.js +105 -0
- package/dist/chunk-F66XEAID.mjs +113 -0
- package/dist/chunk-FOFNKU5G.js +379 -0
- package/dist/{chunk-7NNHBZC5.js → chunk-GNOIETZR.js} +28 -17
- package/dist/chunk-GQQLBQPQ.mjs +32 -0
- package/dist/{chunk-7PRHEOCT.js → chunk-H5NKKUPV.js} +31 -18
- package/dist/{chunk-5SVLMXLH.mjs → chunk-HMJTTE4A.mjs} +39 -30
- package/dist/{chunk-ZKMIASDR.mjs → chunk-HY3ZC5EZ.mjs} +10 -31
- package/dist/{chunk-OQPX75CG.js → chunk-I5MSPQMO.js} +31 -18
- package/dist/{chunk-L2DHGVS5.mjs → chunk-IEZKYJSF.mjs} +3 -6
- package/dist/{chunk-IWCQL3AQ.js → chunk-IL3R5ZVS.js} +10 -31
- package/dist/{chunk-P4OVFIT6.js → chunk-IZN2IVJ4.js} +19 -6
- package/dist/{chunk-UALZJZUK.js → chunk-J2Z4WP3E.js} +32 -16
- package/dist/{chunk-RBU35LQW.js → chunk-J4DYXH46.js} +70 -61
- package/dist/chunk-KP4RPOBI.mjs +105 -0
- package/dist/chunk-KR72GKIT.mjs +7 -0
- package/dist/chunk-L4NCVOB5.mjs +17 -0
- package/dist/{chunk-4Y6B6JDH.js → chunk-LBAVVYKU.js} +315 -136
- package/dist/{chunk-WMTEZ2PV.mjs → chunk-LSF4BHCI.mjs} +24 -14
- package/dist/chunk-M725BO42.mjs +32 -0
- package/dist/{chunk-7IAGL37F.mjs → chunk-MF6VZSIO.mjs} +30 -17
- package/dist/{chunk-7OOYI33U.mjs → chunk-MMBLGUC3.mjs} +311 -132
- package/dist/chunk-MZSZKV4N.mjs +47 -0
- package/dist/chunk-O6RRIC6I.js +32 -0
- package/dist/chunk-OKSECMVK.js +32 -0
- package/dist/chunk-Q2HYWACQ.mjs +50 -0
- package/dist/{chunk-62XRHQ44.mjs → chunk-QFWQZOVG.mjs} +14 -43
- package/dist/{chunk-DHGZTMND.js → chunk-QVYCDING.js} +4 -7
- package/dist/{chunk-Z4NKRWWJ.js → chunk-RJRBED5Q.js} +48 -32
- package/dist/chunk-S5Z4QGF3.js +64 -0
- package/dist/{chunk-CSHHIGIV.mjs → chunk-SITFTWPY.mjs} +23 -8
- package/dist/chunk-SNMXP6JV.mjs +41 -0
- package/dist/chunk-SPXJBMLY.js +50 -0
- package/dist/{chunk-7TLYMNLD.mjs → chunk-SW2E5MQJ.mjs} +4 -19
- package/dist/{chunk-OKW5O5P4.js → chunk-T7BALDKJ.js} +26 -22
- package/dist/chunk-TSYIV33W.js +32 -0
- package/dist/{chunk-H72YBOLR.mjs → chunk-U65XVJ4Y.mjs} +1 -12
- package/dist/{chunk-AVJVDD4L.mjs → chunk-U7JFVMCK.mjs} +6 -12
- package/dist/chunk-UIPUSUAB.js +425 -0
- package/dist/{chunk-LSG534D5.mjs → chunk-UYSJG2E5.mjs} +56 -31
- package/dist/{chunk-EHXSPF7W.mjs → chunk-VLOTOQYE.mjs} +11 -8
- package/dist/{chunk-EULJEPPD.mjs → chunk-W2C5IGWW.mjs} +3 -6
- package/dist/{chunk-G4QFSE5B.js → chunk-WE4HK4RN.js} +327 -212
- package/dist/{chunk-SUQKASD7.js → chunk-X2VJXJEF.js} +82 -67
- package/dist/{chunk-GY4AEA7P.mjs → chunk-X6PHOMFB.mjs} +32 -16
- package/dist/{chunk-PK2SUBWI.js → chunk-XZSS3YAB.js} +19 -16
- package/dist/chunk-YXBFVZ3K.js +47 -0
- package/dist/{chunk-CUPARBOS.js → chunk-ZP76EMBE.js} +41 -32
- package/dist/{chunk-HAXYCYZE.mjs → chunk-ZT4IIRQF.mjs} +254 -146
- package/dist/executors.js +21 -21
- package/dist/executors.mjs +20 -20
- package/dist/generators.js +17 -17
- package/dist/generators.mjs +18 -18
- package/dist/index.js +41 -41
- package/dist/index.mjs +42 -42
- package/dist/src/base/base-executor.js +7 -7
- package/dist/src/base/base-executor.mjs +6 -6
- package/dist/src/base/base-executor.untyped.js +1 -1
- package/dist/src/base/base-executor.untyped.mjs +1 -1
- package/dist/src/base/base-generator.js +7 -7
- package/dist/src/base/base-generator.mjs +6 -6
- package/dist/src/base/base-generator.untyped.js +1 -1
- package/dist/src/base/base-generator.untyped.mjs +1 -1
- package/dist/src/base/cargo-base-executor.untyped.js +3 -3
- package/dist/src/base/cargo-base-executor.untyped.mjs +2 -2
- package/dist/src/base/index.js +13 -13
- package/dist/src/base/index.mjs +12 -12
- package/dist/src/base/typescript-build-executor.untyped.js +3 -3
- package/dist/src/base/typescript-build-executor.untyped.mjs +2 -2
- package/dist/src/base/typescript-library-generator.untyped.js +3 -3
- package/dist/src/base/typescript-library-generator.untyped.mjs +2 -2
- package/dist/src/executors/cargo-build/executor.js +9 -9
- package/dist/src/executors/cargo-build/executor.mjs +8 -8
- package/dist/src/executors/cargo-build/untyped.js +3 -3
- package/dist/src/executors/cargo-build/untyped.mjs +2 -2
- package/dist/src/executors/cargo-check/executor.js +9 -9
- package/dist/src/executors/cargo-check/executor.mjs +8 -8
- package/dist/src/executors/cargo-check/untyped.js +3 -3
- package/dist/src/executors/cargo-check/untyped.mjs +2 -2
- package/dist/src/executors/cargo-clippy/executor.js +9 -9
- package/dist/src/executors/cargo-clippy/executor.mjs +8 -8
- package/dist/src/executors/cargo-clippy/untyped.js +3 -3
- package/dist/src/executors/cargo-clippy/untyped.mjs +2 -2
- package/dist/src/executors/cargo-doc/executor.js +9 -9
- package/dist/src/executors/cargo-doc/executor.mjs +8 -8
- package/dist/src/executors/cargo-doc/untyped.js +3 -3
- package/dist/src/executors/cargo-doc/untyped.mjs +2 -2
- package/dist/src/executors/cargo-format/executor.js +9 -9
- package/dist/src/executors/cargo-format/executor.mjs +8 -8
- package/dist/src/executors/cargo-format/untyped.js +3 -3
- package/dist/src/executors/cargo-format/untyped.mjs +2 -2
- package/dist/src/executors/cargo-publish/executor.js +4 -4
- package/dist/src/executors/cargo-publish/executor.mjs +3 -3
- package/dist/src/executors/cargo-publish/untyped.js +3 -3
- package/dist/src/executors/cargo-publish/untyped.mjs +2 -2
- package/dist/src/executors/clean-package/executor.js +84 -62
- package/dist/src/executors/clean-package/executor.mjs +84 -62
- package/dist/src/executors/clean-package/untyped.js +2 -4
- package/dist/src/executors/clean-package/untyped.mjs +2 -4
- package/dist/src/executors/esbuild/executor.js +8 -8
- package/dist/src/executors/esbuild/executor.mjs +7 -7
- package/dist/src/executors/esbuild/untyped.js +4 -8
- package/dist/src/executors/esbuild/untyped.mjs +3 -7
- package/dist/src/executors/npm-publish/executor.js +5 -5
- package/dist/src/executors/npm-publish/executor.mjs +4 -4
- package/dist/src/executors/npm-publish/untyped.js +1 -1
- package/dist/src/executors/npm-publish/untyped.mjs +1 -1
- package/dist/src/executors/size-limit/executor.js +8 -8
- package/dist/src/executors/size-limit/executor.mjs +7 -7
- package/dist/src/executors/size-limit/untyped.js +1 -1
- package/dist/src/executors/size-limit/untyped.mjs +1 -1
- package/dist/src/executors/typia/executor.js +8 -8
- package/dist/src/executors/typia/executor.mjs +7 -7
- package/dist/src/executors/typia/untyped.js +4 -12
- package/dist/src/executors/typia/untyped.mjs +4 -12
- package/dist/src/executors/unbuild/executor.js +8 -8
- package/dist/src/executors/unbuild/executor.mjs +7 -7
- package/dist/src/executors/unbuild/untyped.js +6 -13
- package/dist/src/executors/unbuild/untyped.mjs +5 -12
- package/dist/src/generators/browser-library/generator.js +10 -10
- package/dist/src/generators/browser-library/generator.mjs +9 -9
- package/dist/src/generators/browser-library/untyped.js +5 -11
- package/dist/src/generators/browser-library/untyped.mjs +4 -10
- package/dist/src/generators/config-schema/generator.js +8 -8
- package/dist/src/generators/config-schema/generator.mjs +7 -7
- package/dist/src/generators/config-schema/untyped.js +1 -1
- package/dist/src/generators/config-schema/untyped.mjs +1 -1
- package/dist/src/generators/init/init.js +3 -3
- package/dist/src/generators/init/init.mjs +2 -2
- package/dist/src/generators/init/untyped.js +1 -1
- package/dist/src/generators/init/untyped.mjs +1 -1
- package/dist/src/generators/neutral-library/generator.js +10 -10
- package/dist/src/generators/neutral-library/generator.mjs +9 -9
- package/dist/src/generators/neutral-library/untyped.js +5 -10
- package/dist/src/generators/neutral-library/untyped.mjs +4 -9
- package/dist/src/generators/node-library/generator.js +10 -10
- package/dist/src/generators/node-library/generator.mjs +9 -9
- package/dist/src/generators/node-library/untyped.js +5 -11
- package/dist/src/generators/node-library/untyped.mjs +4 -10
- package/dist/src/generators/preset/generator.js +8 -8
- package/dist/src/generators/preset/generator.mjs +7 -7
- package/dist/src/generators/preset/untyped.js +3 -11
- package/dist/src/generators/preset/untyped.mjs +3 -11
- package/dist/src/generators/release-version/generator.js +7 -7
- package/dist/src/generators/release-version/generator.mjs +6 -6
- package/dist/src/generators/release-version/untyped.js +3 -14
- package/dist/src/generators/release-version/untyped.mjs +3 -14
- package/dist/src/plugins/rust/cargo-toml.js +5 -5
- package/dist/src/plugins/rust/cargo-toml.mjs +4 -4
- package/dist/src/plugins/rust/index.js +5 -5
- package/dist/src/plugins/rust/index.mjs +4 -4
- package/dist/src/plugins/typescript/index.js +5 -5
- package/dist/src/plugins/typescript/index.mjs +4 -4
- package/dist/src/plugins/typescript/project-config.js +5 -5
- package/dist/src/plugins/typescript/project-config.mjs +4 -4
- package/dist/src/plugins/typescript/tsup.js +114 -109
- package/dist/src/plugins/typescript/tsup.mjs +116 -111
- package/dist/src/plugins/typescript/untyped-schema.js +93 -77
- package/dist/src/plugins/typescript/untyped-schema.mjs +96 -80
- package/dist/src/types.js +1 -1
- package/dist/src/types.mjs +1 -1
- package/dist/src/utils/apply-workspace-tokens.js +5 -5
- package/dist/src/utils/apply-workspace-tokens.mjs +4 -4
- package/dist/src/utils/cargo.js +3 -3
- package/dist/src/utils/cargo.mjs +2 -2
- package/dist/src/utils/create-cli-options.js +3 -3
- package/dist/src/utils/create-cli-options.mjs +2 -2
- package/dist/src/utils/get-project-configurations.js +5 -5
- package/dist/src/utils/get-project-configurations.mjs +4 -4
- package/dist/src/utils/index.js +15 -15
- package/dist/src/utils/index.mjs +14 -14
- package/dist/src/utils/lock-file.js +3 -3
- package/dist/src/utils/lock-file.mjs +2 -2
- package/dist/src/utils/package-helpers.js +5 -5
- package/dist/src/utils/package-helpers.mjs +4 -4
- package/dist/src/utils/plugin-helpers.js +4 -4
- package/dist/src/utils/plugin-helpers.mjs +3 -3
- package/dist/src/utils/pnpm-deps-update.js +4 -4
- package/dist/src/utils/pnpm-deps-update.mjs +3 -3
- package/dist/src/utils/project-tags.js +3 -3
- package/dist/src/utils/project-tags.mjs +2 -2
- package/dist/src/utils/toml.js +3 -3
- package/dist/src/utils/toml.mjs +2 -2
- package/dist/src/utils/typia-transform.js +3 -3
- package/dist/src/utils/typia-transform.mjs +2 -2
- package/dist/src/utils/versions.js +1 -1
- package/dist/src/utils/versions.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-3GQAWCBQ.js +0 -13
- package/dist/chunk-3IZ3O4OK.js +0 -30
- package/dist/chunk-6JJB5AYA.js +0 -51
- package/dist/chunk-6JTXR7YX.mjs +0 -18
- package/dist/chunk-6RHWGD7G.mjs +0 -48
- package/dist/chunk-7AXFMX2T.js +0 -37
- package/dist/chunk-A77TLQ44.mjs +0 -32
- package/dist/chunk-B3DVFXXD.js +0 -32
- package/dist/chunk-BC7L3S46.mjs +0 -51
- package/dist/chunk-BNMJYJOZ.mjs +0 -446
- package/dist/chunk-CUWWZLK7.mjs +0 -37
- package/dist/chunk-HOXPAVCL.js +0 -32
- package/dist/chunk-ICPUM2HS.js +0 -50
- package/dist/chunk-JJ4PSTY4.mjs +0 -32
- package/dist/chunk-JMCJJNBJ.mjs +0 -102
- package/dist/chunk-KEBNU3P2.js +0 -446
- package/dist/chunk-KTRA4YQT.mjs +0 -32
- package/dist/chunk-M2VZ44W7.mjs +0 -13
- package/dist/chunk-NG7BO4BF.mjs +0 -468
- package/dist/chunk-NSCWEC2S.js +0 -32
- package/dist/chunk-OQTJDGUH.js +0 -468
- package/dist/chunk-ORWCIVMB.mjs +0 -30
- package/dist/chunk-RUKOOSWL.js +0 -31
- package/dist/chunk-T6VIUVAL.mjs +0 -43
- package/dist/chunk-TET4GF3D.js +0 -43
- package/dist/chunk-XITP2BX2.js +0 -13
- package/dist/chunk-YMGMEPP5.mjs +0 -86
- package/dist/chunk-YW4UN25U.js +0 -86
- package/dist/chunk-ZJZOACSR.mjs +0 -31
- package/dist/chunk-ZTVHEV5N.mjs +0 -50
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
withRunExecutor
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UYSJG2E5.mjs";
|
|
4
4
|
import {
|
|
5
5
|
getStopwatch,
|
|
6
6
|
getWorkspaceConfig,
|
|
@@ -11,17 +11,16 @@ import {
|
|
|
11
11
|
writeSuccess,
|
|
12
12
|
writeTrace,
|
|
13
13
|
writeWarning
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-2M22JVJQ.mjs";
|
|
15
15
|
import {
|
|
16
16
|
findWorkspaceRoot
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-LSF4BHCI.mjs";
|
|
18
18
|
import {
|
|
19
19
|
joinPaths
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-U7JFVMCK.mjs";
|
|
21
21
|
import {
|
|
22
|
-
__name,
|
|
23
22
|
__require
|
|
24
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-IEZKYJSF.mjs";
|
|
25
24
|
|
|
26
25
|
// ../esbuild/src/build.ts
|
|
27
26
|
import * as esbuild from "esbuild";
|
|
@@ -54,7 +53,7 @@ import { relative } from "path";
|
|
|
54
53
|
import { CopyAssetsHandler } from "@nx/js/src/utils/assets/copy-assets-handler";
|
|
55
54
|
import { glob } from "glob";
|
|
56
55
|
import { readFile, writeFile } from "node:fs/promises";
|
|
57
|
-
var copyAssets =
|
|
56
|
+
var copyAssets = async (config, assets, outputPath, projectRoot, sourceRoot, generatePackageJson2 = true, includeSrc = false, banner, footer) => {
|
|
58
57
|
const pendingAssets = Array.from(assets ?? []);
|
|
59
58
|
pendingAssets.push({
|
|
60
59
|
input: projectRoot,
|
|
@@ -80,8 +79,11 @@ var copyAssets = /* @__PURE__ */ __name(async (config, assets, outputPath, proje
|
|
|
80
79
|
output: "src/"
|
|
81
80
|
});
|
|
82
81
|
}
|
|
83
|
-
writeTrace(
|
|
84
|
-
|
|
82
|
+
writeTrace(
|
|
83
|
+
`\u{1F4DD} Copying the following assets to the output directory:
|
|
84
|
+
${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${pendingAsset} -> ${outputPath}` : ` - ${pendingAsset.input}/${pendingAsset.glob} -> ${joinPaths(outputPath, pendingAsset.output)}`).join("\n")}`,
|
|
85
|
+
config
|
|
86
|
+
);
|
|
85
87
|
const assetHandler = new CopyAssetsHandler({
|
|
86
88
|
projectDir: projectRoot,
|
|
87
89
|
rootDir: config.workspaceRoot,
|
|
@@ -90,28 +92,45 @@ ${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${p
|
|
|
90
92
|
});
|
|
91
93
|
await assetHandler.processAllAssetsOnce();
|
|
92
94
|
if (includeSrc === true) {
|
|
93
|
-
writeDebug(
|
|
95
|
+
writeDebug(
|
|
96
|
+
`\u{1F4DD} Adding banner and writing source files: ${joinPaths(
|
|
97
|
+
outputPath,
|
|
98
|
+
"src"
|
|
99
|
+
)}`,
|
|
100
|
+
config
|
|
101
|
+
);
|
|
94
102
|
const files = await glob([
|
|
95
103
|
joinPaths(config.workspaceRoot, outputPath, "src/**/*.ts"),
|
|
96
104
|
joinPaths(config.workspaceRoot, outputPath, "src/**/*.tsx"),
|
|
97
105
|
joinPaths(config.workspaceRoot, outputPath, "src/**/*.js"),
|
|
98
106
|
joinPaths(config.workspaceRoot, outputPath, "src/**/*.jsx")
|
|
99
107
|
]);
|
|
100
|
-
await Promise.allSettled(
|
|
108
|
+
await Promise.allSettled(
|
|
109
|
+
files.map(
|
|
110
|
+
async (file) => writeFile(
|
|
111
|
+
file,
|
|
112
|
+
`${banner && typeof banner === "string" ? banner.startsWith("//") ? banner : `// ${banner}` : ""}
|
|
101
113
|
|
|
102
114
|
${await readFile(file, "utf8")}
|
|
103
115
|
|
|
104
|
-
${footer && typeof footer === "string" ? footer.startsWith("//") ? footer : `// ${footer}` : ""}`
|
|
116
|
+
${footer && typeof footer === "string" ? footer.startsWith("//") ? footer : `// ${footer}` : ""}`
|
|
117
|
+
)
|
|
118
|
+
)
|
|
119
|
+
);
|
|
105
120
|
}
|
|
106
|
-
}
|
|
121
|
+
};
|
|
107
122
|
|
|
108
123
|
// ../build-tools/src/utilities/generate-package-json.ts
|
|
109
124
|
import { calculateProjectBuildableDependencies } from "@nx/js/src/utils/buildable-libs-utils";
|
|
110
125
|
import { Glob } from "glob";
|
|
111
126
|
import { existsSync, readFileSync } from "node:fs";
|
|
112
127
|
import { readFile as readFile2 } from "node:fs/promises";
|
|
113
|
-
import {
|
|
114
|
-
|
|
128
|
+
import {
|
|
129
|
+
createProjectGraphAsync,
|
|
130
|
+
readCachedProjectGraph,
|
|
131
|
+
readProjectsConfigurationFromProjectGraph
|
|
132
|
+
} from "nx/src/project-graph/project-graph";
|
|
133
|
+
var addPackageDependencies = async (workspaceRoot, projectRoot, projectName, packageJson) => {
|
|
115
134
|
let projectGraph;
|
|
116
135
|
try {
|
|
117
136
|
projectGraph = readCachedProjectGraph();
|
|
@@ -120,16 +139,35 @@ var addPackageDependencies = /* @__PURE__ */ __name(async (workspaceRoot, projec
|
|
|
120
139
|
projectGraph = readCachedProjectGraph();
|
|
121
140
|
}
|
|
122
141
|
if (!projectGraph) {
|
|
123
|
-
throw new Error(
|
|
142
|
+
throw new Error(
|
|
143
|
+
"The Build process failed because the project graph is not available. Please run the build command again."
|
|
144
|
+
);
|
|
124
145
|
}
|
|
125
|
-
const projectDependencies = calculateProjectBuildableDependencies(
|
|
146
|
+
const projectDependencies = calculateProjectBuildableDependencies(
|
|
147
|
+
void 0,
|
|
148
|
+
projectGraph,
|
|
149
|
+
workspaceRoot,
|
|
150
|
+
projectName,
|
|
151
|
+
process.env.NX_TASK_TARGET_TARGET || "build",
|
|
152
|
+
process.env.NX_TASK_TARGET_CONFIGURATION || "production",
|
|
153
|
+
true
|
|
154
|
+
);
|
|
126
155
|
const localPackages = [];
|
|
127
|
-
for (const project of projectDependencies.dependencies.filter(
|
|
156
|
+
for (const project of projectDependencies.dependencies.filter(
|
|
157
|
+
(dep) => dep.node.type === "lib" && dep.node.data?.root !== projectRoot && dep.node.data?.root !== workspaceRoot
|
|
158
|
+
)) {
|
|
128
159
|
const projectNode = project.node;
|
|
129
160
|
if (projectNode.data.root) {
|
|
130
|
-
const projectPackageJsonPath = joinPaths(
|
|
161
|
+
const projectPackageJsonPath = joinPaths(
|
|
162
|
+
workspaceRoot,
|
|
163
|
+
projectNode.data.root,
|
|
164
|
+
"package.json"
|
|
165
|
+
);
|
|
131
166
|
if (existsSync(projectPackageJsonPath)) {
|
|
132
|
-
const projectPackageJsonContent = await readFile2(
|
|
167
|
+
const projectPackageJsonContent = await readFile2(
|
|
168
|
+
projectPackageJsonPath,
|
|
169
|
+
"utf8"
|
|
170
|
+
);
|
|
133
171
|
const projectPackageJson = JSON.parse(projectPackageJsonContent);
|
|
134
172
|
if (projectPackageJson.private !== true) {
|
|
135
173
|
localPackages.push(projectPackageJson);
|
|
@@ -138,19 +176,33 @@ var addPackageDependencies = /* @__PURE__ */ __name(async (workspaceRoot, projec
|
|
|
138
176
|
}
|
|
139
177
|
}
|
|
140
178
|
if (localPackages.length > 0) {
|
|
141
|
-
writeTrace(
|
|
142
|
-
|
|
179
|
+
writeTrace(
|
|
180
|
+
`\u{1F4E6} Adding local packages to package.json: ${localPackages.map((p) => p.name).join(", ")}`
|
|
181
|
+
);
|
|
182
|
+
const projectJsonFile = await readFile2(
|
|
183
|
+
joinPaths(projectRoot, "project.json"),
|
|
184
|
+
"utf8"
|
|
185
|
+
);
|
|
143
186
|
const projectJson = JSON.parse(projectJsonFile);
|
|
144
187
|
const projectName2 = projectJson.name;
|
|
145
188
|
const projectConfigurations = readProjectsConfigurationFromProjectGraph(projectGraph);
|
|
146
189
|
if (!projectConfigurations?.projects?.[projectName2]) {
|
|
147
|
-
throw new Error(
|
|
190
|
+
throw new Error(
|
|
191
|
+
"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."
|
|
192
|
+
);
|
|
148
193
|
}
|
|
149
194
|
const implicitDependencies = projectConfigurations.projects?.[projectName2].implicitDependencies?.reduce((ret, dep) => {
|
|
150
195
|
if (projectConfigurations.projects?.[dep]) {
|
|
151
|
-
const depPackageJsonPath = joinPaths(
|
|
196
|
+
const depPackageJsonPath = joinPaths(
|
|
197
|
+
workspaceRoot,
|
|
198
|
+
projectConfigurations.projects[dep].root,
|
|
199
|
+
"package.json"
|
|
200
|
+
);
|
|
152
201
|
if (existsSync(depPackageJsonPath)) {
|
|
153
|
-
const depPackageJsonContent = readFileSync(
|
|
202
|
+
const depPackageJsonContent = readFileSync(
|
|
203
|
+
depPackageJsonPath,
|
|
204
|
+
"utf8"
|
|
205
|
+
);
|
|
154
206
|
const depPackageJson = JSON.parse(depPackageJsonContent);
|
|
155
207
|
if (depPackageJson.private !== true && !ret.includes(depPackageJson.name)) {
|
|
156
208
|
ret.push(depPackageJson.name);
|
|
@@ -175,10 +227,13 @@ var addPackageDependencies = /* @__PURE__ */ __name(async (workspaceRoot, projec
|
|
|
175
227
|
writeTrace("\u{1F4E6} No local packages dependencies to add to package.json");
|
|
176
228
|
}
|
|
177
229
|
return packageJson;
|
|
178
|
-
}
|
|
179
|
-
var addWorkspacePackageJsonFields =
|
|
230
|
+
};
|
|
231
|
+
var addWorkspacePackageJsonFields = async (workspaceConfig, projectRoot, sourceRoot, projectName, includeSrc = false, packageJson) => {
|
|
180
232
|
const workspaceRoot = workspaceConfig.workspaceRoot ? workspaceConfig.workspaceRoot : findWorkspaceRoot();
|
|
181
|
-
const workspacePackageJsonContent = await readFile2(
|
|
233
|
+
const workspacePackageJsonContent = await readFile2(
|
|
234
|
+
joinPaths(workspaceRoot, "package.json"),
|
|
235
|
+
"utf8"
|
|
236
|
+
);
|
|
182
237
|
const workspacePackageJson = JSON.parse(workspacePackageJsonContent);
|
|
183
238
|
packageJson.type ??= "module";
|
|
184
239
|
packageJson.sideEffects ??= false;
|
|
@@ -189,9 +244,7 @@ var addWorkspacePackageJsonFields = /* @__PURE__ */ __name(async (workspaceConfi
|
|
|
189
244
|
}
|
|
190
245
|
packageJson.source ??= `${joinPaths(distSrc, "index.ts").replaceAll("\\", "/")}`;
|
|
191
246
|
}
|
|
192
|
-
packageJson.files ??= [
|
|
193
|
-
"dist/**/*"
|
|
194
|
-
];
|
|
247
|
+
packageJson.files ??= ["dist/**/*"];
|
|
195
248
|
if (includeSrc === true && !packageJson.files.includes("src")) {
|
|
196
249
|
packageJson.files.push("src/**/*");
|
|
197
250
|
}
|
|
@@ -207,26 +260,22 @@ var addWorkspacePackageJsonFields = /* @__PURE__ */ __name(async (workspaceConfi
|
|
|
207
260
|
packageJson.author ??= workspacePackageJson.author;
|
|
208
261
|
packageJson.maintainers ??= workspacePackageJson.maintainers;
|
|
209
262
|
if (!packageJson.maintainers && packageJson.author) {
|
|
210
|
-
packageJson.maintainers = [
|
|
211
|
-
packageJson.author
|
|
212
|
-
];
|
|
263
|
+
packageJson.maintainers = [packageJson.author];
|
|
213
264
|
}
|
|
214
265
|
packageJson.contributors ??= workspacePackageJson.contributors;
|
|
215
266
|
if (!packageJson.contributors && packageJson.author) {
|
|
216
|
-
packageJson.contributors = [
|
|
217
|
-
packageJson.author
|
|
218
|
-
];
|
|
267
|
+
packageJson.contributors = [packageJson.author];
|
|
219
268
|
}
|
|
220
269
|
packageJson.repository ??= workspacePackageJson.repository;
|
|
221
270
|
packageJson.repository.directory ??= projectRoot ? projectRoot : joinPaths("packages", projectName);
|
|
222
271
|
return packageJson;
|
|
223
|
-
}
|
|
272
|
+
};
|
|
224
273
|
|
|
225
274
|
// ../build-tools/src/utilities/get-entry-points.ts
|
|
226
275
|
import { glob as glob2 } from "glob";
|
|
227
276
|
|
|
228
277
|
// ../build-tools/src/utilities/get-env.ts
|
|
229
|
-
var getEnv =
|
|
278
|
+
var getEnv = (builder, options) => {
|
|
230
279
|
return {
|
|
231
280
|
STORM_BUILD: builder,
|
|
232
281
|
STORM_ORG: options.orgName || DEFAULT_ORGANIZATION,
|
|
@@ -237,39 +286,51 @@ var getEnv = /* @__PURE__ */ __name((builder, options) => {
|
|
|
237
286
|
STORM_TARGET: JSON.stringify(options.target),
|
|
238
287
|
...options.env
|
|
239
288
|
};
|
|
240
|
-
}
|
|
289
|
+
};
|
|
241
290
|
|
|
242
291
|
// ../build-tools/src/utilities/read-nx-config.ts
|
|
243
292
|
import { existsSync as existsSync2 } from "node:fs";
|
|
244
293
|
import { readFile as readFile3 } from "node:fs/promises";
|
|
245
294
|
|
|
246
295
|
// ../build-tools/src/utilities/task-graph.ts
|
|
247
|
-
import {
|
|
296
|
+
import {
|
|
297
|
+
createTaskGraph,
|
|
298
|
+
mapTargetDefaultsToDependencies
|
|
299
|
+
} from "nx/src/tasks-runner/create-task-graph";
|
|
248
300
|
|
|
249
301
|
// ../esbuild/src/assets.ts
|
|
250
302
|
async function copyBuildAssets(context) {
|
|
251
303
|
if (context.result?.errors.length === 0) {
|
|
252
|
-
writeDebug(
|
|
304
|
+
writeDebug(
|
|
305
|
+
` \u{1F4CB} Copying asset files to output directory: ${context.outputPath}`,
|
|
306
|
+
context.workspaceConfig
|
|
307
|
+
);
|
|
253
308
|
const stopwatch = getStopwatch(`${context.options.name} asset copy`);
|
|
254
|
-
await copyAssets(
|
|
309
|
+
await copyAssets(
|
|
310
|
+
context.workspaceConfig,
|
|
311
|
+
context.options.assets ?? [],
|
|
312
|
+
context.outputPath,
|
|
313
|
+
context.options.projectRoot,
|
|
314
|
+
context.sourceRoot,
|
|
315
|
+
true,
|
|
316
|
+
false
|
|
317
|
+
);
|
|
255
318
|
stopwatch();
|
|
256
319
|
}
|
|
257
320
|
return context;
|
|
258
321
|
}
|
|
259
|
-
__name(copyBuildAssets, "copyBuildAssets");
|
|
260
322
|
|
|
261
323
|
// ../esbuild/src/clean.ts
|
|
262
324
|
import { rm } from "node:fs/promises";
|
|
263
325
|
async function cleanDirectories(directory) {
|
|
264
|
-
await rm(directory, {
|
|
265
|
-
recursive: true,
|
|
266
|
-
force: true
|
|
267
|
-
});
|
|
326
|
+
await rm(directory, { recursive: true, force: true });
|
|
268
327
|
}
|
|
269
|
-
__name(cleanDirectories, "cleanDirectories");
|
|
270
328
|
|
|
271
329
|
// ../esbuild/src/context.ts
|
|
272
|
-
import {
|
|
330
|
+
import {
|
|
331
|
+
createProjectGraphAsync as createProjectGraphAsync2,
|
|
332
|
+
readProjectsConfigurationFromProjectGraph as readProjectsConfigurationFromProjectGraph2
|
|
333
|
+
} from "@nx/devkit";
|
|
273
334
|
import defu from "defu";
|
|
274
335
|
import { existsSync as existsSync3 } from "node:fs";
|
|
275
336
|
import hf from "node:fs/promises";
|
|
@@ -326,43 +387,46 @@ function resolvePathsConfig(options, cwd, projectRoot) {
|
|
|
326
387
|
if (options?.compilerOptions?.paths) {
|
|
327
388
|
const paths = Object.entries(options.compilerOptions.paths);
|
|
328
389
|
const resolvedPaths = paths.map(([key, paths2]) => {
|
|
329
|
-
return [
|
|
330
|
-
key,
|
|
331
|
-
paths2.map((v) => path2.resolve(cwd, v))
|
|
332
|
-
];
|
|
390
|
+
return [key, paths2.map((v) => path2.resolve(cwd, v))];
|
|
333
391
|
});
|
|
334
392
|
return Object.fromEntries(resolvedPaths);
|
|
335
393
|
}
|
|
336
394
|
if (options.extends) {
|
|
337
|
-
const extendsPath = path2.resolve(
|
|
395
|
+
const extendsPath = path2.resolve(
|
|
396
|
+
projectRoot ? joinPaths(cwd, projectRoot, options.extends) : joinPaths(cwd, options.extends)
|
|
397
|
+
);
|
|
338
398
|
const extendsDir = path2.dirname(extendsPath);
|
|
339
399
|
const extendsConfig = __require(extendsPath);
|
|
340
400
|
return resolvePathsConfig(extendsConfig, extendsDir);
|
|
341
401
|
}
|
|
342
402
|
return [];
|
|
343
403
|
}
|
|
344
|
-
|
|
345
|
-
var resolvePathsPlugin = /* @__PURE__ */ __name((context) => ({
|
|
404
|
+
var resolvePathsPlugin = (context) => ({
|
|
346
405
|
name: "storm:resolve-paths",
|
|
347
406
|
setup(build3) {
|
|
348
|
-
const parentTsConfig = build3.initialOptions.tsconfig ? __require(joinPaths(
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
407
|
+
const parentTsConfig = build3.initialOptions.tsconfig ? __require(joinPaths(
|
|
408
|
+
context.workspaceConfig.workspaceRoot,
|
|
409
|
+
build3.initialOptions.tsconfig.replace(
|
|
410
|
+
context.workspaceConfig.workspaceRoot,
|
|
411
|
+
""
|
|
412
|
+
)
|
|
413
|
+
)) : __require(joinPaths(context.workspaceConfig.workspaceRoot, "tsconfig.json"));
|
|
414
|
+
const resolvedTsPaths = resolvePathsConfig(
|
|
415
|
+
parentTsConfig,
|
|
416
|
+
context.workspaceConfig.workspaceRoot,
|
|
417
|
+
context.options.projectRoot
|
|
418
|
+
);
|
|
419
|
+
const packagesRegex = new RegExp(
|
|
420
|
+
`^(${Object.keys(resolvedTsPaths).join("|")})$`
|
|
421
|
+
);
|
|
422
|
+
build3.onResolve({ filter: packagesRegex }, (args) => {
|
|
354
423
|
if (build3.initialOptions.external?.includes(args.path)) {
|
|
355
|
-
return {
|
|
356
|
-
path: args.path,
|
|
357
|
-
external: true
|
|
358
|
-
};
|
|
424
|
+
return { path: args.path, external: true };
|
|
359
425
|
}
|
|
360
|
-
return {
|
|
361
|
-
path: `${resolvedTsPaths[args.path][0]}/index.ts`
|
|
362
|
-
};
|
|
426
|
+
return { path: `${resolvedTsPaths[args.path][0]}/index.ts` };
|
|
363
427
|
});
|
|
364
428
|
}
|
|
365
|
-
})
|
|
429
|
+
});
|
|
366
430
|
|
|
367
431
|
// ../esbuild/src/context.ts
|
|
368
432
|
async function resolveContext(userOptions) {
|
|
@@ -379,7 +443,11 @@ async function resolveContext(userOptions) {
|
|
|
379
443
|
const projectGraph = await createProjectGraphAsync2({
|
|
380
444
|
exitOnError: true
|
|
381
445
|
});
|
|
382
|
-
const projectJsonPath = joinPaths(
|
|
446
|
+
const projectJsonPath = joinPaths(
|
|
447
|
+
workspaceRoot.dir,
|
|
448
|
+
projectRoot,
|
|
449
|
+
"project.json"
|
|
450
|
+
);
|
|
383
451
|
if (!existsSync3(projectJsonPath)) {
|
|
384
452
|
throw new Error("Cannot find project.json configuration");
|
|
385
453
|
}
|
|
@@ -388,11 +456,17 @@ async function resolveContext(userOptions) {
|
|
|
388
456
|
const projectName = projectJson.name || userOptions.name;
|
|
389
457
|
const projectConfigurations = readProjectsConfigurationFromProjectGraph2(projectGraph);
|
|
390
458
|
if (!projectConfigurations?.projects?.[projectName]) {
|
|
391
|
-
throw new Error(
|
|
459
|
+
throw new Error(
|
|
460
|
+
"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."
|
|
461
|
+
);
|
|
392
462
|
}
|
|
393
463
|
const options = defu(userOptions, DEFAULT_BUILD_OPTIONS);
|
|
394
464
|
options.name ??= projectName;
|
|
395
|
-
const packageJsonPath = joinPaths(
|
|
465
|
+
const packageJsonPath = joinPaths(
|
|
466
|
+
workspaceRoot.dir,
|
|
467
|
+
options.projectRoot,
|
|
468
|
+
"package.json"
|
|
469
|
+
);
|
|
396
470
|
if (!existsSync3(packageJsonPath)) {
|
|
397
471
|
throw new Error("Cannot find package.json configuration");
|
|
398
472
|
}
|
|
@@ -426,7 +500,11 @@ async function resolveContext(userOptions) {
|
|
|
426
500
|
projectName,
|
|
427
501
|
projectGraph,
|
|
428
502
|
sourceRoot: resolvedOptions.sourceRoot || projectJson.sourceRoot || joinPaths(resolvedOptions.projectRoot, "src"),
|
|
429
|
-
outputPath: resolvedOptions.outputPath || joinPaths(
|
|
503
|
+
outputPath: resolvedOptions.outputPath || joinPaths(
|
|
504
|
+
workspaceConfig.workspaceRoot,
|
|
505
|
+
"dist",
|
|
506
|
+
resolvedOptions.projectRoot
|
|
507
|
+
),
|
|
430
508
|
minify: resolvedOptions.minify || resolvedOptions.mode === "production"
|
|
431
509
|
};
|
|
432
510
|
context.options.esbuildPlugins = [
|
|
@@ -435,7 +513,6 @@ async function resolveContext(userOptions) {
|
|
|
435
513
|
];
|
|
436
514
|
return context;
|
|
437
515
|
}
|
|
438
|
-
__name(resolveContext, "resolveContext");
|
|
439
516
|
|
|
440
517
|
// ../esbuild/src/package-json.ts
|
|
441
518
|
import { writeJsonFile } from "@nx/devkit";
|
|
@@ -445,17 +522,39 @@ async function generatePackageJson(context) {
|
|
|
445
522
|
if (context.options.generatePackageJson !== false && existsSync4(joinPaths(context.options.projectRoot, "package.json"))) {
|
|
446
523
|
writeDebug(" \u270D\uFE0F Writing package.json file", context.workspaceConfig);
|
|
447
524
|
const stopwatch = getStopwatch("Write package.json file");
|
|
448
|
-
const packageJsonPath = joinPaths(
|
|
525
|
+
const packageJsonPath = joinPaths(
|
|
526
|
+
context.options.projectRoot,
|
|
527
|
+
"project.json"
|
|
528
|
+
);
|
|
449
529
|
if (!existsSync4(packageJsonPath)) {
|
|
450
530
|
throw new Error("Cannot find package.json configuration");
|
|
451
531
|
}
|
|
452
|
-
const packageJsonFile = await hf2.readFile(
|
|
532
|
+
const packageJsonFile = await hf2.readFile(
|
|
533
|
+
joinPaths(
|
|
534
|
+
context.workspaceConfig.workspaceRoot,
|
|
535
|
+
context.options.projectRoot,
|
|
536
|
+
"package.json"
|
|
537
|
+
),
|
|
538
|
+
"utf8"
|
|
539
|
+
);
|
|
453
540
|
let packageJson = JSON.parse(packageJsonFile);
|
|
454
541
|
if (!packageJson) {
|
|
455
542
|
throw new Error("Cannot find package.json configuration file");
|
|
456
543
|
}
|
|
457
|
-
packageJson = await addPackageDependencies(
|
|
458
|
-
|
|
544
|
+
packageJson = await addPackageDependencies(
|
|
545
|
+
context.workspaceConfig.workspaceRoot,
|
|
546
|
+
context.options.projectRoot,
|
|
547
|
+
context.projectName,
|
|
548
|
+
packageJson
|
|
549
|
+
);
|
|
550
|
+
packageJson = await addWorkspacePackageJsonFields(
|
|
551
|
+
context.workspaceConfig,
|
|
552
|
+
context.options.projectRoot,
|
|
553
|
+
context.sourceRoot,
|
|
554
|
+
context.projectName,
|
|
555
|
+
false,
|
|
556
|
+
packageJson
|
|
557
|
+
);
|
|
459
558
|
if (context.options.entry) {
|
|
460
559
|
packageJson.exports ??= {};
|
|
461
560
|
packageJson.exports["./package.json"] ??= "./package.json";
|
|
@@ -525,20 +624,25 @@ async function generatePackageJson(context) {
|
|
|
525
624
|
if (isDts) {
|
|
526
625
|
packageJson.types = `${defaultEntry}.d.${isEsm ? "mts" : isCjs ? "cts" : "ts"}`;
|
|
527
626
|
}
|
|
528
|
-
packageJson.exports = Object.keys(packageJson.exports).reduce(
|
|
529
|
-
|
|
530
|
-
ret[key.replace("/index", "")]
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
627
|
+
packageJson.exports = Object.keys(packageJson.exports).reduce(
|
|
628
|
+
(ret, key) => {
|
|
629
|
+
if (key.endsWith("/index") && !ret[key.replace("/index", "")]) {
|
|
630
|
+
ret[key.replace("/index", "")] = packageJson.exports[key];
|
|
631
|
+
}
|
|
632
|
+
return ret;
|
|
633
|
+
},
|
|
634
|
+
packageJson.exports
|
|
635
|
+
);
|
|
534
636
|
}
|
|
535
637
|
}
|
|
536
|
-
await writeJsonFile(
|
|
638
|
+
await writeJsonFile(
|
|
639
|
+
joinPaths(context.outputPath, "package.json"),
|
|
640
|
+
packageJson
|
|
641
|
+
);
|
|
537
642
|
stopwatch();
|
|
538
643
|
}
|
|
539
644
|
return context;
|
|
540
645
|
}
|
|
541
|
-
__name(generatePackageJson, "generatePackageJson");
|
|
542
646
|
|
|
543
647
|
// ../esbuild/src/plugins/deps-check.ts
|
|
544
648
|
import { builtinModules as builtinModules2 } from "node:module";
|
|
@@ -567,12 +671,8 @@ var unusedIgnore = [
|
|
|
567
671
|
// these are indirectly used by build
|
|
568
672
|
"buffer"
|
|
569
673
|
];
|
|
570
|
-
var missingIgnore = [
|
|
571
|
-
|
|
572
|
-
"@prisma/client",
|
|
573
|
-
"ts-toolbelt"
|
|
574
|
-
];
|
|
575
|
-
var depsCheckPlugin = /* @__PURE__ */ __name((bundle) => ({
|
|
674
|
+
var missingIgnore = [".prisma", "@prisma/client", "ts-toolbelt"];
|
|
675
|
+
var depsCheckPlugin = (bundle) => ({
|
|
576
676
|
name: "storm:deps-check",
|
|
577
677
|
setup(build3) {
|
|
578
678
|
const pkgJsonPath = path3.join(process.cwd(), "package.json");
|
|
@@ -586,9 +686,7 @@ var depsCheckPlugin = /* @__PURE__ */ __name((bundle) => ({
|
|
|
586
686
|
];
|
|
587
687
|
const collectedDependencies = /* @__PURE__ */ new Set();
|
|
588
688
|
const onlyPackages = /^[^./](?!:)|^\.[^./]|^\.\.[^/]/;
|
|
589
|
-
build3.onResolve({
|
|
590
|
-
filter: onlyPackages
|
|
591
|
-
}, (args) => {
|
|
689
|
+
build3.onResolve({ filter: onlyPackages }, (args) => {
|
|
592
690
|
if (args.importer.includes(process.cwd())) {
|
|
593
691
|
if (args.path[0] === "@") {
|
|
594
692
|
const [org, pkg] = args.path.split("/");
|
|
@@ -598,19 +696,13 @@ var depsCheckPlugin = /* @__PURE__ */ __name((bundle) => ({
|
|
|
598
696
|
collectedDependencies.add(pkg);
|
|
599
697
|
}
|
|
600
698
|
}
|
|
601
|
-
return {
|
|
602
|
-
external: true
|
|
603
|
-
};
|
|
699
|
+
return { external: true };
|
|
604
700
|
});
|
|
605
701
|
build3.onEnd(() => {
|
|
606
|
-
const unusedDependencies = [
|
|
607
|
-
...dependencies
|
|
608
|
-
].filter((dep) => {
|
|
702
|
+
const unusedDependencies = [...dependencies].filter((dep) => {
|
|
609
703
|
return !collectedDependencies.has(dep) || builtinModules2.includes(dep);
|
|
610
704
|
});
|
|
611
|
-
const missingDependencies = [
|
|
612
|
-
...collectedDependencies
|
|
613
|
-
].filter((dep) => {
|
|
705
|
+
const missingDependencies = [...collectedDependencies].filter((dep) => {
|
|
614
706
|
return !dependencies.includes(dep) && !builtinModules2.includes(dep);
|
|
615
707
|
});
|
|
616
708
|
const filteredUnusedDeps = unusedDependencies.filter((dep) => {
|
|
@@ -619,8 +711,12 @@ var depsCheckPlugin = /* @__PURE__ */ __name((bundle) => ({
|
|
|
619
711
|
const filteredMissingDeps = missingDependencies.filter((dep) => {
|
|
620
712
|
return !missingIgnore.some((pattern) => dep.match(pattern)) && !peerDependencies.includes(dep);
|
|
621
713
|
});
|
|
622
|
-
writeWarning(
|
|
623
|
-
|
|
714
|
+
writeWarning(
|
|
715
|
+
`Unused Dependencies: ${JSON.stringify(filteredUnusedDeps)}`
|
|
716
|
+
);
|
|
717
|
+
writeError(
|
|
718
|
+
`Missing Dependencies: ${JSON.stringify(filteredMissingDeps)}`
|
|
719
|
+
);
|
|
624
720
|
if (filteredMissingDeps.length > 0) {
|
|
625
721
|
throw new Error(`Missing dependencies detected - please install them:
|
|
626
722
|
${JSON.stringify(filteredMissingDeps)}
|
|
@@ -628,12 +724,15 @@ ${JSON.stringify(filteredMissingDeps)}
|
|
|
628
724
|
}
|
|
629
725
|
});
|
|
630
726
|
}
|
|
631
|
-
})
|
|
727
|
+
});
|
|
632
728
|
|
|
633
729
|
// ../esbuild/src/tsup.ts
|
|
634
730
|
import { build as tsup } from "tsup";
|
|
635
731
|
async function executeTsup(context) {
|
|
636
|
-
writeDebug(
|
|
732
|
+
writeDebug(
|
|
733
|
+
` \u{1F680} Running ${context.options.name} build`,
|
|
734
|
+
context.workspaceConfig
|
|
735
|
+
);
|
|
637
736
|
const stopwatch = getStopwatch(`${context.options.name} build`);
|
|
638
737
|
await tsup({
|
|
639
738
|
...context.options,
|
|
@@ -643,21 +742,30 @@ async function executeTsup(context) {
|
|
|
643
742
|
stopwatch();
|
|
644
743
|
return context;
|
|
645
744
|
}
|
|
646
|
-
__name(executeTsup, "executeTsup");
|
|
647
745
|
|
|
648
746
|
// ../esbuild/src/build.ts
|
|
649
747
|
async function reportResults(context) {
|
|
650
748
|
if (context.result?.errors.length === 0) {
|
|
651
749
|
if (context.result.warnings.length > 0) {
|
|
652
|
-
writeWarning(
|
|
750
|
+
writeWarning(
|
|
751
|
+
` \u{1F6A7} The following warnings occurred during the build: ${context.result.warnings.map((warning) => warning.text).join("\n")}`,
|
|
752
|
+
context.workspaceConfig
|
|
753
|
+
);
|
|
653
754
|
}
|
|
654
|
-
writeSuccess(
|
|
755
|
+
writeSuccess(
|
|
756
|
+
` \u{1F4E6} The ${context.options.name} build completed successfully`,
|
|
757
|
+
context.workspaceConfig
|
|
758
|
+
);
|
|
655
759
|
} else if (context.result?.errors && context.result?.errors.length > 0) {
|
|
656
|
-
writeError(
|
|
657
|
-
|
|
760
|
+
writeError(
|
|
761
|
+
` \u274C The ${context.options.name} build failed with the following errors: ${context.result.errors.map((error) => error.text).join("\n")}`,
|
|
762
|
+
context.workspaceConfig
|
|
763
|
+
);
|
|
764
|
+
throw new Error(
|
|
765
|
+
`The ${context.options.name} build failed with the following errors: ${context.result.errors.map((error) => error.text).join("\n")}`
|
|
766
|
+
);
|
|
658
767
|
}
|
|
659
768
|
}
|
|
660
|
-
__name(reportResults, "reportResults");
|
|
661
769
|
async function dependencyCheck(options) {
|
|
662
770
|
if (process.env.DEV === "true") {
|
|
663
771
|
return void 0;
|
|
@@ -668,43 +776,39 @@ async function dependencyCheck(options) {
|
|
|
668
776
|
const buildPromise = esbuild.build({
|
|
669
777
|
entryPoints: globbySync("**/*.{j,t}s", {
|
|
670
778
|
// We don't check dependencies in ecosystem tests because tests are isolated from the build.
|
|
671
|
-
ignore: [
|
|
672
|
-
"./src/__tests__/**/*",
|
|
673
|
-
"./tests/e2e/**/*",
|
|
674
|
-
"./dist/**/*"
|
|
675
|
-
],
|
|
779
|
+
ignore: ["./src/__tests__/**/*", "./tests/e2e/**/*", "./dist/**/*"],
|
|
676
780
|
gitignore: true
|
|
677
781
|
}),
|
|
678
782
|
logLevel: "silent",
|
|
783
|
+
// there will be errors
|
|
679
784
|
bundle: true,
|
|
785
|
+
// we bundle to get everything
|
|
680
786
|
write: false,
|
|
787
|
+
// no need to write for analysis
|
|
681
788
|
outdir: "out",
|
|
682
|
-
plugins: [
|
|
683
|
-
depsCheckPlugin(options.bundle)
|
|
684
|
-
]
|
|
789
|
+
plugins: [depsCheckPlugin(options.bundle)]
|
|
685
790
|
});
|
|
686
791
|
await buildPromise.catch(() => {
|
|
687
792
|
});
|
|
688
793
|
return void 0;
|
|
689
794
|
}
|
|
690
|
-
__name(dependencyCheck, "dependencyCheck");
|
|
691
795
|
async function cleanOutputPath(context) {
|
|
692
796
|
if (context.clean !== false && context.outputPath) {
|
|
693
|
-
writeDebug(
|
|
797
|
+
writeDebug(
|
|
798
|
+
` \u{1F9F9} Cleaning ${context.options.name} output path: ${context.outputPath}`,
|
|
799
|
+
context.workspaceConfig
|
|
800
|
+
);
|
|
694
801
|
const stopwatch = getStopwatch(`${context.options.name} output clean`);
|
|
695
802
|
await cleanDirectories(context.outputPath);
|
|
696
803
|
stopwatch();
|
|
697
804
|
}
|
|
698
805
|
return context;
|
|
699
806
|
}
|
|
700
|
-
__name(cleanOutputPath, "cleanOutputPath");
|
|
701
807
|
async function build2(options) {
|
|
702
808
|
writeDebug(` \u26A1 Executing Storm ESBuild pipeline`);
|
|
703
809
|
const stopwatch = getStopwatch("ESBuild pipeline");
|
|
704
810
|
try {
|
|
705
|
-
const opts = Array.isArray(options) ? options : [
|
|
706
|
-
options
|
|
707
|
-
];
|
|
811
|
+
const opts = Array.isArray(options) ? options : [options];
|
|
708
812
|
if (opts.length === 0) {
|
|
709
813
|
throw new Error("No build options were provided");
|
|
710
814
|
}
|
|
@@ -719,19 +823,22 @@ async function build2(options) {
|
|
|
719
823
|
await reportResults(context);
|
|
720
824
|
writeSuccess(" \u{1F3C1} ESBuild pipeline build completed successfully");
|
|
721
825
|
} catch (error) {
|
|
722
|
-
writeFatal(
|
|
826
|
+
writeFatal(
|
|
827
|
+
"Fatal errors that the build process could not recover from have occured. The build process has been terminated."
|
|
828
|
+
);
|
|
723
829
|
throw error;
|
|
724
830
|
} finally {
|
|
725
831
|
stopwatch();
|
|
726
832
|
}
|
|
727
833
|
}
|
|
728
|
-
__name(build2, "build");
|
|
729
834
|
|
|
730
835
|
// src/executors/esbuild/executor.ts
|
|
731
836
|
async function esbuildExecutorFn(options, context, config) {
|
|
732
837
|
writeInfo("\u{1F4E6} Running Storm ESBuild executor on the workspace", config);
|
|
733
838
|
if (!context.projectsConfigurations?.projects || !context.projectName || !context.projectsConfigurations.projects[context.projectName] || !context.projectsConfigurations.projects[context.projectName]?.root) {
|
|
734
|
-
throw new Error(
|
|
839
|
+
throw new Error(
|
|
840
|
+
"The Build process failed because the context is not valid. Please run this command from a workspace."
|
|
841
|
+
);
|
|
735
842
|
}
|
|
736
843
|
await build2({
|
|
737
844
|
...options,
|
|
@@ -745,20 +852,21 @@ async function esbuildExecutorFn(options, context, config) {
|
|
|
745
852
|
success: true
|
|
746
853
|
};
|
|
747
854
|
}
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
855
|
+
var executor_default = withRunExecutor(
|
|
856
|
+
"Storm ESBuild build",
|
|
857
|
+
esbuildExecutorFn,
|
|
858
|
+
{
|
|
859
|
+
skipReadingConfig: false,
|
|
860
|
+
hooks: {
|
|
861
|
+
applyDefaultOptions: async (options, config) => {
|
|
862
|
+
options.entry ??= ["src/index.ts"];
|
|
863
|
+
options.outputPath ??= "dist/{projectRoot}";
|
|
864
|
+
options.tsconfig ??= "{projectRoot}/tsconfig.json";
|
|
865
|
+
return options;
|
|
866
|
+
}
|
|
867
|
+
}
|
|
760
868
|
}
|
|
761
|
-
|
|
869
|
+
);
|
|
762
870
|
|
|
763
871
|
export {
|
|
764
872
|
esbuildExecutorFn,
|