@wordbricks/velen 0.2.26 → 0.2.27-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
@@ -15,9 +15,16 @@ Runtime config:
15
15
  - Named profiles use `${XDG_CONFIG_HOME:-~/.config}/velen/profiles/<profile>/config.toml` on Unix-like systems and `%APPDATA%\\velen\\profiles\\<profile>\\config.toml` on Windows.
16
16
  - Select a profile with `--profile <profile>`, `VELEN_PROFILE`, or the persisted default from `velen profile switch <profile>`; `--profile` takes precedence over `VELEN_PROFILE`, which takes precedence over the persisted default. The default profile keeps using the legacy flat paths above.
17
17
  - List local profiles with `velen profile list`.
18
- - The current persisted keys are `active_org` and `request_timeout_sec`.
18
+ - The current persisted keys are `active_org` and `request_timeout_sec`; the
19
+ built-in request timeout defaults to 180 seconds.
19
20
  - Runtime config is resolved in this order: built-in defaults -> user config file -> internal typed runtime overrides.
20
21
  - `velen org use <org>` persists `active_org`. Passing `--org <org>` for a command takes precedence over the stored `active_org` value for that invocation.
22
+ - The CLI generates an invocation-scoped request ID when `--request-id` is not
23
+ provided, attaches it to outbound HTTP requests, and can report it on
24
+ transport errors even when no response body is received.
25
+ - Prefer the built-in request timeout for normal commands. Use `--timeout <sec>`
26
+ only when an invocation intentionally needs a shorter or longer request
27
+ window.
21
28
  - `velen auth logout` clears both the stored auth session and the stored `active_org` for the selected profile, so later org-scoped commands fail explicitly until a new org is selected.
22
29
 
23
30
  Credential storage:
package/package.json CHANGED
@@ -1,28 +1,27 @@
1
1
  {
2
- "name": "@wordbricks/velen",
3
- "version": "0.2.26",
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.27-darwin-arm64",
22
24
  "engines": {
23
25
  "node": ">=18"
24
- },
25
- "optionalDependencies": {
26
- "velen-darwin-arm64": "npm:@wordbricks/velen@0.2.26-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
- }