esbuild 0.15.4 → 0.15.7

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
@@ -151,16 +151,22 @@ by esbuild to install the correct binary executable for your current platform.`)
151
151
  throw e;
152
152
  }
153
153
  }
154
- let isYarnPnP = false;
154
+ let pnpapi;
155
155
  try {
156
- require("pnpapi");
157
- isYarnPnP = true;
156
+ pnpapi = require("pnpapi");
158
157
  } catch (e) {
159
158
  }
160
- if (isYarnPnP) {
161
- const esbuildLibDir = path.dirname(require.resolve("esbuild"));
162
- const binTargetPath = path.join(esbuildLibDir, `pnpapi-${pkg}-${path.basename(subpath)}`);
159
+ if (pnpapi) {
160
+ const root = pnpapi.getPackageInformation(pnpapi.topLevel).packageLocation;
161
+ const binTargetPath = path.join(
162
+ root,
163
+ "node_modules",
164
+ ".cache",
165
+ "esbuild",
166
+ `pnpapi-${pkg}-${"0.15.7"}-${path.basename(subpath)}`
167
+ );
163
168
  if (!fs.existsSync(binTargetPath)) {
169
+ fs.mkdirSync(path.dirname(binTargetPath), { recursive: true });
164
170
  fs.copyFileSync(binPath2, binTargetPath);
165
171
  fs.chmodSync(binTargetPath, 493);
166
172
  }
package/install.js CHANGED
@@ -89,8 +89,8 @@ function validateBinaryVersion(...command) {
89
89
  const stdout = child_process.execFileSync(command.shift(), command, {
90
90
  stdio: "pipe"
91
91
  }).toString().trim();
92
- if (stdout !== "0.15.4") {
93
- throw new Error(`Expected ${JSON.stringify("0.15.4")} but got ${JSON.stringify(stdout)}`);
92
+ if (stdout !== "0.15.7") {
93
+ throw new Error(`Expected ${JSON.stringify("0.15.7")} but got ${JSON.stringify(stdout)}`);
94
94
  }
95
95
  }
96
96
  function isYarn() {
@@ -142,7 +142,7 @@ function installUsingNPM(pkg, subpath, binPath) {
142
142
  try {
143
143
  fs2.writeFileSync(path2.join(installDir, "package.json"), "{}");
144
144
  child_process.execSync(
145
- `npm install --loglevel=error --prefer-offline --no-audit --progress=false ${pkg}@${"0.15.4"}`,
145
+ `npm install --loglevel=error --prefer-offline --no-audit --progress=false ${pkg}@${"0.15.7"}`,
146
146
  { cwd: installDir, stdio: "pipe", env }
147
147
  );
148
148
  const installedBinPath = path2.join(installDir, "node_modules", pkg, subpath);
@@ -193,7 +193,7 @@ function maybeOptimizePackage(binPath) {
193
193
  }
194
194
  }
195
195
  async function downloadDirectlyFromNPM(pkg, subpath, binPath) {
196
- const url = `https://registry.npmjs.org/${pkg}/-/${pkg}-${"0.15.4"}.tgz`;
196
+ const url = `https://registry.npmjs.org/${pkg}/-/${pkg}-${"0.15.7"}.tgz`;
197
197
  console.error(`[esbuild] Trying to download ${JSON.stringify(url)}`);
198
198
  try {
199
199
  fs2.writeFileSync(binPath, extractFileFromTarGzip(await fetch(url), subpath));
@@ -237,7 +237,7 @@ this. If that fails, you need to remove the "--no-optional" flag to use esbuild.
237
237
  }
238
238
  checkAndPreparePackage().then(() => {
239
239
  if (isToPathJS) {
240
- validateBinaryVersion("node", toPath);
240
+ validateBinaryVersion(process.execPath, toPath);
241
241
  } else {
242
242
  validateBinaryVersion(toPath);
243
243
  }
package/lib/main.js CHANGED
@@ -758,8 +758,8 @@ function createChannel(streamIn) {
758
758
  if (isFirstPacket) {
759
759
  isFirstPacket = false;
760
760
  let binaryVersion = String.fromCharCode(...bytes);
761
- if (binaryVersion !== "0.15.4") {
762
- throw new Error(`Cannot start service: Host version "${"0.15.4"}" does not match binary version ${JSON.stringify(binaryVersion)}`);
761
+ if (binaryVersion !== "0.15.7") {
762
+ throw new Error(`Cannot start service: Host version "${"0.15.7"}" does not match binary version ${JSON.stringify(binaryVersion)}`);
763
763
  }
764
764
  return;
765
765
  }
@@ -1849,16 +1849,22 @@ by esbuild to install the correct binary executable for your current platform.`)
1849
1849
  throw e;
1850
1850
  }
1851
1851
  }
1852
- let isYarnPnP = false;
1852
+ let pnpapi;
1853
1853
  try {
1854
- require("pnpapi");
1855
- isYarnPnP = true;
1854
+ pnpapi = require("pnpapi");
1856
1855
  } catch (e) {
1857
1856
  }
1858
- if (isYarnPnP) {
1859
- const esbuildLibDir = path.dirname(require.resolve("esbuild"));
1860
- const binTargetPath = path.join(esbuildLibDir, `pnpapi-${pkg}-${path.basename(subpath)}`);
1857
+ if (pnpapi) {
1858
+ const root = pnpapi.getPackageInformation(pnpapi.topLevel).packageLocation;
1859
+ const binTargetPath = path.join(
1860
+ root,
1861
+ "node_modules",
1862
+ ".cache",
1863
+ "esbuild",
1864
+ `pnpapi-${pkg}-${"0.15.7"}-${path.basename(subpath)}`
1865
+ );
1861
1866
  if (!fs.existsSync(binTargetPath)) {
1867
+ fs.mkdirSync(path.dirname(binTargetPath), { recursive: true });
1862
1868
  fs.copyFileSync(binPath, binTargetPath);
1863
1869
  fs.chmodSync(binTargetPath, 493);
1864
1870
  }
@@ -1886,7 +1892,7 @@ if (process.env.ESBUILD_WORKER_THREADS !== "0") {
1886
1892
  }
1887
1893
  }
1888
1894
  var _a;
1889
- var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.15.4";
1895
+ var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.15.7";
1890
1896
  var esbuildCommandAndArgs = () => {
1891
1897
  if ((!ESBUILD_BINARY_PATH || false) && (path2.basename(__filename) !== "main.js" || path2.basename(__dirname) !== "lib")) {
1892
1898
  throw new Error(
@@ -1897,12 +1903,13 @@ More information: The file containing the code for esbuild's JavaScript API (${_
1897
1903
  }
1898
1904
  if (false) {
1899
1905
  return ["node", [path2.join(__dirname, "..", "bin", "esbuild")]];
1900
- }
1901
- const { binPath, isWASM } = generateBinPath();
1902
- if (isWASM) {
1903
- return ["node", [binPath]];
1904
1906
  } else {
1905
- return [binPath, []];
1907
+ const { binPath, isWASM } = generateBinPath();
1908
+ if (isWASM) {
1909
+ return ["node", [binPath]];
1910
+ } else {
1911
+ return [binPath, []];
1912
+ }
1906
1913
  }
1907
1914
  };
1908
1915
  var isTTY = () => tty.isatty(2);
@@ -1952,7 +1959,7 @@ var fsAsync = {
1952
1959
  }
1953
1960
  }
1954
1961
  };
1955
- var version = "0.15.4";
1962
+ var version = "0.15.7";
1956
1963
  var build = (options) => ensureServiceIsRunning().build(options);
1957
1964
  var serve = (serveOptions, buildOptions) => ensureServiceIsRunning().serve(serveOptions, buildOptions);
1958
1965
  var transform = (input, options) => ensureServiceIsRunning().transform(input, options);
@@ -2063,7 +2070,7 @@ var ensureServiceIsRunning = () => {
2063
2070
  if (longLivedService)
2064
2071
  return longLivedService;
2065
2072
  let [command, args] = esbuildCommandAndArgs();
2066
- let child = child_process.spawn(command, args.concat(`--service=${"0.15.4"}`, "--ping"), {
2073
+ let child = child_process.spawn(command, args.concat(`--service=${"0.15.7"}`, "--ping"), {
2067
2074
  windowsHide: true,
2068
2075
  stdio: ["pipe", "pipe", "inherit"],
2069
2076
  cwd: defaultWD
@@ -2177,7 +2184,7 @@ var runServiceSync = (callback) => {
2177
2184
  esbuild: node_exports
2178
2185
  });
2179
2186
  callback(service);
2180
- let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.15.4"}`), {
2187
+ let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.15.7"}`), {
2181
2188
  cwd: defaultWD,
2182
2189
  windowsHide: true,
2183
2190
  input: stdin,
@@ -2193,7 +2200,7 @@ var workerThreadService = null;
2193
2200
  var startWorkerThreadService = (worker_threads2) => {
2194
2201
  let { port1: mainPort, port2: workerPort } = new worker_threads2.MessageChannel();
2195
2202
  let worker = new worker_threads2.Worker(__filename, {
2196
- workerData: { workerPort, defaultWD, esbuildVersion: "0.15.4" },
2203
+ workerData: { workerPort, defaultWD, esbuildVersion: "0.15.7" },
2197
2204
  transferList: [workerPort],
2198
2205
  execArgv: []
2199
2206
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esbuild",
3
- "version": "0.15.4",
3
+ "version": "0.15.7",
4
4
  "description": "An extremely fast JavaScript and CSS bundler and minifier.",
5
5
  "repository": "https://github.com/evanw/esbuild",
6
6
  "scripts": {
@@ -15,27 +15,27 @@
15
15
  "esbuild": "bin/esbuild"
16
16
  },
17
17
  "optionalDependencies": {
18
- "@esbuild/linux-loong64": "0.15.4",
19
- "esbuild-android-64": "0.15.4",
20
- "esbuild-android-arm64": "0.15.4",
21
- "esbuild-darwin-64": "0.15.4",
22
- "esbuild-darwin-arm64": "0.15.4",
23
- "esbuild-freebsd-64": "0.15.4",
24
- "esbuild-freebsd-arm64": "0.15.4",
25
- "esbuild-linux-32": "0.15.4",
26
- "esbuild-linux-64": "0.15.4",
27
- "esbuild-linux-arm": "0.15.4",
28
- "esbuild-linux-arm64": "0.15.4",
29
- "esbuild-linux-mips64le": "0.15.4",
30
- "esbuild-linux-ppc64le": "0.15.4",
31
- "esbuild-linux-riscv64": "0.15.4",
32
- "esbuild-linux-s390x": "0.15.4",
33
- "esbuild-netbsd-64": "0.15.4",
34
- "esbuild-openbsd-64": "0.15.4",
35
- "esbuild-sunos-64": "0.15.4",
36
- "esbuild-windows-32": "0.15.4",
37
- "esbuild-windows-64": "0.15.4",
38
- "esbuild-windows-arm64": "0.15.4"
18
+ "@esbuild/linux-loong64": "0.15.7",
19
+ "esbuild-android-64": "0.15.7",
20
+ "esbuild-android-arm64": "0.15.7",
21
+ "esbuild-darwin-64": "0.15.7",
22
+ "esbuild-darwin-arm64": "0.15.7",
23
+ "esbuild-freebsd-64": "0.15.7",
24
+ "esbuild-freebsd-arm64": "0.15.7",
25
+ "esbuild-linux-32": "0.15.7",
26
+ "esbuild-linux-64": "0.15.7",
27
+ "esbuild-linux-arm": "0.15.7",
28
+ "esbuild-linux-arm64": "0.15.7",
29
+ "esbuild-linux-mips64le": "0.15.7",
30
+ "esbuild-linux-ppc64le": "0.15.7",
31
+ "esbuild-linux-riscv64": "0.15.7",
32
+ "esbuild-linux-s390x": "0.15.7",
33
+ "esbuild-netbsd-64": "0.15.7",
34
+ "esbuild-openbsd-64": "0.15.7",
35
+ "esbuild-sunos-64": "0.15.7",
36
+ "esbuild-windows-32": "0.15.7",
37
+ "esbuild-windows-64": "0.15.7",
38
+ "esbuild-windows-arm64": "0.15.7"
39
39
  },
40
40
  "license": "MIT"
41
41
  }