@1presence/bridge 0.12.0 → 0.13.0

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/dist/index.js +14 -0
  2. package/package.json +2 -1
package/dist/index.js CHANGED
@@ -13,6 +13,20 @@ const claude_1 = require("./claude");
13
13
  const config_1 = require("./config");
14
14
  const update_1 = require("./update");
15
15
  const package_json_1 = require("../package.json");
16
+ // Published tarballs don't ship src/, so this fires only when running the
17
+ // dist build from a live workspace checkout. Catches the trap where editing
18
+ // src/ without re-running tsc leaves you executing stale dist code — banner
19
+ // version matches package.json but behavior doesn't match the source.
20
+ if (__dirname.endsWith('dist')) {
21
+ const srcDir = (0, path_1.join)(__dirname, '..', 'src');
22
+ if ((0, fs_1.existsSync)(srcDir)) {
23
+ const newest = (dir) => Math.max(...(0, fs_1.readdirSync)(dir).map(f => (0, fs_1.statSync)((0, path_1.join)(dir, f)).mtimeMs));
24
+ if (newest(srcDir) > newest(__dirname)) {
25
+ console.error('Bridge dist is stale (src/ has been edited since last build). Run: npm run build');
26
+ process.exit(1);
27
+ }
28
+ }
29
+ }
16
30
  // ─── CLI args ─────────────────────────────────────────────────────────────────
17
31
  const VERBOSE = process.argv.includes('--verbose') || process.argv.includes('-v');
18
32
  // ─── Config ───────────────────────────────────────────────────────────────────
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1presence/bridge",
3
- "version": "0.12.0",
3
+ "version": "0.13.0",
4
4
  "description": "Run 1Presence on your Mac and use your Claude.ai Pro subscription from any device",
5
5
  "bin": {
6
6
  "1presence-bridge": "dist/index.js"
@@ -11,6 +11,7 @@
11
11
  "README.md"
12
12
  ],
13
13
  "scripts": {
14
+ "prepare": "tsc",
14
15
  "prepack": "tsc",
15
16
  "build": "tsc",
16
17
  "dev": "tsx src/index.ts",