esbuild 0.14.42 → 0.14.45
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/LICENSE.md +21 -0
- package/bin/esbuild +1 -0
- package/install.js +5 -4
- package/lib/main.d.ts +3 -1
- package/lib/main.js +15 -10
- package/package.json +21 -21
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 Evan Wallace
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/bin/esbuild
CHANGED
package/install.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __defProps = Object.defineProperties;
|
|
@@ -101,8 +102,8 @@ function validateBinaryVersion(...command) {
|
|
|
101
102
|
const stdout = child_process.execFileSync(command.shift(), command, {
|
|
102
103
|
stdio: "pipe"
|
|
103
104
|
}).toString().trim();
|
|
104
|
-
if (stdout !== "0.14.
|
|
105
|
-
throw new Error(`Expected ${JSON.stringify("0.14.
|
|
105
|
+
if (stdout !== "0.14.45") {
|
|
106
|
+
throw new Error(`Expected ${JSON.stringify("0.14.45")} but got ${JSON.stringify(stdout)}`);
|
|
106
107
|
}
|
|
107
108
|
}
|
|
108
109
|
function isYarn() {
|
|
@@ -153,7 +154,7 @@ function installUsingNPM(pkg, subpath, binPath) {
|
|
|
153
154
|
fs2.mkdirSync(installDir);
|
|
154
155
|
try {
|
|
155
156
|
fs2.writeFileSync(path2.join(installDir, "package.json"), "{}");
|
|
156
|
-
child_process.execSync(`npm install --loglevel=error --prefer-offline --no-audit --progress=false ${pkg}@${"0.14.
|
|
157
|
+
child_process.execSync(`npm install --loglevel=error --prefer-offline --no-audit --progress=false ${pkg}@${"0.14.45"}`, { cwd: installDir, stdio: "pipe", env });
|
|
157
158
|
const installedBinPath = path2.join(installDir, "node_modules", pkg, subpath);
|
|
158
159
|
fs2.renameSync(installedBinPath, binPath);
|
|
159
160
|
} finally {
|
|
@@ -202,7 +203,7 @@ function maybeOptimizePackage(binPath) {
|
|
|
202
203
|
}
|
|
203
204
|
}
|
|
204
205
|
async function downloadDirectlyFromNPM(pkg, subpath, binPath) {
|
|
205
|
-
const url = `https://registry.npmjs.org/${pkg}/-/${pkg}-${"0.14.
|
|
206
|
+
const url = `https://registry.npmjs.org/${pkg}/-/${pkg}-${"0.14.45"}.tgz`;
|
|
206
207
|
console.error(`[esbuild] Trying to download ${JSON.stringify(url)}`);
|
|
207
208
|
try {
|
|
208
209
|
fs2.writeFileSync(binPath, extractFileFromTarGzip(await fetch(url), subpath));
|
package/lib/main.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type Platform = 'browser' | 'node' | 'neutral';
|
|
2
2
|
export type Format = 'iife' | 'cjs' | 'esm';
|
|
3
|
-
export type Loader = 'js' | 'jsx' | 'ts' | 'tsx' | 'css' | 'json' | 'text' | 'base64' | 'file' | 'dataurl' | 'binary' | 'default';
|
|
3
|
+
export type Loader = 'js' | 'jsx' | 'ts' | 'tsx' | 'css' | 'json' | 'text' | 'base64' | 'file' | 'dataurl' | 'binary' | 'copy' | 'default';
|
|
4
4
|
export type LogLevel = 'verbose' | 'debug' | 'info' | 'warning' | 'error' | 'silent';
|
|
5
5
|
export type Charset = 'ascii' | 'utf8';
|
|
6
6
|
export type Drop = 'console' | 'debugger';
|
|
@@ -148,6 +148,7 @@ export interface StdinOptions {
|
|
|
148
148
|
}
|
|
149
149
|
|
|
150
150
|
export interface Message {
|
|
151
|
+
id: string;
|
|
151
152
|
pluginName: string;
|
|
152
153
|
text: string;
|
|
153
154
|
location: Location | null;
|
|
@@ -402,6 +403,7 @@ export interface OnLoadResult {
|
|
|
402
403
|
}
|
|
403
404
|
|
|
404
405
|
export interface PartialMessage {
|
|
406
|
+
id?: string;
|
|
405
407
|
pluginName?: string;
|
|
406
408
|
text?: string;
|
|
407
409
|
location?: Partial<Location> | null;
|
package/lib/main.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __defProps = Object.defineProperties;
|
|
@@ -754,8 +755,8 @@ function createChannel(streamIn) {
|
|
|
754
755
|
if (isFirstPacket) {
|
|
755
756
|
isFirstPacket = false;
|
|
756
757
|
let binaryVersion = String.fromCharCode(...bytes);
|
|
757
|
-
if (binaryVersion !== "0.14.
|
|
758
|
-
throw new Error(`Cannot start service: Host version "${"0.14.
|
|
758
|
+
if (binaryVersion !== "0.14.45") {
|
|
759
|
+
throw new Error(`Cannot start service: Host version "${"0.14.45"}" does not match binary version ${JSON.stringify(binaryVersion)}`);
|
|
759
760
|
}
|
|
760
761
|
return;
|
|
761
762
|
}
|
|
@@ -1264,7 +1265,7 @@ function createChannel(streamIn) {
|
|
|
1264
1265
|
throw new Error("Cannot rebuild");
|
|
1265
1266
|
sendRequest(refs, { command: "rebuild", key }, (error2, response2) => {
|
|
1266
1267
|
if (error2) {
|
|
1267
|
-
const message = { pluginName: "", text: error2, location: null, notes: [], detail: void 0 };
|
|
1268
|
+
const message = { id: "", pluginName: "", text: error2, location: null, notes: [], detail: void 0 };
|
|
1268
1269
|
return callback2(failureErrorWithLog("Build failed", [message], []), null);
|
|
1269
1270
|
}
|
|
1270
1271
|
buildResponseToResult(response2, (error3, result3) => {
|
|
@@ -1547,7 +1548,7 @@ function extractErrorMessageV8(e, streamIn, stash, note, pluginName) {
|
|
|
1547
1548
|
location = parseStackLinesV8(streamIn, (e.stack + "").split("\n"), "");
|
|
1548
1549
|
} catch {
|
|
1549
1550
|
}
|
|
1550
|
-
return { pluginName, text, location, notes: note ? [note] : [], detail: stash ? stash.store(e) : -1 };
|
|
1551
|
+
return { id: "", pluginName, text, location, notes: note ? [note] : [], detail: stash ? stash.store(e) : -1 };
|
|
1551
1552
|
}
|
|
1552
1553
|
function parseStackLinesV8(streamIn, lines, ident) {
|
|
1553
1554
|
let at = " at ";
|
|
@@ -1646,6 +1647,7 @@ function sanitizeMessages(messages, property, stash, fallbackPluginName) {
|
|
|
1646
1647
|
let index = 0;
|
|
1647
1648
|
for (const message of messages) {
|
|
1648
1649
|
let keys = {};
|
|
1650
|
+
let id = getFlag(message, keys, "id", mustBeString);
|
|
1649
1651
|
let pluginName = getFlag(message, keys, "pluginName", mustBeString);
|
|
1650
1652
|
let text = getFlag(message, keys, "text", mustBeString);
|
|
1651
1653
|
let location = getFlag(message, keys, "location", mustBeObjectOrNull);
|
|
@@ -1667,6 +1669,7 @@ function sanitizeMessages(messages, property, stash, fallbackPluginName) {
|
|
|
1667
1669
|
}
|
|
1668
1670
|
}
|
|
1669
1671
|
messagesClone.push({
|
|
1672
|
+
id: id || "",
|
|
1670
1673
|
pluginName: pluginName || fallbackPluginName,
|
|
1671
1674
|
text: text || "",
|
|
1672
1675
|
location: sanitizeLocation(location, where),
|
|
@@ -1867,7 +1870,7 @@ if (process.env.ESBUILD_WORKER_THREADS !== "0") {
|
|
|
1867
1870
|
}
|
|
1868
1871
|
}
|
|
1869
1872
|
var _a;
|
|
1870
|
-
var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.14.
|
|
1873
|
+
var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.14.45";
|
|
1871
1874
|
var esbuildCommandAndArgs = () => {
|
|
1872
1875
|
if ((!ESBUILD_BINARY_PATH || false) && (path2.basename(__filename) !== "main.js" || path2.basename(__dirname) !== "lib")) {
|
|
1873
1876
|
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.
|
|
@@ -1931,7 +1934,7 @@ var fsAsync = {
|
|
|
1931
1934
|
}
|
|
1932
1935
|
}
|
|
1933
1936
|
};
|
|
1934
|
-
var version = "0.14.
|
|
1937
|
+
var version = "0.14.45";
|
|
1935
1938
|
var build = (options) => ensureServiceIsRunning().build(options);
|
|
1936
1939
|
var serve = (serveOptions, buildOptions) => ensureServiceIsRunning().serve(serveOptions, buildOptions);
|
|
1937
1940
|
var transform = (input, options) => ensureServiceIsRunning().transform(input, options);
|
|
@@ -2026,6 +2029,8 @@ var initialize = (options) => {
|
|
|
2026
2029
|
options = validateInitializeOptions(options || {});
|
|
2027
2030
|
if (options.wasmURL)
|
|
2028
2031
|
throw new Error(`The "wasmURL" option only works in the browser`);
|
|
2032
|
+
if (options.wasmModule)
|
|
2033
|
+
throw new Error(`The "wasmModule" option only works in the browser`);
|
|
2029
2034
|
if (options.worker)
|
|
2030
2035
|
throw new Error(`The "worker" option only works in the browser`);
|
|
2031
2036
|
if (initializeWasCalled)
|
|
@@ -2040,7 +2045,7 @@ var ensureServiceIsRunning = () => {
|
|
|
2040
2045
|
if (longLivedService)
|
|
2041
2046
|
return longLivedService;
|
|
2042
2047
|
let [command, args] = esbuildCommandAndArgs();
|
|
2043
|
-
let child = child_process.spawn(command, args.concat(`--service=${"0.14.
|
|
2048
|
+
let child = child_process.spawn(command, args.concat(`--service=${"0.14.45"}`, "--ping"), {
|
|
2044
2049
|
windowsHide: true,
|
|
2045
2050
|
stdio: ["pipe", "pipe", "inherit"],
|
|
2046
2051
|
cwd: defaultWD
|
|
@@ -2154,7 +2159,7 @@ var runServiceSync = (callback) => {
|
|
|
2154
2159
|
esbuild: node_exports
|
|
2155
2160
|
});
|
|
2156
2161
|
callback(service);
|
|
2157
|
-
let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.14.
|
|
2162
|
+
let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.14.45"}`), {
|
|
2158
2163
|
cwd: defaultWD,
|
|
2159
2164
|
windowsHide: true,
|
|
2160
2165
|
input: stdin,
|
|
@@ -2170,7 +2175,7 @@ var workerThreadService = null;
|
|
|
2170
2175
|
var startWorkerThreadService = (worker_threads2) => {
|
|
2171
2176
|
let { port1: mainPort, port2: workerPort } = new worker_threads2.MessageChannel();
|
|
2172
2177
|
let worker = new worker_threads2.Worker(__filename, {
|
|
2173
|
-
workerData: { workerPort, defaultWD, esbuildVersion: "0.14.
|
|
2178
|
+
workerData: { workerPort, defaultWD, esbuildVersion: "0.14.45" },
|
|
2174
2179
|
transferList: [workerPort],
|
|
2175
2180
|
execArgv: []
|
|
2176
2181
|
});
|
|
@@ -2179,7 +2184,7 @@ var startWorkerThreadService = (worker_threads2) => {
|
|
|
2179
2184
|
let fakeBuildError = (text) => {
|
|
2180
2185
|
let error = new Error(`Build failed with 1 error:
|
|
2181
2186
|
error: ${text}`);
|
|
2182
|
-
let errors = [{ pluginName: "", text, location: null, notes: [], detail: void 0 }];
|
|
2187
|
+
let errors = [{ id: "", pluginName: "", text, location: null, notes: [], detail: void 0 }];
|
|
2183
2188
|
error.errors = errors;
|
|
2184
2189
|
error.warnings = [];
|
|
2185
2190
|
return error;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "esbuild",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.45",
|
|
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.45",
|
|
19
|
+
"esbuild-android-arm64": "0.14.45",
|
|
20
|
+
"esbuild-darwin-64": "0.14.45",
|
|
21
|
+
"esbuild-darwin-arm64": "0.14.45",
|
|
22
|
+
"esbuild-freebsd-64": "0.14.45",
|
|
23
|
+
"esbuild-freebsd-arm64": "0.14.45",
|
|
24
|
+
"esbuild-linux-32": "0.14.45",
|
|
25
|
+
"esbuild-linux-64": "0.14.45",
|
|
26
|
+
"esbuild-linux-arm": "0.14.45",
|
|
27
|
+
"esbuild-linux-arm64": "0.14.45",
|
|
28
|
+
"esbuild-linux-mips64le": "0.14.45",
|
|
29
|
+
"esbuild-linux-ppc64le": "0.14.45",
|
|
30
|
+
"esbuild-linux-riscv64": "0.14.45",
|
|
31
|
+
"esbuild-linux-s390x": "0.14.45",
|
|
32
|
+
"esbuild-netbsd-64": "0.14.45",
|
|
33
|
+
"esbuild-openbsd-64": "0.14.45",
|
|
34
|
+
"esbuild-sunos-64": "0.14.45",
|
|
35
|
+
"esbuild-windows-32": "0.14.45",
|
|
36
|
+
"esbuild-windows-64": "0.14.45",
|
|
37
|
+
"esbuild-windows-arm64": "0.14.45"
|
|
38
38
|
},
|
|
39
39
|
"license": "MIT"
|
|
40
40
|
}
|