bun 1.0.35 → 1.1.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.
Files changed (3) hide show
  1. package/bin/bun +20 -3
  2. package/install.js +23 -10
  3. package/package.json +11 -8
package/bin/bun CHANGED
@@ -231,7 +231,7 @@ __name(chmod, "chmod");
231
231
  var import_zlib = require("zlib");
232
232
 
233
233
  // src/platform.ts
234
- var os2 = process.platform, arch = os2 === "darwin" && process.arch === "x64" && isRosetta2() ? "arm64" : process.arch, avx2 = arch === "x64" && os2 === "linux" && isLinuxAVX2() || os2 === "darwin" && isDarwinAVX2(), platforms = [
234
+ var os2 = process.platform, arch = os2 === "darwin" && process.arch === "x64" && isRosetta2() ? "arm64" : process.arch, avx2 = arch === "x64" && (os2 === "linux" && isLinuxAVX2() || os2 === "darwin" && isDarwinAVX2() || os2 === "win32" && isWindowsAVX2()), platforms = [
235
235
  {
236
236
  os: "darwin",
237
237
  arch: "arm64",
@@ -269,6 +269,19 @@ var os2 = process.platform, arch = os2 === "darwin" && process.arch === "x64" &&
269
269
  arch: "x64",
270
270
  bin: "bun-linux-x64-baseline",
271
271
  exe: "bin/bun"
272
+ },
273
+ {
274
+ os: "win32",
275
+ arch: "x64",
276
+ avx2: !0,
277
+ bin: "bun-windows-x64",
278
+ exe: "bin/bun.exe"
279
+ },
280
+ {
281
+ os: "win32",
282
+ arch: "x64",
283
+ bin: "bun-windows-x64-baseline",
284
+ exe: "bin/bun.exe"
272
285
  }
273
286
  ], supportedPlatforms = platforms.filter((platform) => platform.os === os2 && platform.arch === arch && (!platform.avx2 || avx2)).sort((a, b) => a.avx2 === b.avx2 ? 0 : a.avx2 ? -1 : 1);
274
287
  function isLinuxAVX2() {
@@ -297,6 +310,10 @@ function isRosetta2() {
297
310
  }
298
311
  }
299
312
  __name(isRosetta2, "isRosetta2");
313
+ function isWindowsAVX2() {
314
+ return !1;
315
+ }
316
+ __name(isWindowsAVX2, "isWindowsAVX2");
300
317
 
301
318
  // src/npm/install.ts
302
319
  function importBun() {
@@ -352,7 +369,7 @@ function installBun(platform, dst) {
352
369
  write(join(cwd, "package.json"), "{}");
353
370
  let { exitCode } = spawn(
354
371
  "npm",
355
- ["install", "--loglevel=error", "--prefer-offline", "--no-audit", "--progress=false", `${module2}@1.0.35`],
372
+ ["install", "--loglevel=error", "--prefer-offline", "--no-audit", "--progress=false", `${module2}@1.1.0`],
356
373
  {
357
374
  cwd,
358
375
  stdio: "pipe",
@@ -373,7 +390,7 @@ function installBun(platform, dst) {
373
390
  __name(installBun, "installBun");
374
391
  function downloadBun(platform, dst) {
375
392
  return __async(this, null, function* () {
376
- let tgz = yield (yield fetch(`https://registry.npmjs.org/@oven/${platform.bin}/-/${platform.bin}-1.0.35.tgz`)).arrayBuffer(), buffer;
393
+ let tgz = yield (yield fetch(`https://registry.npmjs.org/@oven/${platform.bin}/-/${platform.bin}-1.1.0.tgz`)).arrayBuffer(), buffer;
377
394
  try {
378
395
  buffer = (0, import_zlib.unzipSync)(tgz);
379
396
  } catch (cause) {
package/install.js CHANGED
@@ -230,7 +230,7 @@ __name(chmod, "chmod");
230
230
  var import_zlib = require("zlib");
231
231
 
232
232
  // src/platform.ts
233
- var os2 = process.platform, arch = os2 === "darwin" && process.arch === "x64" && isRosetta2() ? "arm64" : process.arch, avx2 = arch === "x64" && os2 === "linux" && isLinuxAVX2() || os2 === "darwin" && isDarwinAVX2(), platforms = [
233
+ var os2 = process.platform, arch = os2 === "darwin" && process.arch === "x64" && isRosetta2() ? "arm64" : process.arch, avx2 = arch === "x64" && (os2 === "linux" && isLinuxAVX2() || os2 === "darwin" && isDarwinAVX2() || os2 === "win32" && isWindowsAVX2()), platforms = [
234
234
  {
235
235
  os: "darwin",
236
236
  arch: "arm64",
@@ -268,6 +268,19 @@ var os2 = process.platform, arch = os2 === "darwin" && process.arch === "x64" &&
268
268
  arch: "x64",
269
269
  bin: "bun-linux-x64-baseline",
270
270
  exe: "bin/bun"
271
+ },
272
+ {
273
+ os: "win32",
274
+ arch: "x64",
275
+ avx2: !0,
276
+ bin: "bun-windows-x64",
277
+ exe: "bin/bun.exe"
278
+ },
279
+ {
280
+ os: "win32",
281
+ arch: "x64",
282
+ bin: "bun-windows-x64-baseline",
283
+ exe: "bin/bun.exe"
271
284
  }
272
285
  ], supportedPlatforms = platforms.filter((platform) => platform.os === os2 && platform.arch === arch && (!platform.avx2 || avx2)).sort((a, b) => a.avx2 === b.avx2 ? 0 : a.avx2 ? -1 : 1);
273
286
  function isLinuxAVX2() {
@@ -296,6 +309,10 @@ function isRosetta2() {
296
309
  }
297
310
  }
298
311
  __name(isRosetta2, "isRosetta2");
312
+ function isWindowsAVX2() {
313
+ return !1;
314
+ }
315
+ __name(isWindowsAVX2, "isWindowsAVX2");
299
316
 
300
317
  // src/npm/install.ts
301
318
  function importBun() {
@@ -351,7 +368,7 @@ function installBun(platform, dst) {
351
368
  write(join(cwd, "package.json"), "{}");
352
369
  let { exitCode } = spawn(
353
370
  "npm",
354
- ["install", "--loglevel=error", "--prefer-offline", "--no-audit", "--progress=false", `${module2}@1.0.35`],
371
+ ["install", "--loglevel=error", "--prefer-offline", "--no-audit", "--progress=false", `${module2}@1.1.0`],
355
372
  {
356
373
  cwd,
357
374
  stdio: "pipe",
@@ -372,7 +389,7 @@ function installBun(platform, dst) {
372
389
  __name(installBun, "installBun");
373
390
  function downloadBun(platform, dst) {
374
391
  return __async(this, null, function* () {
375
- let tgz = yield (yield fetch(`https://registry.npmjs.org/@oven/${platform.bin}/-/${platform.bin}-1.0.35.tgz`)).arrayBuffer(), buffer;
392
+ let tgz = yield (yield fetch(`https://registry.npmjs.org/@oven/${platform.bin}/-/${platform.bin}-1.1.0.tgz`)).arrayBuffer(), buffer;
376
393
  try {
377
394
  buffer = (0, import_zlib.unzipSync)(tgz);
378
395
  } catch (cause) {
@@ -399,14 +416,10 @@ function downloadBun(platform, dst) {
399
416
  }
400
417
  __name(downloadBun, "downloadBun");
401
418
  function optimizeBun(path2) {
402
- if (os2 === "win32")
403
- throw new Error(
404
- "You must use Windows Subsystem for Linux, aka. WSL, to run bun. Learn more: https://learn.microsoft.com/en-us/windows/wsl/install"
405
- );
406
- let { npm_config_user_agent } = process.env;
419
+ let installScript = os2 === "win32" ? 'powershell -c "irm bun.sh/install.ps1 | iex"' : "curl -fsSL https://bun.sh/install | bash", { npm_config_user_agent } = process.env;
407
420
  if (npm_config_user_agent && /\byarn\//.test(npm_config_user_agent))
408
421
  throw new Error(
409
- "Yarn does not support bun, because it does not allow linking to binaries. To use bun, install using the following command: curl -fsSL https://bun.sh/install | bash"
422
+ `Yarn does not support bun, because it does not allow linking to binaries. To use bun, install using the following command: ${installScript}`
410
423
  );
411
424
  try {
412
425
  rename(path2, join(__dirname, "bin", "bun"));
@@ -415,7 +428,7 @@ function optimizeBun(path2) {
415
428
  debug("optimizeBun failed", error2);
416
429
  }
417
430
  throw new Error(
418
- "Your package manager doesn't seem to support bun. To use bun, install using the following command: curl -fsSL https://bun.sh/install | bash"
431
+ `Your package manager doesn't seem to support bun. To use bun, install using the following command: ${installScript}`
419
432
  );
420
433
  }
421
434
  __name(optimizeBun, "optimizeBun");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bun",
3
- "version": "1.0.35",
3
+ "version": "1.1.0",
4
4
  "description": "Bun is a fast all-in-one JavaScript runtime.",
5
5
  "keywords": [
6
6
  "bun",
@@ -24,16 +24,19 @@
24
24
  "postinstall": "node install.js"
25
25
  },
26
26
  "optionalDependencies": {
27
- "@oven/bun-darwin-aarch64": "1.0.35",
28
- "@oven/bun-darwin-x64": "1.0.35",
29
- "@oven/bun-darwin-x64-baseline": "1.0.35",
30
- "@oven/bun-linux-aarch64": "1.0.35",
31
- "@oven/bun-linux-x64": "1.0.35",
32
- "@oven/bun-linux-x64-baseline": "1.0.35"
27
+ "@oven/bun-darwin-aarch64": "1.1.0",
28
+ "@oven/bun-darwin-x64": "1.1.0",
29
+ "@oven/bun-darwin-x64-baseline": "1.1.0",
30
+ "@oven/bun-linux-aarch64": "1.1.0",
31
+ "@oven/bun-linux-x64": "1.1.0",
32
+ "@oven/bun-linux-x64-baseline": "1.1.0",
33
+ "@oven/bun-windows-x64": "1.1.0",
34
+ "@oven/bun-windows-x64-baseline": "1.1.0"
33
35
  },
34
36
  "os": [
35
37
  "darwin",
36
- "linux"
38
+ "linux",
39
+ "win32"
37
40
  ],
38
41
  "cpu": [
39
42
  "arm64",