@wordbricks/velen 0.2.43 → 0.2.44-darwin-arm64

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
@@ -74,8 +74,19 @@ Install:
74
74
  - `npx @wordbricks/velen --help`
75
75
  - `velen update` updates the globally installed Velen binary and Velen CLI agent skill.
76
76
  - `velen skill add` installs or updates the Velen CLI agent skill globally.
77
- - Linux npm installs ship musl-linked binaries so the CLI runs on both glibc and musl-based distributions, including Alpine.
78
- - Windows npm installs ship both x64 and arm64 platform binaries.
77
+
78
+ Official npm release targets:
79
+
80
+ | Platform | Node architecture | Rust target | npm optional dependency alias |
81
+ | --- | --- | --- | --- |
82
+ | macOS | `arm64` | `aarch64-apple-darwin` | `velen-darwin-arm64` |
83
+ | Linux | `x64` | `x86_64-unknown-linux-musl` | `velen-linux-x64` |
84
+ | Linux | `arm64` | `aarch64-unknown-linux-musl` | `velen-linux-arm64` |
85
+
86
+ - Linux npm installs use musl-linked targets so the same platform
87
+ packages run on glibc distributions and musl distributions such as Alpine.
88
+ - Other platform and architecture pairs are not included in the official npm
89
+ release and the launcher reports them as unsupported.
79
90
 
80
91
  Release:
81
92
 
@@ -85,5 +96,9 @@ Release:
85
96
  - After the release is tagged, close or delete that temporary release branch/PR so `origin/main` stays at `0.0.0`.
86
97
  - Configure npm trusted publishing for `@wordbricks/velen` with GitHub Actions using the workflow filename `cli-release.yml`.
87
98
  - Push a tag like `cli-v0.1.0` or `cli-v0.1.0-alpha.1`.
88
- - The `cli-release` workflow validates `cli-v<version>` against `apps/cli/Cargo.toml`, builds GNU and musl Linux binaries plus the other platform binaries, stages npm tarballs, creates a GitHub release, and publishes them to npm with `npm publish --provenance`.
89
- - Linux npm platform tarballs are staged from musl artifacts for the broadest runtime compatibility.
99
+ - The `cli-release` workflow validates `cli-v<version>` against
100
+ `apps/cli/Cargo.toml`, builds macOS arm64 plus Linux x64/arm64 musl binaries,
101
+ stages the root and platform-specific npm tarballs, creates a GitHub release,
102
+ and publishes the platform packages before the root package.
103
+ - Linux npm platform tarballs are staged from the musl artifacts for the
104
+ broadest runtime compatibility.
package/package.json CHANGED
@@ -1,28 +1,27 @@
1
1
  {
2
- "name": "@wordbricks/velen",
3
- "version": "0.2.43",
2
+ "cpu": [
3
+ "arm64"
4
+ ],
4
5
  "description": "Velen CLI",
5
- "license": "Apache-2.0",
6
- "repository": {
7
- "type": "git",
8
- "url": "git+https://github.com/wordbricks/velen.git",
9
- "directory": "apps/cli"
10
- },
11
- "bin": {
12
- "velen": "bin/velen.js"
13
- },
14
6
  "files": [
15
- "bin",
7
+ "vendor",
16
8
  "README.md"
17
9
  ],
18
- "type": "module",
10
+ "license": "Apache-2.0",
11
+ "name": "@wordbricks/velen",
12
+ "os": [
13
+ "darwin"
14
+ ],
19
15
  "publishConfig": {
20
16
  "access": "public"
21
17
  },
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/wordbricks/velen.git",
21
+ "directory": "apps/cli"
22
+ },
23
+ "version": "0.2.44-darwin-arm64",
22
24
  "engines": {
23
25
  "node": ">=18"
24
- },
25
- "optionalDependencies": {
26
- "velen-darwin-arm64": "npm:@wordbricks/velen@0.2.43-darwin-arm64"
27
26
  }
28
27
  }
package/bin/velen.js DELETED
@@ -1,143 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import { spawn } from "node:child_process";
4
- import { chmodSync, existsSync, statSync } from "node:fs";
5
- import { createRequire } from "node:module";
6
- import path from "node:path";
7
- import { fileURLToPath } from "node:url";
8
-
9
- const __filename = fileURLToPath(import.meta.url);
10
- const __dirname = path.dirname(__filename);
11
- const require = createRequire(import.meta.url);
12
-
13
- const CLI_PACKAGE_NAME = "@wordbricks/velen";
14
- const PLATFORM_PACKAGE_BY_TARGET = {
15
- "aarch64-apple-darwin": "velen-darwin-arm64",
16
- };
17
-
18
- const { platform, arch } = process;
19
- let targetTriple = null;
20
- if (platform === "darwin" && arch === "arm64") {
21
- targetTriple = "aarch64-apple-darwin";
22
- }
23
-
24
- if (!targetTriple) {
25
- throw new Error(`Unsupported platform: ${platform} (${arch})`);
26
- }
27
-
28
- const platformPackage = PLATFORM_PACKAGE_BY_TARGET[targetTriple];
29
- if (!platformPackage) {
30
- throw new Error(`Unsupported target triple: ${targetTriple}`);
31
- }
32
-
33
- // COMMENT: This target map is intentionally duplicated here so the published
34
- // Node launcher stays self-contained, while the typed helper lives in src/.
35
-
36
- // CONTEXT: platform packages are installed through npm alias names so the
37
- // launcher resolves the alias folder, not the underlying published package id.
38
- const binaryName = "velen";
39
- const localVendorRoot = path.join(__dirname, "..", "vendor");
40
- const localBinaryPath = path.join(
41
- localVendorRoot,
42
- targetTriple,
43
- "velen",
44
- binaryName
45
- );
46
-
47
- let vendorRoot;
48
- try {
49
- const packageJsonPath = require.resolve(`${platformPackage}/package.json`);
50
- vendorRoot = path.join(path.dirname(packageJsonPath), "vendor");
51
- } catch {
52
- if (existsSync(localBinaryPath)) {
53
- vendorRoot = localVendorRoot;
54
- } else {
55
- const packageManager = detectPackageManager();
56
- const reinstallCommand =
57
- packageManager === "bun"
58
- ? `bun install -g ${CLI_PACKAGE_NAME}@latest`
59
- : `npm install -g ${CLI_PACKAGE_NAME}@latest`;
60
- throw new Error(
61
- `Missing optional dependency ${platformPackage}. Reinstall Velen CLI: ${reinstallCommand}`
62
- );
63
- }
64
- }
65
-
66
- const binaryPath = path.join(vendorRoot, targetTriple, "velen", binaryName);
67
-
68
- ensureExecutable(binaryPath);
69
-
70
- const child = spawn(binaryPath, process.argv.slice(2), {
71
- env: process.env,
72
- stdio: "inherit",
73
- });
74
-
75
- child.on("error", (error) => {
76
- console.error(error);
77
- process.exit(1);
78
- });
79
-
80
- const forwardSignal = (signal) => {
81
- if (child.killed) {
82
- return;
83
- }
84
-
85
- try {
86
- child.kill(signal);
87
- } catch {
88
- // Ignore forwarding failures if the child already exited.
89
- }
90
- };
91
-
92
- ["SIGINT", "SIGTERM", "SIGHUP"].forEach((signal) => {
93
- process.on(signal, () => forwardSignal(signal));
94
- });
95
-
96
- const childResult = await new Promise((resolve) => {
97
- child.on("exit", (code, signal) => {
98
- if (signal) {
99
- resolve({ signal, type: "signal" });
100
- return;
101
- }
102
-
103
- resolve({ exitCode: code ?? 1, type: "code" });
104
- });
105
- });
106
-
107
- if (childResult.type === "signal") {
108
- process.kill(process.pid, childResult.signal);
109
- } else {
110
- process.exit(childResult.exitCode);
111
- }
112
-
113
- function detectPackageManager() {
114
- const userAgent = process.env.npm_config_user_agent ?? "";
115
- if (/\bbun\//.test(userAgent)) {
116
- return "bun";
117
- }
118
-
119
- const execPath = process.env.npm_execpath ?? "";
120
- if (execPath.includes("bun")) {
121
- return "bun";
122
- }
123
-
124
- if (
125
- __dirname.includes(".bun/install/global") ||
126
- __dirname.includes(".bun\\install\\global")
127
- ) {
128
- return "bun";
129
- }
130
-
131
- return userAgent ? "npm" : null;
132
- }
133
-
134
- function ensureExecutable(filePath) {
135
- const currentMode = statSync(filePath).mode & 0o777;
136
- if ((currentMode & 0o111) !== 0) {
137
- return;
138
- }
139
-
140
- // CONTEXT: npm tarballs store vendored native binaries without execute bits,
141
- // so restore the expected mode before spawning the packaged CLI binary.
142
- chmodSync(filePath, currentMode | 0o755);
143
- }