@fluentci/cli 0.17.3 → 0.17.4

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/README.md CHANGED
@@ -15,8 +15,9 @@ fluentci --help
15
15
  ```
16
16
 
17
17
  Requires Node.js 20 or newer and `tar`. Supports macOS and Linux (glibc 2.39+)
18
- on x86_64/arm64, and FreeBSD, NetBSD, and OpenBSD on x86_64. Windows and Linux
19
- musl binaries are not currently published.
18
+ on x86_64/arm64, including musl builds for Alpine Linux, and FreeBSD, NetBSD,
19
+ and OpenBSD on x86_64. Windows binaries are not currently published.
20
+ Linux libc detection selects GNU or musl archives and keeps their caches separate.
20
21
 
21
22
  The package has no runtime npm dependencies. Installation downloads the matching
22
23
  binary from [GitHub releases](https://github.com/fluentci-io/fluentci/releases)
@@ -31,6 +32,7 @@ The wrapper forwards arguments, terminal input/output, exit codes, and signals.
31
32
  ## Configuration
32
33
 
33
34
  - `FLUENTCI_VERSION`: override the binary release, e.g. `v0.17.3` or `latest`.
35
+ - `FLUENTCI_LIBC`: override Linux libc detection with `gnu` or `musl`.
34
36
  - `FLUENTCI_CACHE_DIR`: override the binary cache directory.
35
37
  - `FLUENTCI_SKIP_DOWNLOAD=1`: skip the install-time download. The first invocation
36
38
  downloads the binary if it is missing, including when npm lifecycle scripts
package/lib/install.mjs CHANGED
@@ -12,10 +12,15 @@ const packageVersion = JSON.parse(
12
12
  readFileSync(new URL("../package.json", import.meta.url), "utf8"),
13
13
  ).version;
14
14
 
15
- export function targetFor(platform, architecture) {
15
+ export function detectLinuxLibc(report = process.report?.getReport?.()) {
16
+ return report?.header?.glibcVersionRuntime ? "gnu" : "musl";
17
+ }
18
+
19
+ export function targetFor(platform, architecture, libc = "gnu") {
20
+ if (platform === "linux" && !["gnu", "musl"].includes(libc)) throw Error("FLUENTCI_LIBC must be gnu or musl.");
16
21
  const os = {
17
22
  darwin: "apple-darwin",
18
- linux: "unknown-linux-gnu",
23
+ linux: `unknown-linux-${libc}`,
19
24
  freebsd: "unknown-freebsd",
20
25
  netbsd: "unknown-netbsd",
21
26
  openbsd: "unknown-openbsd",
@@ -104,12 +109,13 @@ export async function ensureBinary({
104
109
  version = process.env.FLUENTCI_VERSION || packageVersion,
105
110
  platform = process.platform,
106
111
  architecture = process.arch,
112
+ libc = platform === "linux" ? (process.env.FLUENTCI_LIBC || detectLinuxLibc()) : undefined,
107
113
  cacheRoot = defaultCacheRoot(),
108
114
  fetchImpl = globalThis.fetch,
109
115
  extract = extractArchive,
110
116
  log = (message) => process.stderr.write(`${message}\n`),
111
117
  } = {}) {
112
- const target = targetFor(platform, architecture);
118
+ const target = targetFor(platform, architecture, libc);
113
119
  let tag = releaseTag(version);
114
120
  if (tag === "latest") {
115
121
  const response = await request(fetchImpl, `${repository}/releases/latest`, "HEAD");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentci/cli",
3
- "version": "0.17.3",
3
+ "version": "0.17.4",
4
4
  "description": "FluentCI CLI: typed, composable CI/CD pipelines powered by WebAssembly.",
5
5
  "type": "module",
6
6
  "bin": {