@crustjs/crust 0.2.0 → 0.2.1

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/bin/crust.js +25 -4
  2. package/package.json +10 -8
package/bin/crust.js CHANGED
@@ -10,13 +10,23 @@ const PLATFORMS = {
10
10
  "linux-x64": {
11
11
  "packagePathSegment": "crust-linux-x64",
12
12
  "packageName": "@crustjs/crust-linux-x64",
13
- "binaryFilename": "crust-bun-linux-x64-baseline"
13
+ "binaryFilename": "crust-bun-linux-x64"
14
14
  },
15
15
  "linux-arm64": {
16
16
  "packagePathSegment": "crust-linux-arm64",
17
17
  "packageName": "@crustjs/crust-linux-arm64",
18
18
  "binaryFilename": "crust-bun-linux-arm64"
19
19
  },
20
+ "linux-x64-musl": {
21
+ "packagePathSegment": "crust-linux-x64-musl",
22
+ "packageName": "@crustjs/crust-linux-x64-musl",
23
+ "binaryFilename": "crust-bun-linux-x64-musl"
24
+ },
25
+ "linux-arm64-musl": {
26
+ "packagePathSegment": "crust-linux-arm64-musl",
27
+ "packageName": "@crustjs/crust-linux-arm64-musl",
28
+ "binaryFilename": "crust-bun-linux-arm64-musl"
29
+ },
20
30
  "darwin-x64": {
21
31
  "packagePathSegment": "crust-darwin-x64",
22
32
  "packageName": "@crustjs/crust-darwin-x64",
@@ -30,7 +40,7 @@ const PLATFORMS = {
30
40
  "win32-x64": {
31
41
  "packagePathSegment": "crust-windows-x64",
32
42
  "packageName": "@crustjs/crust-windows-x64",
33
- "binaryFilename": "crust-bun-windows-x64-baseline.exe"
43
+ "binaryFilename": "crust-bun-windows-x64.exe"
34
44
  },
35
45
  "win32-arm64": {
36
46
  "packagePathSegment": "crust-windows-arm64",
@@ -39,12 +49,23 @@ const PLATFORMS = {
39
49
  }
40
50
  };
41
51
  const dir = dirname(fileURLToPath(import.meta.url));
42
- const platformKey = `${process.platform}-${process.arch}`;
52
+
53
+ // Same check as Bun's own npm installer: glibc reports its version, musl does not.
54
+ function isMusl() {
55
+ try {
56
+ const report = process.report?.getReport();
57
+ if (report?.header) return report.header.glibcVersionRuntime === undefined;
58
+ } catch {}
59
+ return existsSync("/etc/alpine-release");
60
+ }
61
+
62
+ const platformKey =
63
+ `${process.platform}-${process.arch}` + (process.platform === "linux" && isMusl() ? "-musl" : "");
43
64
  const target = PLATFORMS[platformKey];
44
65
 
45
66
  if (!target) {
46
67
  console.error("[crust] Unsupported platform: " + platformKey);
47
- console.error("[crust] Supported platforms: linux-x64, linux-arm64, darwin-x64, darwin-arm64, windows-x64, windows-arm64");
68
+ console.error("[crust] Supported platforms: linux-x64, linux-arm64, linux-x64-musl, linux-arm64-musl, darwin-x64, darwin-arm64, windows-x64, windows-arm64");
48
69
  process.exit(1);
49
70
  }
50
71
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crustjs/crust",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "CLI tooling for the Crust framework",
5
5
  "license": "MIT",
6
6
  "author": "chenxin-yan",
@@ -25,7 +25,7 @@
25
25
  "access": "public"
26
26
  },
27
27
  "engines": {
28
- "bun": ">=1.3.14"
28
+ "bun": ">=1.4.0"
29
29
  },
30
30
  "type": "module",
31
31
  "files": [
@@ -35,11 +35,13 @@
35
35
  "crust": "bin/crust.js"
36
36
  },
37
37
  "optionalDependencies": {
38
- "@crustjs/crust-linux-x64": "0.2.0",
39
- "@crustjs/crust-linux-arm64": "0.2.0",
40
- "@crustjs/crust-darwin-x64": "0.2.0",
41
- "@crustjs/crust-darwin-arm64": "0.2.0",
42
- "@crustjs/crust-windows-x64": "0.2.0",
43
- "@crustjs/crust-windows-arm64": "0.2.0"
38
+ "@crustjs/crust-linux-x64": "0.2.1",
39
+ "@crustjs/crust-linux-arm64": "0.2.1",
40
+ "@crustjs/crust-linux-x64-musl": "0.2.1",
41
+ "@crustjs/crust-linux-arm64-musl": "0.2.1",
42
+ "@crustjs/crust-darwin-x64": "0.2.1",
43
+ "@crustjs/crust-darwin-arm64": "0.2.1",
44
+ "@crustjs/crust-windows-x64": "0.2.1",
45
+ "@crustjs/crust-windows-arm64": "0.2.1"
44
46
  }
45
47
  }