linkr-bee-cli 1.1.2 → 1.1.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
@@ -6,10 +6,11 @@ or against a loopback simulator. It is the program the
6
6
  [`dsh-linkr-bee`](https://github.com/radxa/linkr-bee/tree/main/linkr-bee-dsh)
7
7
  DeepSeek Harness plugin shells out to — and it is useful on its own.
8
8
 
9
- This npm package carries no binary. On first use it downloads the release asset
10
- built for your platform by the project's Rust release workflow, verifies it
11
- against the release's `SHA256SUMS`, and caches it, so `npx` and a global install
12
- both end up running the same compiled program.
9
+ This npm package carries no binary and runs no install script. On first use it
10
+ downloads the release asset built for your platform by the project's Rust
11
+ release workflow, verifies it against the release's `SHA256SUMS`, and caches it,
12
+ so `npx`, a global install and a package manager that refuses build scripts all
13
+ end up running the same compiled program.
13
14
 
14
15
  ## Use
15
16
 
@@ -52,7 +53,6 @@ a guess: nothing is executed that the release did not sign for.
52
53
  | `BEE_CLI_REPO` | GitHub `owner/name` to download from (default `radxa/linkr-bee`) |
53
54
  | `BEE_CLI_CACHE_DIR` | Cache root (default `$XDG_CACHE_HOME/bee-cli`) |
54
55
  | `BEE_CLI_SHA256` | Pin the expected checksum instead of reading `SHA256SUMS` |
55
- | `BEE_CLI_SKIP_DOWNLOAD=1` | Do not warm the cache during `npm install` |
56
56
 
57
57
  ### Platforms
58
58
 
@@ -1,6 +1,6 @@
1
1
  # Third-party components
2
2
 
3
- Linkr Bee Terminal 1.1.2 is licensed under Apache-2.0.
3
+ Linkr Bee Terminal 1.1.4 is licensed under Apache-2.0.
4
4
 
5
5
  This file is generated from the crate's `Cargo.lock`, `cargo metadata` and
6
6
  `cargo tree`. It lists the normal-dependency closure across all targets
package/bin/bee-cli.js CHANGED
@@ -20,22 +20,34 @@ async function main() {
20
20
  process.exit(1)
21
21
  }
22
22
  const child = spawn(binary, process.argv.slice(2), { stdio: 'inherit' })
23
+ // Keep the listeners so they can be removed again: a re-raised signal that
24
+ // this process still handles would be forwarded to a dead child and ignored.
25
+ const relays = new Map()
23
26
  for (const signal of ['SIGINT', 'SIGTERM', 'SIGHUP', 'SIGQUIT']) {
24
- process.on(signal, () => {
27
+ const relay = () => {
25
28
  try {
26
29
  child.kill(signal)
27
30
  } catch {
28
31
  /* the child is already gone */
29
32
  }
30
- })
33
+ }
34
+ relays.set(signal, relay)
35
+ process.on(signal, relay)
31
36
  }
32
37
  child.on('error', (error) => {
33
38
  process.stderr.write(`bee-cli: cannot run ${binary}: ${error.message}\n`)
34
39
  process.exit(1)
35
40
  })
36
41
  child.on('exit', (code, signal) => {
37
- if (signal) process.kill(process.pid, signal)
38
- else process.exit(code === null ? 1 : code)
42
+ if (!signal) {
43
+ process.exit(code === null ? 1 : code)
44
+ return
45
+ }
46
+ // Die the way the child died — but stop listening first, or this process
47
+ // catches its own re-raised signal, forwards it to a dead child and lives
48
+ // on, which is how a Ctrl-C in a terminal left the launcher running.
49
+ for (const [name, relay] of relays) process.removeListener(name, relay)
50
+ process.kill(process.pid, signal)
39
51
  })
40
52
  }
41
53
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "linkr-bee-cli",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "Linkr Bee wireless serial bridge: the command-line client (bee-cli) for talking to a board's UART console over Bluetooth LE, LAN or loopback.",
5
5
  "keywords": [
6
6
  "bee-cli",
@@ -37,10 +37,6 @@
37
37
  "engines": {
38
38
  "node": ">=18"
39
39
  },
40
- "scripts": {
41
- "postinstall": "node ./lib/install.js",
42
- "test": "node --test ./test/*.test.mjs"
43
- },
44
40
  "publishConfig": {
45
41
  "access": "public"
46
42
  }
package/lib/install.js DELETED
@@ -1,20 +0,0 @@
1
- 'use strict'
2
- /**
3
- * Postinstall: warm the cache so the first `bee-cli` run does not wait for a
4
- * download. Best effort by design — an offline install must not fail, because
5
- * the binary is not needed until something actually talks to a board.
6
- */
7
-
8
- const { ensureBinary } = require('./ensure')
9
-
10
- async function main() {
11
- if (process.env.BEE_CLI_SKIP_DOWNLOAD === '1') return
12
- try {
13
- const binary = await ensureBinary({ quiet: true })
14
- if (binary) process.stdout.write(`bee-cli: ${binary}\n`)
15
- } catch (error) {
16
- process.stderr.write(`bee-cli: will fetch the binary on first use (${error.message})\n`)
17
- }
18
- }
19
-
20
- if (require.main === module) main()