esbuild 0.14.13 → 0.14.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/install.js CHANGED
@@ -92,9 +92,11 @@ var toPath = path2.join(__dirname, "bin", "esbuild");
92
92
  var isToPathJS = true;
93
93
  function validateBinaryVersion(...command) {
94
94
  command.push("--version");
95
- const stdout = child_process.execFileSync(command.shift(), command).toString().trim();
96
- if (stdout !== "0.14.13") {
97
- throw new Error(`Expected ${JSON.stringify("0.14.13")} but got ${JSON.stringify(stdout)}`);
95
+ const stdout = child_process.execFileSync(command.shift(), command, {
96
+ stdio: "pipe"
97
+ }).toString().trim();
98
+ if (stdout !== "0.14.17") {
99
+ throw new Error(`Expected ${JSON.stringify("0.14.17")} but got ${JSON.stringify(stdout)}`);
98
100
  }
99
101
  }
100
102
  function isYarn() {
@@ -145,7 +147,7 @@ function installUsingNPM(pkg, subpath, binPath) {
145
147
  fs2.mkdirSync(installDir);
146
148
  try {
147
149
  fs2.writeFileSync(path2.join(installDir, "package.json"), "{}");
148
- child_process.execSync(`npm install --loglevel=error --prefer-offline --no-audit --progress=false ${pkg}@${"0.14.13"}`, { cwd: installDir, stdio: "pipe", env });
150
+ child_process.execSync(`npm install --loglevel=error --prefer-offline --no-audit --progress=false ${pkg}@${"0.14.17"}`, { cwd: installDir, stdio: "pipe", env });
149
151
  const installedBinPath = path2.join(installDir, "node_modules", pkg, subpath);
150
152
  fs2.renameSync(installedBinPath, binPath);
151
153
  } finally {
@@ -194,7 +196,7 @@ function maybeOptimizePackage(binPath) {
194
196
  }
195
197
  }
196
198
  async function downloadDirectlyFromNPM(pkg, subpath, binPath) {
197
- const url = `https://registry.npmjs.org/${pkg}/-/${pkg}-${"0.14.13"}.tgz`;
199
+ const url = `https://registry.npmjs.org/${pkg}/-/${pkg}-${"0.14.17"}.tgz`;
198
200
  console.error(`[esbuild] Trying to download ${JSON.stringify(url)}`);
199
201
  try {
200
202
  fs2.writeFileSync(binPath, extractFileFromTarGzip(await fetch(url), subpath));
package/lib/main.d.ts CHANGED
@@ -22,6 +22,11 @@ interface CommonOptions {
22
22
  /** Documentation: https://esbuild.github.io/api/#target */
23
23
  target?: string | string[];
24
24
 
25
+ /** Documentation: https://esbuild.github.io/api/#mangle-props */
26
+ mangleProps?: RegExp;
27
+ /** Documentation: https://esbuild.github.io/api/#mangle-props */
28
+ reserveProps?: RegExp;
29
+ /** Documentation: https://esbuild.github.io/api/#drop */
25
30
  drop?: Drop[];
26
31
  /** Documentation: https://esbuild.github.io/api/#minify */
27
32
  minify?: boolean;
package/lib/main.js CHANGED
@@ -290,6 +290,8 @@ function pushCommonFlags(flags, options, keys) {
290
290
  let target = getFlag(options, keys, "target", mustBeStringOrArray);
291
291
  let format = getFlag(options, keys, "format", mustBeString);
292
292
  let globalName = getFlag(options, keys, "globalName", mustBeString);
293
+ let mangleProps = getFlag(options, keys, "mangleProps", mustBeRegExp);
294
+ let reserveProps = getFlag(options, keys, "reserveProps", mustBeRegExp);
293
295
  let minify = getFlag(options, keys, "minify", mustBeBoolean);
294
296
  let minifySyntax = getFlag(options, keys, "minifySyntax", mustBeBoolean);
295
297
  let minifyWhitespace = getFlag(options, keys, "minifyWhitespace", mustBeBoolean);
@@ -337,6 +339,10 @@ function pushCommonFlags(flags, options, keys) {
337
339
  if (drop)
338
340
  for (let what of drop)
339
341
  flags.push(`--drop:${what}`);
342
+ if (mangleProps)
343
+ flags.push(`--mangle-props=${mangleProps.source}`);
344
+ if (reserveProps)
345
+ flags.push(`--reserve-props=${reserveProps.source}`);
340
346
  if (jsx)
341
347
  flags.push(`--jsx=${jsx}`);
342
348
  if (jsxFactory)
@@ -717,8 +723,8 @@ function createChannel(streamIn) {
717
723
  if (isFirstPacket) {
718
724
  isFirstPacket = false;
719
725
  let binaryVersion = String.fromCharCode(...bytes);
720
- if (binaryVersion !== "0.14.13") {
721
- throw new Error(`Cannot start service: Host version "${"0.14.13"}" does not match binary version ${JSON.stringify(binaryVersion)}`);
726
+ if (binaryVersion !== "0.14.17") {
727
+ throw new Error(`Cannot start service: Host version "${"0.14.17"}" does not match binary version ${JSON.stringify(binaryVersion)}`);
722
728
  }
723
729
  return;
724
730
  }
@@ -1804,7 +1810,7 @@ if (process.env.ESBUILD_WORKER_THREADS !== "0") {
1804
1810
  }
1805
1811
  }
1806
1812
  var _a;
1807
- var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.14.13";
1813
+ var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.14.17";
1808
1814
  var esbuildCommandAndArgs = () => {
1809
1815
  if ((!ESBUILD_BINARY_PATH || false) && (path2.basename(__filename) !== "main.js" || path2.basename(__dirname) !== "lib")) {
1810
1816
  throw new Error(`The esbuild JavaScript API cannot be bundled. Please mark the "esbuild" package as external so it's not included in the bundle.
@@ -1863,7 +1869,7 @@ var fsAsync = {
1863
1869
  }
1864
1870
  }
1865
1871
  };
1866
- var version = "0.14.13";
1872
+ var version = "0.14.17";
1867
1873
  var build = (options) => ensureServiceIsRunning().build(options);
1868
1874
  var serve = (serveOptions, buildOptions) => ensureServiceIsRunning().serve(serveOptions, buildOptions);
1869
1875
  var transform = (input, options) => ensureServiceIsRunning().transform(input, options);
@@ -1972,7 +1978,7 @@ var ensureServiceIsRunning = () => {
1972
1978
  if (longLivedService)
1973
1979
  return longLivedService;
1974
1980
  let [command, args] = esbuildCommandAndArgs();
1975
- let child = child_process.spawn(command, args.concat(`--service=${"0.14.13"}`, "--ping"), {
1981
+ let child = child_process.spawn(command, args.concat(`--service=${"0.14.17"}`, "--ping"), {
1976
1982
  windowsHide: true,
1977
1983
  stdio: ["pipe", "pipe", "inherit"],
1978
1984
  cwd: defaultWD
@@ -2081,7 +2087,7 @@ var runServiceSync = (callback) => {
2081
2087
  esbuild: node_exports
2082
2088
  });
2083
2089
  callback(service);
2084
- let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.14.13"}`), {
2090
+ let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.14.17"}`), {
2085
2091
  cwd: defaultWD,
2086
2092
  windowsHide: true,
2087
2093
  input: stdin,
@@ -2097,7 +2103,7 @@ var workerThreadService = null;
2097
2103
  var startWorkerThreadService = (worker_threads2) => {
2098
2104
  let { port1: mainPort, port2: workerPort } = new worker_threads2.MessageChannel();
2099
2105
  let worker = new worker_threads2.Worker(__filename, {
2100
- workerData: { workerPort, defaultWD, esbuildVersion: "0.14.13" },
2106
+ workerData: { workerPort, defaultWD, esbuildVersion: "0.14.17" },
2101
2107
  transferList: [workerPort],
2102
2108
  execArgv: []
2103
2109
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esbuild",
3
- "version": "0.14.13",
3
+ "version": "0.14.17",
4
4
  "description": "An extremely fast JavaScript and CSS bundler and minifier.",
5
5
  "repository": "https://github.com/evanw/esbuild",
6
6
  "scripts": {
@@ -8,28 +8,31 @@
8
8
  },
9
9
  "main": "lib/main.js",
10
10
  "types": "lib/main.d.ts",
11
+ "engines": {
12
+ "node": ">=12"
13
+ },
11
14
  "bin": {
12
15
  "esbuild": "bin/esbuild"
13
16
  },
14
17
  "optionalDependencies": {
15
- "esbuild-android-arm64": "0.14.13",
16
- "esbuild-darwin-64": "0.14.13",
17
- "esbuild-darwin-arm64": "0.14.13",
18
- "esbuild-freebsd-64": "0.14.13",
19
- "esbuild-freebsd-arm64": "0.14.13",
20
- "esbuild-linux-32": "0.14.13",
21
- "esbuild-linux-64": "0.14.13",
22
- "esbuild-linux-arm": "0.14.13",
23
- "esbuild-linux-arm64": "0.14.13",
24
- "esbuild-linux-mips64le": "0.14.13",
25
- "esbuild-linux-ppc64le": "0.14.13",
26
- "esbuild-linux-s390x": "0.14.13",
27
- "esbuild-netbsd-64": "0.14.13",
28
- "esbuild-openbsd-64": "0.14.13",
29
- "esbuild-sunos-64": "0.14.13",
30
- "esbuild-windows-32": "0.14.13",
31
- "esbuild-windows-64": "0.14.13",
32
- "esbuild-windows-arm64": "0.14.13"
18
+ "esbuild-android-arm64": "0.14.17",
19
+ "esbuild-darwin-64": "0.14.17",
20
+ "esbuild-darwin-arm64": "0.14.17",
21
+ "esbuild-freebsd-64": "0.14.17",
22
+ "esbuild-freebsd-arm64": "0.14.17",
23
+ "esbuild-linux-32": "0.14.17",
24
+ "esbuild-linux-64": "0.14.17",
25
+ "esbuild-linux-arm": "0.14.17",
26
+ "esbuild-linux-arm64": "0.14.17",
27
+ "esbuild-linux-mips64le": "0.14.17",
28
+ "esbuild-linux-ppc64le": "0.14.17",
29
+ "esbuild-linux-s390x": "0.14.17",
30
+ "esbuild-netbsd-64": "0.14.17",
31
+ "esbuild-openbsd-64": "0.14.17",
32
+ "esbuild-sunos-64": "0.14.17",
33
+ "esbuild-windows-32": "0.14.17",
34
+ "esbuild-windows-64": "0.14.17",
35
+ "esbuild-windows-arm64": "0.14.17"
33
36
  },
34
37
  "license": "MIT"
35
38
  }