esbuild 0.14.31 → 0.14.32
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/install.js +4 -4
- package/lib/main.d.ts +10 -0
- package/lib/main.js +11 -8
- package/package.json +21 -21
package/install.js
CHANGED
|
@@ -101,8 +101,8 @@ function validateBinaryVersion(...command) {
|
|
|
101
101
|
const stdout = child_process.execFileSync(command.shift(), command, {
|
|
102
102
|
stdio: "pipe"
|
|
103
103
|
}).toString().trim();
|
|
104
|
-
if (stdout !== "0.14.
|
|
105
|
-
throw new Error(`Expected ${JSON.stringify("0.14.
|
|
104
|
+
if (stdout !== "0.14.32") {
|
|
105
|
+
throw new Error(`Expected ${JSON.stringify("0.14.32")} but got ${JSON.stringify(stdout)}`);
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
function isYarn() {
|
|
@@ -153,7 +153,7 @@ function installUsingNPM(pkg, subpath, binPath) {
|
|
|
153
153
|
fs2.mkdirSync(installDir);
|
|
154
154
|
try {
|
|
155
155
|
fs2.writeFileSync(path2.join(installDir, "package.json"), "{}");
|
|
156
|
-
child_process.execSync(`npm install --loglevel=error --prefer-offline --no-audit --progress=false ${pkg}@${"0.14.
|
|
156
|
+
child_process.execSync(`npm install --loglevel=error --prefer-offline --no-audit --progress=false ${pkg}@${"0.14.32"}`, { cwd: installDir, stdio: "pipe", env });
|
|
157
157
|
const installedBinPath = path2.join(installDir, "node_modules", pkg, subpath);
|
|
158
158
|
fs2.renameSync(installedBinPath, binPath);
|
|
159
159
|
} finally {
|
|
@@ -202,7 +202,7 @@ function maybeOptimizePackage(binPath) {
|
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
204
|
async function downloadDirectlyFromNPM(pkg, subpath, binPath) {
|
|
205
|
-
const url = `https://registry.npmjs.org/${pkg}/-/${pkg}-${"0.14.
|
|
205
|
+
const url = `https://registry.npmjs.org/${pkg}/-/${pkg}-${"0.14.32"}.tgz`;
|
|
206
206
|
console.error(`[esbuild] Trying to download ${JSON.stringify(url)}`);
|
|
207
207
|
try {
|
|
208
208
|
fs2.writeFileSync(binPath, extractFileFromTarGzip(await fetch(url), subpath));
|
package/lib/main.d.ts
CHANGED
|
@@ -571,6 +571,16 @@ export interface InitializeOptions {
|
|
|
571
571
|
*/
|
|
572
572
|
wasmURL?: string
|
|
573
573
|
|
|
574
|
+
/**
|
|
575
|
+
* The result of calling "new WebAssembly.Module(buffer)" where "buffer"
|
|
576
|
+
* is a typed array or ArrayBuffer containing the binary code of the
|
|
577
|
+
* "esbuild.wasm" file.
|
|
578
|
+
*
|
|
579
|
+
* You can use this as an alternative to "wasmURL" for environments where it's
|
|
580
|
+
* not possible to download the WebAssembly module.
|
|
581
|
+
*/
|
|
582
|
+
wasmModule?: WebAssembly.Module
|
|
583
|
+
|
|
574
584
|
/**
|
|
575
585
|
* By default esbuild runs the WebAssembly-based browser API in a web worker
|
|
576
586
|
* to avoid blocking the UI thread. This can be disabled by setting "worker"
|
package/lib/main.js
CHANGED
|
@@ -234,6 +234,7 @@ var mustBeInteger = (value) => typeof value === "number" && value === (value | 0
|
|
|
234
234
|
var mustBeFunction = (value) => typeof value === "function" ? null : "a function";
|
|
235
235
|
var mustBeArray = (value) => Array.isArray(value) ? null : "an array";
|
|
236
236
|
var mustBeObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value) ? null : "an object";
|
|
237
|
+
var mustBeWebAssemblyModule = (value) => value instanceof WebAssembly.Module ? null : "a WebAssembly.Module";
|
|
237
238
|
var mustBeArrayOrRecord = (value) => typeof value === "object" && value !== null ? null : "an array or an object";
|
|
238
239
|
var mustBeObjectOrNull = (value) => typeof value === "object" && !Array.isArray(value) ? null : "an object or null";
|
|
239
240
|
var mustBeStringOrBoolean = (value) => typeof value === "string" || typeof value === "boolean" ? null : "a string or a boolean";
|
|
@@ -260,10 +261,12 @@ function checkForInvalidFlags(object, keys, where) {
|
|
|
260
261
|
function validateInitializeOptions(options) {
|
|
261
262
|
let keys = /* @__PURE__ */ Object.create(null);
|
|
262
263
|
let wasmURL = getFlag(options, keys, "wasmURL", mustBeString);
|
|
264
|
+
let wasmModule = getFlag(options, keys, "wasmModule", mustBeWebAssemblyModule);
|
|
263
265
|
let worker = getFlag(options, keys, "worker", mustBeBoolean);
|
|
264
|
-
checkForInvalidFlags(options, keys, "in
|
|
266
|
+
checkForInvalidFlags(options, keys, "in initialize() call");
|
|
265
267
|
return {
|
|
266
268
|
wasmURL,
|
|
269
|
+
wasmModule,
|
|
267
270
|
worker
|
|
268
271
|
};
|
|
269
272
|
}
|
|
@@ -743,8 +746,8 @@ function createChannel(streamIn) {
|
|
|
743
746
|
if (isFirstPacket) {
|
|
744
747
|
isFirstPacket = false;
|
|
745
748
|
let binaryVersion = String.fromCharCode(...bytes);
|
|
746
|
-
if (binaryVersion !== "0.14.
|
|
747
|
-
throw new Error(`Cannot start service: Host version "${"0.14.
|
|
749
|
+
if (binaryVersion !== "0.14.32") {
|
|
750
|
+
throw new Error(`Cannot start service: Host version "${"0.14.32"}" does not match binary version ${JSON.stringify(binaryVersion)}`);
|
|
748
751
|
}
|
|
749
752
|
return;
|
|
750
753
|
}
|
|
@@ -1856,7 +1859,7 @@ if (process.env.ESBUILD_WORKER_THREADS !== "0") {
|
|
|
1856
1859
|
}
|
|
1857
1860
|
}
|
|
1858
1861
|
var _a;
|
|
1859
|
-
var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.14.
|
|
1862
|
+
var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.14.32";
|
|
1860
1863
|
var esbuildCommandAndArgs = () => {
|
|
1861
1864
|
if ((!ESBUILD_BINARY_PATH || false) && (path2.basename(__filename) !== "main.js" || path2.basename(__dirname) !== "lib")) {
|
|
1862
1865
|
throw new Error(`The esbuild JavaScript API cannot be bundled. Please mark the "esbuild" package as external so it's not included in the bundle.
|
|
@@ -1920,7 +1923,7 @@ var fsAsync = {
|
|
|
1920
1923
|
}
|
|
1921
1924
|
}
|
|
1922
1925
|
};
|
|
1923
|
-
var version = "0.14.
|
|
1926
|
+
var version = "0.14.32";
|
|
1924
1927
|
var build = (options) => ensureServiceIsRunning().build(options);
|
|
1925
1928
|
var serve = (serveOptions, buildOptions) => ensureServiceIsRunning().serve(serveOptions, buildOptions);
|
|
1926
1929
|
var transform = (input, options) => ensureServiceIsRunning().transform(input, options);
|
|
@@ -2029,7 +2032,7 @@ var ensureServiceIsRunning = () => {
|
|
|
2029
2032
|
if (longLivedService)
|
|
2030
2033
|
return longLivedService;
|
|
2031
2034
|
let [command, args] = esbuildCommandAndArgs();
|
|
2032
|
-
let child = child_process.spawn(command, args.concat(`--service=${"0.14.
|
|
2035
|
+
let child = child_process.spawn(command, args.concat(`--service=${"0.14.32"}`, "--ping"), {
|
|
2033
2036
|
windowsHide: true,
|
|
2034
2037
|
stdio: ["pipe", "pipe", "inherit"],
|
|
2035
2038
|
cwd: defaultWD
|
|
@@ -2143,7 +2146,7 @@ var runServiceSync = (callback) => {
|
|
|
2143
2146
|
esbuild: node_exports
|
|
2144
2147
|
});
|
|
2145
2148
|
callback(service);
|
|
2146
|
-
let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.14.
|
|
2149
|
+
let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.14.32"}`), {
|
|
2147
2150
|
cwd: defaultWD,
|
|
2148
2151
|
windowsHide: true,
|
|
2149
2152
|
input: stdin,
|
|
@@ -2159,7 +2162,7 @@ var workerThreadService = null;
|
|
|
2159
2162
|
var startWorkerThreadService = (worker_threads2) => {
|
|
2160
2163
|
let { port1: mainPort, port2: workerPort } = new worker_threads2.MessageChannel();
|
|
2161
2164
|
let worker = new worker_threads2.Worker(__filename, {
|
|
2162
|
-
workerData: { workerPort, defaultWD, esbuildVersion: "0.14.
|
|
2165
|
+
workerData: { workerPort, defaultWD, esbuildVersion: "0.14.32" },
|
|
2163
2166
|
transferList: [workerPort],
|
|
2164
2167
|
execArgv: []
|
|
2165
2168
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "esbuild",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.32",
|
|
4
4
|
"description": "An extremely fast JavaScript and CSS bundler and minifier.",
|
|
5
5
|
"repository": "https://github.com/evanw/esbuild",
|
|
6
6
|
"scripts": {
|
|
@@ -15,26 +15,26 @@
|
|
|
15
15
|
"esbuild": "bin/esbuild"
|
|
16
16
|
},
|
|
17
17
|
"optionalDependencies": {
|
|
18
|
-
"esbuild-android-64": "0.14.
|
|
19
|
-
"esbuild-android-arm64": "0.14.
|
|
20
|
-
"esbuild-darwin-64": "0.14.
|
|
21
|
-
"esbuild-darwin-arm64": "0.14.
|
|
22
|
-
"esbuild-freebsd-64": "0.14.
|
|
23
|
-
"esbuild-freebsd-arm64": "0.14.
|
|
24
|
-
"esbuild-linux-32": "0.14.
|
|
25
|
-
"esbuild-linux-64": "0.14.
|
|
26
|
-
"esbuild-linux-arm": "0.14.
|
|
27
|
-
"esbuild-linux-arm64": "0.14.
|
|
28
|
-
"esbuild-linux-mips64le": "0.14.
|
|
29
|
-
"esbuild-linux-ppc64le": "0.14.
|
|
30
|
-
"esbuild-linux-riscv64": "0.14.
|
|
31
|
-
"esbuild-linux-s390x": "0.14.
|
|
32
|
-
"esbuild-netbsd-64": "0.14.
|
|
33
|
-
"esbuild-openbsd-64": "0.14.
|
|
34
|
-
"esbuild-sunos-64": "0.14.
|
|
35
|
-
"esbuild-windows-32": "0.14.
|
|
36
|
-
"esbuild-windows-64": "0.14.
|
|
37
|
-
"esbuild-windows-arm64": "0.14.
|
|
18
|
+
"esbuild-android-64": "0.14.32",
|
|
19
|
+
"esbuild-android-arm64": "0.14.32",
|
|
20
|
+
"esbuild-darwin-64": "0.14.32",
|
|
21
|
+
"esbuild-darwin-arm64": "0.14.32",
|
|
22
|
+
"esbuild-freebsd-64": "0.14.32",
|
|
23
|
+
"esbuild-freebsd-arm64": "0.14.32",
|
|
24
|
+
"esbuild-linux-32": "0.14.32",
|
|
25
|
+
"esbuild-linux-64": "0.14.32",
|
|
26
|
+
"esbuild-linux-arm": "0.14.32",
|
|
27
|
+
"esbuild-linux-arm64": "0.14.32",
|
|
28
|
+
"esbuild-linux-mips64le": "0.14.32",
|
|
29
|
+
"esbuild-linux-ppc64le": "0.14.32",
|
|
30
|
+
"esbuild-linux-riscv64": "0.14.32",
|
|
31
|
+
"esbuild-linux-s390x": "0.14.32",
|
|
32
|
+
"esbuild-netbsd-64": "0.14.32",
|
|
33
|
+
"esbuild-openbsd-64": "0.14.32",
|
|
34
|
+
"esbuild-sunos-64": "0.14.32",
|
|
35
|
+
"esbuild-windows-32": "0.14.32",
|
|
36
|
+
"esbuild-windows-64": "0.14.32",
|
|
37
|
+
"esbuild-windows-arm64": "0.14.32"
|
|
38
38
|
},
|
|
39
39
|
"license": "MIT"
|
|
40
40
|
}
|