prjct-cli 1.23.0 → 1.24.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,89 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.24.0] - 2026-02-11
4
+
5
+ ### Features
6
+
7
+ - implement daemon mode with IPC socket for near-zero startup (PRJ-302) (#170)
8
+
9
+ ### Bug Fixes
10
+
11
+ - remove source shebang causing SyntaxError in compiled linear CLI (#169)
12
+
13
+
14
+ ## [1.24.1] - 2026-02-10
15
+
16
+ ### Bug Fixes
17
+
18
+ - **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.
19
+
20
+ ## [1.24.0] - 2026-02-10
21
+
22
+ ### Features
23
+
24
+ - **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).
25
+ - **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.
26
+ - **Auto-start daemon**: First CLI invocation automatically spawns the daemon in background for future commands. 30-minute idle auto-shutdown.
27
+ - **Daemon lifecycle commands**: `prjct daemon start|stop|status` for manual control. Supports `--foreground`, `--port=N`, `--no-http` flags.
28
+
29
+ ### Security
30
+
31
+ - **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/`.
32
+
33
+ ### Implementation Details
34
+
35
+ 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.
36
+
37
+ ### Learnings
38
+
39
+ - ESM hoists static imports — placing code before `import` statements doesn't help; all imports must be dynamic for a true fast path
40
+ - esbuild code splitting creates ~60 chunk files, not suitable for CLI distribution; explicit two-file shim is cleaner
41
+ - `process.stdin.unref()` doesn't exist in Bun — needs try/catch guard
42
+ - Unix domain sockets with NDJSON are ideal for local IPC: secure (file permissions), fast, debuggable
43
+
44
+ ### Test Plan
45
+
46
+ #### For QA
47
+ 1. `prjct daemon start` — verify socket at `~/.prjct-cli/run/daemon.sock`
48
+ 2. `prjct daemon status` — shows PID, uptime, commands served
49
+ 3. `prjct sync --json --yes` — works via IPC with valid JSON output
50
+ 4. `prjct daemon stop` — clean shutdown, socket removed
51
+ 5. Run any command without daemon — falls back to direct execution
52
+ 6. Verify `dist/` contains NO `.map` files or `sourcesContent`
53
+
54
+ #### For Users
55
+ **What changed:** CLI commands are now routed through a background daemon for faster execution.
56
+ **How to use:** Automatic — daemon starts on first use, stops after 30min idle. Use `PRJCT_NO_DAEMON=1` to disable.
57
+ **Breaking changes:** None.
58
+
59
+ ## [1.23.1] - 2026-02-10
60
+
61
+ ### Bug Fix
62
+
63
+ - **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.
64
+
65
+ ### Root Cause
66
+
67
+ 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.
68
+
69
+ ### Learnings
70
+
71
+ - Source files compiled by esbuild should NOT have shebangs — the build script's `banner` option is the single source of truth for shebang injection
72
+ - Only the first line shebang is stripped by Node.js; any subsequent shebang lines cause parse errors
73
+
74
+ ### Test Plan
75
+
76
+ #### For QA
77
+ 1. `head -1 dist/cli/linear.mjs` — single `#!/usr/bin/env node` shebang
78
+ 2. `node dist/cli/linear.mjs --help` — no SyntaxError
79
+ 3. `prjct linear list` — works end-to-end
80
+ 4. `grep -c '#!/' dist/cli/linear.mjs` — returns `1`
81
+
82
+ #### For Users
83
+ **What changed:** Fixed `prjct linear` commands failing with SyntaxError after v1.23.0.
84
+ **How to use:** Update to v1.23.1 — no action needed.
85
+ **Breaking changes:** None.
86
+
3
87
  ## [1.23.0] - 2026-02-11
4
88
 
5
89
  ### Features
@@ -11,7 +95,6 @@
11
95
 
12
96
  - consolidate core modules from 27 to 20 directories (PRJ-292) (#167)
13
97
 
14
-
15
98
  ## [1.25.0] - 2026-02-10
16
99
 
17
100
  ### Infrastructure