Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deps-dev): bump esbuild from 0.20.2 to 0.21.2 #877

Merged
merged 2 commits into from
May 19, 2024

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github May 13, 2024

Bumps esbuild from 0.20.2 to 0.21.2.

Release notes

Sourced from esbuild's releases.

v0.21.2

  • Correct this in field and accessor decorators (#3761)

    This release changes the value of this in initializers for class field and accessor decorators from the module-level this value to the appropriate this value for the decorated element (either the class or the instance). It was previously incorrect due to lack of test coverage. Here's an example of a decorator that doesn't work without this change:

    const dec = () => function() { this.bar = true }
    class Foo { @dec static foo }
    console.log(Foo.bar) // Should be "true"
  • Allow es2023 as a target environment (#3762)

    TypeScript recently added es2023 as a compilation target, so esbuild now supports this too. There is no difference between a target of es2022 and es2023 as far as esbuild is concerned since the 2023 edition of JavaScript doesn't introduce any new syntax features.

v0.21.1

  • Fix a regression with --keep-names (#3756)

    The previous release introduced a regression with the --keep-names setting and object literals with get/set accessor methods, in which case the generated code contained syntax errors. This release fixes the regression:

    // Original code
    x = { get y() {} }
    // Output from version 0.21.0 (with --keep-names)
    x = { get y: /* @PURE */ __name(function() {
    }, "y") };
    // Output from this version (with --keep-names)
    x = { get y() {
    } };

v0.21.0

This release doesn't contain any deliberately-breaking changes. However, it contains a very complex new feature and while all of esbuild's tests pass, I would not be surprised if an important edge case turns out to be broken. So I'm releasing this as a breaking change release to avoid causing any trouble. As usual, make sure to test your code when you upgrade.

  • Implement the JavaScript decorators proposal (#104)

    With this release, esbuild now contains an implementation of the upcoming JavaScript decorators proposal. This is the same feature that shipped in TypeScript 5.0 and has been highly-requested on esbuild's issue tracker. You can read more about them in that blog post and in this other (now slightly outdated) extensive blog post here: https://2ality.com/2022/10/javascript-decorators.html. Here's a quick example:

    const log = (fn, context) => function() {
      console.log(`before ${context.name}`)
      const it = fn.apply(this, arguments)
      console.log(`after ${context.name}`)
      return it
    }
    class Foo {
    @​log static foo() {

... (truncated)

Changelog

Sourced from esbuild's changelog.

0.21.2

  • Correct this in field and accessor decorators (#3761)

    This release changes the value of this in initializers for class field and accessor decorators from the module-level this value to the appropriate this value for the decorated element (either the class or the instance). It was previously incorrect due to lack of test coverage. Here's an example of a decorator that doesn't work without this change:

    const dec = () => function() { this.bar = true }
    class Foo { @dec static foo }
    console.log(Foo.bar) // Should be "true"
  • Allow es2023 as a target environment (#3762)

    TypeScript recently added es2023 as a compilation target, so esbuild now supports this too. There is no difference between a target of es2022 and es2023 as far as esbuild is concerned since the 2023 edition of JavaScript doesn't introduce any new syntax features.

0.21.1

  • Fix a regression with --keep-names (#3756)

    The previous release introduced a regression with the --keep-names setting and object literals with get/set accessor methods, in which case the generated code contained syntax errors. This release fixes the regression:

    // Original code
    x = { get y() {} }
    // Output from version 0.21.0 (with --keep-names)
    x = { get y: /* @PURE */ __name(function() {
    }, "y") };
    // Output from this version (with --keep-names)
    x = { get y() {
    } };

0.21.0

This release doesn't contain any deliberately-breaking changes. However, it contains a very complex new feature and while all of esbuild's tests pass, I would not be surprised if an important edge case turns out to be broken. So I'm releasing this as a breaking change release to avoid causing any trouble. As usual, make sure to test your code when you upgrade.

  • Implement the JavaScript decorators proposal (#104)

    With this release, esbuild now contains an implementation of the upcoming JavaScript decorators proposal. This is the same feature that shipped in TypeScript 5.0 and has been highly-requested on esbuild's issue tracker. You can read more about them in that blog post and in this other (now slightly outdated) extensive blog post here: https://2ality.com/2022/10/javascript-decorators.html. Here's a quick example:

    const log = (fn, context) => function() {
      console.log(`before ${context.name}`)
      const it = fn.apply(this, arguments)
      console.log(`after ${context.name}`)
      return it
    }

... (truncated)

Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [esbuild](https://github.com/evanw/esbuild) from 0.20.2 to 0.21.2.
- [Release notes](https://github.com/evanw/esbuild/releases)
- [Changelog](https://github.com/evanw/esbuild/blob/main/CHANGELOG.md)
- [Commits](evanw/esbuild@v0.20.2...v0.21.2)

---
updated-dependencies:
- dependency-name: esbuild
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code labels May 13, 2024
@github-actions github-actions bot enabled auto-merge (squash) May 13, 2024 21:15
Copy link
Contributor

Diff between esbuild 0.20.2 and 0.21.2
diff --git a/bin/esbuild b/bin/esbuild
index v0.20.2..v0.21.2 100755
--- a/bin/esbuild
+++ b/bin/esbuild
@@ -88,6 +88,5 @@
       try {
         const pkg = knownUnixlikePackages[unixKey];
-        if (fs.existsSync(path.join(nodeModulesDirectory, pkg)))
-          return pkg;
+        if (fs.existsSync(path.join(nodeModulesDirectory, pkg))) return pkg;
       } catch {
       }
@@ -96,6 +95,5 @@
       try {
         const pkg = knownWindowsPackages[windowsKey];
-        if (fs.existsSync(path.join(nodeModulesDirectory, pkg)))
-          return pkg;
+        if (fs.existsSync(path.join(nodeModulesDirectory, pkg))) return pkg;
       } catch {
       }
@@ -201,5 +199,5 @@
         ".cache",
         "esbuild",
-        `pnpapi-${pkg.replace("/", "-")}-${"0.20.2"}-${path.basename(subpath)}`
+        `pnpapi-${pkg.replace("/", "-")}-${"0.21.2"}-${path.basename(subpath)}`
       );
       if (!fs.existsSync(binTargetPath)) {
diff --git a/install.js b/install.js
index v0.20.2..v0.21.2 100644
--- a/install.js
+++ b/install.js
@@ -168,6 +168,5 @@
     offset += 512;
     if (!isNaN(size)) {
-      if (name === subpath)
-        return buffer.subarray(offset, offset + size);
+      if (name === subpath) return buffer.subarray(offset, offset + size);
       offset += size + 511 & ~511;
     }
@@ -204,8 +203,6 @@
       continue;
     }
-    if (stats.isDirectory())
-      removeRecursive(entryPath);
-    else
-      fs2.unlinkSync(entryPath);
+    if (stats.isDirectory()) removeRecursive(entryPath);
+    else fs2.unlinkSync(entryPath);
   }
   fs2.rmdirSync(dir);
diff --git a/lib/main.js b/lib/main.js
index v0.20.2..v0.21.2 100644
--- a/lib/main.js
+++ b/lib/main.js
@@ -221,6 +221,5 @@
 function validateTarget(target) {
   validateStringValue(target, "target");
-  if (target.indexOf(",") >= 0)
-    throw new Error(`Invalid target: ${target}`);
+  if (target.indexOf(",") >= 0) throw new Error(`Invalid target: ${target}`);
   return target;
 }
@@ -244,9 +243,7 @@
   let value = object[key];
   keys[key + ""] = true;
-  if (value === void 0)
-    return void 0;
+  if (value === void 0) return void 0;
   let mustBe = mustBeFn(value);
-  if (mustBe !== null)
-    throw new Error(`${quote(key)} must be ${mustBe}`);
+  if (mustBe !== null) throw new Error(`${quote(key)} must be ${mustBe}`);
   return value;
 }
@@ -289,8 +286,6 @@
   let logLevel = getFlag(options, keys, "logLevel", mustBeString);
   let logLimit = getFlag(options, keys, "logLimit", mustBeInteger);
-  if (color !== void 0)
-    flags.push(`--color=${color}`);
-  else if (isTTY2)
-    flags.push(`--color=true`);
+  if (color !== void 0) flags.push(`--color=${color}`);
+  else if (isTTY2) flags.push(`--color=true`);
   flags.push(`--log-level=${logLevel || logLevelDefault}`);
   flags.push(`--log-limit=${logLimit || 0}`);
@@ -335,67 +330,37 @@
   let platform = getFlag(options, keys, "platform", mustBeString);
   let tsconfigRaw = getFlag(options, keys, "tsconfigRaw", mustBeStringOrObject);
-  if (legalComments)
-    flags.push(`--legal-comments=${legalComments}`);
-  if (sourceRoot !== void 0)
-    flags.push(`--source-root=${sourceRoot}`);
-  if (sourcesContent !== void 0)
-    flags.push(`--sources-content=${sourcesContent}`);
+  if (legalComments) flags.push(`--legal-comments=${legalComments}`);
+  if (sourceRoot !== void 0) flags.push(`--source-root=${sourceRoot}`);
+  if (sourcesContent !== void 0) flags.push(`--sources-content=${sourcesContent}`);
   if (target) {
-    if (Array.isArray(target))
-      flags.push(`--target=${Array.from(target).map(validateTarget).join(",")}`);
-    else
-      flags.push(`--target=${validateTarget(target)}`);
+    if (Array.isArray(target)) flags.push(`--target=${Array.from(target).map(validateTarget).join(",")}`);
+    else flags.push(`--target=${validateTarget(target)}`);
   }
-  if (format)
-    flags.push(`--format=${format}`);
-  if (globalName)
-    flags.push(`--global-name=${globalName}`);
-  if (platform)
-    flags.push(`--platform=${platform}`);
-  if (tsconfigRaw)
-    flags.push(`--tsconfig-raw=${typeof tsconfigRaw === "string" ? tsconfigRaw : JSON.stringify(tsconfigRaw)}`);
-  if (minify)
-    flags.push("--minify");
-  if (minifySyntax)
-    flags.push("--minify-syntax");
-  if (minifyWhitespace)
-    flags.push("--minify-whitespace");
-  if (minifyIdentifiers)
-    flags.push("--minify-identifiers");
-  if (lineLimit)
-    flags.push(`--line-limit=${lineLimit}`);
-  if (charset)
-    flags.push(`--charset=${charset}`);
-  if (treeShaking !== void 0)
-    flags.push(`--tree-shaking=${treeShaking}`);
-  if (ignoreAnnotations)
-    flags.push(`--ignore-annotations`);
-  if (drop)
-    for (let what of drop)
-      flags.push(`--drop:${validateStringValue(what, "drop")}`);
-  if (dropLabels)
-    flags.push(`--drop-labels=${Array.from(dropLabels).map((what) => validateStringValue(what, "dropLabels")).join(",")}`);
-  if (mangleProps)
-    flags.push(`--mangle-props=${mangleProps.source}`);
-  if (reserveProps)
-    flags.push(`--reserve-props=${reserveProps.source}`);
-  if (mangleQuoted !== void 0)
-    flags.push(`--mangle-quoted=${mangleQuoted}`);
-  if (jsx)
-    flags.push(`--jsx=${jsx}`);
-  if (jsxFactory)
-    flags.push(`--jsx-factory=${jsxFactory}`);
-  if (jsxFragment)
-    flags.push(`--jsx-fragment=${jsxFragment}`);
-  if (jsxImportSource)
-    flags.push(`--jsx-import-source=${jsxImportSource}`);
-  if (jsxDev)
-    flags.push(`--jsx-dev`);
-  if (jsxSideEffects)
-    flags.push(`--jsx-side-effects`);
+  if (format) flags.push(`--format=${format}`);
+  if (globalName) flags.push(`--global-name=${globalName}`);
+  if (platform) flags.push(`--platform=${platform}`);
+  if (tsconfigRaw) flags.push(`--tsconfig-raw=${typeof tsconfigRaw === "string" ? tsconfigRaw : JSON.stringify(tsconfigRaw)}`);
+  if (minify) flags.push("--minify");
+  if (minifySyntax) flags.push("--minify-syntax");
+  if (minifyWhitespace) flags.push("--minify-whitespace");
+  if (minifyIdentifiers) flags.push("--minify-identifiers");
+  if (lineLimit) flags.push(`--line-limit=${lineLimit}`);
+  if (charset) flags.push(`--charset=${charset}`);
+  if (treeShaking !== void 0) flags.push(`--tree-shaking=${treeShaking}`);
+  if (ignoreAnnotations) flags.push(`--ignore-annotations`);
+  if (drop) for (let what of drop) flags.push(`--drop:${validateStringValue(what, "drop")}`);
+  if (dropLabels) flags.push(`--drop-labels=${Array.from(dropLabels).map((what) => validateStringValue(what, "dropLabels")).join(",")}`);
+  if (mangleProps) flags.push(`--mangle-props=${mangleProps.source}`);
+  if (reserveProps) flags.push(`--reserve-props=${reserveProps.source}`);
+  if (mangleQuoted !== void 0) flags.push(`--mangle-quoted=${mangleQuoted}`);
+  if (jsx) flags.push(`--jsx=${jsx}`);
+  if (jsxFactory) flags.push(`--jsx-factory=${jsxFactory}`);
+  if (jsxFragment) flags.push(`--jsx-fragment=${jsxFragment}`);
+  if (jsxImportSource) flags.push(`--jsx-import-source=${jsxImportSource}`);
+  if (jsxDev) flags.push(`--jsx-dev`);
+  if (jsxSideEffects) flags.push(`--jsx-side-effects`);
   if (define) {
     for (let key in define) {
-      if (key.indexOf("=") >= 0)
-        throw new Error(`Invalid define: ${key}`);
+      if (key.indexOf("=") >= 0) throw new Error(`Invalid define: ${key}`);
       flags.push(`--define:${key}=${validateStringValue(define[key], "define", key)}`);
     }
@@ -403,6 +368,5 @@
   if (logOverride) {
     for (let key in logOverride) {
-      if (key.indexOf("=") >= 0)
-        throw new Error(`Invalid log override: ${key}`);
+      if (key.indexOf("=") >= 0) throw new Error(`Invalid log override: ${key}`);
       flags.push(`--log-override:${key}=${validateStringValue(logOverride[key], "log override", key)}`);
     }
@@ -410,17 +374,12 @@
   if (supported) {
     for (let key in supported) {
-      if (key.indexOf("=") >= 0)
-        throw new Error(`Invalid supported: ${key}`);
+      if (key.indexOf("=") >= 0) throw new Error(`Invalid supported: ${key}`);
       const value = supported[key];
-      if (typeof value !== "boolean")
-        throw new Error(`Expected value for supported ${quote(key)} to be a boolean, got ${typeof value} instead`);
+      if (typeof value !== "boolean") throw new Error(`Expected value for supported ${quote(key)} to be a boolean, got ${typeof value} instead`);
       flags.push(`--supported:${key}=${value}`);
     }
   }
-  if (pure)
-    for (let fn of pure)
-      flags.push(`--pure:${validateStringValue(fn, "pure")}`);
-  if (keepNames)
-    flags.push(`--keep-names`);
+  if (pure) for (let fn of pure) flags.push(`--pure:${validateStringValue(fn, "pure")}`);
+  if (keepNames) flags.push(`--keep-names`);
 }
 function flagsForBuildOptions(callName, options, isTTY2, logLevelDefault, writeDefault) {
@@ -466,50 +425,33 @@
   keys.plugins = true;
   checkForInvalidFlags(options, keys, `in ${callName}() call`);
-  if (sourcemap)
-    flags.push(`--sourcemap${sourcemap === true ? "" : `=${sourcemap}`}`);
-  if (bundle)
-    flags.push("--bundle");
-  if (allowOverwrite)
-    flags.push("--allow-overwrite");
-  if (splitting)
-    flags.push("--splitting");
-  if (preserveSymlinks)
-    flags.push("--preserve-symlinks");
-  if (metafile)
-    flags.push(`--metafile`);
-  if (outfile)
-    flags.push(`--outfile=${outfile}`);
-  if (outdir)
-    flags.push(`--outdir=${outdir}`);
-  if (outbase)
-    flags.push(`--outbase=${outbase}`);
-  if (tsconfig)
-    flags.push(`--tsconfig=${tsconfig}`);
-  if (packages)
-    flags.push(`--packages=${packages}`);
+  if (sourcemap) flags.push(`--sourcemap${sourcemap === true ? "" : `=${sourcemap}`}`);
+  if (bundle) flags.push("--bundle");
+  if (allowOverwrite) flags.push("--allow-overwrite");
+  if (splitting) flags.push("--splitting");
+  if (preserveSymlinks) flags.push("--preserve-symlinks");
+  if (metafile) flags.push(`--metafile`);
+  if (outfile) flags.push(`--outfile=${outfile}`);
+  if (outdir) flags.push(`--outdir=${outdir}`);
+  if (outbase) flags.push(`--outbase=${outbase}`);
+  if (tsconfig) flags.push(`--tsconfig=${tsconfig}`);
+  if (packages) flags.push(`--packages=${packages}`);
   if (resolveExtensions) {
     let values = [];
     for (let value of resolveExtensions) {
       validateStringValue(value, "resolve extension");
-      if (value.indexOf(",") >= 0)
-        throw new Error(`Invalid resolve extension: ${value}`);
+      if (value.indexOf(",") >= 0) throw new Error(`Invalid resolve extension: ${value}`);
       values.push(value);
     }
     flags.push(`--resolve-extensions=${values.join(",")}`);
   }
-  if (publicPath)
-    flags.push(`--public-path=${publicPath}`);
-  if (entryNames)
-    flags.push(`--entry-names=${entryNames}`);
-  if (chunkNames)
-    flags.push(`--chunk-names=${chunkNames}`);
-  if (assetNames)
-    flags.push(`--asset-names=${assetNames}`);
+  if (publicPath) flags.push(`--public-path=${publicPath}`);
+  if (entryNames) flags.push(`--entry-names=${entryNames}`);
+  if (chunkNames) flags.push(`--chunk-names=${chunkNames}`);
+  if (assetNames) flags.push(`--asset-names=${assetNames}`);
   if (mainFields) {
     let values = [];
     for (let value of mainFields) {
       validateStringValue(value, "main field");
-      if (value.indexOf(",") >= 0)
-        throw new Error(`Invalid main field: ${value}`);
+      if (value.indexOf(",") >= 0) throw new Error(`Invalid main field: ${value}`);
       values.push(value);
     }
@@ -520,17 +462,13 @@
     for (let value of conditions) {
       validateStringValue(value, "condition");
-      if (value.indexOf(",") >= 0)
-        throw new Error(`Invalid condition: ${value}`);
+      if (value.indexOf(",") >= 0) throw new Error(`Invalid condition: ${value}`);
       values.push(value);
     }
     flags.push(`--conditions=${values.join(",")}`);
   }
-  if (external)
-    for (let name of external)
-      flags.push(`--external:${validateStringValue(name, "external")}`);
+  if (external) for (let name of external) flags.push(`--external:${validateStringValue(name, "external")}`);
   if (alias) {
     for (let old in alias) {
-      if (old.indexOf("=") >= 0)
-        throw new Error(`Invalid package name in alias: ${old}`);
+      if (old.indexOf("=") >= 0) throw new Error(`Invalid package name in alias: ${old}`);
       flags.push(`--alias:${old}=${validateStringValue(alias[old], "alias", old)}`);
     }
@@ -538,6 +476,5 @@
   if (banner) {
     for (let type in banner) {
-      if (type.indexOf("=") >= 0)
-        throw new Error(`Invalid banner file type: ${type}`);
+      if (type.indexOf("=") >= 0) throw new Error(`Invalid banner file type: ${type}`);
       flags.push(`--banner:${type}=${validateStringValue(banner[type], "banner", type)}`);
     }
@@ -545,16 +482,12 @@
   if (footer) {
     for (let type in footer) {
-      if (type.indexOf("=") >= 0)
-        throw new Error(`Invalid footer file type: ${type}`);
+      if (type.indexOf("=") >= 0) throw new Error(`Invalid footer file type: ${type}`);
       flags.push(`--footer:${type}=${validateStringValue(footer[type], "footer", type)}`);
     }
   }
-  if (inject)
-    for (let path3 of inject)
-      flags.push(`--inject:${validateStringValue(path3, "inject")}`);
+  if (inject) for (let path3 of inject) flags.push(`--inject:${validateStringValue(path3, "inject")}`);
   if (loader) {
     for (let ext in loader) {
-      if (ext.indexOf("=") >= 0)
-        throw new Error(`Invalid loader extension: ${ext}`);
+      if (ext.indexOf("=") >= 0) throw new Error(`Invalid loader extension: ${ext}`);
       flags.push(`--loader:${ext}=${validateStringValue(loader[ext], "loader", ext)}`);
     }
@@ -562,6 +495,5 @@
   if (outExtension) {
     for (let ext in outExtension) {
-      if (ext.indexOf("=") >= 0)
-        throw new Error(`Invalid out extension: ${ext}`);
+      if (ext.indexOf("=") >= 0) throw new Error(`Invalid out extension: ${ext}`);
       flags.push(`--out-extension:${ext}=${validateStringValue(outExtension[ext], "out extension", ext)}`);
     }
@@ -576,8 +508,6 @@
           let output = getFlag(entryPoint, entryPointKeys, "out", mustBeString);
           checkForInvalidFlags(entryPoint, entryPointKeys, "in entry point at index " + i);
-          if (input === void 0)
-            throw new Error('Missing property "in" for entry point at index ' + i);
-          if (output === void 0)
-            throw new Error('Missing property "out" for entry point at index ' + i);
+          if (input === void 0) throw new Error('Missing property "in" for entry point at index ' + i);
+          if (output === void 0) throw new Error('Missing property "out" for entry point at index ' + i);
           entries.push([output, input]);
         } else {
@@ -598,14 +528,9 @@
     let loader2 = getFlag(stdin, stdinKeys, "loader", mustBeString);
     checkForInvalidFlags(stdin, stdinKeys, 'in "stdin" object');
-    if (sourcefile)
-      flags.push(`--sourcefile=${sourcefile}`);
-    if (loader2)
-      flags.push(`--loader=${loader2}`);
-    if (resolveDir)
-      stdinResolveDir = resolveDir;
-    if (typeof contents === "string")
-      stdinContents = encodeUTF8(contents);
-    else if (contents instanceof Uint8Array)
-      stdinContents = contents;
+    if (sourcefile) flags.push(`--sourcefile=${sourcefile}`);
+    if (loader2) flags.push(`--loader=${loader2}`);
+    if (resolveDir) stdinResolveDir = resolveDir;
+    if (typeof contents === "string") stdinContents = encodeUTF8(contents);
+    else if (contents instanceof Uint8Array) stdinContents = contents;
   }
   let nodePaths = [];
@@ -639,14 +564,9 @@
   let mangleCache = getFlag(options, keys, "mangleCache", mustBeObject);
   checkForInvalidFlags(options, keys, `in ${callName}() call`);
-  if (sourcemap)
-    flags.push(`--sourcemap=${sourcemap === true ? "external" : sourcemap}`);
-  if (sourcefile)
-    flags.push(`--sourcefile=${sourcefile}`);
-  if (loader)
-    flags.push(`--loader=${loader}`);
-  if (banner)
-    flags.push(`--banner=${banner}`);
-  if (footer)
-    flags.push(`--footer=${footer}`);
+  if (sourcemap) flags.push(`--sourcemap=${sourcemap === true ? "external" : sourcemap}`);
+  if (sourcefile) flags.push(`--sourcefile=${sourcefile}`);
+  if (loader) flags.push(`--loader=${loader}`);
+  if (banner) flags.push(`--banner=${banner}`);
+  if (footer) flags.push(`--footer=${footer}`);
   return {
     flags,
@@ -688,6 +608,5 @@
   let afterClose = (error) => {
     closeData.didClose = true;
-    if (error)
-      closeData.reason = ": " + (error.message || error);
+    if (error) closeData.reason = ": " + (error.message || error);
     const text = "The service was stopped" + closeData.reason;
     for (let id in responseCallbacks) {
@@ -697,6 +616,5 @@
   };
   let sendRequest = (refs, value, callback) => {
-    if (closeData.didClose)
-      return callback("The service is no longer running" + closeData.reason, null);
+    if (closeData.didClose) return callback("The service is no longer running" + closeData.reason, null);
     let id = nextRequestID++;
     responseCallbacks[id] = (error, response) => {
@@ -704,15 +622,12 @@
         callback(error, response);
       } finally {
-        if (refs)
-          refs.unref();
+        if (refs) refs.unref();
       }
     };
-    if (refs)
-      refs.ref();
+    if (refs) refs.ref();
     streamIn.writeToStdin(encodePacket({ id, isRequest: true, value }));
   };
   let sendResponse = (id, value) => {
-    if (closeData.didClose)
-      throw new Error("The service is no longer running" + closeData.reason);
+    if (closeData.didClose) throw new Error("The service is no longer running" + closeData.reason);
     streamIn.writeToStdin(encodePacket({ id, isRequest: false, value }));
   };
@@ -748,6 +663,6 @@
       isFirstPacket = false;
       let binaryVersion = String.fromCharCode(...bytes);
-      if (binaryVersion !== "0.20.2") {
-        throw new Error(`Cannot start service: Host version "${"0.20.2"}" does not match binary version ${quote(binaryVersion)}`);
+      if (binaryVersion !== "0.21.2") {
+        throw new Error(`Cannot start service: Host version "${"0.21.2"}" does not match binary version ${quote(binaryVersion)}`);
       }
       return;
@@ -759,8 +674,6 @@
       let callback = responseCallbacks[packet.id];
       delete responseCallbacks[packet.id];
-      if (packet.value.error)
-        callback(packet.value.error, {});
-      else
-        callback(null, packet.value);
+      if (packet.value.error) callback(packet.value.error, {});
+      else callback(null, packet.value);
     }
   };
@@ -772,6 +685,5 @@
       ref() {
         if (++refCount === 1) {
-          if (refs)
-            refs.ref();
+          if (refs) refs.ref();
         }
       },
@@ -779,6 +691,5 @@
         if (--refCount === 0) {
           delete requestCallbacksByKey[buildKey];
-          if (refs)
-            refs.unref();
+          if (refs) refs.unref();
         }
       }
@@ -822,9 +733,7 @@
           input: inputPath !== null ? encodeUTF8(inputPath) : typeof input === "string" ? encodeUTF8(input) : input
         };
-        if (mangleCache)
-          request.mangleCache = mangleCache;
+        if (mangleCache) request.mangleCache = mangleCache;
         sendRequest(refs, request, (error, response) => {
-          if (error)
-            return callback(new Error(error), null);
+          if (error) return callback(new Error(error), null);
           let errors = replaceDetailsInMessages(response.errors, details);
           let warnings = replaceDetailsInMessages(response.warnings, details);
@@ -839,13 +748,10 @@
                 legalComments: void 0
               };
-              if ("legalComments" in response)
-                result.legalComments = response == null ? void 0 : response.legalComments;
-              if (response.mangleCache)
-                result.mangleCache = response == null ? void 0 : response.mangleCache;
+              if ("legalComments" in response) result.legalComments = response == null ? void 0 : response.legalComments;
+              if (response.mangleCache) result.mangleCache = response == null ? void 0 : response.mangleCache;
               callback(null, result);
             }
           };
-          if (errors.length > 0)
-            return callback(failureErrorWithLog("Transform failed", errors, warnings), null);
+          if (errors.length > 0) return callback(failureErrorWithLog("Transform failed", errors, warnings), null);
           if (response.codeFS) {
             outstanding++;
@@ -892,6 +798,5 @@
   };
   let formatMessages2 = ({ callName, refs, messages, options, callback }) => {
-    if (!options)
-      throw new Error(`Missing second argument in ${callName}() call`);
+    if (!options) throw new Error(`Missing second argument in ${callName}() call`);
     let keys = {};
     let kind = getFlag(options, keys, "kind", mustBeString);
@@ -899,8 +804,6 @@
     let terminalWidth = getFlag(options, keys, "terminalWidth", mustBeInteger);
     checkForInvalidFlags(options, keys, `in ${callName}() call`);
-    if (kind === void 0)
-      throw new Error(`Missing "kind" in ${callName}() call`);
-    if (kind !== "error" && kind !== "warning")
-      throw new Error(`Expected "kind" to be "error" or "warning" in ${callName}() call`);
+    if (kind === void 0) throw new Error(`Missing "kind" in ${callName}() call`);
+    if (kind !== "error" && kind !== "warning") throw new Error(`Expected "kind" to be "error" or "warning" in ${callName}() call`);
     let request = {
       command: "format-msgs",
@@ -908,17 +811,13 @@
       isWarning: kind === "warning"
     };
-    if (color !== void 0)
-      request.color = color;
-    if (terminalWidth !== void 0)
-      request.terminalWidth = terminalWidth;
+    if (color !== void 0) request.color = color;
+    if (terminalWidth !== void 0) request.terminalWidth = terminalWidth;
     sendRequest(refs, request, (error, response) => {
-      if (error)
-        return callback(new Error(error), null);
+      if (error) return callback(new Error(error), null);
       callback(null, response.messages);
     });
   };
   let analyzeMetafile2 = ({ callName, refs, metafile, options, callback }) => {
-    if (options === void 0)
-      options = {};
+    if (options === void 0) options = {};
     let keys = {};
     let color = getFlag(options, keys, "color", mustBeBoolean);
@@ -929,11 +828,8 @@
       metafile
     };
-    if (color !== void 0)
-      request.color = color;
-    if (verbose !== void 0)
-      request.verbose = verbose;
+    if (color !== void 0) request.color = color;
+    if (verbose !== void 0) request.verbose = verbose;
     sendRequest(refs, request, (error, response) => {
-      if (error)
-        return callback(new Error(error), null);
+      if (error) return callback(new Error(error), null);
       callback(null, response.result);
     });
@@ -969,12 +865,10 @@
     const value = options.plugins;
     if (value !== void 0) {
-      if (!Array.isArray(value))
-        return handleError(new Error(`"plugins" must be an array`), "");
+      if (!Array.isArray(value)) return handleError(new Error(`"plugins" must be an array`), "");
       plugins = value;
     }
   }
   if (plugins && plugins.length > 0) {
-    if (streamIn.isSync)
-      return handleError(new Error("Cannot use plugins in synchronous API calls"), "");
+    if (streamIn.isSync) return handleError(new Error("Cannot use plugins in synchronous API calls"), "");
     handlePlugins(
       buildKey,
@@ -989,6 +883,5 @@
     ).then(
       (result) => {
-        if (!result.ok)
-          return handleError(result.error, result.pluginName);
+        if (!result.ok) return handleError(result.error, result.pluginName);
         try {
           buildOrContextContinue(result.requestPlugins, result.runOnEndCallbacks, result.scheduleOnDisposeCallbacks);
@@ -1019,6 +912,5 @@
       mangleCache
     } = flagsForBuildOptions(callName, options, isTTY2, buildLogLevelDefault, writeDefault);
-    if (write && !streamIn.hasFS)
-      throw new Error(`The "write" option is unavailable in this environment`);
+    if (write && !streamIn.hasFS) throw new Error(`The "write" option is unavailable in this environment`);
     const request = {
       command: "build",
@@ -1033,8 +925,6 @@
       context: isContext
     };
-    if (requestPlugins)
-      request.plugins = requestPlugins;
-    if (mangleCache)
-      request.mangleCache = mangleCache;
+    if (requestPlugins) request.plugins = requestPlugins;
+    if (mangleCache) request.mangleCache = mangleCache;
     const buildResponseToResult = (response, callback2) => {
       const result = {
@@ -1047,12 +937,8 @@
       const originalErrors = result.errors.slice();
       const originalWarnings = result.warnings.slice();
-      if (response.outputFiles)
-        result.outputFiles = response.outputFiles.map(convertOutputFiles);
-      if (response.metafile)
-        result.metafile = JSON.parse(response.metafile);
-      if (response.mangleCache)
-        result.mangleCache = response.mangleCache;
-      if (response.writeToStdout !== void 0)
-        console.log(decodeUTF8(response.writeToStdout).replace(/\n$/, ""));
+      if (response.outputFiles) result.outputFiles = response.outputFiles.map(convertOutputFiles);
+      if (response.metafile) result.metafile = JSON.parse(response.metafile);
+      if (response.mangleCache) result.mangleCache = response.mangleCache;
+      if (response.writeToStdout !== void 0) console.log(decodeUTF8(response.writeToStdout).replace(/\n$/, ""));
       runOnEndCallbacks(result, (onEndErrors, onEndWarnings) => {
         if (originalErrors.length > 0 || onEndErrors.length > 0) {
@@ -1072,6 +958,5 @@
             warnings: onEndWarnings
           };
-          if (provideLatestResult)
-            provideLatestResult(err, result);
+          if (provideLatestResult) provideLatestResult(err, result);
           latestResultPromise = void 0;
           provideLatestResult = void 0;
@@ -1081,6 +966,5 @@
       });
     sendRequest(refs, request, (error, response) => {
-      if (error)
-        return callback(new Error(error), null);
+      if (error) return callback(new Error(error), null);
       if (!isContext) {
         return buildResponseToResult(response, (err, res) => {
@@ -1095,33 +979,30 @@
       const result = {
         rebuild: () => {
-          if (!latestResultPromise)
-            latestResultPromise = new Promise((resolve, reject) => {
-              let settlePromise;
-              provideLatestResult = (err, result2) => {
-                if (!settlePromise)
-                  settlePromise = () => err ? reject(err) : resolve(result2);
+          if (!latestResultPromise) latestResultPromise = new Promise((resolve, reject) => {
+            let settlePromise;
+            provideLatestResult = (err, result2) => {
+              if (!settlePromise) settlePromise = () => err ? reject(err) : resolve(result2);
+            };
+            const triggerAnotherBuild = () => {
+              const request2 = {
+                command: "rebuild",
+                key: buildKey
               };
-              const triggerAnotherBuild = () => {
-                const request2 = {
-                  command: "rebuild",
-                  key: buildKey
-                };
-                sendRequest(refs, request2, (error2, response2) => {
-                  if (error2) {
-                    reject(new Error(error2));
-                  } else if (settlePromise) {
-                    settlePromise();
-                  } else {
-                    triggerAnotherBuild();
-                  }
-                });
-              };
-              triggerAnotherBuild();
-            });
+              sendRequest(refs, request2, (error2, response2) => {
+                if (error2) {
+                  reject(new Error(error2));
+                } else if (settlePromise) {
+                  settlePromise();
+                } else {
+                  triggerAnotherBuild();
+                }
+              });
+            };
+            triggerAnotherBuild();
+          });
           return latestResultPromise;
         },
         watch: (options2 = {}) => new Promise((resolve, reject) => {
-          if (!streamIn.hasFS)
-            throw new Error(`Cannot use the "watch" API in this environment`);
+          if (!streamIn.hasFS) throw new Error(`Cannot use the "watch" API in this environment`);
           const keys = {};
           checkForInvalidFlags(options2, keys, `in watch() call`);
@@ -1131,13 +1012,10 @@
           };
           sendRequest(refs, request2, (error2) => {
-            if (error2)
-              reject(new Error(error2));
-            else
-              resolve(void 0);
+            if (error2) reject(new Error(error2));
+            else resolve(void 0);
           });
         }),
         serve: (options2 = {}) => new Promise((resolve, reject) => {
-          if (!streamIn.hasFS)
-            throw new Error(`Cannot use the "serve" API in this environment`);
+          if (!streamIn.hasFS) throw new Error(`Cannot use the "serve" API in this environment`);
           const keys = {};
           const port = getFlag(options2, keys, "port", mustBeInteger);
@@ -1154,19 +1032,12 @@
             onRequest: !!onRequest
           };
-          if (port !== void 0)
-            request2.port = port;
-          if (host !== void 0)
-            request2.host = host;
-          if (servedir !== void 0)
-            request2.servedir = servedir;
-          if (keyfile !== void 0)
-            request2.keyfile = keyfile;
-          if (certfile !== void 0)
-            request2.certfile = certfile;
-          if (fallback !== void 0)
-            request2.fallback = fallback;
+          if (port !== void 0) request2.port = port;
+          if (host !== void 0) request2.host = host;
+          if (servedir !== void 0) request2.servedir = servedir;
+          if (keyfile !== void 0) request2.keyfile = keyfile;
+          if (certfile !== void 0) request2.certfile = certfile;
+          if (fallback !== void 0) request2.fallback = fallback;
           sendRequest(refs, request2, (error2, response2) => {
-            if (error2)
-              return reject(new Error(error2));
+            if (error2) return reject(new Error(error2));
             if (onRequest) {
               requestCallbacks["serve-request"] = (id, request3) => {
@@ -1179,6 +1050,5 @@
         }),
         cancel: () => new Promise((resolve) => {
-          if (didDispose)
-            return resolve();
+          if (didDispose) return resolve();
           const request2 = {
             command: "cancel",
@@ -1190,6 +1060,5 @@
         }),
         dispose: () => new Promise((resolve) => {
-          if (didDispose)
-            return resolve();
+          if (didDispose) return resolve();
           didDispose = true;
           const request2 = {
@@ -1222,13 +1091,10 @@
   for (let item of plugins) {
     let keys = {};
-    if (typeof item !== "object")
-      throw new Error(`Plugin at index ${i} must be an object`);
+    if (typeof item !== "object") throw new Error(`Plugin at index ${i} must be an object`);
     const name = getFlag(item, keys, "name", mustBeString);
-    if (typeof name !== "string" || name === "")
-      throw new Error(`Plugin at index ${i} is missing a name`);
+    if (typeof name !== "string" || name === "") throw new Error(`Plugin at index ${i} is missing a name`);
     try {
       let setup = getFlag(item, keys, "setup", mustBeFunction);
-      if (typeof setup !== "function")
-        throw new Error(`Plugin is missing a setup function`);
+      if (typeof setup !== "function") throw new Error(`Plugin is missing a setup function`);
       checkForInvalidFlags(item, keys, `on plugin ${quote(name)}`);
       let plugin = {
@@ -1241,8 +1107,6 @@
       i++;
       let resolve = (path3, options = {}) => {
-        if (!isSetupDone)
-          throw new Error('Cannot call "resolve" before plugin setup has completed');
-        if (typeof path3 !== "string")
-          throw new Error(`The path to resolve must be a string`);
+        if (!isSetupDone) throw new Error('Cannot call "resolve" before plugin setup has completed');
+        if (typeof path3 !== "string") throw new Error(`The path to resolve must be a string`);
         let keys2 = /* @__PURE__ */ Object.create(null);
         let pluginName = getFlag(options, keys2, "pluginName", mustBeString);
@@ -1260,32 +1124,23 @@
             pluginName: name
           };
-          if (pluginName != null)
-            request.pluginName = pluginName;
-          if (importer != null)
-            request.importer = importer;
-          if (namespace != null)
-            request.namespace = namespace;
-          if (resolveDir != null)
-            request.resolveDir = resolveDir;
-          if (kind != null)
-            request.kind = kind;
-          else
-            throw new Error(`Must specify "kind" when calling "resolve"`);
-          if (pluginData != null)
-            request.pluginData = details.store(pluginData);
+          if (pluginName != null) request.pluginName = pluginName;
+          if (importer != null) request.importer = importer;
+          if (namespace != null) request.namespace = namespace;
+          if (resolveDir != null) request.resolveDir = resolveDir;
+          if (kind != null) request.kind = kind;
+          else throw new Error(`Must specify "kind" when calling "resolve"`);
+          if (pluginData != null) request.pluginData = details.store(pluginData);
           sendRequest(refs, request, (error, response) => {
-            if (error !== null)
-              reject(new Error(error));
-            else
-              resolve2({
-                errors: replaceDetailsInMessages(response.errors, details),
-                warnings: replaceDetailsInMessages(response.warnings, details),
-                path: response.path,
-                external: response.external,
-                sideEffects: response.sideEffects,
-                namespace: response.namespace,
-                suffix: response.suffix,
-                pluginData: details.load(response.pluginData)
-              });
+            if (error !== null) reject(new Error(error));
+            else resolve2({
+              errors: replaceDetailsInMessages(response.errors, details),
+              warnings: replaceDetailsInMessages(response.warnings, details),
+              path: response.path,
+              external: response.external,
+              sideEffects: response.sideEffects,
+              namespace: response.namespace,
+              suffix: response.suffix,
+              pluginData: details.load(response.pluginData)
+            });
           });
         });
@@ -1313,6 +1168,5 @@
           let namespace = getFlag(options, keys2, "namespace", mustBeString);
           checkForInvalidFlags(options, keys2, `in onResolve() call for plugin ${quote(name)}`);
-          if (filter == null)
-            throw new Error(`onResolve() call is missing a filter`);
+          if (filter == null) throw new Error(`onResolve() call is missing a filter`);
           let id = nextCallbackID++;
           onResolveCallbacks[id] = { name, callback, note: registeredNote };
@@ -1326,6 +1180,5 @@
           let namespace = getFlag(options, keys2, "namespace", mustBeString);
           checkForInvalidFlags(options, keys2, `in onLoad() call for plugin ${quote(name)}`);
-          if (filter == null)
-            throw new Error(`onLoad() call is missing a filter`);
+          if (filter == null) throw new Error(`onLoad() call is missing a filter`);
           let id = nextCallbackID++;
           onLoadCallbacks[id] = { name, callback, note: registeredNote };
@@ -1337,6 +1190,5 @@
         esbuild: streamIn.esbuild
       });
-      if (promise)
-        await promise;
+      if (promise) await promise;
       requestPlugins.push(plugin);
     } catch (e) {
@@ -1350,14 +1202,11 @@
         let result = await callback();
         if (result != null) {
-          if (typeof result !== "object")
-            throw new Error(`Expected onStart() callback in plugin ${quote(name)} to return an object`);
+          if (typeof result !== "object") throw new Error(`Expected onStart() callback in plugin ${quote(name)} to return an object`);
           let keys = {};
           let errors = getFlag(result, keys, "errors", mustBeArray);
           let warnings = getFlag(result, keys, "warnings", mustBeArray);
           checkForInvalidFlags(result, keys, `from onStart() callback in plugin ${quote(name)}`);
-          if (errors != null)
-            response.errors.push(...sanitizeMessages(errors, "errors", details, name, void 0));
-          if (warnings != null)
-            response.warnings.push(...sanitizeMessages(warnings, "warnings", details, name, void 0));
+          if (errors != null) response.errors.push(...sanitizeMessages(errors, "errors", details, name, void 0));
+          if (warnings != null) response.warnings.push(...sanitizeMessages(warnings, "warnings", details, name, void 0));
         }
       } catch (e) {
@@ -1381,6 +1230,5 @@
         });
         if (result != null) {
-          if (typeof result !== "object")
-            throw new Error(`Expected onResolve() callback in plugin ${quote(name)} to return an object`);
+          if (typeof result !== "object") throw new Error(`Expected onResolve() callback in plugin ${quote(name)} to return an object`);
           let keys = {};
           let pluginName = getFlag(result, keys, "pluginName", mustBeString);
@@ -1397,26 +1245,15 @@
           checkForInvalidFlags(result, keys, `from onResolve() callback in plugin ${quote(name)}`);
           response.id = id2;
-          if (pluginName != null)
-            response.pluginName = pluginName;
-          if (path3 != null)
-            response.path = path3;
-          if (namespace != null)
-            response.namespace = namespace;
-          if (suffix != null)
-            response.suffix = suffix;
-          if (external != null)
-            response.external = external;
-          if (sideEffects != null)
-            response.sideEffects = sideEffects;
-          if (pluginData != null)
-            response.pluginData = details.store(pluginData);
-          if (errors != null)
-            response.errors = sanitizeMessages(errors, "errors", details, name, void 0);
-          if (warnings != null)
-            response.warnings = sanitizeMessages(warnings, "warnings", details, name, void 0);
-          if (watchFiles != null)
-            response.watchFiles = sanitizeStringArray(watchFiles, "watchFiles");
-          if (watchDirs != null)
-            response.watchDirs = sanitizeStringArray(watchDirs, "watchDirs");
+          if (pluginName != null) response.pluginName = pluginName;
+          if (path3 != null) response.path = path3;
+          if (namespace != null) response.namespace = namespace;
+          if (suffix != null) response.suffix = suffix;
+          if (external != null) response.external = external;
+          if (sideEffects != null) response.sideEffects = sideEffects;
+          if (pluginData != null) response.pluginData = details.store(pluginData);
+          if (errors != null) response.errors = sanitizeMessages(errors, "errors", details, name, void 0);
+          if (warnings != null) response.warnings = sanitizeMessages(warnings, "warnings", details, name, void 0);
+          if (watchFiles != null) response.watchFiles = sanitizeStringArray(watchFiles, "watchFiles");
+          if (watchDirs != null) response.watchDirs = sanitizeStringArray(watchDirs, "watchDirs");
           break;
         }
@@ -1441,6 +1278,5 @@
         });
         if (result != null) {
-          if (typeof result !== "object")
-            throw new Error(`Expected onLoad() callback in plugin ${quote(name)} to return an object`);
+          if (typeof result !== "object") throw new Error(`Expected onLoad() callback in plugin ${quote(name)} to return an object`);
           let keys = {};
           let pluginName = getFlag(result, keys, "pluginName", mustBeString);
@@ -1455,24 +1291,14 @@
           checkForInvalidFlags(result, keys, `from onLoad() callback in plugin ${quote(name)}`);
           response.id = id2;
-          if (pluginName != null)
-            response.pluginName = pluginName;
-          if (contents instanceof Uint8Array)
-            response.contents = contents;
-          else if (contents != null)
-            response.contents = encodeUTF8(contents);
-          if (resolveDir != null)
-            response.resolveDir = resolveDir;
-          if (pluginData != null)
-            response.pluginData = details.store(pluginData);
-          if (loader != null)
-            response.loader = loader;
-          if (errors != null)
-            response.errors = sanitizeMessages(errors, "errors", details, name, void 0);
-          if (warnings != null)
-            response.warnings = sanitizeMessages(warnings, "warnings", details, name, void 0);
-          if (watchFiles != null)
-            response.watchFiles = sanitizeStringArray(watchFiles, "watchFiles");
-          if (watchDirs != null)
-            response.watchDirs = sanitizeStringArray(watchDirs, "watchDirs");
+          if (pluginName != null) response.pluginName = pluginName;
+          if (contents instanceof Uint8Array) response.contents = contents;
+          else if (contents != null) response.contents = encodeUTF8(contents);
+          if (resolveDir != null) response.resolveDir = resolveDir;
+          if (pluginData != null) response.pluginData = details.store(pluginData);
+          if (loader != null) response.loader = loader;
+          if (errors != null) response.errors = sanitizeMessages(errors, "errors", details, name, void 0);
+          if (warnings != null) response.warnings = sanitizeMessages(warnings, "warnings", details, name, void 0);
+          if (watchFiles != null) response.watchFiles = sanitizeStringArray(watchFiles, "watchFiles");
+          if (watchDirs != null) response.watchDirs = sanitizeStringArray(watchDirs, "watchDirs");
           break;
         }
@@ -1496,14 +1322,11 @@
             const value = await callback(result);
             if (value != null) {
-              if (typeof value !== "object")
-                throw new Error(`Expected onEnd() callback in plugin ${quote(name)} to return an object`);
+              if (typeof value !== "object") throw new Error(`Expected onEnd() callback in plugin ${quote(name)} to return an object`);
               let keys = {};
               let errors = getFlag(value, keys, "errors", mustBeArray);
               let warnings = getFlag(value, keys, "warnings", mustBeArray);
               checkForInvalidFlags(value, keys, `from onEnd() callback in plugin ${quote(name)}`);
-              if (errors != null)
-                newErrors = sanitizeMessages(errors, "errors", details, name, void 0);
-              if (warnings != null)
-                newWarnings = sanitizeMessages(warnings, "warnings", details, name, void 0);
+              if (errors != null) newErrors = sanitizeMessages(errors, "errors", details, name, void 0);
+              if (warnings != null) newWarnings = sanitizeMessages(warnings, "warnings", details, name, void 0);
             }
           } catch (e) {
@@ -1550,6 +1373,5 @@
     },
     store(value) {
-      if (value === void 0)
-        return -1;
+      if (value === void 0) return -1;
       const id = nextID++;
       map.set(id, value);
@@ -1562,6 +1384,5 @@
   let tried = false;
   return () => {
-    if (tried)
-      return note;
+    if (tried) return note;
     tried = true;
     try {
@@ -1595,6 +1416,5 @@
     for (let i = 1; i < lines.length; i++) {
       let line = lines[i];
-      if (!line.startsWith(at))
-        continue;
+      if (!line.startsWith(at)) continue;
       line = line.slice(at.length);
       while (true) {
@@ -1639,8 +1459,6 @@
   let limit = 5;
   text += errors.length < 1 ? "" : ` with ${errors.length} error${errors.length < 2 ? "" : "s"}:` + errors.slice(0, limit + 1).map((e, i) => {
-    if (i === limit)
-      return "\n...";
-    if (!e.location)
-      return `
+    if (i === limit) return "\n...";
+    if (!e.location) return `
 error: ${e.text}`;
     let { file, line, column } = e.location;
@@ -1671,6 +1489,5 @@
 }
 function sanitizeLocation(location, where, terminalWidth) {
-  if (location == null)
-    return null;
+  if (location == null) return null;
   let keys = {};
   let file = getFlag(location, keys, "file", mustBeString);
@@ -1742,6 +1559,5 @@
   const result = [];
   for (const value of values) {
-    if (typeof value !== "string")
-      throw new Error(`${quote(property)} must be an array of strings`);
+    if (typeof value !== "string") throw new Error(`${quote(property)} must be an array of strings`);
     result.push(value);
   }
@@ -1829,6 +1645,5 @@
       try {
         const pkg = knownUnixlikePackages[unixKey];
-        if (fs.existsSync(path.join(nodeModulesDirectory, pkg)))
-          return pkg;
+        if (fs.existsSync(path.join(nodeModulesDirectory, pkg))) return pkg;
       } catch {
       }
@@ -1837,6 +1652,5 @@
       try {
         const pkg = knownWindowsPackages[windowsKey];
-        if (fs.existsSync(path.join(nodeModulesDirectory, pkg)))
-          return pkg;
+        if (fs.existsSync(path.join(nodeModulesDirectory, pkg))) return pkg;
       } catch {
       }
@@ -1942,5 +1756,5 @@
         ".cache",
         "esbuild",
-        `pnpapi-${pkg.replace("/", "-")}-${"0.20.2"}-${path.basename(subpath)}`
+        `pnpapi-${pkg.replace("/", "-")}-${"0.21.2"}-${path.basename(subpath)}`
       );
       if (!fs.existsSync(binTargetPath)) {
@@ -1977,5 +1791,5 @@
 }
 var _a;
-var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.20.2";
+var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.21.2";
 var esbuildCommandAndArgs = () => {
   if ((!ESBUILD_BINARY_PATH || false) && (path2.basename(__filename) !== "main.js" || path2.basename(__dirname) !== "lib")) {
@@ -2044,5 +1858,5 @@
   }
 };
-var version = "0.20.2";
+var version = "0.21.2";
 var build = (options) => ensureServiceIsRunning().build(options);
 var context = (buildOptions) => ensureServiceIsRunning().context(buildOptions);
@@ -2052,6 +1866,5 @@
 var buildSync = (options) => {
   if (worker_threads && !isInternalWorkerThread) {
-    if (!workerThreadService)
-      workerThreadService = startWorkerThreadService(worker_threads);
+    if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads);
     return workerThreadService.buildSync(options);
   }
@@ -2064,6 +1877,5 @@
     defaultWD,
     callback: (err, res) => {
-      if (err)
-        throw err;
+      if (err) throw err;
       result = res;
     }
@@ -2073,6 +1885,5 @@
 var transformSync = (input, options) => {
   if (worker_threads && !isInternalWorkerThread) {
-    if (!workerThreadService)
-      workerThreadService = startWorkerThreadService(worker_threads);
+    if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads);
     return workerThreadService.transformSync(input, options);
   }
@@ -2086,6 +1897,5 @@
     fs: fsSync,
     callback: (err, res) => {
-      if (err)
-        throw err;
+      if (err) throw err;
       result = res;
     }
@@ -2095,6 +1905,5 @@
 var formatMessagesSync = (messages, options) => {
   if (worker_threads && !isInternalWorkerThread) {
-    if (!workerThreadService)
-      workerThreadService = startWorkerThreadService(worker_threads);
+    if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads);
     return workerThreadService.formatMessagesSync(messages, options);
   }
@@ -2106,6 +1915,5 @@
     options,
     callback: (err, res) => {
-      if (err)
-        throw err;
+      if (err) throw err;
       result = res;
     }
@@ -2115,6 +1923,5 @@
 var analyzeMetafileSync = (metafile, options) => {
   if (worker_threads && !isInternalWorkerThread) {
-    if (!workerThreadService)
-      workerThreadService = startWorkerThreadService(worker_threads);
+    if (!workerThreadService) workerThreadService = startWorkerThreadService(worker_threads);
     return workerThreadService.analyzeMetafileSync(metafile, options);
   }
@@ -2126,6 +1933,5 @@
     options,
     callback: (err, res) => {
-      if (err)
-        throw err;
+      if (err) throw err;
       result = res;
     }
@@ -2134,8 +1940,6 @@
 };
 var stop = () => {
-  if (stopService)
-    stopService();
-  if (workerThreadService)
-    workerThreadService.stop();
+  if (stopService) stopService();
+  if (workerThreadService) workerThreadService.stop();
   return Promise.resolve();
 };
@@ -2143,12 +1947,8 @@
 var initialize = (options) => {
   options = validateInitializeOptions(options || {});
-  if (options.wasmURL)
-    throw new Error(`The "wasmURL" option only works in the browser`);
-  if (options.wasmModule)
-    throw new Error(`The "wasmModule" option only works in the browser`);
-  if (options.worker)
-    throw new Error(`The "worker" option only works in the browser`);
-  if (initializeWasCalled)
-    throw new Error('Cannot call "initialize" more than once');
+  if (options.wasmURL) throw new Error(`The "wasmURL" option only works in the browser`);
+  if (options.wasmModule) throw new Error(`The "wasmModule" option only works in the browser`);
+  if (options.worker) throw new Error(`The "worker" option only works in the browser`);
+  if (initializeWasCalled) throw new Error('Cannot call "initialize" more than once');
   ensureServiceIsRunning();
   initializeWasCalled = true;
@@ -2159,8 +1959,7 @@
 var stopService;
 var ensureServiceIsRunning = () => {
-  if (longLivedService)
-    return longLivedService;
+  if (longLivedService) return longLivedService;
   let [command, args] = esbuildCommandAndArgs();
-  let child = child_process.spawn(command, args.concat(`--service=${"0.20.2"}`, "--ping"), {
+  let child = child_process.spawn(command, args.concat(`--service=${"0.21.2"}`, "--ping"), {
     windowsHide: true,
     stdio: ["pipe", "pipe", "inherit"],
@@ -2170,6 +1969,5 @@
     writeToStdin(bytes) {
       child.stdin.write(bytes, (err) => {
-        if (err)
-          afterClose(err);
+        if (err) afterClose(err);
       });
     },
@@ -2203,10 +2001,8 @@
   const refs = {
     ref() {
-      if (++refCount === 1)
-        child.ref();
+      if (++refCount === 1) child.ref();
     },
     unref() {
-      if (--refCount === 0)
-        child.unref();
+      if (--refCount === 0) child.unref();
     }
   };
@@ -2261,6 +2057,5 @@
   let { readFromStdout, afterClose, service } = createChannel({
     writeToStdin(bytes) {
-      if (stdin.length !== 0)
-        throw new Error("Must run at most one command");
+      if (stdin.length !== 0) throw new Error("Must run at most one command");
       stdin = bytes;
     },
@@ -2270,5 +2065,5 @@
   });
   callback(service);
-  let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.20.2"}`), {
+  let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.21.2"}`), {
     cwd: defaultWD,
     windowsHide: true,
@@ -2290,5 +2085,5 @@
   let { port1: mainPort, port2: workerPort } = new worker_threads2.MessageChannel();
   let worker = new worker_threads2.Worker(__filename, {
-    workerData: { workerPort, defaultWD, esbuildVersion: "0.20.2" },
+    workerData: { workerPort, defaultWD, esbuildVersion: "0.21.2" },
     transferList: [workerPort],
     // From node's documentation: https://nodejs.org/api/worker_threads.html
@@ -2313,9 +2108,7 @@
   };
   let validateBuildSyncOptions = (options) => {
-    if (!options)
-      return;
+    if (!options) return;
     let plugins = options.plugins;
-    if (plugins && plugins.length > 0)
-      throw fakeBuildError(`Cannot use plugins in synchronous API calls`);
+    if (plugins && plugins.length > 0) throw fakeBuildError(`Cannot use plugins in synchronous API calls`);
   };
   let applyProperties = (object, properties) => {
@@ -2331,9 +2124,7 @@
     worker.postMessage(msg);
     let status = Atomics.wait(sharedBufferView, 0, 0);
-    if (status !== "ok" && status !== "not-equal")
-      throw new Error("Internal error: Atomics.wait() failed: " + status);
+    if (status !== "ok" && status !== "not-equal") throw new Error("Internal error: Atomics.wait() failed: " + status);
     let { message: { id: id2, resolve, reject, properties } } = worker_threads2.receiveMessageOnPort(mainPort);
-    if (id !== id2)
-      throw new Error(`Internal error: Expected id ${id} but got id ${id2}`);
+    if (id !== id2) throw new Error(`Internal error: Expected id ${id} but got id ${id2}`);
     if (reject) {
       applyProperties(reject, properties);
diff --git a/package.json b/package.json
index v0.20.2..v0.21.2 100644
--- a/package.json
+++ b/package.json
@@ -1,5 +1,5 @@
 {
   "name": "esbuild",
-  "version": "0.20.2",
+  "version": "0.21.2",
   "description": "An extremely fast JavaScript and CSS bundler and minifier.",
   "repository": {
@@ -19,27 +19,27 @@
   },
   "optionalDependencies": {
-    "@esbuild/aix-ppc64": "0.20.2",
-    "@esbuild/android-arm": "0.20.2",
-    "@esbuild/android-arm64": "0.20.2",
-    "@esbuild/android-x64": "0.20.2",
-    "@esbuild/darwin-arm64": "0.20.2",
-    "@esbuild/darwin-x64": "0.20.2",
-    "@esbuild/freebsd-arm64": "0.20.2",
-    "@esbuild/freebsd-x64": "0.20.2",
-    "@esbuild/linux-arm": "0.20.2",
-    "@esbuild/linux-arm64": "0.20.2",
-    "@esbuild/linux-ia32": "0.20.2",
-    "@esbuild/linux-loong64": "0.20.2",
-    "@esbuild/linux-mips64el": "0.20.2",
-    "@esbuild/linux-ppc64": "0.20.2",
-    "@esbuild/linux-riscv64": "0.20.2",
-    "@esbuild/linux-s390x": "0.20.2",
-    "@esbuild/linux-x64": "0.20.2",
-    "@esbuild/netbsd-x64": "0.20.2",
-    "@esbuild/openbsd-x64": "0.20.2",
-    "@esbuild/sunos-x64": "0.20.2",
-    "@esbuild/win32-arm64": "0.20.2",
-    "@esbuild/win32-ia32": "0.20.2",
-    "@esbuild/win32-x64": "0.20.2"
+    "@esbuild/aix-ppc64": "0.21.2",
+    "@esbuild/android-arm": "0.21.2",
+    "@esbuild/android-arm64": "0.21.2",
+    "@esbuild/android-x64": "0.21.2",
+    "@esbuild/darwin-arm64": "0.21.2",
+    "@esbuild/darwin-x64": "0.21.2",
+    "@esbuild/freebsd-arm64": "0.21.2",
+    "@esbuild/freebsd-x64": "0.21.2",
+    "@esbuild/linux-arm": "0.21.2",
+    "@esbuild/linux-arm64": "0.21.2",
+    "@esbuild/linux-ia32": "0.21.2",
+    "@esbuild/linux-loong64": "0.21.2",
+    "@esbuild/linux-mips64el": "0.21.2",
+    "@esbuild/linux-ppc64": "0.21.2",
+    "@esbuild/linux-riscv64": "0.21.2",
+    "@esbuild/linux-s390x": "0.21.2",
+    "@esbuild/linux-x64": "0.21.2",
+    "@esbuild/netbsd-x64": "0.21.2",
+    "@esbuild/openbsd-x64": "0.21.2",
+    "@esbuild/sunos-x64": "0.21.2",
+    "@esbuild/win32-arm64": "0.21.2",
+    "@esbuild/win32-ia32": "0.21.2",
+    "@esbuild/win32-x64": "0.21.2"
   },
   "license": "MIT"
Size Files
131.4 KB → 129.7 KB (-1.7 KB 🟢) 7 → 7 (±0 🟢)
Command details
npm diff --diff=esbuild@0.20.2 --diff=esbuild@0.21.2 --diff-unified=2

See also the npm diff document.

Reported by ybiquitous/npm-diff-action@v1.6.0 (Node.js 22.1.0 and npm 10.7.0)

@ybiquitous ybiquitous self-assigned this May 16, 2024
@ybiquitous ybiquitous disabled auto-merge May 19, 2024 23:25
@ybiquitous ybiquitous changed the title chore(deps-dev): bump esbuild from 0.20.2 to 0.21.2 fix(deps-dev): bump esbuild from 0.20.2 to 0.21.2 May 19, 2024
@ybiquitous ybiquitous merged commit cc2990e into main May 19, 2024
4 checks passed
@ybiquitous ybiquitous deleted the dependabot/npm_and_yarn/esbuild-0.21.2 branch May 19, 2024 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant