esbuild 0.19.12 → 0.20.0

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
@@ -200,7 +200,7 @@ for your current platform.`);
200
200
  "node_modules",
201
201
  ".cache",
202
202
  "esbuild",
203
- `pnpapi-${pkg.replace("/", "-")}-${"0.19.12"}-${path.basename(subpath)}`
203
+ `pnpapi-${pkg.replace("/", "-")}-${"0.20.0"}-${path.basename(subpath)}`
204
204
  );
205
205
  if (!fs.existsSync(binTargetPath)) {
206
206
  fs.mkdirSync(path.dirname(binTargetPath), { recursive: true });
package/lib/main.d.ts CHANGED
@@ -663,14 +663,17 @@ export interface InitializeOptions {
663
663
  export let version: string
664
664
 
665
665
  // Call this function to terminate esbuild's child process. The child process
666
- // is not terminated and re-created for each API call because it's more
667
- // efficient to keep it around when there are multiple API calls.
666
+ // is not terminated and re-created after each API call because it's more
667
+ // efficient to keep it around when there are multiple API calls. This child
668
+ // process normally exits automatically when the parent process exits, so you
669
+ // usually don't need to call this function.
668
670
  //
669
- // In node this happens automatically before the parent node process exits. So
670
- // you only need to call this if you know you will not make any more esbuild
671
- // API calls and you want to clean up resources.
671
+ // One reason you might want to call this is if you know you will not make any
672
+ // more esbuild API calls and you want to clean up resources (since the esbuild
673
+ // child process takes up some memory even when idle).
672
674
  //
673
- // Unlike node, Deno lacks the necessary APIs to clean up child processes
674
- // automatically. You must manually call stop() in Deno when you're done
675
- // using esbuild or Deno will continue running forever.
676
- export declare function stop(): void;
675
+ // Another reason you might want to call this is if you are using esbuild from
676
+ // within a Deno test. Deno fails tests that create a child process without
677
+ // killing it before the test ends, so you have to call this function (and
678
+ // await the returned promise) in every Deno test that uses esbuild.
679
+ export declare function stop(): Promise<void>
package/lib/main.js CHANGED
@@ -747,8 +747,8 @@ function createChannel(streamIn) {
747
747
  if (isFirstPacket) {
748
748
  isFirstPacket = false;
749
749
  let binaryVersion = String.fromCharCode(...bytes);
750
- if (binaryVersion !== "0.19.12") {
751
- throw new Error(`Cannot start service: Host version "${"0.19.12"}" does not match binary version ${quote(binaryVersion)}`);
750
+ if (binaryVersion !== "0.20.0") {
751
+ throw new Error(`Cannot start service: Host version "${"0.20.0"}" does not match binary version ${quote(binaryVersion)}`);
752
752
  }
753
753
  return;
754
754
  }
@@ -1941,7 +1941,7 @@ for your current platform.`);
1941
1941
  "node_modules",
1942
1942
  ".cache",
1943
1943
  "esbuild",
1944
- `pnpapi-${pkg.replace("/", "-")}-${"0.19.12"}-${path.basename(subpath)}`
1944
+ `pnpapi-${pkg.replace("/", "-")}-${"0.20.0"}-${path.basename(subpath)}`
1945
1945
  );
1946
1946
  if (!fs.existsSync(binTargetPath)) {
1947
1947
  fs.mkdirSync(path.dirname(binTargetPath), { recursive: true });
@@ -1976,7 +1976,7 @@ if (process.env.ESBUILD_WORKER_THREADS !== "0") {
1976
1976
  }
1977
1977
  }
1978
1978
  var _a;
1979
- var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.19.12";
1979
+ var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.20.0";
1980
1980
  var esbuildCommandAndArgs = () => {
1981
1981
  if ((!ESBUILD_BINARY_PATH || false) && (path2.basename(__filename) !== "main.js" || path2.basename(__dirname) !== "lib")) {
1982
1982
  throw new Error(
@@ -2043,7 +2043,7 @@ var fsAsync = {
2043
2043
  }
2044
2044
  }
2045
2045
  };
2046
- var version = "0.19.12";
2046
+ var version = "0.20.0";
2047
2047
  var build = (options) => ensureServiceIsRunning().build(options);
2048
2048
  var context = (buildOptions) => ensureServiceIsRunning().context(buildOptions);
2049
2049
  var transform = (input, options) => ensureServiceIsRunning().transform(input, options);
@@ -2137,6 +2137,7 @@ var stop = () => {
2137
2137
  stopService();
2138
2138
  if (workerThreadService)
2139
2139
  workerThreadService.stop();
2140
+ return Promise.resolve();
2140
2141
  };
2141
2142
  var initializeWasCalled = false;
2142
2143
  var initialize = (options) => {
@@ -2160,7 +2161,7 @@ var ensureServiceIsRunning = () => {
2160
2161
  if (longLivedService)
2161
2162
  return longLivedService;
2162
2163
  let [command, args] = esbuildCommandAndArgs();
2163
- let child = child_process.spawn(command, args.concat(`--service=${"0.19.12"}`, "--ping"), {
2164
+ let child = child_process.spawn(command, args.concat(`--service=${"0.20.0"}`, "--ping"), {
2164
2165
  windowsHide: true,
2165
2166
  stdio: ["pipe", "pipe", "inherit"],
2166
2167
  cwd: defaultWD
@@ -2268,7 +2269,7 @@ var runServiceSync = (callback) => {
2268
2269
  esbuild: node_exports
2269
2270
  });
2270
2271
  callback(service);
2271
- let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.19.12"}`), {
2272
+ let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.20.0"}`), {
2272
2273
  cwd: defaultWD,
2273
2274
  windowsHide: true,
2274
2275
  input: stdin,
@@ -2288,7 +2289,7 @@ var workerThreadService = null;
2288
2289
  var startWorkerThreadService = (worker_threads2) => {
2289
2290
  let { port1: mainPort, port2: workerPort } = new worker_threads2.MessageChannel();
2290
2291
  let worker = new worker_threads2.Worker(__filename, {
2291
- workerData: { workerPort, defaultWD, esbuildVersion: "0.19.12" },
2292
+ workerData: { workerPort, defaultWD, esbuildVersion: "0.20.0" },
2292
2293
  transferList: [workerPort],
2293
2294
  // From node's documentation: https://nodejs.org/api/worker_threads.html
2294
2295
  //
package/package.json CHANGED
@@ -1,8 +1,11 @@
1
1
  {
2
2
  "name": "esbuild",
3
- "version": "0.19.12",
3
+ "version": "0.20.0",
4
4
  "description": "An extremely fast JavaScript and CSS bundler and minifier.",
5
- "repository": "https://github.com/evanw/esbuild",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/evanw/esbuild.git"
8
+ },
6
9
  "scripts": {
7
10
  "postinstall": "node install.js"
8
11
  },
@@ -15,29 +18,29 @@
15
18
  "esbuild": "bin/esbuild"
16
19
  },
17
20
  "optionalDependencies": {
18
- "@esbuild/aix-ppc64": "0.19.12",
19
- "@esbuild/android-arm": "0.19.12",
20
- "@esbuild/android-arm64": "0.19.12",
21
- "@esbuild/android-x64": "0.19.12",
22
- "@esbuild/darwin-arm64": "0.19.12",
23
- "@esbuild/darwin-x64": "0.19.12",
24
- "@esbuild/freebsd-arm64": "0.19.12",
25
- "@esbuild/freebsd-x64": "0.19.12",
26
- "@esbuild/linux-arm": "0.19.12",
27
- "@esbuild/linux-arm64": "0.19.12",
28
- "@esbuild/linux-ia32": "0.19.12",
29
- "@esbuild/linux-loong64": "0.19.12",
30
- "@esbuild/linux-mips64el": "0.19.12",
31
- "@esbuild/linux-ppc64": "0.19.12",
32
- "@esbuild/linux-riscv64": "0.19.12",
33
- "@esbuild/linux-s390x": "0.19.12",
34
- "@esbuild/linux-x64": "0.19.12",
35
- "@esbuild/netbsd-x64": "0.19.12",
36
- "@esbuild/openbsd-x64": "0.19.12",
37
- "@esbuild/sunos-x64": "0.19.12",
38
- "@esbuild/win32-arm64": "0.19.12",
39
- "@esbuild/win32-ia32": "0.19.12",
40
- "@esbuild/win32-x64": "0.19.12"
21
+ "@esbuild/aix-ppc64": "0.20.0",
22
+ "@esbuild/android-arm": "0.20.0",
23
+ "@esbuild/android-arm64": "0.20.0",
24
+ "@esbuild/android-x64": "0.20.0",
25
+ "@esbuild/darwin-arm64": "0.20.0",
26
+ "@esbuild/darwin-x64": "0.20.0",
27
+ "@esbuild/freebsd-arm64": "0.20.0",
28
+ "@esbuild/freebsd-x64": "0.20.0",
29
+ "@esbuild/linux-arm": "0.20.0",
30
+ "@esbuild/linux-arm64": "0.20.0",
31
+ "@esbuild/linux-ia32": "0.20.0",
32
+ "@esbuild/linux-loong64": "0.20.0",
33
+ "@esbuild/linux-mips64el": "0.20.0",
34
+ "@esbuild/linux-ppc64": "0.20.0",
35
+ "@esbuild/linux-riscv64": "0.20.0",
36
+ "@esbuild/linux-s390x": "0.20.0",
37
+ "@esbuild/linux-x64": "0.20.0",
38
+ "@esbuild/netbsd-x64": "0.20.0",
39
+ "@esbuild/openbsd-x64": "0.20.0",
40
+ "@esbuild/sunos-x64": "0.20.0",
41
+ "@esbuild/win32-arm64": "0.20.0",
42
+ "@esbuild/win32-ia32": "0.20.0",
43
+ "@esbuild/win32-x64": "0.20.0"
41
44
  },
42
45
  "license": "MIT"
43
46
  }