bun 1.1.36 → 1.1.38-canary.20241204.2

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 (2) hide show
  1. package/install.js +47 -5
  2. package/package.json +14 -10
package/install.js CHANGED
@@ -226,12 +226,22 @@ function chmod(path2, mode) {
226
226
  debug("chmod", path2, mode), import_fs.default.chmodSync(path2, mode);
227
227
  }
228
228
  __name(chmod, "chmod");
229
+ function exists(path2) {
230
+ debug("exists", path2);
231
+ try {
232
+ return import_fs.default.existsSync(path2);
233
+ } catch (error2) {
234
+ debug("fs.existsSync failed", error2);
235
+ }
236
+ return !1;
237
+ }
238
+ __name(exists, "exists");
229
239
 
230
240
  // src/npm/install.ts
231
241
  var import_zlib = require("zlib");
232
242
 
233
243
  // 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() || os2 === "win32" && isWindowsAVX2()), platforms = [
244
+ 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()), abi = os2 === "linux" && isLinuxMusl() ? "musl" : void 0, platforms = [
235
245
  {
236
246
  os: "darwin",
237
247
  arch: "arm64",
@@ -270,6 +280,28 @@ var os2 = process.platform, arch = os2 === "darwin" && process.arch === "x64" &&
270
280
  bin: "bun-linux-x64-baseline",
271
281
  exe: "bin/bun"
272
282
  },
283
+ {
284
+ os: "linux",
285
+ arch: "aarch64",
286
+ abi: "musl",
287
+ bin: "bun-linux-aarch64-musl",
288
+ exe: "bin/bun"
289
+ },
290
+ {
291
+ os: "linux",
292
+ arch: "x64",
293
+ abi: "musl",
294
+ avx2: !0,
295
+ bin: "bun-linux-x64-musl",
296
+ exe: "bin/bun"
297
+ },
298
+ {
299
+ os: "linux",
300
+ arch: "x64",
301
+ abi: "musl",
302
+ bin: "bun-linux-x64-musl-baseline",
303
+ exe: "bin/bun"
304
+ },
273
305
  {
274
306
  os: "win32",
275
307
  arch: "x64",
@@ -283,7 +315,17 @@ var os2 = process.platform, arch = os2 === "darwin" && process.arch === "x64" &&
283
315
  bin: "bun-windows-x64-baseline",
284
316
  exe: "bin/bun.exe"
285
317
  }
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);
318
+ ], supportedPlatforms = platforms.filter(
319
+ (platform) => platform.os === os2 && platform.arch === arch && (!platform.avx2 || avx2) && (!platform.abi || abi === platform.abi)
320
+ ).sort((a, b) => a.avx2 === b.avx2 ? 0 : a.avx2 ? -1 : 1);
321
+ function isLinuxMusl() {
322
+ try {
323
+ return exists("/etc/alpine-release");
324
+ } catch (error2) {
325
+ return debug("isLinuxMusl failed", error2), !1;
326
+ }
327
+ }
328
+ __name(isLinuxMusl, "isLinuxMusl");
287
329
  function isLinuxAVX2() {
288
330
  try {
289
331
  return read("/proc/cpuinfo").includes("avx2");
@@ -326,7 +368,7 @@ __name(isWindowsAVX2, "isWindowsAVX2");
326
368
  function importBun() {
327
369
  return __async(this, null, function* () {
328
370
  if (!supportedPlatforms.length)
329
- throw new Error(`Unsupported platform: ${os2} ${arch}`);
371
+ throw new Error(`Unsupported platform: ${os2} ${arch} ${abi || ""}`);
330
372
  for (let platform of supportedPlatforms)
331
373
  try {
332
374
  return yield requireBun(platform);
@@ -376,7 +418,7 @@ function installBun(platform, dst) {
376
418
  write(join(cwd, "package.json"), "{}");
377
419
  let { exitCode } = spawn(
378
420
  "npm",
379
- ["install", "--loglevel=error", "--prefer-offline", "--no-audit", "--progress=false", `${module2}@1.1.36`],
421
+ ["install", "--loglevel=error", "--prefer-offline", "--no-audit", "--progress=false", `${module2}@1.1.38-canary.20241204.2+b4dce96`],
380
422
  {
381
423
  cwd,
382
424
  stdio: "pipe",
@@ -397,7 +439,7 @@ function installBun(platform, dst) {
397
439
  __name(installBun, "installBun");
398
440
  function downloadBun(platform, dst) {
399
441
  return __async(this, null, function* () {
400
- let tgz = yield (yield fetch(`https://registry.npmjs.org/@oven/${platform.bin}/-/${platform.bin}-1.1.36.tgz`)).arrayBuffer(), buffer;
442
+ let tgz = yield (yield fetch(`https://registry.npmjs.org/@oven/${platform.bin}/-/${platform.bin}-1.1.38-canary.20241204.2+b4dce96.tgz`)).arrayBuffer(), buffer;
401
443
  try {
402
444
  buffer = (0, import_zlib.unzipSync)(tgz);
403
445
  } catch (cause) {
package/package.json CHANGED
@@ -1,19 +1,22 @@
1
1
  {
2
2
  "name": "bun",
3
3
  "description": "Bun is a fast all-in-one JavaScript runtime.",
4
- "version": "1.1.36",
4
+ "version": "1.1.38-canary.20241204.2+b4dce96",
5
5
  "scripts": {
6
6
  "postinstall": "node install.js"
7
7
  },
8
8
  "optionalDependencies": {
9
- "@oven/bun-darwin-aarch64": "1.1.36",
10
- "@oven/bun-darwin-x64": "1.1.36",
11
- "@oven/bun-darwin-x64-baseline": "1.1.36",
12
- "@oven/bun-linux-aarch64": "1.1.36",
13
- "@oven/bun-linux-x64": "1.1.36",
14
- "@oven/bun-linux-x64-baseline": "1.1.36",
15
- "@oven/bun-windows-x64": "1.1.36",
16
- "@oven/bun-windows-x64-baseline": "1.1.36"
9
+ "@oven/bun-darwin-aarch64": "1.1.38-canary.20241204.2+b4dce96",
10
+ "@oven/bun-darwin-x64": "1.1.38-canary.20241204.2+b4dce96",
11
+ "@oven/bun-darwin-x64-baseline": "1.1.38-canary.20241204.2+b4dce96",
12
+ "@oven/bun-linux-aarch64": "1.1.38-canary.20241204.2+b4dce96",
13
+ "@oven/bun-linux-x64": "1.1.38-canary.20241204.2+b4dce96",
14
+ "@oven/bun-linux-x64-baseline": "1.1.38-canary.20241204.2+b4dce96",
15
+ "@oven/bun-linux-aarch64-musl": "1.1.38-canary.20241204.2+b4dce96",
16
+ "@oven/bun-linux-x64-musl": "1.1.38-canary.20241204.2+b4dce96",
17
+ "@oven/bun-linux-x64-musl-baseline": "1.1.38-canary.20241204.2+b4dce96",
18
+ "@oven/bun-windows-x64": "1.1.38-canary.20241204.2+b4dce96",
19
+ "@oven/bun-windows-x64-baseline": "1.1.38-canary.20241204.2+b4dce96"
17
20
  },
18
21
  "bin": {
19
22
  "bun": "bin/bun.exe",
@@ -26,7 +29,8 @@
26
29
  ],
27
30
  "cpu": [
28
31
  "arm64",
29
- "x64"
32
+ "x64",
33
+ "aarch64"
30
34
  ],
31
35
  "keywords": [
32
36
  "bun",