pinkcollab 2.4.1 → 2.4.3

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
@@ -4,6 +4,7 @@ This package installs the prebuilt [PinkCollab Gateway](https://github.com/3xian
4
4
 
5
5
  ```sh
6
6
  npm install -g pinkcollab@latest
7
+ node "$(npm root -g)/pinkcollab/bin/check-install.js"
7
8
  cd ~/projects
8
9
  pinkcollab setup
9
10
  ```
@@ -17,3 +18,7 @@ Supported targets are macOS arm64/x64, Linux arm64/x64, and Windows x64. The pla
17
18
  Use `pinkcollab status` to check the host and `pinkcollab doctor` for detailed diagnostics. Manual Serve or HTTPS proxy deployments remain supported; their remote connectivity is reported as externally managed, not verified.
18
19
 
19
20
  After upgrading this package, run `pinkcollab setup` or `pinkcollab service install` to update the stable service binary. Changed running services restart, stopping active OMP runtimes while preserving stored sessions and pairings. If an update fails, resolve the error and rerun it; pending updates are retried.
21
+
22
+ Run the PATH check directly from your shell after installing or upgrading. npm changes PATH inside lifecycle scripts, so this diagnostic is deliberately not an install hook. It warns when a different `pinkcollab` takes precedence and prints both the selected command and the installed launcher. Resolve any warning before setup. The check never deletes another installation or restarts a Gateway; shell aliases, cached lookups, and PowerShell-only script precedence require the shell checks below. In PowerShell, run `node (Join-Path (npm root -g) "pinkcollab/bin/check-install.js")`.
23
+
24
+ Before setup, compare `pinkcollab --version` with `npm list -g pinkcollab --depth=0`. If they differ, inspect `type -a pinkcollab` on macOS/Linux or `Get-Command pinkcollab -All` in PowerShell. Run the launcher from the current npm prefix explicitly or correct PATH before upgrading the service; see [upgrade checks and duplicate installations](https://github.com/3xian/PinkCollab/blob/main/docs/deployment.md#upgrade-checks-and-duplicate-installations). Afterward, `pinkcollab doctor` must show matching CLI and installed-binary hashes. Start a stopped service with `pinkcollab service start`.
@@ -0,0 +1,68 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+
4
+ const fs = require("node:fs");
5
+ const path = require("node:path");
6
+
7
+ function findShadowedInstall({
8
+ env = process.env,
9
+ platform = process.platform,
10
+ cwd = process.cwd(),
11
+ launcher = path.join(__dirname, "pinkcollab.js"),
12
+ } = {}) {
13
+ // npm lifecycle scripts replace PATH with package-local entries and do not
14
+ // expose the original PATH. Only a caller-run check can inspect shell lookup.
15
+ if (env.npm_lifecycle_event) {
16
+ throw new Error("npm lifecycle scripts change PATH; run this script directly with node from your shell after npm finishes");
17
+ }
18
+
19
+ const windows = platform === "win32";
20
+ const extensions = windows
21
+ ? (env.PATHEXT || ".COM;.EXE;.BAT;.CMD").split(";").map((extension) => extension.toLowerCase())
22
+ : [""];
23
+ const installedLauncher = fs.realpathSync(launcher);
24
+ const prefix = windows
25
+ ? fs.realpathSync(env.npm_config_prefix || path.resolve(path.dirname(launcher), "../../.."))
26
+ : null;
27
+ for (const directory of (env.PATH || "").split(windows ? ";" : ":")) {
28
+ for (const extension of extensions) {
29
+ const candidate = path.resolve(cwd, directory || ".", `pinkcollab${extension}`);
30
+ let resolved;
31
+ try {
32
+ if (!fs.statSync(candidate).isFile()) continue;
33
+ fs.accessSync(candidate, windows ? fs.constants.F_OK : fs.constants.X_OK);
34
+ resolved = fs.realpathSync(candidate);
35
+ } catch {
36
+ continue;
37
+ }
38
+ const current = windows
39
+ ? extension === ".cmd" && path.dirname(resolved).toLowerCase() === prefix.toLowerCase()
40
+ : resolved === installedLauncher;
41
+ return current ? null : { candidate, launcher: installedLauncher };
42
+ }
43
+ }
44
+ return null;
45
+ }
46
+
47
+ function main() {
48
+ try {
49
+ const shadow = findShadowedInstall();
50
+ if (!shadow) return;
51
+ console.warn(
52
+ "pinkcollab: WARNING: another installation takes precedence on PATH.\n" +
53
+ ` Shell command: ${shadow.candidate}\n` +
54
+ ` Newly installed npm launcher: ${shadow.launcher}\n` +
55
+ "Running pinkcollab setup may still run the other installation.\n" +
56
+ "Run the new launcher explicitly with node, or correct PATH before setup.\n" +
57
+ "Remove an older npm installation only using its original global prefix.\n" +
58
+ "Then run setup or service install to update the background Gateway.\n" +
59
+ "Gateway updates can stop active OMP runtimes; sessions and pairings remain.",
60
+ );
61
+ } catch (error) {
62
+ // Report diagnostic failures without changing PATH or other installations.
63
+ console.warn(`pinkcollab: could not check PATH: ${error.message}`);
64
+ }
65
+ }
66
+
67
+ if (require.main === module) main();
68
+ module.exports = { findShadowedInstall };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinkcollab",
3
- "version": "2.4.1",
3
+ "version": "2.4.3",
4
4
  "description": "Install and run the PinkCollab Gateway without a Rust toolchain",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -28,10 +28,10 @@
28
28
  "provenance": true
29
29
  },
30
30
  "optionalDependencies": {
31
- "@pinkcollab/gateway-darwin-arm64": "2.4.1",
32
- "@pinkcollab/gateway-darwin-x64": "2.4.1",
33
- "@pinkcollab/gateway-linux-arm64": "2.4.1",
34
- "@pinkcollab/gateway-linux-x64": "2.4.1",
35
- "@pinkcollab/gateway-win32-x64": "2.4.1"
31
+ "@pinkcollab/gateway-darwin-arm64": "2.4.3",
32
+ "@pinkcollab/gateway-darwin-x64": "2.4.3",
33
+ "@pinkcollab/gateway-linux-arm64": "2.4.3",
34
+ "@pinkcollab/gateway-linux-x64": "2.4.3",
35
+ "@pinkcollab/gateway-win32-x64": "2.4.3"
36
36
  }
37
37
  }