termeet 0.1.11 → 0.1.15

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.
Files changed (2) hide show
  1. package/bin/termeet.js +14 -22
  2. package/package.json +7 -7
package/bin/termeet.js CHANGED
@@ -3,13 +3,13 @@
3
3
  * npm global entry: resolves the native binary from optionalDependency
4
4
  * termeet-cli-<platform>-<arch> (same pattern as @multiplayer-app/cli).
5
5
  */
6
- import { execFileSync } from "node:child_process"
7
- import { existsSync } from "node:fs"
8
- import { dirname, join } from "node:path"
9
- import { fileURLToPath } from "node:url"
6
+ import { execFileSync } from 'node:child_process'
7
+ import { existsSync } from 'node:fs'
8
+ import { dirname, join } from 'node:path'
9
+ import { fileURLToPath } from 'node:url'
10
10
 
11
- const PLATFORM_MAP = { darwin: "darwin", linux: "linux", win32: "windows" }
12
- const ARCH_MAP = { x64: "x64", arm64: "arm64" }
11
+ const PLATFORM_MAP = { darwin: 'darwin', linux: 'linux', win32: 'windows' }
12
+ const ARCH_MAP = { x64: 'x64', arm64: 'arm64' }
13
13
 
14
14
  const platform = PLATFORM_MAP[/** @type {keyof typeof PLATFORM_MAP} */ (process.platform)]
15
15
  const arch = ARCH_MAP[/** @type {keyof typeof ARCH_MAP} */ (process.arch)]
@@ -21,28 +21,21 @@ if (!platform || !arch) {
21
21
 
22
22
  const slug = `${platform}-${arch}`
23
23
  const pkgName = `termeet-cli-${slug}`
24
- const binName = process.platform === "win32" ? "termeet.exe" : "termeet"
24
+ const binName = process.platform === 'win32' ? 'termeet.exe' : 'termeet'
25
25
 
26
26
  function findBinary() {
27
- if (process.env["TERMEET_BIN_PATH"]) return process.env["TERMEET_BIN_PATH"]
27
+ if (process.env['TERMEET_BIN_PATH']) return process.env['TERMEET_BIN_PATH']
28
28
 
29
29
  let dir = dirname(fileURLToPath(import.meta.url))
30
30
  while (true) {
31
- const candidate = join(dir, "node_modules", pkgName, "bin", binName)
31
+ const candidate = join(dir, 'node_modules', pkgName, 'bin', binName)
32
32
  if (existsSync(candidate)) return candidate
33
33
  const parent = dirname(dir)
34
34
  if (parent === dir) break
35
35
  dir = parent
36
36
  }
37
37
 
38
- const devBin = join(
39
- dirname(fileURLToPath(import.meta.url)),
40
- "..",
41
- "dist",
42
- slug,
43
- "bin",
44
- binName,
45
- )
38
+ const devBin = join(dirname(fileURLToPath(import.meta.url)), '..', 'dist', slug, 'bin', binName)
46
39
  if (existsSync(devBin)) return devBin
47
40
 
48
41
  return null
@@ -50,19 +43,18 @@ function findBinary() {
50
43
 
51
44
  const bin = findBinary()
52
45
  if (!bin) {
53
- process.stderr.write(
54
- `Could not find Termeet binary for ${slug}.\n` +
55
- `Try reinstalling: npm install -g termeet\n`,
56
- )
46
+ process.stderr.write(`Could not find Termeet binary for ${slug}.\n` + `Try reinstalling: npm install -g termeet\n`)
57
47
  process.exit(1)
58
48
  }
59
49
 
60
50
  try {
61
- execFileSync(bin, process.argv.slice(2), { stdio: "inherit" })
51
+ execFileSync(bin, process.argv.slice(2), { stdio: 'inherit' })
62
52
  } catch (err) {
63
53
  if (err.signal) {
54
+ // Re-raise the same signal so the parent sees the correct exit reason
64
55
  // Re-raise the same signal so the parent sees the correct exit reason
65
56
  process.kill(process.pid, err.signal)
66
57
  }
58
+
67
59
  process.exit(err.status ?? 1)
68
60
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "termeet",
3
- "version": "0.1.11",
3
+ "version": "0.1.15",
4
4
  "description": "Termeet - Video conferencing with ASCII art",
5
5
  "module": "src/index.tsx",
6
6
  "type": "module",
@@ -21,12 +21,12 @@
21
21
  "bin"
22
22
  ],
23
23
  "optionalDependencies": {
24
- "termeet-cli-darwin-arm64": "0.1.11",
25
- "termeet-cli-darwin-x64": "0.1.11",
26
- "termeet-cli-linux-arm64": "0.1.11",
27
- "termeet-cli-linux-x64": "0.1.11",
28
- "termeet-cli-windows-arm64": "0.1.11",
29
- "termeet-cli-windows-x64": "0.1.11"
24
+ "termeet-cli-darwin-arm64": "0.1.15",
25
+ "termeet-cli-darwin-x64": "0.1.15",
26
+ "termeet-cli-linux-arm64": "0.1.15",
27
+ "termeet-cli-linux-x64": "0.1.15",
28
+ "termeet-cli-windows-arm64": "0.1.15",
29
+ "termeet-cli-windows-x64": "0.1.15"
30
30
  },
31
31
  "repository": {
32
32
  "type": "git",