@storm-software/esbuild 0.4.1 → 0.14.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/README.md +1 -1
- package/dist/build.cjs +15 -11
- package/dist/build.d.cts +3 -3
- package/dist/build.d.ts +3 -3
- package/dist/build.js +14 -10
- package/dist/{chunk-WCQVDF3K.js → chunk-3GQAWCBQ.js} +0 -1
- package/dist/chunk-4JLYXTKD.cjs +26 -0
- package/dist/chunk-5I2MGPRN.cjs +919 -0
- package/dist/{chunk-CMWXE5MF.js → chunk-7KR3YBS6.js} +5 -3
- package/dist/chunk-7MDMXJ5V.js +26 -0
- package/dist/{chunk-WGEGR3DF.cjs → chunk-BGYQAVKQ.cjs} +0 -1
- package/dist/{chunk-J34FQYKV.cjs → chunk-CGFDQ5AJ.cjs} +8 -5
- package/dist/{chunk-TTHABTDU.js → chunk-DAGDNKO5.js} +8 -6
- package/dist/{chunk-DFGHPRBD.cjs → chunk-EZGTDCYM.cjs} +6 -6
- package/dist/chunk-GGNOJ77I.js +0 -0
- package/dist/{chunk-YQBU3FSL.js → chunk-GWG4HOQ6.js} +4 -4
- package/dist/chunk-HQGUIF4U.js +537 -0
- package/dist/{chunk-X5TLV7MF.js → chunk-KE5DL2BG.js} +11 -6
- package/dist/{chunk-KJ7ZHAFS.js → chunk-KOK4WCHS.js} +52 -28
- package/dist/chunk-LVWQSCJM.cjs +26 -0
- package/dist/chunk-LYDEMC26.js +23 -0
- package/dist/chunk-MAMLS55E.js +582 -0
- package/dist/chunk-NVWDQVN6.js +21 -0
- package/dist/chunk-PQ6YIJ72.cjs +136 -0
- package/dist/{chunk-BF5W6GVP.cjs → chunk-RMB62XEL.cjs} +10 -8
- package/dist/chunk-S6M44SSZ.cjs +60 -0
- package/dist/chunk-SFZRYJZ2.cjs +1 -0
- package/dist/chunk-T5272PC2.js +60 -0
- package/dist/chunk-TP5EOMRD.cjs +21 -0
- package/dist/chunk-VBINBV4Z.cjs +537 -0
- package/dist/chunk-VLP3P6HF.js +919 -0
- package/dist/{chunk-KVBDKVBU.cjs → chunk-VZBOWHCM.cjs} +9 -7
- package/dist/chunk-WRBUO7H6.cjs +23 -0
- package/dist/chunk-WYMD6YG2.cjs +582 -0
- package/dist/{chunk-437F3SFI.js → chunk-YNQ45EAM.js} +7 -4
- package/dist/clean.cjs +9 -0
- package/dist/clean.d.cts +1194 -0
- package/dist/clean.d.ts +1194 -0
- package/dist/clean.js +9 -0
- package/dist/config.cjs +14 -4
- package/dist/config.d.cts +8 -13
- package/dist/config.d.ts +8 -13
- package/dist/config.js +15 -5
- package/dist/esbuild.cjs +1185 -0
- package/dist/index.cjs +21 -12
- package/dist/index.d.cts +7 -5
- package/dist/index.d.ts +7 -5
- package/dist/index.js +22 -13
- package/dist/types.cjs +1 -2
- package/dist/types.d.cts +84 -1177
- package/dist/types.d.ts +84 -1177
- package/dist/types.js +1 -2
- package/package.json +1 -222
- package/dist/build.cjs.map +0 -1
- package/dist/build.js.map +0 -1
- package/dist/chunk-263L44RM.cjs +0 -112
- package/dist/chunk-263L44RM.cjs.map +0 -1
- package/dist/chunk-437F3SFI.js.map +0 -1
- package/dist/chunk-BF5W6GVP.cjs.map +0 -1
- package/dist/chunk-CMEDJ4L4.js +0 -352
- package/dist/chunk-CMEDJ4L4.js.map +0 -1
- package/dist/chunk-CMWXE5MF.js.map +0 -1
- package/dist/chunk-D5PRB2E2.cjs +0 -40
- package/dist/chunk-D5PRB2E2.cjs.map +0 -1
- package/dist/chunk-DFGHPRBD.cjs.map +0 -1
- package/dist/chunk-DRRPNILS.js +0 -40
- package/dist/chunk-DRRPNILS.js.map +0 -1
- package/dist/chunk-J34FQYKV.cjs.map +0 -1
- package/dist/chunk-KJ7ZHAFS.js.map +0 -1
- package/dist/chunk-KVBDKVBU.cjs.map +0 -1
- package/dist/chunk-MUYXFAKB.cjs +0 -1
- package/dist/chunk-MUYXFAKB.cjs.map +0 -1
- package/dist/chunk-MVLEDP7K.cjs +0 -21
- package/dist/chunk-MVLEDP7K.cjs.map +0 -1
- package/dist/chunk-PBHOTQGA.cjs +0 -352
- package/dist/chunk-PBHOTQGA.cjs.map +0 -1
- package/dist/chunk-QNDLJ2W7.js +0 -1
- package/dist/chunk-QNDLJ2W7.js.map +0 -1
- package/dist/chunk-TTHABTDU.js.map +0 -1
- package/dist/chunk-WCQVDF3K.js.map +0 -1
- package/dist/chunk-WGEGR3DF.cjs.map +0 -1
- package/dist/chunk-X5TLV7MF.js.map +0 -1
- package/dist/chunk-YQBU3FSL.js.map +0 -1
- package/dist/config.cjs.map +0 -1
- package/dist/config.js.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/types.cjs.map +0 -1
- package/dist/types.js.map +0 -1
|
@@ -1,15 +1,40 @@
|
|
|
1
|
+
import {
|
|
2
|
+
writeError
|
|
3
|
+
} from "./chunk-HQGUIF4U.js";
|
|
4
|
+
import {
|
|
5
|
+
joinPaths
|
|
6
|
+
} from "./chunk-7MDMXJ5V.js";
|
|
1
7
|
import {
|
|
2
8
|
__name,
|
|
3
9
|
__require
|
|
4
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-3GQAWCBQ.js";
|
|
5
11
|
|
|
6
12
|
// src/plugins/tsc.ts
|
|
7
13
|
import { hfs } from "@humanfs/node";
|
|
8
14
|
import { Extractor, ExtractorConfig } from "@microsoft/api-extractor";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
15
|
+
|
|
16
|
+
// ../config-tools/src/utilities/run.ts
|
|
17
|
+
import { exec, execSync } from "node:child_process";
|
|
18
|
+
var LARGE_BUFFER = 1024 * 1e6;
|
|
19
|
+
var run = /* @__PURE__ */ __name((config, command, cwd = config.workspaceRoot ?? process.cwd(), stdio = "inherit", env = process.env) => {
|
|
20
|
+
return execSync(command, {
|
|
21
|
+
cwd,
|
|
22
|
+
env: {
|
|
23
|
+
...process.env,
|
|
24
|
+
...env,
|
|
25
|
+
CLICOLOR: "true",
|
|
26
|
+
FORCE_COLOR: "true"
|
|
27
|
+
},
|
|
28
|
+
windowsHide: true,
|
|
29
|
+
stdio,
|
|
30
|
+
maxBuffer: LARGE_BUFFER,
|
|
31
|
+
killSignal: "SIGTERM"
|
|
32
|
+
});
|
|
33
|
+
}, "run");
|
|
34
|
+
|
|
35
|
+
// src/plugins/tsc.ts
|
|
36
|
+
function bundleTypeDefinitions(filename, outfile, externals, options) {
|
|
37
|
+
const { dependencies, peerDependencies, devDependencies } = __require(joinPaths(options.projectRoot, "package.json"));
|
|
13
38
|
const dependenciesKeys = Object.keys(dependencies ?? {}).flatMap((p) => [
|
|
14
39
|
p,
|
|
15
40
|
getTypeDependencyPackageName(p)
|
|
@@ -31,11 +56,11 @@ function bundleTypeDefinitions(filename, outfile, externals) {
|
|
|
31
56
|
const bundledPackages = includeDeps.filter((dep) => !excludeDeps.has(dep));
|
|
32
57
|
const extractorConfig = ExtractorConfig.prepare({
|
|
33
58
|
configObject: {
|
|
34
|
-
projectFolder:
|
|
59
|
+
projectFolder: options.projectRoot,
|
|
35
60
|
mainEntryPointFilePath: filename,
|
|
36
61
|
bundledPackages,
|
|
37
62
|
compiler: {
|
|
38
|
-
tsconfigFilePath:
|
|
63
|
+
tsconfigFilePath: options.tsconfig,
|
|
39
64
|
overrideTsconfig: {
|
|
40
65
|
compilerOptions: {
|
|
41
66
|
paths: {}
|
|
@@ -45,13 +70,13 @@ function bundleTypeDefinitions(filename, outfile, externals) {
|
|
|
45
70
|
},
|
|
46
71
|
dtsRollup: {
|
|
47
72
|
enabled: true,
|
|
48
|
-
untrimmedFilePath:
|
|
73
|
+
untrimmedFilePath: joinPaths(options.outdir, `${outfile}.d.ts`)
|
|
49
74
|
},
|
|
50
75
|
tsdocMetadata: {
|
|
51
76
|
enabled: false
|
|
52
77
|
}
|
|
53
78
|
},
|
|
54
|
-
packageJsonFullPath:
|
|
79
|
+
packageJsonFullPath: joinPaths(options.projectRoot, "package.json"),
|
|
55
80
|
configObjectFullPath: void 0
|
|
56
81
|
});
|
|
57
82
|
const extractorResult = Extractor.invoke(extractorConfig, {
|
|
@@ -64,34 +89,34 @@ function bundleTypeDefinitions(filename, outfile, externals) {
|
|
|
64
89
|
}
|
|
65
90
|
}
|
|
66
91
|
__name(bundleTypeDefinitions, "bundleTypeDefinitions");
|
|
67
|
-
var tscPlugin = /* @__PURE__ */ __name((
|
|
68
|
-
name: "
|
|
92
|
+
var tscPlugin = /* @__PURE__ */ __name((options, resolvedOptions) => ({
|
|
93
|
+
name: "storm:tsc",
|
|
69
94
|
setup(build) {
|
|
70
|
-
|
|
71
|
-
|
|
95
|
+
if (options.emitTypes === false) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
72
98
|
build.onStart(async () => {
|
|
73
|
-
const config = await loadStormConfig();
|
|
74
99
|
if (process.env.WATCH !== "true" && process.env.DEV !== "true") {
|
|
75
|
-
await run(config, `pnpm exec tsc --project ${
|
|
100
|
+
await run(resolvedOptions.config, `pnpm exec tsc --project ${resolvedOptions.tsconfig}`, resolvedOptions.config.workspaceRoot);
|
|
76
101
|
}
|
|
77
|
-
if (
|
|
78
|
-
const
|
|
79
|
-
const typeOutDir =
|
|
80
|
-
const entryPoint =
|
|
81
|
-
const bundlePath =
|
|
102
|
+
if (resolvedOptions.bundle && resolvedOptions.entryPoints && resolvedOptions.entryPoints.length > 0 && resolvedOptions.entryPoints[0] && resolvedOptions.entryPoints[0].endsWith(".ts")) {
|
|
103
|
+
const sourceRoot = resolvedOptions.sourceRoot.replaceAll(resolvedOptions.projectRoot, "");
|
|
104
|
+
const typeOutDir = resolvedOptions.outdir;
|
|
105
|
+
const entryPoint = resolvedOptions.entryPoints[0].replace(sourceRoot, "").replace(/\.ts$/, "");
|
|
106
|
+
const bundlePath = joinPaths(resolvedOptions.outdir, entryPoint);
|
|
82
107
|
let dtsPath;
|
|
83
|
-
if (await hfs.isFile(
|
|
84
|
-
dtsPath =
|
|
85
|
-
} else if (await hfs.isFile(
|
|
86
|
-
dtsPath =
|
|
108
|
+
if (await hfs.isFile(joinPaths(resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint}.d.ts`))) {
|
|
109
|
+
dtsPath = joinPaths(resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint}.d.ts`);
|
|
110
|
+
} else if (await hfs.isFile(joinPaths(resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint.replace(/^src\//, "")}.d.ts`))) {
|
|
111
|
+
dtsPath = joinPaths(resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint.replace(/^src\//, "")}.d.ts`);
|
|
87
112
|
}
|
|
88
|
-
const ext =
|
|
113
|
+
const ext = resolvedOptions.outExtension.dts || resolvedOptions.format === "esm" ? "d.mts" : "d.ts";
|
|
89
114
|
if (process.env.WATCH !== "true" && process.env.DEV !== "true") {
|
|
90
|
-
bundleTypeDefinitions(dtsPath, bundlePath,
|
|
115
|
+
bundleTypeDefinitions(dtsPath, bundlePath, resolvedOptions.external ?? [], resolvedOptions);
|
|
91
116
|
const dtsContents = await hfs.text(`${bundlePath}.d.ts`);
|
|
92
117
|
await hfs.write(`${bundlePath}.${ext}`, dtsContents);
|
|
93
118
|
} else {
|
|
94
|
-
await hfs.write(`${bundlePath}.${ext}`, `export * from '
|
|
119
|
+
await hfs.write(`${bundlePath}.${ext}`, `export * from './${entryPoint}'`);
|
|
95
120
|
}
|
|
96
121
|
}
|
|
97
122
|
});
|
|
@@ -109,4 +134,3 @@ __name(getTypeDependencyPackageName, "getTypeDependencyPackageName");
|
|
|
109
134
|
export {
|
|
110
135
|
tscPlugin
|
|
111
136
|
};
|
|
112
|
-
//# sourceMappingURL=chunk-KJ7ZHAFS.js.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunkBGYQAVKQcjs = require('./chunk-BGYQAVKQ.cjs');
|
|
4
|
+
|
|
5
|
+
// ../config-tools/src/utilities/correct-paths.ts
|
|
6
|
+
var _devkit = require('@nx/devkit');
|
|
7
|
+
var correctPaths = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (path) => {
|
|
8
|
+
if (!path) {
|
|
9
|
+
return "";
|
|
10
|
+
}
|
|
11
|
+
if (!path.toUpperCase().startsWith("C:") && path.includes("\\")) {
|
|
12
|
+
path = `C:${path}`;
|
|
13
|
+
}
|
|
14
|
+
return path.replaceAll("\\", "/");
|
|
15
|
+
}, "correctPaths");
|
|
16
|
+
var joinPaths = /* @__PURE__ */ _chunkBGYQAVKQcjs.__name.call(void 0, (...paths) => {
|
|
17
|
+
if (!paths || paths.length === 0) {
|
|
18
|
+
return "";
|
|
19
|
+
}
|
|
20
|
+
return correctPaths(_devkit.joinPathFragments.call(void 0, ...paths.map((path) => correctPaths(path))));
|
|
21
|
+
}, "joinPaths");
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
exports.correctPaths = correctPaths; exports.joinPaths = joinPaths;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__name
|
|
3
|
+
} from "./chunk-3GQAWCBQ.js";
|
|
4
|
+
|
|
5
|
+
// src/plugins/node-protocol.ts
|
|
6
|
+
var nodeProtocolPlugin = /* @__PURE__ */ __name((options, resolvedOptions) => {
|
|
7
|
+
const nodeProtocol = "node:";
|
|
8
|
+
return {
|
|
9
|
+
name: "node-protocol-plugin",
|
|
10
|
+
setup({ onResolve }) {
|
|
11
|
+
onResolve({
|
|
12
|
+
filter: /^node:/
|
|
13
|
+
}, ({ path }) => ({
|
|
14
|
+
path: path.slice(nodeProtocol.length),
|
|
15
|
+
external: true
|
|
16
|
+
}));
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
}, "nodeProtocolPlugin");
|
|
20
|
+
|
|
21
|
+
export {
|
|
22
|
+
nodeProtocolPlugin
|
|
23
|
+
};
|