esbuild 0.25.5 → 0.25.7

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
@@ -60,7 +60,8 @@ var knownUnixlikePackages = {
60
60
  };
61
61
  var knownWebAssemblyFallbackPackages = {
62
62
  "android arm LE": "@esbuild/android-arm",
63
- "android x64 LE": "@esbuild/android-x64"
63
+ "android x64 LE": "@esbuild/android-x64",
64
+ "openharmony arm64 LE": "@esbuild/openharmony-arm64"
64
65
  };
65
66
  function pkgAndSubpathForCurrentPlatform() {
66
67
  let pkg;
@@ -200,7 +201,7 @@ for your current platform.`);
200
201
  "node_modules",
201
202
  ".cache",
202
203
  "esbuild",
203
- `pnpapi-${pkg.replace("/", "-")}-${"0.25.5"}-${path.basename(subpath)}`
204
+ `pnpapi-${pkg.replace("/", "-")}-${"0.25.7"}-${path.basename(subpath)}`
204
205
  );
205
206
  if (!fs.existsSync(binTargetPath)) {
206
207
  fs.mkdirSync(path.dirname(binTargetPath), { recursive: true });
package/install.js CHANGED
@@ -57,7 +57,8 @@ var knownUnixlikePackages = {
57
57
  };
58
58
  var knownWebAssemblyFallbackPackages = {
59
59
  "android arm LE": "@esbuild/android-arm",
60
- "android x64 LE": "@esbuild/android-x64"
60
+ "android x64 LE": "@esbuild/android-x64",
61
+ "openharmony arm64 LE": "@esbuild/openharmony-arm64"
61
62
  };
62
63
  function pkgAndSubpathForCurrentPlatform() {
63
64
  let pkg;
@@ -220,7 +221,8 @@ require('child_process').execFileSync(${pathString}, process.argv.slice(2), { st
220
221
  ${code}`);
221
222
  }
222
223
  function maybeOptimizePackage(binPath) {
223
- if (os2.platform() !== "win32" && !isYarn()) {
224
+ const { isWASM } = pkgAndSubpathForCurrentPlatform();
225
+ if (os2.platform() !== "win32" && !isYarn() && !isWASM) {
224
226
  const tempPath = path2.join(__dirname, "bin-esbuild");
225
227
  try {
226
228
  fs2.linkSync(binPath, tempPath);
package/lib/main.d.ts CHANGED
@@ -4,6 +4,7 @@ export type Loader = 'base64' | 'binary' | 'copy' | 'css' | 'dataurl' | 'default
4
4
  export type LogLevel = 'verbose' | 'debug' | 'info' | 'warning' | 'error' | 'silent'
5
5
  export type Charset = 'ascii' | 'utf8'
6
6
  export type Drop = 'console' | 'debugger'
7
+ export type AbsPaths = 'code' | 'log' | 'metafile'
7
8
 
8
9
  interface CommonOptions {
9
10
  /** Documentation: https://esbuild.github.io/api/#sourcemap */
@@ -75,6 +76,8 @@ interface CommonOptions {
75
76
  /** Documentation: https://esbuild.github.io/api/#keep-names */
76
77
  keepNames?: boolean
77
78
 
79
+ /** Documentation: https://esbuild.github.io/api/#abs-paths */
80
+ absPaths?: AbsPaths[]
78
81
  /** Documentation: https://esbuild.github.io/api/#color */
79
82
  color?: boolean
80
83
  /** Documentation: https://esbuild.github.io/api/#log-level */
@@ -159,7 +162,7 @@ export interface BuildOptions extends CommonOptions {
159
162
  /** Documentation: https://esbuild.github.io/api/#footer */
160
163
  footer?: { [type: string]: string }
161
164
  /** Documentation: https://esbuild.github.io/api/#entry-points */
162
- entryPoints?: string[] | Record<string, string> | { in: string, out: string }[]
165
+ entryPoints?: (string | { in: string, out: string })[] | Record<string, string>
163
166
  /** Documentation: https://esbuild.github.io/api/#stdin */
164
167
  stdin?: StdinOptions
165
168
  /** Documentation: https://esbuild.github.io/plugins/ */
@@ -513,7 +516,9 @@ export interface AnalyzeMetafileOptions {
513
516
  verbose?: boolean
514
517
  }
515
518
 
519
+ /** Documentation: https://esbuild.github.io/api/#watch-arguments */
516
520
  export interface WatchOptions {
521
+ delay?: number // In milliseconds
517
522
  }
518
523
 
519
524
  export interface BuildContext<ProvidedOptions extends BuildOptions = BuildOptions> {
package/lib/main.js CHANGED
@@ -335,6 +335,7 @@ function pushCommonFlags(flags, options, keys) {
335
335
  let keepNames = getFlag(options, keys, "keepNames", mustBeBoolean);
336
336
  let platform = getFlag(options, keys, "platform", mustBeString);
337
337
  let tsconfigRaw = getFlag(options, keys, "tsconfigRaw", mustBeStringOrObject);
338
+ let absPaths = getFlag(options, keys, "absPaths", mustBeArrayOfStrings);
338
339
  if (legalComments) flags.push(`--legal-comments=${legalComments}`);
339
340
  if (sourceRoot !== void 0) flags.push(`--source-root=${sourceRoot}`);
340
341
  if (sourcesContent !== void 0) flags.push(`--sources-content=${sourcesContent}`);
@@ -353,6 +354,7 @@ function pushCommonFlags(flags, options, keys) {
353
354
  if (ignoreAnnotations) flags.push(`--ignore-annotations`);
354
355
  if (drop) for (let what of drop) flags.push(`--drop:${validateStringValue(what, "drop")}`);
355
356
  if (dropLabels) flags.push(`--drop-labels=${validateAndJoinStringArray(dropLabels, "drop label")}`);
357
+ if (absPaths) flags.push(`--abs-paths=${validateAndJoinStringArray(absPaths, "abs paths")}`);
356
358
  if (mangleProps) flags.push(`--mangle-props=${jsRegExpToGoRegExp(mangleProps)}`);
357
359
  if (reserveProps) flags.push(`--reserve-props=${jsRegExpToGoRegExp(reserveProps)}`);
358
360
  if (mangleQuoted !== void 0) flags.push(`--mangle-quoted=${mangleQuoted}`);
@@ -641,8 +643,8 @@ function createChannel(streamIn) {
641
643
  if (isFirstPacket) {
642
644
  isFirstPacket = false;
643
645
  let binaryVersion = String.fromCharCode(...bytes);
644
- if (binaryVersion !== "0.25.5") {
645
- throw new Error(`Cannot start service: Host version "${"0.25.5"}" does not match binary version ${quote(binaryVersion)}`);
646
+ if (binaryVersion !== "0.25.7") {
647
+ throw new Error(`Cannot start service: Host version "${"0.25.7"}" does not match binary version ${quote(binaryVersion)}`);
646
648
  }
647
649
  return;
648
650
  }
@@ -984,11 +986,13 @@ function buildOrContextImpl(callName, buildKey, sendRequest, sendResponse, refs,
984
986
  watch: (options2 = {}) => new Promise((resolve, reject) => {
985
987
  if (!streamIn.hasFS) throw new Error(`Cannot use the "watch" API in this environment`);
986
988
  const keys = {};
989
+ const delay = getFlag(options2, keys, "delay", mustBeInteger);
987
990
  checkForInvalidFlags(options2, keys, `in watch() call`);
988
991
  const request2 = {
989
992
  command: "watch",
990
993
  key: buildKey
991
994
  };
995
+ if (delay) request2.delay = delay;
992
996
  sendRequest(refs, request2, (error2) => {
993
997
  if (error2) reject(new Error(error2));
994
998
  else resolve(void 0);
@@ -1625,7 +1629,8 @@ var knownUnixlikePackages = {
1625
1629
  };
1626
1630
  var knownWebAssemblyFallbackPackages = {
1627
1631
  "android arm LE": "@esbuild/android-arm",
1628
- "android x64 LE": "@esbuild/android-x64"
1632
+ "android x64 LE": "@esbuild/android-x64",
1633
+ "openharmony arm64 LE": "@esbuild/openharmony-arm64"
1629
1634
  };
1630
1635
  function pkgAndSubpathForCurrentPlatform() {
1631
1636
  let pkg;
@@ -1765,7 +1770,7 @@ for your current platform.`);
1765
1770
  "node_modules",
1766
1771
  ".cache",
1767
1772
  "esbuild",
1768
- `pnpapi-${pkg.replace("/", "-")}-${"0.25.5"}-${path.basename(subpath)}`
1773
+ `pnpapi-${pkg.replace("/", "-")}-${"0.25.7"}-${path.basename(subpath)}`
1769
1774
  );
1770
1775
  if (!fs.existsSync(binTargetPath)) {
1771
1776
  fs.mkdirSync(path.dirname(binTargetPath), { recursive: true });
@@ -1800,7 +1805,7 @@ if (process.env.ESBUILD_WORKER_THREADS !== "0") {
1800
1805
  }
1801
1806
  }
1802
1807
  var _a;
1803
- var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.25.5";
1808
+ var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.25.7";
1804
1809
  var esbuildCommandAndArgs = () => {
1805
1810
  if ((!ESBUILD_BINARY_PATH || false) && (path2.basename(__filename) !== "main.js" || path2.basename(__dirname) !== "lib")) {
1806
1811
  throw new Error(
@@ -1867,7 +1872,7 @@ var fsAsync = {
1867
1872
  }
1868
1873
  }
1869
1874
  };
1870
- var version = "0.25.5";
1875
+ var version = "0.25.7";
1871
1876
  var build = (options) => ensureServiceIsRunning().build(options);
1872
1877
  var context = (buildOptions) => ensureServiceIsRunning().context(buildOptions);
1873
1878
  var transform = (input, options) => ensureServiceIsRunning().transform(input, options);
@@ -1970,7 +1975,7 @@ var stopService;
1970
1975
  var ensureServiceIsRunning = () => {
1971
1976
  if (longLivedService) return longLivedService;
1972
1977
  let [command, args] = esbuildCommandAndArgs();
1973
- let child = child_process.spawn(command, args.concat(`--service=${"0.25.5"}`, "--ping"), {
1978
+ let child = child_process.spawn(command, args.concat(`--service=${"0.25.7"}`, "--ping"), {
1974
1979
  windowsHide: true,
1975
1980
  stdio: ["pipe", "pipe", "inherit"],
1976
1981
  cwd: defaultWD
@@ -2074,7 +2079,7 @@ var runServiceSync = (callback) => {
2074
2079
  esbuild: node_exports
2075
2080
  });
2076
2081
  callback(service);
2077
- let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.25.5"}`), {
2082
+ let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.25.7"}`), {
2078
2083
  cwd: defaultWD,
2079
2084
  windowsHide: true,
2080
2085
  input: stdin,
@@ -2094,7 +2099,7 @@ var workerThreadService = null;
2094
2099
  var startWorkerThreadService = (worker_threads2) => {
2095
2100
  let { port1: mainPort, port2: workerPort } = new worker_threads2.MessageChannel();
2096
2101
  let worker = new worker_threads2.Worker(__filename, {
2097
- workerData: { workerPort, defaultWD, esbuildVersion: "0.25.5" },
2102
+ workerData: { workerPort, defaultWD, esbuildVersion: "0.25.7" },
2098
2103
  transferList: [workerPort],
2099
2104
  // From node's documentation: https://nodejs.org/api/worker_threads.html
2100
2105
  //
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esbuild",
3
- "version": "0.25.5",
3
+ "version": "0.25.7",
4
4
  "description": "An extremely fast JavaScript and CSS bundler and minifier.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -18,31 +18,32 @@
18
18
  "esbuild": "bin/esbuild"
19
19
  },
20
20
  "optionalDependencies": {
21
- "@esbuild/aix-ppc64": "0.25.5",
22
- "@esbuild/android-arm": "0.25.5",
23
- "@esbuild/android-arm64": "0.25.5",
24
- "@esbuild/android-x64": "0.25.5",
25
- "@esbuild/darwin-arm64": "0.25.5",
26
- "@esbuild/darwin-x64": "0.25.5",
27
- "@esbuild/freebsd-arm64": "0.25.5",
28
- "@esbuild/freebsd-x64": "0.25.5",
29
- "@esbuild/linux-arm": "0.25.5",
30
- "@esbuild/linux-arm64": "0.25.5",
31
- "@esbuild/linux-ia32": "0.25.5",
32
- "@esbuild/linux-loong64": "0.25.5",
33
- "@esbuild/linux-mips64el": "0.25.5",
34
- "@esbuild/linux-ppc64": "0.25.5",
35
- "@esbuild/linux-riscv64": "0.25.5",
36
- "@esbuild/linux-s390x": "0.25.5",
37
- "@esbuild/linux-x64": "0.25.5",
38
- "@esbuild/netbsd-arm64": "0.25.5",
39
- "@esbuild/netbsd-x64": "0.25.5",
40
- "@esbuild/openbsd-arm64": "0.25.5",
41
- "@esbuild/openbsd-x64": "0.25.5",
42
- "@esbuild/sunos-x64": "0.25.5",
43
- "@esbuild/win32-arm64": "0.25.5",
44
- "@esbuild/win32-ia32": "0.25.5",
45
- "@esbuild/win32-x64": "0.25.5"
21
+ "@esbuild/aix-ppc64": "0.25.7",
22
+ "@esbuild/android-arm": "0.25.7",
23
+ "@esbuild/android-arm64": "0.25.7",
24
+ "@esbuild/android-x64": "0.25.7",
25
+ "@esbuild/darwin-arm64": "0.25.7",
26
+ "@esbuild/darwin-x64": "0.25.7",
27
+ "@esbuild/freebsd-arm64": "0.25.7",
28
+ "@esbuild/freebsd-x64": "0.25.7",
29
+ "@esbuild/linux-arm": "0.25.7",
30
+ "@esbuild/linux-arm64": "0.25.7",
31
+ "@esbuild/linux-ia32": "0.25.7",
32
+ "@esbuild/linux-loong64": "0.25.7",
33
+ "@esbuild/linux-mips64el": "0.25.7",
34
+ "@esbuild/linux-ppc64": "0.25.7",
35
+ "@esbuild/linux-riscv64": "0.25.7",
36
+ "@esbuild/linux-s390x": "0.25.7",
37
+ "@esbuild/linux-x64": "0.25.7",
38
+ "@esbuild/netbsd-arm64": "0.25.7",
39
+ "@esbuild/netbsd-x64": "0.25.7",
40
+ "@esbuild/openbsd-arm64": "0.25.7",
41
+ "@esbuild/openbsd-x64": "0.25.7",
42
+ "@esbuild/openharmony-arm64": "0.25.7",
43
+ "@esbuild/sunos-x64": "0.25.7",
44
+ "@esbuild/win32-arm64": "0.25.7",
45
+ "@esbuild/win32-ia32": "0.25.7",
46
+ "@esbuild/win32-x64": "0.25.7"
46
47
  },
47
48
  "license": "MIT"
48
49
  }