esbuild 0.16.15 → 0.16.17

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/bin/esbuild CHANGED
@@ -107,7 +107,11 @@ function downloadedBinPath(pkg, subpath) {
107
107
  }
108
108
  function generateBinPath() {
109
109
  if (ESBUILD_BINARY_PATH) {
110
- return { binPath: ESBUILD_BINARY_PATH, isWASM: false };
110
+ if (!fs.existsSync(ESBUILD_BINARY_PATH)) {
111
+ console.warn(`[esbuild] Ignoring bad configuration: ESBUILD_BINARY_PATH=${ESBUILD_BINARY_PATH}`);
112
+ } else {
113
+ return { binPath: ESBUILD_BINARY_PATH, isWASM: false };
114
+ }
111
115
  }
112
116
  const { pkg, subpath, isWASM: isWASM2 } = pkgAndSubpathForCurrentPlatform();
113
117
  let binPath2;
@@ -194,7 +198,7 @@ for your current platform.`);
194
198
  "node_modules",
195
199
  ".cache",
196
200
  "esbuild",
197
- `pnpapi-${pkg.replace("/", "-")}-${"0.16.15"}-${path.basename(subpath)}`
201
+ `pnpapi-${pkg.replace("/", "-")}-${"0.16.17"}-${path.basename(subpath)}`
198
202
  );
199
203
  if (!fs.existsSync(binTargetPath)) {
200
204
  fs.mkdirSync(path.dirname(binTargetPath), { recursive: true });
package/install.js CHANGED
@@ -126,8 +126,8 @@ which means the "esbuild" binary executable can't be run. You can either:
126
126
  }
127
127
  throw err;
128
128
  }
129
- if (stdout !== "0.16.15") {
130
- throw new Error(`Expected ${JSON.stringify("0.16.15")} but got ${JSON.stringify(stdout)}`);
129
+ if (stdout !== "0.16.17") {
130
+ throw new Error(`Expected ${JSON.stringify("0.16.17")} but got ${JSON.stringify(stdout)}`);
131
131
  }
132
132
  }
133
133
  function isYarn() {
@@ -179,7 +179,7 @@ function installUsingNPM(pkg, subpath, binPath) {
179
179
  try {
180
180
  fs2.writeFileSync(path2.join(installDir, "package.json"), "{}");
181
181
  child_process.execSync(
182
- `npm install --loglevel=error --prefer-offline --no-audit --progress=false ${pkg}@${"0.16.15"}`,
182
+ `npm install --loglevel=error --prefer-offline --no-audit --progress=false ${pkg}@${"0.16.17"}`,
183
183
  { cwd: installDir, stdio: "pipe", env }
184
184
  );
185
185
  const installedBinPath = path2.join(installDir, "node_modules", pkg, subpath);
@@ -230,7 +230,7 @@ function maybeOptimizePackage(binPath) {
230
230
  }
231
231
  }
232
232
  async function downloadDirectlyFromNPM(pkg, subpath, binPath) {
233
- const url = `https://registry.npmjs.org/${pkg}/-/${pkg.replace("@esbuild/", "")}-${"0.16.15"}.tgz`;
233
+ const url = `https://registry.npmjs.org/${pkg}/-/${pkg.replace("@esbuild/", "")}-${"0.16.17"}.tgz`;
234
234
  console.error(`[esbuild] Trying to download ${JSON.stringify(url)}`);
235
235
  try {
236
236
  fs2.writeFileSync(binPath, extractFileFromTarGzip(await fetch(url), subpath));
@@ -242,8 +242,12 @@ async function downloadDirectlyFromNPM(pkg, subpath, binPath) {
242
242
  }
243
243
  async function checkAndPreparePackage() {
244
244
  if (ESBUILD_BINARY_PATH) {
245
- applyManualBinaryPathOverride(ESBUILD_BINARY_PATH);
246
- return;
245
+ if (!fs2.existsSync(ESBUILD_BINARY_PATH)) {
246
+ console.warn(`[esbuild] Ignoring bad configuration: ESBUILD_BINARY_PATH=${ESBUILD_BINARY_PATH}`);
247
+ } else {
248
+ applyManualBinaryPathOverride(ESBUILD_BINARY_PATH);
249
+ return;
250
+ }
247
251
  }
248
252
  const { pkg, subpath } = pkgAndSubpathForCurrentPlatform();
249
253
  let binPath;
package/lib/main.js CHANGED
@@ -739,8 +739,8 @@ function createChannel(streamIn) {
739
739
  if (isFirstPacket) {
740
740
  isFirstPacket = false;
741
741
  let binaryVersion = String.fromCharCode(...bytes);
742
- if (binaryVersion !== "0.16.15") {
743
- throw new Error(`Cannot start service: Host version "${"0.16.15"}" does not match binary version ${quote(binaryVersion)}`);
742
+ if (binaryVersion !== "0.16.17") {
743
+ throw new Error(`Cannot start service: Host version "${"0.16.17"}" does not match binary version ${quote(binaryVersion)}`);
744
744
  }
745
745
  return;
746
746
  }
@@ -1227,6 +1227,8 @@ var handlePlugins = async (buildKey, sendRequest, sendResponse, refs, streamIn,
1227
1227
  checkForInvalidFlags(item, keys, `on plugin ${quote(name)}`);
1228
1228
  let plugin = {
1229
1229
  name,
1230
+ onStart: false,
1231
+ onEnd: false,
1230
1232
  onResolve: [],
1231
1233
  onLoad: []
1232
1234
  };
@@ -1289,11 +1291,13 @@ var handlePlugins = async (buildKey, sendRequest, sendResponse, refs, streamIn,
1289
1291
  let registeredText = `This error came from the "onStart" callback registered here:`;
1290
1292
  let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onStart");
1291
1293
  onStartCallbacks.push({ name, callback, note: registeredNote });
1294
+ plugin.onStart = true;
1292
1295
  },
1293
1296
  onEnd(callback) {
1294
1297
  let registeredText = `This error came from the "onEnd" callback registered here:`;
1295
1298
  let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onEnd");
1296
1299
  onEndCallbacks.push({ name, callback, note: registeredNote });
1300
+ plugin.onEnd = true;
1297
1301
  },
1298
1302
  onResolve(options, callback) {
1299
1303
  let registeredText = `This error came from the "onResolve" callback registered here:`;
@@ -1777,7 +1781,11 @@ function downloadedBinPath(pkg, subpath) {
1777
1781
  }
1778
1782
  function generateBinPath() {
1779
1783
  if (ESBUILD_BINARY_PATH) {
1780
- return { binPath: ESBUILD_BINARY_PATH, isWASM: false };
1784
+ if (!fs.existsSync(ESBUILD_BINARY_PATH)) {
1785
+ console.warn(`[esbuild] Ignoring bad configuration: ESBUILD_BINARY_PATH=${ESBUILD_BINARY_PATH}`);
1786
+ } else {
1787
+ return { binPath: ESBUILD_BINARY_PATH, isWASM: false };
1788
+ }
1781
1789
  }
1782
1790
  const { pkg, subpath, isWASM } = pkgAndSubpathForCurrentPlatform();
1783
1791
  let binPath;
@@ -1864,7 +1872,7 @@ for your current platform.`);
1864
1872
  "node_modules",
1865
1873
  ".cache",
1866
1874
  "esbuild",
1867
- `pnpapi-${pkg.replace("/", "-")}-${"0.16.15"}-${path.basename(subpath)}`
1875
+ `pnpapi-${pkg.replace("/", "-")}-${"0.16.17"}-${path.basename(subpath)}`
1868
1876
  );
1869
1877
  if (!fs.existsSync(binTargetPath)) {
1870
1878
  fs.mkdirSync(path.dirname(binTargetPath), { recursive: true });
@@ -1891,13 +1899,15 @@ if (process.env.ESBUILD_WORKER_THREADS !== "0") {
1891
1899
  } catch {
1892
1900
  }
1893
1901
  let [major, minor] = process.versions.node.split(".");
1894
- if (// <v12.17.0 does not work
1895
- +major < 12 || +major === 12 && +minor < 17 || +major === 13 && +minor < 13) {
1902
+ if (
1903
+ // <v12.17.0 does not work
1904
+ +major < 12 || +major === 12 && +minor < 17 || +major === 13 && +minor < 13
1905
+ ) {
1896
1906
  worker_threads = void 0;
1897
1907
  }
1898
1908
  }
1899
1909
  var _a;
1900
- var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.16.15";
1910
+ var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.16.17";
1901
1911
  var esbuildCommandAndArgs = () => {
1902
1912
  if ((!ESBUILD_BINARY_PATH || false) && (path2.basename(__filename) !== "main.js" || path2.basename(__dirname) !== "lib")) {
1903
1913
  throw new Error(
@@ -1964,7 +1974,7 @@ var fsAsync = {
1964
1974
  }
1965
1975
  }
1966
1976
  };
1967
- var version = "0.16.15";
1977
+ var version = "0.16.17";
1968
1978
  var build = (options) => ensureServiceIsRunning().build(options);
1969
1979
  var serve = (serveOptions, buildOptions) => ensureServiceIsRunning().serve(serveOptions, buildOptions);
1970
1980
  var transform = (input, options) => ensureServiceIsRunning().transform(input, options);
@@ -2075,7 +2085,7 @@ var ensureServiceIsRunning = () => {
2075
2085
  if (longLivedService)
2076
2086
  return longLivedService;
2077
2087
  let [command, args] = esbuildCommandAndArgs();
2078
- let child = child_process.spawn(command, args.concat(`--service=${"0.16.15"}`, "--ping"), {
2088
+ let child = child_process.spawn(command, args.concat(`--service=${"0.16.17"}`, "--ping"), {
2079
2089
  windowsHide: true,
2080
2090
  stdio: ["pipe", "pipe", "inherit"],
2081
2091
  cwd: defaultWD
@@ -2189,7 +2199,7 @@ var runServiceSync = (callback) => {
2189
2199
  esbuild: node_exports
2190
2200
  });
2191
2201
  callback(service);
2192
- let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.16.15"}`), {
2202
+ let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.16.17"}`), {
2193
2203
  cwd: defaultWD,
2194
2204
  windowsHide: true,
2195
2205
  input: stdin,
@@ -2209,7 +2219,7 @@ var workerThreadService = null;
2209
2219
  var startWorkerThreadService = (worker_threads2) => {
2210
2220
  let { port1: mainPort, port2: workerPort } = new worker_threads2.MessageChannel();
2211
2221
  let worker = new worker_threads2.Worker(__filename, {
2212
- workerData: { workerPort, defaultWD, esbuildVersion: "0.16.15" },
2222
+ workerData: { workerPort, defaultWD, esbuildVersion: "0.16.17" },
2213
2223
  transferList: [workerPort],
2214
2224
  // From node's documentation: https://nodejs.org/api/worker_threads.html
2215
2225
  //
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esbuild",
3
- "version": "0.16.15",
3
+ "version": "0.16.17",
4
4
  "description": "An extremely fast JavaScript and CSS bundler and minifier.",
5
5
  "repository": "https://github.com/evanw/esbuild",
6
6
  "scripts": {
@@ -15,28 +15,28 @@
15
15
  "esbuild": "bin/esbuild"
16
16
  },
17
17
  "optionalDependencies": {
18
- "@esbuild/android-arm": "0.16.15",
19
- "@esbuild/android-arm64": "0.16.15",
20
- "@esbuild/android-x64": "0.16.15",
21
- "@esbuild/darwin-arm64": "0.16.15",
22
- "@esbuild/darwin-x64": "0.16.15",
23
- "@esbuild/freebsd-arm64": "0.16.15",
24
- "@esbuild/freebsd-x64": "0.16.15",
25
- "@esbuild/linux-arm": "0.16.15",
26
- "@esbuild/linux-arm64": "0.16.15",
27
- "@esbuild/linux-ia32": "0.16.15",
28
- "@esbuild/linux-loong64": "0.16.15",
29
- "@esbuild/linux-mips64el": "0.16.15",
30
- "@esbuild/linux-ppc64": "0.16.15",
31
- "@esbuild/linux-riscv64": "0.16.15",
32
- "@esbuild/linux-s390x": "0.16.15",
33
- "@esbuild/linux-x64": "0.16.15",
34
- "@esbuild/netbsd-x64": "0.16.15",
35
- "@esbuild/openbsd-x64": "0.16.15",
36
- "@esbuild/sunos-x64": "0.16.15",
37
- "@esbuild/win32-arm64": "0.16.15",
38
- "@esbuild/win32-ia32": "0.16.15",
39
- "@esbuild/win32-x64": "0.16.15"
18
+ "@esbuild/android-arm": "0.16.17",
19
+ "@esbuild/android-arm64": "0.16.17",
20
+ "@esbuild/android-x64": "0.16.17",
21
+ "@esbuild/darwin-arm64": "0.16.17",
22
+ "@esbuild/darwin-x64": "0.16.17",
23
+ "@esbuild/freebsd-arm64": "0.16.17",
24
+ "@esbuild/freebsd-x64": "0.16.17",
25
+ "@esbuild/linux-arm": "0.16.17",
26
+ "@esbuild/linux-arm64": "0.16.17",
27
+ "@esbuild/linux-ia32": "0.16.17",
28
+ "@esbuild/linux-loong64": "0.16.17",
29
+ "@esbuild/linux-mips64el": "0.16.17",
30
+ "@esbuild/linux-ppc64": "0.16.17",
31
+ "@esbuild/linux-riscv64": "0.16.17",
32
+ "@esbuild/linux-s390x": "0.16.17",
33
+ "@esbuild/linux-x64": "0.16.17",
34
+ "@esbuild/netbsd-x64": "0.16.17",
35
+ "@esbuild/openbsd-x64": "0.16.17",
36
+ "@esbuild/sunos-x64": "0.16.17",
37
+ "@esbuild/win32-arm64": "0.16.17",
38
+ "@esbuild/win32-ia32": "0.16.17",
39
+ "@esbuild/win32-x64": "0.16.17"
40
40
  },
41
41
  "license": "MIT"
42
42
  }