esbuild 0.16.8 → 0.16.10

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
@@ -190,7 +190,7 @@ for your current platform.`);
190
190
  "node_modules",
191
191
  ".cache",
192
192
  "esbuild",
193
- `pnpapi-${pkg.replace("/", "-")}-${"0.16.8"}-${path.basename(subpath)}`
193
+ `pnpapi-${pkg.replace("/", "-")}-${"0.16.10"}-${path.basename(subpath)}`
194
194
  );
195
195
  if (!fs.existsSync(binTargetPath)) {
196
196
  fs.mkdirSync(path.dirname(binTargetPath), { recursive: true });
package/install.js CHANGED
@@ -90,8 +90,8 @@ function validateBinaryVersion(...command) {
90
90
  const stdout = child_process.execFileSync(command.shift(), command, {
91
91
  stdio: "pipe"
92
92
  }).toString().trim();
93
- if (stdout !== "0.16.8") {
94
- throw new Error(`Expected ${JSON.stringify("0.16.8")} but got ${JSON.stringify(stdout)}`);
93
+ if (stdout !== "0.16.10") {
94
+ throw new Error(`Expected ${JSON.stringify("0.16.10")} but got ${JSON.stringify(stdout)}`);
95
95
  }
96
96
  }
97
97
  function isYarn() {
@@ -143,7 +143,7 @@ function installUsingNPM(pkg, subpath, binPath) {
143
143
  try {
144
144
  fs2.writeFileSync(path2.join(installDir, "package.json"), "{}");
145
145
  child_process.execSync(
146
- `npm install --loglevel=error --prefer-offline --no-audit --progress=false ${pkg}@${"0.16.8"}`,
146
+ `npm install --loglevel=error --prefer-offline --no-audit --progress=false ${pkg}@${"0.16.10"}`,
147
147
  { cwd: installDir, stdio: "pipe", env }
148
148
  );
149
149
  const installedBinPath = path2.join(installDir, "node_modules", pkg, subpath);
@@ -194,7 +194,7 @@ function maybeOptimizePackage(binPath) {
194
194
  }
195
195
  }
196
196
  async function downloadDirectlyFromNPM(pkg, subpath, binPath) {
197
- const url = `https://registry.npmjs.org/${pkg}/-/${pkg.replace("@esbuild/", "")}-${"0.16.8"}.tgz`;
197
+ const url = `https://registry.npmjs.org/${pkg}/-/${pkg.replace("@esbuild/", "")}-${"0.16.10"}.tgz`;
198
198
  console.error(`[esbuild] Trying to download ${JSON.stringify(url)}`);
199
199
  try {
200
200
  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' | 'copy' | 'default';
3
+ export type Loader = 'base64' | 'binary' | 'copy' | 'css' | 'dataurl' | 'default' | 'empty' | 'file' | 'js' | 'json' | 'jsx' | 'text' | 'ts' | 'tsx';
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';
@@ -280,6 +280,8 @@ export interface TransformResult {
280
280
  warnings: Message[];
281
281
  /** Only when "mangleCache" is present */
282
282
  mangleCache?: Record<string, string | false>;
283
+ /** Only when "legalComments" is "external" */
284
+ legalComments?: string;
283
285
  }
284
286
 
285
287
  export interface TransformFailure extends Error {
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.16.8") {
739
- throw new Error(`Cannot start service: Host version "${"0.16.8"}" does not match binary version ${quote(binaryVersion)}`);
738
+ if (binaryVersion !== "0.16.10") {
739
+ throw new Error(`Cannot start service: Host version "${"0.16.10"}" does not match binary version ${quote(binaryVersion)}`);
740
740
  }
741
741
  return;
742
742
  }
@@ -822,6 +822,8 @@ function createChannel(streamIn) {
822
822
  let next = () => {
823
823
  if (--outstanding === 0) {
824
824
  let result = { warnings, code: response.code, map: response.map };
825
+ if ("legalComments" in response)
826
+ result.legalComments = response == null ? void 0 : response.legalComments;
825
827
  if (response.mangleCache)
826
828
  result.mangleCache = response == null ? void 0 : response.mangleCache;
827
829
  callback(null, result);
@@ -1858,7 +1860,7 @@ for your current platform.`);
1858
1860
  "node_modules",
1859
1861
  ".cache",
1860
1862
  "esbuild",
1861
- `pnpapi-${pkg.replace("/", "-")}-${"0.16.8"}-${path.basename(subpath)}`
1863
+ `pnpapi-${pkg.replace("/", "-")}-${"0.16.10"}-${path.basename(subpath)}`
1862
1864
  );
1863
1865
  if (!fs.existsSync(binTargetPath)) {
1864
1866
  fs.mkdirSync(path.dirname(binTargetPath), { recursive: true });
@@ -1890,7 +1892,7 @@ if (process.env.ESBUILD_WORKER_THREADS !== "0") {
1890
1892
  }
1891
1893
  }
1892
1894
  var _a;
1893
- var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.16.8";
1895
+ var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.16.10";
1894
1896
  var esbuildCommandAndArgs = () => {
1895
1897
  if ((!ESBUILD_BINARY_PATH || false) && (path2.basename(__filename) !== "main.js" || path2.basename(__dirname) !== "lib")) {
1896
1898
  throw new Error(
@@ -1957,7 +1959,7 @@ var fsAsync = {
1957
1959
  }
1958
1960
  }
1959
1961
  };
1960
- var version = "0.16.8";
1962
+ var version = "0.16.10";
1961
1963
  var build = (options) => ensureServiceIsRunning().build(options);
1962
1964
  var serve = (serveOptions, buildOptions) => ensureServiceIsRunning().serve(serveOptions, buildOptions);
1963
1965
  var transform = (input, options) => ensureServiceIsRunning().transform(input, options);
@@ -2068,7 +2070,7 @@ var ensureServiceIsRunning = () => {
2068
2070
  if (longLivedService)
2069
2071
  return longLivedService;
2070
2072
  let [command, args] = esbuildCommandAndArgs();
2071
- let child = child_process.spawn(command, args.concat(`--service=${"0.16.8"}`, "--ping"), {
2073
+ let child = child_process.spawn(command, args.concat(`--service=${"0.16.10"}`, "--ping"), {
2072
2074
  windowsHide: true,
2073
2075
  stdio: ["pipe", "pipe", "inherit"],
2074
2076
  cwd: defaultWD
@@ -2182,7 +2184,7 @@ var runServiceSync = (callback) => {
2182
2184
  esbuild: node_exports
2183
2185
  });
2184
2186
  callback(service);
2185
- let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.16.8"}`), {
2187
+ let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.16.10"}`), {
2186
2188
  cwd: defaultWD,
2187
2189
  windowsHide: true,
2188
2190
  input: stdin,
@@ -2198,7 +2200,7 @@ var workerThreadService = null;
2198
2200
  var startWorkerThreadService = (worker_threads2) => {
2199
2201
  let { port1: mainPort, port2: workerPort } = new worker_threads2.MessageChannel();
2200
2202
  let worker = new worker_threads2.Worker(__filename, {
2201
- workerData: { workerPort, defaultWD, esbuildVersion: "0.16.8" },
2203
+ workerData: { workerPort, defaultWD, esbuildVersion: "0.16.10" },
2202
2204
  transferList: [workerPort],
2203
2205
  execArgv: []
2204
2206
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esbuild",
3
- "version": "0.16.8",
3
+ "version": "0.16.10",
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.8",
19
- "@esbuild/android-arm64": "0.16.8",
20
- "@esbuild/android-x64": "0.16.8",
21
- "@esbuild/darwin-arm64": "0.16.8",
22
- "@esbuild/darwin-x64": "0.16.8",
23
- "@esbuild/freebsd-arm64": "0.16.8",
24
- "@esbuild/freebsd-x64": "0.16.8",
25
- "@esbuild/linux-arm": "0.16.8",
26
- "@esbuild/linux-arm64": "0.16.8",
27
- "@esbuild/linux-ia32": "0.16.8",
28
- "@esbuild/linux-loong64": "0.16.8",
29
- "@esbuild/linux-mips64el": "0.16.8",
30
- "@esbuild/linux-ppc64": "0.16.8",
31
- "@esbuild/linux-riscv64": "0.16.8",
32
- "@esbuild/linux-s390x": "0.16.8",
33
- "@esbuild/linux-x64": "0.16.8",
34
- "@esbuild/netbsd-x64": "0.16.8",
35
- "@esbuild/openbsd-x64": "0.16.8",
36
- "@esbuild/sunos-x64": "0.16.8",
37
- "@esbuild/win32-arm64": "0.16.8",
38
- "@esbuild/win32-ia32": "0.16.8",
39
- "@esbuild/win32-x64": "0.16.8"
18
+ "@esbuild/android-arm": "0.16.10",
19
+ "@esbuild/android-arm64": "0.16.10",
20
+ "@esbuild/android-x64": "0.16.10",
21
+ "@esbuild/darwin-arm64": "0.16.10",
22
+ "@esbuild/darwin-x64": "0.16.10",
23
+ "@esbuild/freebsd-arm64": "0.16.10",
24
+ "@esbuild/freebsd-x64": "0.16.10",
25
+ "@esbuild/linux-arm": "0.16.10",
26
+ "@esbuild/linux-arm64": "0.16.10",
27
+ "@esbuild/linux-ia32": "0.16.10",
28
+ "@esbuild/linux-loong64": "0.16.10",
29
+ "@esbuild/linux-mips64el": "0.16.10",
30
+ "@esbuild/linux-ppc64": "0.16.10",
31
+ "@esbuild/linux-riscv64": "0.16.10",
32
+ "@esbuild/linux-s390x": "0.16.10",
33
+ "@esbuild/linux-x64": "0.16.10",
34
+ "@esbuild/netbsd-x64": "0.16.10",
35
+ "@esbuild/openbsd-x64": "0.16.10",
36
+ "@esbuild/sunos-x64": "0.16.10",
37
+ "@esbuild/win32-arm64": "0.16.10",
38
+ "@esbuild/win32-ia32": "0.16.10",
39
+ "@esbuild/win32-x64": "0.16.10"
40
40
  },
41
41
  "license": "MIT"
42
42
  }