@term-hub/term-hub 0.1.5 → 0.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@term-hub/term-hub",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "Terminal Hub — capture every terminal you open and manage them all from one window. One-command cross-platform install (macOS / Linux / Windows).",
5
5
  "keywords": [
6
6
  "terminal",
@@ -41,10 +41,10 @@
41
41
  },
42
42
  "//": "optionalDependencies: npm installs ONLY the package whose os/cpu matches the host, so a mac user downloads just the darwin binaries, etc. Versions are kept in lockstep with this package and bumped together by CI.",
43
43
  "optionalDependencies": {
44
- "@term-hub/darwin-arm64": "0.1.5",
45
- "@term-hub/darwin-x64": "0.1.5",
46
- "@term-hub/linux-x64": "0.1.5",
47
- "@term-hub/linux-arm64": "0.1.5"
44
+ "@term-hub/darwin-arm64": "0.1.6",
45
+ "@term-hub/darwin-x64": "0.1.6",
46
+ "@term-hub/linux-x64": "0.1.6",
47
+ "@term-hub/linux-arm64": "0.1.6"
48
48
  },
49
49
  "engines": {
50
50
  "node": ">=18"
@@ -67,13 +67,24 @@ function safe(fn) {
67
67
  if (process.platform !== "darwin" && process.platform !== "linux") process.exit(0);
68
68
 
69
69
  let hubBin = null;
70
+ let hubBinErr = null;
70
71
  try {
71
72
  const p = require("../lib/resolve").exe("hub");
72
73
  if (fs.existsSync(p)) hubBin = p;
73
- } catch {
74
- /* CLI wasn't installed for this platform either -- nothing to verify with */
74
+ else hubBinErr = `resolved path ${p} does not exist`;
75
+ } catch (e) {
76
+ hubBinErr = e.message || String(e);
77
+ }
78
+ if (!hubBin) {
79
+ // This is the #1 cause of a silent "npm install did nothing" report: the
80
+ // platform-specific optional dependency (e.g. @term-hub/darwin-arm64)
81
+ // isn't installed or is missing its binary, so there's nothing to verify
82
+ // the GUI update signature with, so the whole GUI install step is skipped.
83
+ // Say so instead of exiting quietly -- the CLI itself still works either
84
+ // way, so this is informational, not an install failure.
85
+ if (hubBinErr) console.error(`Terminal Hub: skipping GUI install -- no CLI binary to verify signatures with (${hubBinErr}).`);
86
+ process.exit(0);
75
87
  }
76
- if (!hubBin) process.exit(0);
77
88
 
78
89
  // Tauri's {{target}}/{{arch}} keys, e.g. "darwin-aarch64", "linux-x86_64".
79
90
  const TARGET = { darwin: "darwin", linux: "linux" }[process.platform];
@@ -113,21 +124,27 @@ function installedVersionLinux() {
113
124
  }
114
125
  }
115
126
 
116
- // Fetching latest.json is the one step that runs unconditionally on every
117
- // `npm install`, including when there's nothing to do -- so its failure
118
- // (offline, GitHub unreachable) must be silent, not routed through safe()'s
119
- // error message.
127
+ // Checked before the fetch (cheap, local, no network) so a fetch failure
128
+ // can be judged against it below: an already-installed user going offline
129
+ // is a real no-op and must stay silent, but a never-installed machine that
130
+ // can't reach GitHub must not look identical to "nothing to do" -- that's
131
+ // exactly what makes a fresh `npm install -g` look like it silently did
132
+ // nothing.
133
+ const installed = process.platform === "darwin" ? installedVersionMac() : installedVersionLinux();
134
+
120
135
  let manifest = null;
121
136
  try {
122
137
  manifest = fetchJsonSync(LATEST_JSON_URL);
123
- } catch {
124
- process.exit(0);
138
+ } catch (e) {
139
+ if (!installed) {
140
+ console.error(`Terminal Hub: could not check for the GUI app (${e.message || e}). The \`hub\`/\`term-hub\` CLI still works; retry the GUI install later with a fresh \`npm install -g @term-hub/term-hub\`.`);
141
+ }
142
+ process.exit(0); // offline/GitHub-unreachable is a real no-op once already installed
125
143
  }
126
144
 
127
145
  const entry = manifest.platforms && manifest.platforms[PLATFORM_KEY];
128
146
  if (!entry) process.exit(0); // no release artifact for this platform/arch yet
129
147
 
130
- const installed = process.platform === "darwin" ? installedVersionMac() : installedVersionLinux();
131
148
  if (installed && versionAtLeast(installed, manifest.version)) {
132
149
  process.exit(0); // already current -- install exactly once, never redundantly re-download/re-extract
133
150
  }