esbuild 0.16.14 → 0.16.16

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
@@ -194,7 +194,7 @@ for your current platform.`);
194
194
  "node_modules",
195
195
  ".cache",
196
196
  "esbuild",
197
- `pnpapi-${pkg.replace("/", "-")}-${"0.16.14"}-${path.basename(subpath)}`
197
+ `pnpapi-${pkg.replace("/", "-")}-${"0.16.16"}-${path.basename(subpath)}`
198
198
  );
199
199
  if (!fs.existsSync(binTargetPath)) {
200
200
  fs.mkdirSync(path.dirname(binTargetPath), { recursive: true });
package/install.js CHANGED
@@ -126,8 +126,8 @@ which means the "esbuild" binary executable can't be run. You can either:
126
126
  }
127
127
  throw err;
128
128
  }
129
- if (stdout !== "0.16.14") {
130
- throw new Error(`Expected ${JSON.stringify("0.16.14")} but got ${JSON.stringify(stdout)}`);
129
+ if (stdout !== "0.16.16") {
130
+ throw new Error(`Expected ${JSON.stringify("0.16.16")} but got ${JSON.stringify(stdout)}`);
131
131
  }
132
132
  }
133
133
  function isYarn() {
@@ -179,7 +179,7 @@ function installUsingNPM(pkg, subpath, binPath) {
179
179
  try {
180
180
  fs2.writeFileSync(path2.join(installDir, "package.json"), "{}");
181
181
  child_process.execSync(
182
- `npm install --loglevel=error --prefer-offline --no-audit --progress=false ${pkg}@${"0.16.14"}`,
182
+ `npm install --loglevel=error --prefer-offline --no-audit --progress=false ${pkg}@${"0.16.16"}`,
183
183
  { cwd: installDir, stdio: "pipe", env }
184
184
  );
185
185
  const installedBinPath = path2.join(installDir, "node_modules", pkg, subpath);
@@ -230,7 +230,7 @@ function maybeOptimizePackage(binPath) {
230
230
  }
231
231
  }
232
232
  async function downloadDirectlyFromNPM(pkg, subpath, binPath) {
233
- const url = `https://registry.npmjs.org/${pkg}/-/${pkg.replace("@esbuild/", "")}-${"0.16.14"}.tgz`;
233
+ const url = `https://registry.npmjs.org/${pkg}/-/${pkg.replace("@esbuild/", "")}-${"0.16.16"}.tgz`;
234
234
  console.error(`[esbuild] Trying to download ${JSON.stringify(url)}`);
235
235
  try {
236
236
  fs2.writeFileSync(binPath, extractFileFromTarGzip(await fetch(url), subpath));
package/lib/main.d.ts CHANGED
@@ -196,7 +196,7 @@ export interface OutputFile {
196
196
  /** "text" as bytes */
197
197
  contents: Uint8Array;
198
198
  /** "contents" as text (changes automatically with "contents") */
199
- get text(): string;
199
+ readonly text: string;
200
200
  }
201
201
 
202
202
  export interface BuildInvalidate {
@@ -444,6 +444,7 @@ export interface Metafile {
444
444
  external?: boolean
445
445
  original?: string
446
446
  }[]
447
+ format?: 'cjs' | 'esm'
447
448
  }
448
449
  }
449
450
  outputs: {
package/lib/main.js CHANGED
@@ -739,8 +739,8 @@ function createChannel(streamIn) {
739
739
  if (isFirstPacket) {
740
740
  isFirstPacket = false;
741
741
  let binaryVersion = String.fromCharCode(...bytes);
742
- if (binaryVersion !== "0.16.14") {
743
- throw new Error(`Cannot start service: Host version "${"0.16.14"}" does not match binary version ${quote(binaryVersion)}`);
742
+ if (binaryVersion !== "0.16.16") {
743
+ throw new Error(`Cannot start service: Host version "${"0.16.16"}" does not match binary version ${quote(binaryVersion)}`);
744
744
  }
745
745
  return;
746
746
  }
@@ -1227,6 +1227,8 @@ var handlePlugins = async (buildKey, sendRequest, sendResponse, refs, streamIn,
1227
1227
  checkForInvalidFlags(item, keys, `on plugin ${quote(name)}`);
1228
1228
  let plugin = {
1229
1229
  name,
1230
+ onStart: false,
1231
+ onEnd: false,
1230
1232
  onResolve: [],
1231
1233
  onLoad: []
1232
1234
  };
@@ -1289,11 +1291,13 @@ var handlePlugins = async (buildKey, sendRequest, sendResponse, refs, streamIn,
1289
1291
  let registeredText = `This error came from the "onStart" callback registered here:`;
1290
1292
  let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onStart");
1291
1293
  onStartCallbacks.push({ name, callback, note: registeredNote });
1294
+ plugin.onStart = true;
1292
1295
  },
1293
1296
  onEnd(callback) {
1294
1297
  let registeredText = `This error came from the "onEnd" callback registered here:`;
1295
1298
  let registeredNote = extractCallerV8(new Error(registeredText), streamIn, "onEnd");
1296
1299
  onEndCallbacks.push({ name, callback, note: registeredNote });
1300
+ plugin.onEnd = true;
1297
1301
  },
1298
1302
  onResolve(options, callback) {
1299
1303
  let registeredText = `This error came from the "onResolve" callback registered here:`;
@@ -1864,7 +1868,7 @@ for your current platform.`);
1864
1868
  "node_modules",
1865
1869
  ".cache",
1866
1870
  "esbuild",
1867
- `pnpapi-${pkg.replace("/", "-")}-${"0.16.14"}-${path.basename(subpath)}`
1871
+ `pnpapi-${pkg.replace("/", "-")}-${"0.16.16"}-${path.basename(subpath)}`
1868
1872
  );
1869
1873
  if (!fs.existsSync(binTargetPath)) {
1870
1874
  fs.mkdirSync(path.dirname(binTargetPath), { recursive: true });
@@ -1897,7 +1901,7 @@ if (process.env.ESBUILD_WORKER_THREADS !== "0") {
1897
1901
  }
1898
1902
  }
1899
1903
  var _a;
1900
- var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.16.14";
1904
+ var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.16.16";
1901
1905
  var esbuildCommandAndArgs = () => {
1902
1906
  if ((!ESBUILD_BINARY_PATH || false) && (path2.basename(__filename) !== "main.js" || path2.basename(__dirname) !== "lib")) {
1903
1907
  throw new Error(
@@ -1964,7 +1968,7 @@ var fsAsync = {
1964
1968
  }
1965
1969
  }
1966
1970
  };
1967
- var version = "0.16.14";
1971
+ var version = "0.16.16";
1968
1972
  var build = (options) => ensureServiceIsRunning().build(options);
1969
1973
  var serve = (serveOptions, buildOptions) => ensureServiceIsRunning().serve(serveOptions, buildOptions);
1970
1974
  var transform = (input, options) => ensureServiceIsRunning().transform(input, options);
@@ -2075,7 +2079,7 @@ var ensureServiceIsRunning = () => {
2075
2079
  if (longLivedService)
2076
2080
  return longLivedService;
2077
2081
  let [command, args] = esbuildCommandAndArgs();
2078
- let child = child_process.spawn(command, args.concat(`--service=${"0.16.14"}`, "--ping"), {
2082
+ let child = child_process.spawn(command, args.concat(`--service=${"0.16.16"}`, "--ping"), {
2079
2083
  windowsHide: true,
2080
2084
  stdio: ["pipe", "pipe", "inherit"],
2081
2085
  cwd: defaultWD
@@ -2189,7 +2193,7 @@ var runServiceSync = (callback) => {
2189
2193
  esbuild: node_exports
2190
2194
  });
2191
2195
  callback(service);
2192
- let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.16.14"}`), {
2196
+ let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.16.16"}`), {
2193
2197
  cwd: defaultWD,
2194
2198
  windowsHide: true,
2195
2199
  input: stdin,
@@ -2209,7 +2213,7 @@ var workerThreadService = null;
2209
2213
  var startWorkerThreadService = (worker_threads2) => {
2210
2214
  let { port1: mainPort, port2: workerPort } = new worker_threads2.MessageChannel();
2211
2215
  let worker = new worker_threads2.Worker(__filename, {
2212
- workerData: { workerPort, defaultWD, esbuildVersion: "0.16.14" },
2216
+ workerData: { workerPort, defaultWD, esbuildVersion: "0.16.16" },
2213
2217
  transferList: [workerPort],
2214
2218
  // From node's documentation: https://nodejs.org/api/worker_threads.html
2215
2219
  //
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esbuild",
3
- "version": "0.16.14",
3
+ "version": "0.16.16",
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.14",
19
- "@esbuild/android-arm64": "0.16.14",
20
- "@esbuild/android-x64": "0.16.14",
21
- "@esbuild/darwin-arm64": "0.16.14",
22
- "@esbuild/darwin-x64": "0.16.14",
23
- "@esbuild/freebsd-arm64": "0.16.14",
24
- "@esbuild/freebsd-x64": "0.16.14",
25
- "@esbuild/linux-arm": "0.16.14",
26
- "@esbuild/linux-arm64": "0.16.14",
27
- "@esbuild/linux-ia32": "0.16.14",
28
- "@esbuild/linux-loong64": "0.16.14",
29
- "@esbuild/linux-mips64el": "0.16.14",
30
- "@esbuild/linux-ppc64": "0.16.14",
31
- "@esbuild/linux-riscv64": "0.16.14",
32
- "@esbuild/linux-s390x": "0.16.14",
33
- "@esbuild/linux-x64": "0.16.14",
34
- "@esbuild/netbsd-x64": "0.16.14",
35
- "@esbuild/openbsd-x64": "0.16.14",
36
- "@esbuild/sunos-x64": "0.16.14",
37
- "@esbuild/win32-arm64": "0.16.14",
38
- "@esbuild/win32-ia32": "0.16.14",
39
- "@esbuild/win32-x64": "0.16.14"
18
+ "@esbuild/android-arm": "0.16.16",
19
+ "@esbuild/android-arm64": "0.16.16",
20
+ "@esbuild/android-x64": "0.16.16",
21
+ "@esbuild/darwin-arm64": "0.16.16",
22
+ "@esbuild/darwin-x64": "0.16.16",
23
+ "@esbuild/freebsd-arm64": "0.16.16",
24
+ "@esbuild/freebsd-x64": "0.16.16",
25
+ "@esbuild/linux-arm": "0.16.16",
26
+ "@esbuild/linux-arm64": "0.16.16",
27
+ "@esbuild/linux-ia32": "0.16.16",
28
+ "@esbuild/linux-loong64": "0.16.16",
29
+ "@esbuild/linux-mips64el": "0.16.16",
30
+ "@esbuild/linux-ppc64": "0.16.16",
31
+ "@esbuild/linux-riscv64": "0.16.16",
32
+ "@esbuild/linux-s390x": "0.16.16",
33
+ "@esbuild/linux-x64": "0.16.16",
34
+ "@esbuild/netbsd-x64": "0.16.16",
35
+ "@esbuild/openbsd-x64": "0.16.16",
36
+ "@esbuild/sunos-x64": "0.16.16",
37
+ "@esbuild/win32-arm64": "0.16.16",
38
+ "@esbuild/win32-ia32": "0.16.16",
39
+ "@esbuild/win32-x64": "0.16.16"
40
40
  },
41
41
  "license": "MIT"
42
42
  }