esbuild 0.16.16 → 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.16"}-${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.16") {
130
- throw new Error(`Expected ${JSON.stringify("0.16.16")} 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.16"}`,
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.16"}.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.16") {
743
- throw new Error(`Cannot start service: Host version "${"0.16.16"}" 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
  }
@@ -1781,7 +1781,11 @@ function downloadedBinPath(pkg, subpath) {
1781
1781
  }
1782
1782
  function generateBinPath() {
1783
1783
  if (ESBUILD_BINARY_PATH) {
1784
- 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
+ }
1785
1789
  }
1786
1790
  const { pkg, subpath, isWASM } = pkgAndSubpathForCurrentPlatform();
1787
1791
  let binPath;
@@ -1868,7 +1872,7 @@ for your current platform.`);
1868
1872
  "node_modules",
1869
1873
  ".cache",
1870
1874
  "esbuild",
1871
- `pnpapi-${pkg.replace("/", "-")}-${"0.16.16"}-${path.basename(subpath)}`
1875
+ `pnpapi-${pkg.replace("/", "-")}-${"0.16.17"}-${path.basename(subpath)}`
1872
1876
  );
1873
1877
  if (!fs.existsSync(binTargetPath)) {
1874
1878
  fs.mkdirSync(path.dirname(binTargetPath), { recursive: true });
@@ -1895,13 +1899,15 @@ if (process.env.ESBUILD_WORKER_THREADS !== "0") {
1895
1899
  } catch {
1896
1900
  }
1897
1901
  let [major, minor] = process.versions.node.split(".");
1898
- if (// <v12.17.0 does not work
1899
- +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
+ ) {
1900
1906
  worker_threads = void 0;
1901
1907
  }
1902
1908
  }
1903
1909
  var _a;
1904
- var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.16.16";
1910
+ var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.16.17";
1905
1911
  var esbuildCommandAndArgs = () => {
1906
1912
  if ((!ESBUILD_BINARY_PATH || false) && (path2.basename(__filename) !== "main.js" || path2.basename(__dirname) !== "lib")) {
1907
1913
  throw new Error(
@@ -1968,7 +1974,7 @@ var fsAsync = {
1968
1974
  }
1969
1975
  }
1970
1976
  };
1971
- var version = "0.16.16";
1977
+ var version = "0.16.17";
1972
1978
  var build = (options) => ensureServiceIsRunning().build(options);
1973
1979
  var serve = (serveOptions, buildOptions) => ensureServiceIsRunning().serve(serveOptions, buildOptions);
1974
1980
  var transform = (input, options) => ensureServiceIsRunning().transform(input, options);
@@ -2079,7 +2085,7 @@ var ensureServiceIsRunning = () => {
2079
2085
  if (longLivedService)
2080
2086
  return longLivedService;
2081
2087
  let [command, args] = esbuildCommandAndArgs();
2082
- let child = child_process.spawn(command, args.concat(`--service=${"0.16.16"}`, "--ping"), {
2088
+ let child = child_process.spawn(command, args.concat(`--service=${"0.16.17"}`, "--ping"), {
2083
2089
  windowsHide: true,
2084
2090
  stdio: ["pipe", "pipe", "inherit"],
2085
2091
  cwd: defaultWD
@@ -2193,7 +2199,7 @@ var runServiceSync = (callback) => {
2193
2199
  esbuild: node_exports
2194
2200
  });
2195
2201
  callback(service);
2196
- let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.16.16"}`), {
2202
+ let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.16.17"}`), {
2197
2203
  cwd: defaultWD,
2198
2204
  windowsHide: true,
2199
2205
  input: stdin,
@@ -2213,7 +2219,7 @@ var workerThreadService = null;
2213
2219
  var startWorkerThreadService = (worker_threads2) => {
2214
2220
  let { port1: mainPort, port2: workerPort } = new worker_threads2.MessageChannel();
2215
2221
  let worker = new worker_threads2.Worker(__filename, {
2216
- workerData: { workerPort, defaultWD, esbuildVersion: "0.16.16" },
2222
+ workerData: { workerPort, defaultWD, esbuildVersion: "0.16.17" },
2217
2223
  transferList: [workerPort],
2218
2224
  // From node's documentation: https://nodejs.org/api/worker_threads.html
2219
2225
  //
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esbuild",
3
- "version": "0.16.16",
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.16",
19
- "@esbuild/android-arm64": "0.16.16",
20
- "@esbuild/android-x64": "0.16.16",
21
- "@esbuild/darwin-arm64": "0.16.16",
22
- "@esbuild/darwin-x64": "0.16.16",
23
- "@esbuild/freebsd-arm64": "0.16.16",
24
- "@esbuild/freebsd-x64": "0.16.16",
25
- "@esbuild/linux-arm": "0.16.16",
26
- "@esbuild/linux-arm64": "0.16.16",
27
- "@esbuild/linux-ia32": "0.16.16",
28
- "@esbuild/linux-loong64": "0.16.16",
29
- "@esbuild/linux-mips64el": "0.16.16",
30
- "@esbuild/linux-ppc64": "0.16.16",
31
- "@esbuild/linux-riscv64": "0.16.16",
32
- "@esbuild/linux-s390x": "0.16.16",
33
- "@esbuild/linux-x64": "0.16.16",
34
- "@esbuild/netbsd-x64": "0.16.16",
35
- "@esbuild/openbsd-x64": "0.16.16",
36
- "@esbuild/sunos-x64": "0.16.16",
37
- "@esbuild/win32-arm64": "0.16.16",
38
- "@esbuild/win32-ia32": "0.16.16",
39
- "@esbuild/win32-x64": "0.16.16"
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
  }