@storm-software/esbuild 0.34.2 → 0.34.3
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 +2 -1
- package/bin/esbuild.cjs +12143 -158
- package/dist/assets.cjs +9 -0
- package/dist/assets.d.cts +16 -0
- package/dist/assets.d.ts +16 -0
- package/dist/assets.js +9 -0
- package/dist/build.cjs +13 -17
- package/dist/build.d.cts +3 -13
- package/dist/build.d.ts +3 -13
- package/dist/build.js +14 -18
- package/dist/chunk-2CM3VAO5.cjs +119 -0
- package/dist/{chunk-Y7JBB452.js → chunk-4D6ICA75.js} +36 -3
- package/dist/{chunk-5RVOO3YF.js → chunk-ABRK5MYP.js} +3 -5
- package/dist/chunk-CVOQEYHW.cjs +117 -0
- package/dist/{chunk-3PF5YMWK.js → chunk-DNZNN5SK.js} +2 -2
- package/dist/chunk-EBTMX5WL.js +117 -0
- package/dist/chunk-ECCVVXNX.js +100 -0
- package/dist/chunk-EDLA3ZZN.js +26 -0
- package/dist/{chunk-GJHRTQAS.cjs → chunk-EVDNG72R.cjs} +35 -37
- package/dist/{chunk-TDBBRZTC.cjs → chunk-FQQYNAPT.cjs} +111 -189
- package/dist/{chunk-QKJ7KLDL.cjs → chunk-G66JI4BS.cjs} +5 -7
- package/dist/{chunk-SKJRUPDP.js → chunk-NJJBR57W.js} +24 -102
- package/dist/{chunk-STCE44IS.js → chunk-OCDIIBBZ.js} +2 -2
- package/dist/{chunk-M3AOQRGN.cjs → chunk-PTHYT3U2.cjs} +188 -582
- package/dist/chunk-QVMJLFU5.cjs +26 -0
- package/dist/{chunk-DPRINYB6.js → chunk-QWTKBUQW.js} +40 -434
- package/dist/chunk-R2KKGNQL.js +119 -0
- package/dist/{chunk-TH2QFJHI.cjs → chunk-RK34D7S5.cjs} +6 -6
- package/dist/chunk-SLSBBNRF.cjs +52 -0
- package/dist/{chunk-VQHKIS7J.js → chunk-TSQT5MWW.js} +2 -4
- package/dist/{chunk-BNPCRQK4.cjs → chunk-VTBMJYSM.cjs} +6 -6
- package/dist/chunk-WLJT52I3.cjs +100 -0
- package/dist/chunk-WXURMFT7.js +52 -0
- package/dist/{chunk-VPTKC3UK.cjs → chunk-YHMM6RY5.cjs} +42 -9
- package/dist/clean.cjs +4 -5
- package/dist/clean.d.cts +1 -2
- package/dist/clean.d.ts +1 -2
- package/dist/clean.js +3 -4
- package/dist/config.cjs +5 -14
- package/dist/config.d.cts +4 -6
- package/dist/config.d.ts +4 -6
- package/dist/config.js +6 -15
- package/dist/context.cjs +11 -0
- package/dist/context.d.cts +16 -0
- package/dist/context.d.ts +16 -0
- package/dist/context.js +11 -0
- package/dist/index.cjs +14 -52
- package/dist/index.d.cts +3 -216
- package/dist/index.d.ts +3 -216
- package/dist/index.js +15 -53
- package/dist/package-json.cjs +9 -0
- package/dist/package-json.d.cts +16 -0
- package/dist/package-json.d.ts +16 -0
- package/dist/package-json.js +9 -0
- package/dist/plugins/deps-check.cjs +4 -5
- package/dist/plugins/deps-check.js +3 -4
- package/dist/plugins/resolve-paths.cjs +3 -4
- package/dist/plugins/resolve-paths.d.cts +3 -4
- package/dist/plugins/resolve-paths.d.ts +3 -4
- package/dist/plugins/resolve-paths.js +2 -3
- package/dist/tsup.cjs +8 -0
- package/dist/tsup.d.cts +16 -0
- package/dist/tsup.d.ts +16 -0
- package/dist/tsup.js +8 -0
- package/dist/types.d.cts +1 -2
- package/dist/types.d.ts +1 -2
- package/dist/watch.cjs +111 -0
- package/dist/watch.d.cts +18 -0
- package/dist/watch.d.ts +18 -0
- package/dist/watch.js +111 -0
- package/package.json +59 -38
- package/dist/chunk-27VOV3G4.cjs +0 -23
- package/dist/chunk-2TG2H4XL.js +0 -29
- package/dist/chunk-2X5ZMEAN.js +0 -167
- package/dist/chunk-3QHFCKSI.js +0 -140
- package/dist/chunk-AZON722Q.js +0 -23
- package/dist/chunk-B4CUDMY2.cjs +0 -39
- package/dist/chunk-BOFHC4OE.cjs +0 -26
- package/dist/chunk-BWSIRV3D.js +0 -26
- package/dist/chunk-CCEWV2BR.js +0 -39
- package/dist/chunk-CGMLIVTB.cjs +0 -167
- package/dist/chunk-ILJQ4NCE.cjs +0 -29
- package/dist/chunk-N62ZR7UV.cjs +0 -140
- package/dist/chunk-RLQJRD62.cjs +0 -27
- package/dist/chunk-UYE6LM4C.js +0 -60
- package/dist/chunk-XLUZXKDY.js +0 -27
- package/dist/chunk-Y5SBBYX3.cjs +0 -60
- package/dist/plugins/esm-split-code-to-cjs.cjs +0 -7
- package/dist/plugins/esm-split-code-to-cjs.d.cts +0 -15
- package/dist/plugins/esm-split-code-to-cjs.d.ts +0 -15
- package/dist/plugins/esm-split-code-to-cjs.js +0 -7
- package/dist/plugins/fix-imports.cjs +0 -7
- package/dist/plugins/fix-imports.d.cts +0 -14
- package/dist/plugins/fix-imports.d.ts +0 -14
- package/dist/plugins/fix-imports.js +0 -7
- package/dist/plugins/native-node-module.cjs +0 -7
- package/dist/plugins/native-node-module.d.cts +0 -11
- package/dist/plugins/native-node-module.d.ts +0 -11
- package/dist/plugins/native-node-module.js +0 -7
- package/dist/plugins/node-protocol.cjs +0 -7
- package/dist/plugins/node-protocol.d.cts +0 -15
- package/dist/plugins/node-protocol.d.ts +0 -15
- package/dist/plugins/node-protocol.js +0 -7
- package/dist/plugins/on-error.cjs +0 -9
- package/dist/plugins/on-error.d.cts +0 -14
- package/dist/plugins/on-error.d.ts +0 -14
- package/dist/plugins/on-error.js +0 -9
- package/dist/plugins/tsc.cjs +0 -9
- package/dist/plugins/tsc.d.cts +0 -14
- package/dist/plugins/tsc.d.ts +0 -14
- package/dist/plugins/tsc.js +0 -9
- package/dist/tsc.cjs +0 -17
- package/dist/tsc.d.cts +0 -21
- package/dist/tsc.d.ts +0 -21
- package/dist/tsc.js +0 -17
- package/dist/types-B4jbZA4j.d.cts +0 -1286
- package/dist/types-B4jbZA4j.d.ts +0 -1286
package/dist/chunk-N62ZR7UV.cjs
DELETED
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
-
|
|
3
|
-
var _chunkGJHRTQAScjs = require('./chunk-GJHRTQAS.cjs');
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var _chunkVPTKC3UKcjs = require('./chunk-VPTKC3UK.cjs');
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var _chunkB4CUDMY2cjs = require('./chunk-B4CUDMY2.cjs');
|
|
11
|
-
|
|
12
|
-
// src/plugins/tsc.ts
|
|
13
|
-
var _apiextractor = require('@microsoft/api-extractor');
|
|
14
|
-
|
|
15
|
-
// ../config-tools/src/utilities/run.ts
|
|
16
|
-
var _child_process = require('child_process');
|
|
17
|
-
var LARGE_BUFFER = 1024 * 1e6;
|
|
18
|
-
var run = /* @__PURE__ */ _chunkB4CUDMY2cjs.__name.call(void 0, (config, command, cwd = _nullishCoalesce(config.workspaceRoot, () => ( process.cwd())), stdio = "inherit", env = process.env) => {
|
|
19
|
-
return _child_process.execSync.call(void 0, command, {
|
|
20
|
-
cwd,
|
|
21
|
-
env: {
|
|
22
|
-
...process.env,
|
|
23
|
-
...env,
|
|
24
|
-
CLICOLOR: "true",
|
|
25
|
-
FORCE_COLOR: "true"
|
|
26
|
-
},
|
|
27
|
-
windowsHide: true,
|
|
28
|
-
stdio,
|
|
29
|
-
maxBuffer: LARGE_BUFFER,
|
|
30
|
-
killSignal: "SIGTERM"
|
|
31
|
-
});
|
|
32
|
-
}, "run");
|
|
33
|
-
|
|
34
|
-
// src/plugins/tsc.ts
|
|
35
|
-
var _fs = require('fs');
|
|
36
|
-
var _promises = require('fs/promises'); var _promises2 = _interopRequireDefault(_promises);
|
|
37
|
-
function bundleTypeDefinitions(filename, outfile, context) {
|
|
38
|
-
const { dependencies, peerDependencies, devDependencies } = _chunkB4CUDMY2cjs.__require.call(void 0, _chunkVPTKC3UKcjs.joinPaths.call(void 0, context.workspaceConfig.workspaceRoot, "package.json"));
|
|
39
|
-
const dependenciesKeys = Object.keys(_nullishCoalesce(dependencies, () => ( {}))).flatMap((p) => [
|
|
40
|
-
p,
|
|
41
|
-
getTypeDependencyPackageName(p)
|
|
42
|
-
]);
|
|
43
|
-
const peerDependenciesKeys = Object.keys(_nullishCoalesce(peerDependencies, () => ( {}))).flatMap((p) => [
|
|
44
|
-
p,
|
|
45
|
-
getTypeDependencyPackageName(p)
|
|
46
|
-
]);
|
|
47
|
-
const devDependenciesKeys = Object.keys(_nullishCoalesce(devDependencies, () => ( {}))).flatMap((p) => [
|
|
48
|
-
p,
|
|
49
|
-
getTypeDependencyPackageName(p)
|
|
50
|
-
]);
|
|
51
|
-
const includeDeps = devDependenciesKeys;
|
|
52
|
-
const excludeDeps = /* @__PURE__ */ new Set([
|
|
53
|
-
...dependenciesKeys,
|
|
54
|
-
...peerDependenciesKeys,
|
|
55
|
-
..._nullishCoalesce(context.options.external, () => ( []))
|
|
56
|
-
]);
|
|
57
|
-
const bundledPackages = includeDeps.filter((dep) => !excludeDeps.has(dep));
|
|
58
|
-
const extractorConfig = _apiextractor.ExtractorConfig.prepare({
|
|
59
|
-
configObject: {
|
|
60
|
-
projectFolder: context.options.projectRoot,
|
|
61
|
-
mainEntryPointFilePath: filename,
|
|
62
|
-
bundledPackages,
|
|
63
|
-
compiler: {
|
|
64
|
-
tsconfigFilePath: context.options.tsconfig,
|
|
65
|
-
overrideTsconfig: {
|
|
66
|
-
compilerOptions: {
|
|
67
|
-
paths: {}
|
|
68
|
-
// bug with api extract + paths
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
dtsRollup: {
|
|
73
|
-
enabled: true,
|
|
74
|
-
untrimmedFilePath: _chunkVPTKC3UKcjs.joinPaths.call(void 0, context.workspaceConfig.workspaceRoot, `${outfile}.d.ts`)
|
|
75
|
-
},
|
|
76
|
-
tsdocMetadata: {
|
|
77
|
-
enabled: false
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
packageJsonFullPath: _chunkVPTKC3UKcjs.joinPaths.call(void 0, context.workspaceConfig.workspaceRoot, "package.json"),
|
|
81
|
-
configObjectFullPath: void 0
|
|
82
|
-
});
|
|
83
|
-
const extractorResult = _apiextractor.Extractor.invoke(extractorConfig, {
|
|
84
|
-
showVerboseMessages: true,
|
|
85
|
-
localBuild: true
|
|
86
|
-
});
|
|
87
|
-
if (extractorResult.succeeded === false) {
|
|
88
|
-
_chunkGJHRTQAScjs.writeError.call(void 0, `API Extractor completed with ${extractorResult.errorCount} ${extractorResult.errorCount === 1 ? "error" : "errors"}`);
|
|
89
|
-
throw new Error("API Extractor completed with errors");
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
_chunkB4CUDMY2cjs.__name.call(void 0, bundleTypeDefinitions, "bundleTypeDefinitions");
|
|
93
|
-
var tscPlugin = /* @__PURE__ */ _chunkB4CUDMY2cjs.__name.call(void 0, (context) => ({
|
|
94
|
-
name: "storm:tsc",
|
|
95
|
-
setup(build) {
|
|
96
|
-
if (context.options.dts === false) {
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
build.onStart(async () => {
|
|
100
|
-
if (process.env.WATCH !== "true" && process.env.DEV !== "true") {
|
|
101
|
-
await run(context.workspaceConfig, `pnpm exec tsc --project ${context.options.tsconfig}`, context.workspaceConfig.workspaceRoot);
|
|
102
|
-
}
|
|
103
|
-
if (context.options.bundle && context.options.entry) {
|
|
104
|
-
const sourceRoot = context.sourceRoot.replaceAll(context.options.projectRoot, "");
|
|
105
|
-
const typeOutDir = context.options.outputPath || _chunkVPTKC3UKcjs.joinPaths.call(void 0, context.workspaceConfig.workspaceRoot, "dist", context.options.projectRoot);
|
|
106
|
-
const entries = Array.isArray(context.options.entry) ? context.options.entry : Object.values(context.options.entry);
|
|
107
|
-
for (const entry of entries) {
|
|
108
|
-
const entryPoint = entry.replace(sourceRoot, "").replace(/\.ts$/, "");
|
|
109
|
-
const bundlePath = _chunkVPTKC3UKcjs.joinPaths.call(void 0, typeOutDir, entryPoint);
|
|
110
|
-
let dtsPath;
|
|
111
|
-
if (_fs.existsSync.call(void 0, _chunkVPTKC3UKcjs.joinPaths.call(void 0, context.workspaceConfig.workspaceRoot, typeOutDir, `${entryPoint}.d.ts`))) {
|
|
112
|
-
dtsPath = _chunkVPTKC3UKcjs.joinPaths.call(void 0, context.workspaceConfig.workspaceRoot, typeOutDir, `${entryPoint}.d.ts`);
|
|
113
|
-
} else if (_fs.existsSync.call(void 0, _chunkVPTKC3UKcjs.joinPaths.call(void 0, context.workspaceConfig.workspaceRoot, typeOutDir, `${entryPoint.replace(/^src\//, "")}.d.ts`))) {
|
|
114
|
-
dtsPath = _chunkVPTKC3UKcjs.joinPaths.call(void 0, context.workspaceConfig.workspaceRoot, typeOutDir, `${entryPoint.replace(/^src\//, "")}.d.ts`);
|
|
115
|
-
}
|
|
116
|
-
const ext = (Array.isArray(context.options.format) ? _optionalChain([context, 'access', _ => _.options, 'access', _2 => _2.format, 'optionalAccess', _3 => _3.some, 'call', _4 => _4((format) => format === "esm")]) : context.options.format === "esm") ? "d.mts" : "d.ts";
|
|
117
|
-
if (process.env.WATCH !== "true" && process.env.DEV !== "true") {
|
|
118
|
-
bundleTypeDefinitions(dtsPath, bundlePath, context);
|
|
119
|
-
const dtsContents = await _promises2.default.readFile(`${bundlePath}.d.ts`, "utf8");
|
|
120
|
-
await _promises2.default.writeFile(`${bundlePath}.${ext}`, dtsContents);
|
|
121
|
-
} else {
|
|
122
|
-
await _promises2.default.writeFile(`${bundlePath}.${ext}`, `export * from './${entryPoint}'`);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
}), "tscPlugin");
|
|
129
|
-
function getTypeDependencyPackageName(npmPackage) {
|
|
130
|
-
if (npmPackage.startsWith("@")) {
|
|
131
|
-
const [scope, name] = npmPackage.split("/");
|
|
132
|
-
return `@types/${_optionalChain([scope, 'optionalAccess', _5 => _5.slice, 'call', _6 => _6(1)])}__${name}`;
|
|
133
|
-
}
|
|
134
|
-
return `@types/${npmPackage}`;
|
|
135
|
-
}
|
|
136
|
-
_chunkB4CUDMY2cjs.__name.call(void 0, getTypeDependencyPackageName, "getTypeDependencyPackageName");
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
exports.tscPlugin = tscPlugin;
|
package/dist/chunk-RLQJRD62.cjs
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
-
|
|
3
|
-
var _chunkB4CUDMY2cjs = require('./chunk-B4CUDMY2.cjs');
|
|
4
|
-
|
|
5
|
-
// src/plugins/esm-split-code-to-cjs.ts
|
|
6
|
-
var _esbuild = require('esbuild'); var esbuild = _interopRequireWildcard(_esbuild);
|
|
7
|
-
var esmSplitCodeToCjsPlugin = /* @__PURE__ */ _chunkB4CUDMY2cjs.__name.call(void 0, (options, resolvedOptions) => ({
|
|
8
|
-
name: "storm:esm-split-code-to-cjs",
|
|
9
|
-
setup(build2) {
|
|
10
|
-
build2.onEnd(async (result) => {
|
|
11
|
-
const outFiles = Object.keys(_nullishCoalesce(_optionalChain([result, 'access', _ => _.metafile, 'optionalAccess', _2 => _2.outputs]), () => ( {})));
|
|
12
|
-
const jsFiles = outFiles.filter((f) => f.endsWith("js"));
|
|
13
|
-
await esbuild.build({
|
|
14
|
-
outdir: resolvedOptions.outputPath,
|
|
15
|
-
entryPoints: jsFiles,
|
|
16
|
-
allowOverwrite: true,
|
|
17
|
-
format: "cjs",
|
|
18
|
-
logLevel: "error",
|
|
19
|
-
packages: "external"
|
|
20
|
-
});
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
}), "esmSplitCodeToCjsPlugin");
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
exports.esmSplitCodeToCjsPlugin = esmSplitCodeToCjsPlugin;
|
package/dist/chunk-UYE6LM4C.js
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__name,
|
|
3
|
-
__require
|
|
4
|
-
} from "./chunk-CCEWV2BR.js";
|
|
5
|
-
|
|
6
|
-
// src/plugins/native-node-module.ts
|
|
7
|
-
import { dirname } from "node:path";
|
|
8
|
-
var nativeNodeModulesPlugin = /* @__PURE__ */ __name((options, resolvedOptions) => {
|
|
9
|
-
return {
|
|
10
|
-
name: "native-node-modules",
|
|
11
|
-
setup(build) {
|
|
12
|
-
build.onResolve({
|
|
13
|
-
filter: /\.node$/,
|
|
14
|
-
namespace: "file"
|
|
15
|
-
}, (args) => {
|
|
16
|
-
const resolvedId = __require.resolve(args.path, {
|
|
17
|
-
paths: [
|
|
18
|
-
args.resolveDir
|
|
19
|
-
]
|
|
20
|
-
});
|
|
21
|
-
if (resolvedId.endsWith(".node")) {
|
|
22
|
-
return {
|
|
23
|
-
path: resolvedId,
|
|
24
|
-
namespace: "node-file"
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
return {
|
|
28
|
-
path: resolvedId
|
|
29
|
-
};
|
|
30
|
-
});
|
|
31
|
-
build.onLoad({
|
|
32
|
-
filter: /.*/,
|
|
33
|
-
namespace: "node-file"
|
|
34
|
-
}, (args) => {
|
|
35
|
-
return {
|
|
36
|
-
contents: `
|
|
37
|
-
import path from ${JSON.stringify(args.path)}
|
|
38
|
-
try { module.exports = require(path) }
|
|
39
|
-
catch {}
|
|
40
|
-
`,
|
|
41
|
-
resolveDir: dirname(args.path)
|
|
42
|
-
};
|
|
43
|
-
});
|
|
44
|
-
build.onResolve({
|
|
45
|
-
filter: /\.node$/,
|
|
46
|
-
namespace: "node-file"
|
|
47
|
-
}, (args) => ({
|
|
48
|
-
path: args.path,
|
|
49
|
-
namespace: "file"
|
|
50
|
-
}));
|
|
51
|
-
const opts = build.initialOptions;
|
|
52
|
-
opts.loader = opts.loader || {};
|
|
53
|
-
opts.loader[".node"] = "file";
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
}, "nativeNodeModulesPlugin");
|
|
57
|
-
|
|
58
|
-
export {
|
|
59
|
-
nativeNodeModulesPlugin
|
|
60
|
-
};
|
package/dist/chunk-XLUZXKDY.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__name
|
|
3
|
-
} from "./chunk-CCEWV2BR.js";
|
|
4
|
-
|
|
5
|
-
// src/plugins/esm-split-code-to-cjs.ts
|
|
6
|
-
import * as esbuild from "esbuild";
|
|
7
|
-
var esmSplitCodeToCjsPlugin = /* @__PURE__ */ __name((options, resolvedOptions) => ({
|
|
8
|
-
name: "storm:esm-split-code-to-cjs",
|
|
9
|
-
setup(build2) {
|
|
10
|
-
build2.onEnd(async (result) => {
|
|
11
|
-
const outFiles = Object.keys(result.metafile?.outputs ?? {});
|
|
12
|
-
const jsFiles = outFiles.filter((f) => f.endsWith("js"));
|
|
13
|
-
await esbuild.build({
|
|
14
|
-
outdir: resolvedOptions.outputPath,
|
|
15
|
-
entryPoints: jsFiles,
|
|
16
|
-
allowOverwrite: true,
|
|
17
|
-
format: "cjs",
|
|
18
|
-
logLevel: "error",
|
|
19
|
-
packages: "external"
|
|
20
|
-
});
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
}), "esmSplitCodeToCjsPlugin");
|
|
24
|
-
|
|
25
|
-
export {
|
|
26
|
-
esmSplitCodeToCjsPlugin
|
|
27
|
-
};
|
package/dist/chunk-Y5SBBYX3.cjs
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var _chunkB4CUDMY2cjs = require('./chunk-B4CUDMY2.cjs');
|
|
5
|
-
|
|
6
|
-
// src/plugins/native-node-module.ts
|
|
7
|
-
var _path = require('path');
|
|
8
|
-
var nativeNodeModulesPlugin = /* @__PURE__ */ _chunkB4CUDMY2cjs.__name.call(void 0, (options, resolvedOptions) => {
|
|
9
|
-
return {
|
|
10
|
-
name: "native-node-modules",
|
|
11
|
-
setup(build) {
|
|
12
|
-
build.onResolve({
|
|
13
|
-
filter: /\.node$/,
|
|
14
|
-
namespace: "file"
|
|
15
|
-
}, (args) => {
|
|
16
|
-
const resolvedId = _chunkB4CUDMY2cjs.__require.resolve(args.path, {
|
|
17
|
-
paths: [
|
|
18
|
-
args.resolveDir
|
|
19
|
-
]
|
|
20
|
-
});
|
|
21
|
-
if (resolvedId.endsWith(".node")) {
|
|
22
|
-
return {
|
|
23
|
-
path: resolvedId,
|
|
24
|
-
namespace: "node-file"
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
return {
|
|
28
|
-
path: resolvedId
|
|
29
|
-
};
|
|
30
|
-
});
|
|
31
|
-
build.onLoad({
|
|
32
|
-
filter: /.*/,
|
|
33
|
-
namespace: "node-file"
|
|
34
|
-
}, (args) => {
|
|
35
|
-
return {
|
|
36
|
-
contents: `
|
|
37
|
-
import path from ${JSON.stringify(args.path)}
|
|
38
|
-
try { module.exports = require(path) }
|
|
39
|
-
catch {}
|
|
40
|
-
`,
|
|
41
|
-
resolveDir: _path.dirname.call(void 0, args.path)
|
|
42
|
-
};
|
|
43
|
-
});
|
|
44
|
-
build.onResolve({
|
|
45
|
-
filter: /\.node$/,
|
|
46
|
-
namespace: "node-file"
|
|
47
|
-
}, (args) => ({
|
|
48
|
-
path: args.path,
|
|
49
|
-
namespace: "file"
|
|
50
|
-
}));
|
|
51
|
-
const opts = build.initialOptions;
|
|
52
|
-
opts.loader = opts.loader || {};
|
|
53
|
-
opts.loader[".node"] = "file";
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
}, "nativeNodeModulesPlugin");
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
exports.nativeNodeModulesPlugin = nativeNodeModulesPlugin;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import * as esbuild from 'esbuild';
|
|
2
|
-
import { ESBuildOptions } from '../types.cjs';
|
|
3
|
-
import '@nx/devkit';
|
|
4
|
-
import '@storm-software/build-tools';
|
|
5
|
-
import '../types-B4jbZA4j.cjs';
|
|
6
|
-
import 'zod';
|
|
7
|
-
import 'tsup';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Code splitting only works in ESM at the moment, this plugin will convert the
|
|
11
|
-
* ESM code to CJS automatically after the build. Only works with `outdir` set.
|
|
12
|
-
*/
|
|
13
|
-
declare const esmSplitCodeToCjsPlugin: (options: ESBuildOptions, resolvedOptions: ESBuildOptions) => esbuild.Plugin;
|
|
14
|
-
|
|
15
|
-
export { esmSplitCodeToCjsPlugin };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import * as esbuild from 'esbuild';
|
|
2
|
-
import { ESBuildOptions } from '../types.js';
|
|
3
|
-
import '@nx/devkit';
|
|
4
|
-
import '@storm-software/build-tools';
|
|
5
|
-
import '../types-B4jbZA4j.js';
|
|
6
|
-
import 'zod';
|
|
7
|
-
import 'tsup';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Code splitting only works in ESM at the moment, this plugin will convert the
|
|
11
|
-
* ESM code to CJS automatically after the build. Only works with `outdir` set.
|
|
12
|
-
*/
|
|
13
|
-
declare const esmSplitCodeToCjsPlugin: (options: ESBuildOptions, resolvedOptions: ESBuildOptions) => esbuild.Plugin;
|
|
14
|
-
|
|
15
|
-
export { esmSplitCodeToCjsPlugin };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import * as esbuild from 'esbuild';
|
|
2
|
-
import { ESBuildOptions } from '../types.cjs';
|
|
3
|
-
import '@nx/devkit';
|
|
4
|
-
import '@storm-software/build-tools';
|
|
5
|
-
import '../types-B4jbZA4j.cjs';
|
|
6
|
-
import 'zod';
|
|
7
|
-
import 'tsup';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* For dependencies that forgot to add them into their package.json.
|
|
11
|
-
*/
|
|
12
|
-
declare const fixImportsPlugin: (options: ESBuildOptions, resolvedOptions: ESBuildOptions) => esbuild.Plugin;
|
|
13
|
-
|
|
14
|
-
export { fixImportsPlugin };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import * as esbuild from 'esbuild';
|
|
2
|
-
import { ESBuildOptions } from '../types.js';
|
|
3
|
-
import '@nx/devkit';
|
|
4
|
-
import '@storm-software/build-tools';
|
|
5
|
-
import '../types-B4jbZA4j.js';
|
|
6
|
-
import 'zod';
|
|
7
|
-
import 'tsup';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* For dependencies that forgot to add them into their package.json.
|
|
11
|
-
*/
|
|
12
|
-
declare const fixImportsPlugin: (options: ESBuildOptions, resolvedOptions: ESBuildOptions) => esbuild.Plugin;
|
|
13
|
-
|
|
14
|
-
export { fixImportsPlugin };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import * as esbuild from 'esbuild';
|
|
2
|
-
import { ESBuildOptions } from '../types.cjs';
|
|
3
|
-
import '@nx/devkit';
|
|
4
|
-
import '@storm-software/build-tools';
|
|
5
|
-
import '../types-B4jbZA4j.cjs';
|
|
6
|
-
import 'zod';
|
|
7
|
-
import 'tsup';
|
|
8
|
-
|
|
9
|
-
declare const nativeNodeModulesPlugin: (options: ESBuildOptions, resolvedOptions: ESBuildOptions) => esbuild.Plugin;
|
|
10
|
-
|
|
11
|
-
export { nativeNodeModulesPlugin };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import * as esbuild from 'esbuild';
|
|
2
|
-
import { ESBuildOptions } from '../types.js';
|
|
3
|
-
import '@nx/devkit';
|
|
4
|
-
import '@storm-software/build-tools';
|
|
5
|
-
import '../types-B4jbZA4j.js';
|
|
6
|
-
import 'zod';
|
|
7
|
-
import 'tsup';
|
|
8
|
-
|
|
9
|
-
declare const nativeNodeModulesPlugin: (options: ESBuildOptions, resolvedOptions: ESBuildOptions) => esbuild.Plugin;
|
|
10
|
-
|
|
11
|
-
export { nativeNodeModulesPlugin };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import * as esbuild from 'esbuild';
|
|
2
|
-
import { ESBuildOptions } from '../types.cjs';
|
|
3
|
-
import '@nx/devkit';
|
|
4
|
-
import '@storm-software/build-tools';
|
|
5
|
-
import '../types-B4jbZA4j.cjs';
|
|
6
|
-
import 'zod';
|
|
7
|
-
import 'tsup';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* The node: protocol was added to require in Node v14.18.0
|
|
11
|
-
* https://nodejs.org/api/esm.html#node-imports
|
|
12
|
-
*/
|
|
13
|
-
declare const nodeProtocolPlugin: (options: ESBuildOptions, resolvedOptions: ESBuildOptions) => esbuild.Plugin;
|
|
14
|
-
|
|
15
|
-
export { nodeProtocolPlugin };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import * as esbuild from 'esbuild';
|
|
2
|
-
import { ESBuildOptions } from '../types.js';
|
|
3
|
-
import '@nx/devkit';
|
|
4
|
-
import '@storm-software/build-tools';
|
|
5
|
-
import '../types-B4jbZA4j.js';
|
|
6
|
-
import 'zod';
|
|
7
|
-
import 'tsup';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* The node: protocol was added to require in Node v14.18.0
|
|
11
|
-
* https://nodejs.org/api/esm.html#node-imports
|
|
12
|
-
*/
|
|
13
|
-
declare const nodeProtocolPlugin: (options: ESBuildOptions, resolvedOptions: ESBuildOptions) => esbuild.Plugin;
|
|
14
|
-
|
|
15
|
-
export { nodeProtocolPlugin };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
var _chunkBOFHC4OEcjs = require('../chunk-BOFHC4OE.cjs');
|
|
4
|
-
require('../chunk-GJHRTQAS.cjs');
|
|
5
|
-
require('../chunk-VPTKC3UK.cjs');
|
|
6
|
-
require('../chunk-B4CUDMY2.cjs');
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
exports.onErrorPlugin = _chunkBOFHC4OEcjs.onErrorPlugin;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import * as esbuild from 'esbuild';
|
|
2
|
-
import { ESBuildOptions } from '../types.cjs';
|
|
3
|
-
import '@nx/devkit';
|
|
4
|
-
import '@storm-software/build-tools';
|
|
5
|
-
import '../types-B4jbZA4j.cjs';
|
|
6
|
-
import 'zod';
|
|
7
|
-
import 'tsup';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Causes esbuild to exit immediately with an error code.
|
|
11
|
-
*/
|
|
12
|
-
declare const onErrorPlugin: (options: ESBuildOptions, resolvedOptions: ESBuildOptions) => esbuild.Plugin;
|
|
13
|
-
|
|
14
|
-
export { onErrorPlugin };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import * as esbuild from 'esbuild';
|
|
2
|
-
import { ESBuildOptions } from '../types.js';
|
|
3
|
-
import '@nx/devkit';
|
|
4
|
-
import '@storm-software/build-tools';
|
|
5
|
-
import '../types-B4jbZA4j.js';
|
|
6
|
-
import 'zod';
|
|
7
|
-
import 'tsup';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Causes esbuild to exit immediately with an error code.
|
|
11
|
-
*/
|
|
12
|
-
declare const onErrorPlugin: (options: ESBuildOptions, resolvedOptions: ESBuildOptions) => esbuild.Plugin;
|
|
13
|
-
|
|
14
|
-
export { onErrorPlugin };
|
package/dist/plugins/on-error.js
DELETED
package/dist/plugins/tsc.cjs
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
var _chunkN62ZR7UVcjs = require('../chunk-N62ZR7UV.cjs');
|
|
4
|
-
require('../chunk-GJHRTQAS.cjs');
|
|
5
|
-
require('../chunk-VPTKC3UK.cjs');
|
|
6
|
-
require('../chunk-B4CUDMY2.cjs');
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
exports.tscPlugin = _chunkN62ZR7UVcjs.tscPlugin;
|
package/dist/plugins/tsc.d.cts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import * as esbuild from 'esbuild';
|
|
2
|
-
import { ESBuildContext } from '../types.cjs';
|
|
3
|
-
import '@nx/devkit';
|
|
4
|
-
import '@storm-software/build-tools';
|
|
5
|
-
import '../types-B4jbZA4j.cjs';
|
|
6
|
-
import 'zod';
|
|
7
|
-
import 'tsup';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Triggers the TypeScript compiler and the type bundler.
|
|
11
|
-
*/
|
|
12
|
-
declare const tscPlugin: (context: ESBuildContext) => esbuild.Plugin;
|
|
13
|
-
|
|
14
|
-
export { tscPlugin };
|
package/dist/plugins/tsc.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import * as esbuild from 'esbuild';
|
|
2
|
-
import { ESBuildContext } from '../types.js';
|
|
3
|
-
import '@nx/devkit';
|
|
4
|
-
import '@storm-software/build-tools';
|
|
5
|
-
import '../types-B4jbZA4j.js';
|
|
6
|
-
import 'zod';
|
|
7
|
-
import 'tsup';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Triggers the TypeScript compiler and the type bundler.
|
|
11
|
-
*/
|
|
12
|
-
declare const tscPlugin: (context: ESBuildContext) => esbuild.Plugin;
|
|
13
|
-
|
|
14
|
-
export { tscPlugin };
|
package/dist/plugins/tsc.js
DELETED
package/dist/tsc.cjs
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var _chunkCGMLIVTBcjs = require('./chunk-CGMLIVTB.cjs');
|
|
8
|
-
require('./chunk-GJHRTQAS.cjs');
|
|
9
|
-
require('./chunk-VPTKC3UK.cjs');
|
|
10
|
-
require('./chunk-B4CUDMY2.cjs');
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
exports.emitDts = _chunkCGMLIVTBcjs.emitDts; exports.emitDtsFiles = _chunkCGMLIVTBcjs.emitDtsFiles; exports.ensureTempDeclarationDir = _chunkCGMLIVTBcjs.ensureTempDeclarationDir; exports.slash = _chunkCGMLIVTBcjs.slash; exports.toAbsolutePath = _chunkCGMLIVTBcjs.toAbsolutePath;
|
package/dist/tsc.d.cts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { S as StormWorkspaceConfig } from './types-B4jbZA4j.cjs';
|
|
2
|
-
import { TsconfigRaw } from 'esbuild';
|
|
3
|
-
import ts from 'typescript';
|
|
4
|
-
import { ExportDeclaration } from './types.cjs';
|
|
5
|
-
import 'zod';
|
|
6
|
-
import '@nx/devkit';
|
|
7
|
-
import '@storm-software/build-tools';
|
|
8
|
-
import 'tsup';
|
|
9
|
-
|
|
10
|
-
declare function ensureTempDeclarationDir(workspaceConfig: StormWorkspaceConfig): string;
|
|
11
|
-
declare function slash(path: string): string;
|
|
12
|
-
declare function toAbsolutePath(workspaceConfig: StormWorkspaceConfig, p: string, cwd?: string): string;
|
|
13
|
-
/**
|
|
14
|
-
* Use TypeScript compiler to emit declaration files.
|
|
15
|
-
*
|
|
16
|
-
* @returns The mapping from source TS file paths to output declaration file paths
|
|
17
|
-
*/
|
|
18
|
-
declare function emitDtsFiles(workspaceConfig: StormWorkspaceConfig, program: ts.Program, host: ts.CompilerHost, emitOnlyDtsFiles?: boolean, customTransformers?: ts.CustomTransformers): Map<string, string>;
|
|
19
|
-
declare function emitDts(workspaceConfig: StormWorkspaceConfig, tsconfig: string, tsconfigRaw?: TsconfigRaw, emitOnlyDtsFiles?: boolean, customTransformers?: ts.CustomTransformers): ExportDeclaration[];
|
|
20
|
-
|
|
21
|
-
export { emitDts, emitDtsFiles, ensureTempDeclarationDir, slash, toAbsolutePath };
|