esbuild 0.17.4 → 0.17.6

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
@@ -28,6 +28,7 @@ var fs = require("fs");
28
28
  var os = require("os");
29
29
  var path = require("path");
30
30
  var ESBUILD_BINARY_PATH = process.env.ESBUILD_BINARY_PATH || ESBUILD_BINARY_PATH;
31
+ var isValidBinaryPath = (x) => !!x && x !== "/usr/bin/esbuild";
31
32
  var packageDarwin_arm64 = "@esbuild/darwin-arm64";
32
33
  var packageDarwin_x64 = "@esbuild/darwin-x64";
33
34
  var knownWindowsPackages = {
@@ -106,7 +107,7 @@ function downloadedBinPath(pkg, subpath) {
106
107
  return path.join(esbuildLibDir, `downloaded-${pkg.replace("/", "-")}-${path.basename(subpath)}`);
107
108
  }
108
109
  function generateBinPath() {
109
- if (ESBUILD_BINARY_PATH) {
110
+ if (isValidBinaryPath(ESBUILD_BINARY_PATH)) {
110
111
  if (!fs.existsSync(ESBUILD_BINARY_PATH)) {
111
112
  console.warn(`[esbuild] Ignoring bad configuration: ESBUILD_BINARY_PATH=${ESBUILD_BINARY_PATH}`);
112
113
  } else {
@@ -198,7 +199,7 @@ for your current platform.`);
198
199
  "node_modules",
199
200
  ".cache",
200
201
  "esbuild",
201
- `pnpapi-${pkg.replace("/", "-")}-${"0.17.4"}-${path.basename(subpath)}`
202
+ `pnpapi-${pkg.replace("/", "-")}-${"0.17.6"}-${path.basename(subpath)}`
202
203
  );
203
204
  if (!fs.existsSync(binTargetPath)) {
204
205
  fs.mkdirSync(path.dirname(binTargetPath), { recursive: true });
package/install.js CHANGED
@@ -27,6 +27,7 @@ var fs = require("fs");
27
27
  var os = require("os");
28
28
  var path = require("path");
29
29
  var ESBUILD_BINARY_PATH = process.env.ESBUILD_BINARY_PATH || ESBUILD_BINARY_PATH;
30
+ var isValidBinaryPath = (x) => !!x && x !== "/usr/bin/esbuild";
30
31
  var knownWindowsPackages = {
31
32
  "win32 arm64 LE": "@esbuild/win32-arm64",
32
33
  "win32 ia32 LE": "@esbuild/win32-ia32",
@@ -126,8 +127,8 @@ which means the "esbuild" binary executable can't be run. You can either:
126
127
  }
127
128
  throw err;
128
129
  }
129
- if (stdout !== "0.17.4") {
130
- throw new Error(`Expected ${JSON.stringify("0.17.4")} but got ${JSON.stringify(stdout)}`);
130
+ if (stdout !== "0.17.6") {
131
+ throw new Error(`Expected ${JSON.stringify("0.17.6")} but got ${JSON.stringify(stdout)}`);
131
132
  }
132
133
  }
133
134
  function isYarn() {
@@ -179,7 +180,7 @@ function installUsingNPM(pkg, subpath, binPath) {
179
180
  try {
180
181
  fs2.writeFileSync(path2.join(installDir, "package.json"), "{}");
181
182
  child_process.execSync(
182
- `npm install --loglevel=error --prefer-offline --no-audit --progress=false ${pkg}@${"0.17.4"}`,
183
+ `npm install --loglevel=error --prefer-offline --no-audit --progress=false ${pkg}@${"0.17.6"}`,
183
184
  { cwd: installDir, stdio: "pipe", env }
184
185
  );
185
186
  const installedBinPath = path2.join(installDir, "node_modules", pkg, subpath);
@@ -230,7 +231,7 @@ function maybeOptimizePackage(binPath) {
230
231
  }
231
232
  }
232
233
  async function downloadDirectlyFromNPM(pkg, subpath, binPath) {
233
- const url = `https://registry.npmjs.org/${pkg}/-/${pkg.replace("@esbuild/", "")}-${"0.17.4"}.tgz`;
234
+ const url = `https://registry.npmjs.org/${pkg}/-/${pkg.replace("@esbuild/", "")}-${"0.17.6"}.tgz`;
234
235
  console.error(`[esbuild] Trying to download ${JSON.stringify(url)}`);
235
236
  try {
236
237
  fs2.writeFileSync(binPath, extractFileFromTarGzip(await fetch(url), subpath));
@@ -241,7 +242,7 @@ async function downloadDirectlyFromNPM(pkg, subpath, binPath) {
241
242
  }
242
243
  }
243
244
  async function checkAndPreparePackage() {
244
- if (ESBUILD_BINARY_PATH) {
245
+ if (isValidBinaryPath(ESBUILD_BINARY_PATH)) {
245
246
  if (!fs2.existsSync(ESBUILD_BINARY_PATH)) {
246
247
  console.warn(`[esbuild] Ignoring bad configuration: ESBUILD_BINARY_PATH=${ESBUILD_BINARY_PATH}`);
247
248
  } else {
package/lib/main.js CHANGED
@@ -735,8 +735,8 @@ function createChannel(streamIn) {
735
735
  if (isFirstPacket) {
736
736
  isFirstPacket = false;
737
737
  let binaryVersion = String.fromCharCode(...bytes);
738
- if (binaryVersion !== "0.17.4") {
739
- throw new Error(`Cannot start service: Host version "${"0.17.4"}" does not match binary version ${quote(binaryVersion)}`);
738
+ if (binaryVersion !== "0.17.6") {
739
+ throw new Error(`Cannot start service: Host version "${"0.17.6"}" does not match binary version ${quote(binaryVersion)}`);
740
740
  }
741
741
  return;
742
742
  }
@@ -1734,6 +1734,7 @@ var fs = require("fs");
1734
1734
  var os = require("os");
1735
1735
  var path = require("path");
1736
1736
  var ESBUILD_BINARY_PATH = process.env.ESBUILD_BINARY_PATH || ESBUILD_BINARY_PATH;
1737
+ var isValidBinaryPath = (x) => !!x && x !== "/usr/bin/esbuild";
1737
1738
  var packageDarwin_arm64 = "@esbuild/darwin-arm64";
1738
1739
  var packageDarwin_x64 = "@esbuild/darwin-x64";
1739
1740
  var knownWindowsPackages = {
@@ -1812,7 +1813,7 @@ function downloadedBinPath(pkg, subpath) {
1812
1813
  return path.join(esbuildLibDir, `downloaded-${pkg.replace("/", "-")}-${path.basename(subpath)}`);
1813
1814
  }
1814
1815
  function generateBinPath() {
1815
- if (ESBUILD_BINARY_PATH) {
1816
+ if (isValidBinaryPath(ESBUILD_BINARY_PATH)) {
1816
1817
  if (!fs.existsSync(ESBUILD_BINARY_PATH)) {
1817
1818
  console.warn(`[esbuild] Ignoring bad configuration: ESBUILD_BINARY_PATH=${ESBUILD_BINARY_PATH}`);
1818
1819
  } else {
@@ -1904,7 +1905,7 @@ for your current platform.`);
1904
1905
  "node_modules",
1905
1906
  ".cache",
1906
1907
  "esbuild",
1907
- `pnpapi-${pkg.replace("/", "-")}-${"0.17.4"}-${path.basename(subpath)}`
1908
+ `pnpapi-${pkg.replace("/", "-")}-${"0.17.6"}-${path.basename(subpath)}`
1908
1909
  );
1909
1910
  if (!fs.existsSync(binTargetPath)) {
1910
1911
  fs.mkdirSync(path.dirname(binTargetPath), { recursive: true });
@@ -1939,7 +1940,7 @@ if (process.env.ESBUILD_WORKER_THREADS !== "0") {
1939
1940
  }
1940
1941
  }
1941
1942
  var _a;
1942
- var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.17.4";
1943
+ var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.17.6";
1943
1944
  var esbuildCommandAndArgs = () => {
1944
1945
  if ((!ESBUILD_BINARY_PATH || false) && (path2.basename(__filename) !== "main.js" || path2.basename(__dirname) !== "lib")) {
1945
1946
  throw new Error(
@@ -2006,7 +2007,7 @@ var fsAsync = {
2006
2007
  }
2007
2008
  }
2008
2009
  };
2009
- var version = "0.17.4";
2010
+ var version = "0.17.6";
2010
2011
  var build = (options) => ensureServiceIsRunning().build(options);
2011
2012
  var context = (buildOptions) => ensureServiceIsRunning().context(buildOptions);
2012
2013
  var transform = (input, options) => ensureServiceIsRunning().transform(input, options);
@@ -2116,7 +2117,7 @@ var ensureServiceIsRunning = () => {
2116
2117
  if (longLivedService)
2117
2118
  return longLivedService;
2118
2119
  let [command, args] = esbuildCommandAndArgs();
2119
- let child = child_process.spawn(command, args.concat(`--service=${"0.17.4"}`, "--ping"), {
2120
+ let child = child_process.spawn(command, args.concat(`--service=${"0.17.6"}`, "--ping"), {
2120
2121
  windowsHide: true,
2121
2122
  stdio: ["pipe", "pipe", "inherit"],
2122
2123
  cwd: defaultWD
@@ -2216,7 +2217,7 @@ var runServiceSync = (callback) => {
2216
2217
  esbuild: node_exports
2217
2218
  });
2218
2219
  callback(service);
2219
- let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.17.4"}`), {
2220
+ let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.17.6"}`), {
2220
2221
  cwd: defaultWD,
2221
2222
  windowsHide: true,
2222
2223
  input: stdin,
@@ -2236,7 +2237,7 @@ var workerThreadService = null;
2236
2237
  var startWorkerThreadService = (worker_threads2) => {
2237
2238
  let { port1: mainPort, port2: workerPort } = new worker_threads2.MessageChannel();
2238
2239
  let worker = new worker_threads2.Worker(__filename, {
2239
- workerData: { workerPort, defaultWD, esbuildVersion: "0.17.4" },
2240
+ workerData: { workerPort, defaultWD, esbuildVersion: "0.17.6" },
2240
2241
  transferList: [workerPort],
2241
2242
  // From node's documentation: https://nodejs.org/api/worker_threads.html
2242
2243
  //
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esbuild",
3
- "version": "0.17.4",
3
+ "version": "0.17.6",
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.17.4",
19
- "@esbuild/android-arm64": "0.17.4",
20
- "@esbuild/android-x64": "0.17.4",
21
- "@esbuild/darwin-arm64": "0.17.4",
22
- "@esbuild/darwin-x64": "0.17.4",
23
- "@esbuild/freebsd-arm64": "0.17.4",
24
- "@esbuild/freebsd-x64": "0.17.4",
25
- "@esbuild/linux-arm": "0.17.4",
26
- "@esbuild/linux-arm64": "0.17.4",
27
- "@esbuild/linux-ia32": "0.17.4",
28
- "@esbuild/linux-loong64": "0.17.4",
29
- "@esbuild/linux-mips64el": "0.17.4",
30
- "@esbuild/linux-ppc64": "0.17.4",
31
- "@esbuild/linux-riscv64": "0.17.4",
32
- "@esbuild/linux-s390x": "0.17.4",
33
- "@esbuild/linux-x64": "0.17.4",
34
- "@esbuild/netbsd-x64": "0.17.4",
35
- "@esbuild/openbsd-x64": "0.17.4",
36
- "@esbuild/sunos-x64": "0.17.4",
37
- "@esbuild/win32-arm64": "0.17.4",
38
- "@esbuild/win32-ia32": "0.17.4",
39
- "@esbuild/win32-x64": "0.17.4"
18
+ "@esbuild/android-arm": "0.17.6",
19
+ "@esbuild/android-arm64": "0.17.6",
20
+ "@esbuild/android-x64": "0.17.6",
21
+ "@esbuild/darwin-arm64": "0.17.6",
22
+ "@esbuild/darwin-x64": "0.17.6",
23
+ "@esbuild/freebsd-arm64": "0.17.6",
24
+ "@esbuild/freebsd-x64": "0.17.6",
25
+ "@esbuild/linux-arm": "0.17.6",
26
+ "@esbuild/linux-arm64": "0.17.6",
27
+ "@esbuild/linux-ia32": "0.17.6",
28
+ "@esbuild/linux-loong64": "0.17.6",
29
+ "@esbuild/linux-mips64el": "0.17.6",
30
+ "@esbuild/linux-ppc64": "0.17.6",
31
+ "@esbuild/linux-riscv64": "0.17.6",
32
+ "@esbuild/linux-s390x": "0.17.6",
33
+ "@esbuild/linux-x64": "0.17.6",
34
+ "@esbuild/netbsd-x64": "0.17.6",
35
+ "@esbuild/openbsd-x64": "0.17.6",
36
+ "@esbuild/sunos-x64": "0.17.6",
37
+ "@esbuild/win32-arm64": "0.17.6",
38
+ "@esbuild/win32-ia32": "0.17.6",
39
+ "@esbuild/win32-x64": "0.17.6"
40
40
  },
41
41
  "license": "MIT"
42
42
  }