prjct-cli 1.23.0 → 1.24.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,113 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.24.1] - 2026-02-11
4
+
5
+ ### Bug Fixes
6
+
7
+ - strip shebangs in build via esbuild plugin (#171)
8
+
9
+
10
+ ## [1.24.2] - 2026-02-10
11
+
12
+ ### Bug Fixes
13
+
14
+ - **Strip shebangs in build via esbuild plugin**: Added a `stripShebangPlugin` to the build script that removes shebangs from source files before bundling. This prevents double-shebang SyntaxErrors when source files (e.g. `#!/usr/bin/env bun`) are compiled with a banner that also injects a shebang. The previous fix (v1.24.1) removed shebangs manually from known files; this fix handles it generically for all future source files.
15
+
16
+ ### Test Plan
17
+
18
+ #### For QA
19
+ 1. Add `#!/usr/bin/env bun` to any source `.ts` file used as an entry point
20
+ 2. Run `node scripts/build.js`
21
+ 3. Verify compiled output has exactly one shebang (`#!/usr/bin/env node`) — not two
22
+ 4. Run `node dist/cli/linear.mjs --help` — should work without SyntaxError
23
+
24
+ #### For Users
25
+ **What changed:** Build-time fix — no user action needed.
26
+ **Breaking changes:** None
27
+
28
+ ## [1.24.0] - 2026-02-11
29
+
30
+ ### Features
31
+
32
+ - implement daemon mode with IPC socket for near-zero startup (PRJ-302) (#170)
33
+
34
+ ### Bug Fixes
35
+
36
+ - remove source shebang causing SyntaxError in compiled linear CLI (#169)
37
+
38
+ ## [1.24.1] - 2026-02-10
39
+
40
+ ### Bug Fixes
41
+
42
+ - **Remove source shebangs from compiled entry points**: `core/daemon/entry.ts` and `core/cli/lint-meta-commentary.ts` had shebangs (`#!/usr/bin/env node`, `#!/usr/bin/env bun`) that caused dual shebangs in compiled `.mjs` output. Node.js only strips the first-line shebang, so the second became a SyntaxError. The build script's `banner` option is the single source of truth for shebang injection.
43
+
44
+ ## [1.24.0] - 2026-02-10
45
+
46
+ ### Features
47
+
48
+ - **Daemon mode with IPC socket**: Background daemon process keeps CLI modules warm in memory. Commands are routed through a Unix domain socket using NDJSON protocol, achieving 1.6ms IPC roundtrip. Production startup drops from ~1060ms to ~220ms (4.8x speedup).
49
+ - **Thin shim entry point**: Production build now uses a 1.6KB shim (`prjct.mjs`) that tries the daemon first, only loading the full 613KB core bundle (`prjct-core.mjs`) when the daemon is unavailable.
50
+ - **Auto-start daemon**: First CLI invocation automatically spawns the daemon in background for future commands. 30-minute idle auto-shutdown.
51
+ - **Daemon lifecycle commands**: `prjct daemon start|stop|status` for manual control. Supports `--foreground`, `--port=N`, `--no-http` flags.
52
+
53
+ ### Security
54
+
55
+ - **Removed source maps from production build**: `.map` files previously embedded full `sourcesContent` including credential management code (`keychain.ts`, `project-credentials.ts`). Source maps are now completely removed from `dist/`.
56
+
57
+ ### Implementation Details
58
+
59
+ Daemon mode with Unix socket IPC for near-zero CLI startup. The daemon pre-loads `PrjctCommands`, `CommandRegistry`, and storage caches once, then reuses them across invocations. The thin shim entry point avoids parsing the heavy core bundle when the daemon handles the command. ESM static imports are hoisted before any code runs, so all imports in `bin/prjct.ts` are now dynamic to enable the fast path.
60
+
61
+ ### Learnings
62
+
63
+ - ESM hoists static imports — placing code before `import` statements doesn't help; all imports must be dynamic for a true fast path
64
+ - esbuild code splitting creates ~60 chunk files, not suitable for CLI distribution; explicit two-file shim is cleaner
65
+ - `process.stdin.unref()` doesn't exist in Bun — needs try/catch guard
66
+ - Unix domain sockets with NDJSON are ideal for local IPC: secure (file permissions), fast, debuggable
67
+
68
+ ### Test Plan
69
+
70
+ #### For QA
71
+ 1. `prjct daemon start` — verify socket at `~/.prjct-cli/run/daemon.sock`
72
+ 2. `prjct daemon status` — shows PID, uptime, commands served
73
+ 3. `prjct sync --json --yes` — works via IPC with valid JSON output
74
+ 4. `prjct daemon stop` — clean shutdown, socket removed
75
+ 5. Run any command without daemon — falls back to direct execution
76
+ 6. Verify `dist/` contains NO `.map` files or `sourcesContent`
77
+
78
+ #### For Users
79
+ **What changed:** CLI commands are now routed through a background daemon for faster execution.
80
+ **How to use:** Automatic — daemon starts on first use, stops after 30min idle. Use `PRJCT_NO_DAEMON=1` to disable.
81
+ **Breaking changes:** None.
82
+
83
+ ## [1.23.1] - 2026-02-10
84
+
85
+ ### Bug Fix
86
+
87
+ - **Fix dual shebang in compiled linear CLI**: Removed `#!/usr/bin/env bun` from `core/cli/linear.ts` source file. The build script (esbuild) already injects `#!/usr/bin/env node` via banner, so the source shebang was duplicated in `dist/cli/linear.mjs` — causing `SyntaxError: Invalid or unexpected token` on Node.js for all `prjct linear` commands.
88
+
89
+ ### Root Cause
90
+
91
+ The source file `core/cli/linear.ts` had `#!/usr/bin/env bun` on line 1. esbuild preserved it during compilation, and the build banner injected `#!/usr/bin/env node` — resulting in two shebangs. Node.js only strips line 1's shebang, so line 2 (`#!/usr/bin/env bun`) was parsed as JavaScript and threw a SyntaxError.
92
+
93
+ ### Learnings
94
+
95
+ - Source files compiled by esbuild should NOT have shebangs — the build script's `banner` option is the single source of truth for shebang injection
96
+ - Only the first line shebang is stripped by Node.js; any subsequent shebang lines cause parse errors
97
+
98
+ ### Test Plan
99
+
100
+ #### For QA
101
+ 1. `head -1 dist/cli/linear.mjs` — single `#!/usr/bin/env node` shebang
102
+ 2. `node dist/cli/linear.mjs --help` — no SyntaxError
103
+ 3. `prjct linear list` — works end-to-end
104
+ 4. `grep -c '#!/' dist/cli/linear.mjs` — returns `1`
105
+
106
+ #### For Users
107
+ **What changed:** Fixed `prjct linear` commands failing with SyntaxError after v1.23.0.
108
+ **How to use:** Update to v1.23.1 — no action needed.
109
+ **Breaking changes:** None.
110
+
3
111
  ## [1.23.0] - 2026-02-11
4
112
 
5
113
  ### Features
@@ -11,7 +119,6 @@
11
119
 
12
120
  - consolidate core modules from 27 to 20 directories (PRJ-292) (#167)
13
121
 
14
-
15
122
  ## [1.25.0] - 2026-02-10
16
123
 
17
124
  ### Infrastructure