esbuild 0.25.1 → 0.25.3

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.
Files changed (3) hide show
  1. package/bin/esbuild +1 -1
  2. package/lib/main.js +17 -12
  3. package/package.json +26 -26
package/bin/esbuild CHANGED
@@ -200,7 +200,7 @@ for your current platform.`);
200
200
  "node_modules",
201
201
  ".cache",
202
202
  "esbuild",
203
- `pnpapi-${pkg.replace("/", "-")}-${"0.25.1"}-${path.basename(subpath)}`
203
+ `pnpapi-${pkg.replace("/", "-")}-${"0.25.3"}-${path.basename(subpath)}`
204
204
  );
205
205
  if (!fs.existsSync(binTargetPath)) {
206
206
  fs.mkdirSync(path.dirname(binTargetPath), { recursive: true });
package/lib/main.js CHANGED
@@ -351,8 +351,8 @@ function pushCommonFlags(flags, options, keys) {
351
351
  if (ignoreAnnotations) flags.push(`--ignore-annotations`);
352
352
  if (drop) for (let what of drop) flags.push(`--drop:${validateStringValue(what, "drop")}`);
353
353
  if (dropLabels) flags.push(`--drop-labels=${Array.from(dropLabels).map((what) => validateStringValue(what, "dropLabels")).join(",")}`);
354
- if (mangleProps) flags.push(`--mangle-props=${mangleProps.source}`);
355
- if (reserveProps) flags.push(`--reserve-props=${reserveProps.source}`);
354
+ if (mangleProps) flags.push(`--mangle-props=${jsRegExpToGoRegExp(mangleProps)}`);
355
+ if (reserveProps) flags.push(`--reserve-props=${jsRegExpToGoRegExp(reserveProps)}`);
356
356
  if (mangleQuoted !== void 0) flags.push(`--mangle-quoted=${mangleQuoted}`);
357
357
  if (jsx) flags.push(`--jsx=${jsx}`);
358
358
  if (jsxFactory) flags.push(`--jsx-factory=${jsxFactory}`);
@@ -663,8 +663,8 @@ function createChannel(streamIn) {
663
663
  if (isFirstPacket) {
664
664
  isFirstPacket = false;
665
665
  let binaryVersion = String.fromCharCode(...bytes);
666
- if (binaryVersion !== "0.25.1") {
667
- throw new Error(`Cannot start service: Host version "${"0.25.1"}" does not match binary version ${quote(binaryVersion)}`);
666
+ if (binaryVersion !== "0.25.3") {
667
+ throw new Error(`Cannot start service: Host version "${"0.25.3"}" does not match binary version ${quote(binaryVersion)}`);
668
668
  }
669
669
  return;
670
670
  }
@@ -1173,7 +1173,7 @@ var handlePlugins = async (buildKey, sendRequest, sendResponse, refs, streamIn,
1173
1173
  if (filter == null) throw new Error(`onResolve() call is missing a filter`);
1174
1174
  let id = nextCallbackID++;
1175
1175
  onResolveCallbacks[id] = { name, callback, note: registeredNote };
1176
- plugin.onResolve.push({ id, filter: filter.source, namespace: namespace || "" });
1176
+ plugin.onResolve.push({ id, filter: jsRegExpToGoRegExp(filter), namespace: namespace || "" });
1177
1177
  },
1178
1178
  onLoad(options, callback) {
1179
1179
  let registeredText = `This error came from the "onLoad" callback registered here:`;
@@ -1185,7 +1185,7 @@ var handlePlugins = async (buildKey, sendRequest, sendResponse, refs, streamIn,
1185
1185
  if (filter == null) throw new Error(`onLoad() call is missing a filter`);
1186
1186
  let id = nextCallbackID++;
1187
1187
  onLoadCallbacks[id] = { name, callback, note: registeredNote };
1188
- plugin.onLoad.push({ id, filter: filter.source, namespace: namespace || "" });
1188
+ plugin.onLoad.push({ id, filter: jsRegExpToGoRegExp(filter), namespace: namespace || "" });
1189
1189
  },
1190
1190
  onDispose(callback) {
1191
1191
  onDisposeCallbacks.push(callback);
@@ -1596,6 +1596,11 @@ function convertOutputFiles({ path: path3, contents, hash }) {
1596
1596
  }
1597
1597
  };
1598
1598
  }
1599
+ function jsRegExpToGoRegExp(regexp) {
1600
+ let result = regexp.source;
1601
+ if (regexp.flags) result = `(?${regexp.flags})${result}`;
1602
+ return result;
1603
+ }
1599
1604
 
1600
1605
  // lib/npm/node-platform.ts
1601
1606
  var fs = require("fs");
@@ -1774,7 +1779,7 @@ for your current platform.`);
1774
1779
  "node_modules",
1775
1780
  ".cache",
1776
1781
  "esbuild",
1777
- `pnpapi-${pkg.replace("/", "-")}-${"0.25.1"}-${path.basename(subpath)}`
1782
+ `pnpapi-${pkg.replace("/", "-")}-${"0.25.3"}-${path.basename(subpath)}`
1778
1783
  );
1779
1784
  if (!fs.existsSync(binTargetPath)) {
1780
1785
  fs.mkdirSync(path.dirname(binTargetPath), { recursive: true });
@@ -1809,7 +1814,7 @@ if (process.env.ESBUILD_WORKER_THREADS !== "0") {
1809
1814
  }
1810
1815
  }
1811
1816
  var _a;
1812
- var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.25.1";
1817
+ var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.25.3";
1813
1818
  var esbuildCommandAndArgs = () => {
1814
1819
  if ((!ESBUILD_BINARY_PATH || false) && (path2.basename(__filename) !== "main.js" || path2.basename(__dirname) !== "lib")) {
1815
1820
  throw new Error(
@@ -1876,7 +1881,7 @@ var fsAsync = {
1876
1881
  }
1877
1882
  }
1878
1883
  };
1879
- var version = "0.25.1";
1884
+ var version = "0.25.3";
1880
1885
  var build = (options) => ensureServiceIsRunning().build(options);
1881
1886
  var context = (buildOptions) => ensureServiceIsRunning().context(buildOptions);
1882
1887
  var transform = (input, options) => ensureServiceIsRunning().transform(input, options);
@@ -1979,7 +1984,7 @@ var stopService;
1979
1984
  var ensureServiceIsRunning = () => {
1980
1985
  if (longLivedService) return longLivedService;
1981
1986
  let [command, args] = esbuildCommandAndArgs();
1982
- let child = child_process.spawn(command, args.concat(`--service=${"0.25.1"}`, "--ping"), {
1987
+ let child = child_process.spawn(command, args.concat(`--service=${"0.25.3"}`, "--ping"), {
1983
1988
  windowsHide: true,
1984
1989
  stdio: ["pipe", "pipe", "inherit"],
1985
1990
  cwd: defaultWD
@@ -2083,7 +2088,7 @@ var runServiceSync = (callback) => {
2083
2088
  esbuild: node_exports
2084
2089
  });
2085
2090
  callback(service);
2086
- let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.25.1"}`), {
2091
+ let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.25.3"}`), {
2087
2092
  cwd: defaultWD,
2088
2093
  windowsHide: true,
2089
2094
  input: stdin,
@@ -2103,7 +2108,7 @@ var workerThreadService = null;
2103
2108
  var startWorkerThreadService = (worker_threads2) => {
2104
2109
  let { port1: mainPort, port2: workerPort } = new worker_threads2.MessageChannel();
2105
2110
  let worker = new worker_threads2.Worker(__filename, {
2106
- workerData: { workerPort, defaultWD, esbuildVersion: "0.25.1" },
2111
+ workerData: { workerPort, defaultWD, esbuildVersion: "0.25.3" },
2107
2112
  transferList: [workerPort],
2108
2113
  // From node's documentation: https://nodejs.org/api/worker_threads.html
2109
2114
  //
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esbuild",
3
- "version": "0.25.1",
3
+ "version": "0.25.3",
4
4
  "description": "An extremely fast JavaScript and CSS bundler and minifier.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -18,31 +18,31 @@
18
18
  "esbuild": "bin/esbuild"
19
19
  },
20
20
  "optionalDependencies": {
21
- "@esbuild/aix-ppc64": "0.25.1",
22
- "@esbuild/android-arm": "0.25.1",
23
- "@esbuild/android-arm64": "0.25.1",
24
- "@esbuild/android-x64": "0.25.1",
25
- "@esbuild/darwin-arm64": "0.25.1",
26
- "@esbuild/darwin-x64": "0.25.1",
27
- "@esbuild/freebsd-arm64": "0.25.1",
28
- "@esbuild/freebsd-x64": "0.25.1",
29
- "@esbuild/linux-arm": "0.25.1",
30
- "@esbuild/linux-arm64": "0.25.1",
31
- "@esbuild/linux-ia32": "0.25.1",
32
- "@esbuild/linux-loong64": "0.25.1",
33
- "@esbuild/linux-mips64el": "0.25.1",
34
- "@esbuild/linux-ppc64": "0.25.1",
35
- "@esbuild/linux-riscv64": "0.25.1",
36
- "@esbuild/linux-s390x": "0.25.1",
37
- "@esbuild/linux-x64": "0.25.1",
38
- "@esbuild/netbsd-arm64": "0.25.1",
39
- "@esbuild/netbsd-x64": "0.25.1",
40
- "@esbuild/openbsd-arm64": "0.25.1",
41
- "@esbuild/openbsd-x64": "0.25.1",
42
- "@esbuild/sunos-x64": "0.25.1",
43
- "@esbuild/win32-arm64": "0.25.1",
44
- "@esbuild/win32-ia32": "0.25.1",
45
- "@esbuild/win32-x64": "0.25.1"
21
+ "@esbuild/aix-ppc64": "0.25.3",
22
+ "@esbuild/android-arm": "0.25.3",
23
+ "@esbuild/android-arm64": "0.25.3",
24
+ "@esbuild/android-x64": "0.25.3",
25
+ "@esbuild/darwin-arm64": "0.25.3",
26
+ "@esbuild/darwin-x64": "0.25.3",
27
+ "@esbuild/freebsd-arm64": "0.25.3",
28
+ "@esbuild/freebsd-x64": "0.25.3",
29
+ "@esbuild/linux-arm": "0.25.3",
30
+ "@esbuild/linux-arm64": "0.25.3",
31
+ "@esbuild/linux-ia32": "0.25.3",
32
+ "@esbuild/linux-loong64": "0.25.3",
33
+ "@esbuild/linux-mips64el": "0.25.3",
34
+ "@esbuild/linux-ppc64": "0.25.3",
35
+ "@esbuild/linux-riscv64": "0.25.3",
36
+ "@esbuild/linux-s390x": "0.25.3",
37
+ "@esbuild/linux-x64": "0.25.3",
38
+ "@esbuild/netbsd-arm64": "0.25.3",
39
+ "@esbuild/netbsd-x64": "0.25.3",
40
+ "@esbuild/openbsd-arm64": "0.25.3",
41
+ "@esbuild/openbsd-x64": "0.25.3",
42
+ "@esbuild/sunos-x64": "0.25.3",
43
+ "@esbuild/win32-arm64": "0.25.3",
44
+ "@esbuild/win32-ia32": "0.25.3",
45
+ "@esbuild/win32-x64": "0.25.3"
46
46
  },
47
47
  "license": "MIT"
48
48
  }