@sylphx/cli 0.22.4 → 0.22.6

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/CHANGELOG.md CHANGED
@@ -1,3 +1,14 @@
1
+ ## 0.22.6
2
+
3
+ - Fix ESM npm shim: get-binary.js used __dirname/require under type=module, so npm i -g @sylphx/cli printed "__dirname is not defined" and never reached login.
4
+ - Meta adapter only; reuses platform binaries @sylphx/cli-*@0.22.5 (sylphx-cli 0.2.23).
5
+
6
+ ## 0.22.5
7
+
8
+ - Product binary `sylphx-cli` **0.2.23** (includes `login` / `logout` / `update` / modern operator surface).
9
+ - Unblocks public npm + curl installers stuck on pre-login 0.20.x / stale 0.22.4→0.2.7 channel lag behind crates.io.
10
+ - `sylphx update` treats crates.io as product version authority when npm adapters lag.
11
+
1
12
  ## 0.22.4
2
13
 
3
14
  - Product binary `sylphx-cli` **0.2.7**: portable Linux prebuilds (Debian bookworm glibc 2.36 baseline).
Binary file
package/lib/get-binary.js CHANGED
@@ -1,5 +1,7 @@
1
1
  import fs from 'node:fs'
2
+ import { createRequire } from 'node:module'
2
3
  import path from 'node:path'
4
+ import { fileURLToPath } from 'node:url'
3
5
  import { knownPlatforms, normalizeArch, platformKey, platformPackageName } from './platform.js'
4
6
 
5
7
  /**
@@ -8,11 +10,15 @@ import { knownPlatforms, normalizeArch, platformKey, platformPackageName } from
8
10
  *
9
11
  * Resolution order:
10
12
  * 1. SYLPHX_CLI_BINARY env override (absolute path)
11
- * 2. Vendored binaries shipped inside this package (binaries/<os>-<arch>/sylphx)
12
- * 3. optionalDependency platform package bin/sylphx(.exe)
13
+ * 2. optionalDependency platform package bin/sylphx(.exe)
14
+ * (glibc-portable prebuilds from bookworm; preferred over host-vendored)
15
+ * 3. Vendored binaries shipped inside this package (binaries/<os>-<arch>/sylphx)
13
16
  * 4. sibling packages/cli-<platform>/bin (workspace / local pack layout)
14
17
  */
15
18
 
19
+ const require = createRequire(import.meta.url)
20
+ const __dirname = path.dirname(fileURLToPath(import.meta.url))
21
+
16
22
  function binaryFileName() {
17
23
  return process.platform === 'win32' ? 'sylphx.exe' : 'sylphx'
18
24
  }
@@ -52,9 +58,6 @@ function getBinaryPath() {
52
58
  return override
53
59
  }
54
60
 
55
- const vendored = pathFromVendor()
56
- if (vendored) return vendored
57
-
58
61
  const pkgName = platformPackageName()
59
62
  if (!pkgName) {
60
63
  throw missingBinaryError(
@@ -68,18 +71,21 @@ function getBinaryPath() {
68
71
  if (fromOptional) return fromOptional
69
72
  }
70
73
 
71
- const localSibling = pathFromPackageRoot(
72
- path.resolve(__dirname, '..', '..', pkgName.replace('@sylphx/', '')),
73
- )
74
- if (localSibling) return localSibling
75
-
76
74
  const nested = pathFromPackageRoot(
77
75
  path.resolve(__dirname, '..', 'node_modules', ...pkgName.split('/')),
78
76
  )
79
77
  if (nested) return nested
80
78
 
79
+ const vendored = pathFromVendor()
80
+ if (vendored) return vendored
81
+
82
+ const localSibling = pathFromPackageRoot(
83
+ path.resolve(__dirname, '..', '..', pkgName.replace('@sylphx/', '')),
84
+ )
85
+ if (localSibling) return localSibling
86
+
81
87
  throw missingBinaryError(
82
- `No vendored binary for ${platformKey()} and optional package ${pkgName} is missing.`,
88
+ `No platform package ${pkgName} and no vendored binary for ${platformKey()}.`,
83
89
  )
84
90
  }
85
91
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sylphx/cli",
3
- "version": "0.22.4",
4
- "description": "Sylphx Platform CLI — npm install channel for the Rust `sylphx` binary (same SSOT as crates.io sylphx-cli).",
3
+ "version": "0.22.6",
4
+ "description": "Sylphx Platform CLI \u2014 npm install channel for the Rust `sylphx` binary (same SSOT as crates.io sylphx-cli).",
5
5
  "type": "module",
6
6
  "homepage": "https://sylphx.com",
7
7
  "repository": {
@@ -35,10 +35,10 @@
35
35
  "postinstall": "node ./install.js"
36
36
  },
37
37
  "optionalDependencies": {
38
- "@sylphx/cli-linux-x64": "0.22.4",
39
- "@sylphx/cli-linux-arm64": "0.22.4",
40
- "@sylphx/cli-darwin-x64": "0.22.4",
41
- "@sylphx/cli-darwin-arm64": "0.22.4"
38
+ "@sylphx/cli-linux-x64": "0.22.6",
39
+ "@sylphx/cli-linux-arm64": "0.22.6",
40
+ "@sylphx/cli-darwin-x64": "0.22.6",
41
+ "@sylphx/cli-darwin-arm64": "0.22.6"
42
42
  },
43
43
  "engines": {
44
44
  "node": ">=18"
@@ -58,7 +58,7 @@
58
58
  "sylphx": {
59
59
  "channel": "rust-native",
60
60
  "crate": "sylphx-cli",
61
- "crateVersion": "0.2.7",
61
+ "crateVersion": "0.2.23",
62
62
  "binaryName": "sylphx"
63
63
  }
64
64
  }