prjct-cli 2.1.1 → 2.2.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,141 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.2.1] - 2026-04-22
4
+
5
+ Follow-up to 2.2.0: the vault was generated at the right location but
6
+ Obsidian refused to open it via `obsidian://open?vault=<slug>` because
7
+ the folder wasn't registered in Obsidian's global vault list. Users had
8
+ to manually "Open folder as vault" the first time.
9
+
10
+ ### Added
11
+ - `core/services/obsidian-vault.ts`: `ensureObsidianVault(vaultPath)`
12
+ does two things, idempotently:
13
+ 1. Bootstraps a minimal `.obsidian/app.json` inside the vault so
14
+ Obsidian treats the folder as already-initialized (and skips its
15
+ trust prompt).
16
+ 2. Registers the vault path in Obsidian's config file
17
+ (`~/Library/Application Support/obsidian/obsidian.json` on macOS,
18
+ `$XDG_CONFIG_HOME/obsidian/obsidian.json` on Linux,
19
+ `%APPDATA%\obsidian\obsidian.json` on Windows). The vault then
20
+ shows up in the Vault Switcher after a restart.
21
+ Best-effort — quietly skips registration when Obsidian isn't
22
+ installed (no config directory). Bootstrap still runs so the vault
23
+ is valid the moment the user does run Obsidian.
24
+ - `wiki-generator.ts` calls `ensureObsidianVault(wikiRoot)` at the end
25
+ of every regen. `.catch(() => undefined)` guard: never fail a regen
26
+ because Obsidian glue misbehaved.
27
+ - Tests in `core/__tests__/services/obsidian-vault.test.ts` cover
28
+ bootstrap, URL-encoding of vault names, registration append (keeps
29
+ prior vaults), idempotency, and the no-Obsidian-installed path.
30
+
31
+ ### Operator note
32
+
33
+ First-time upgraders from <2.2.1: Obsidian caches its vault list in
34
+ memory. Close Obsidian fully (⌘Q on macOS, File > Exit on Windows/
35
+ Linux) and relaunch — the newly-registered vault will appear in the
36
+ switcher.
37
+
38
+ ## [2.2.0] - 2026-04-22
39
+
40
+ Obsidian vault location moved out of the repo. Each project now has its
41
+ own visible vault at `~/Documents/prjct/<slug>/` instead of the hidden
42
+ `<repo>/.prjct/wiki/` path. Two reasons:
43
+
44
+ 1. The `.prjct/` prefix is a dotfile — Finder/Explorer hide it by
45
+ default, so users who opened Obsidian looking for their vault often
46
+ couldn't find it. The new path lives under `~/Documents/prjct/`,
47
+ visible without toggling hidden files.
48
+ 2. Privacy-by-default. The old path lived inside the repo and got
49
+ committed on any `git add -A` unless the user remembered to
50
+ `.gitignore` it — leaking private decisions, learnings, and gotchas
51
+ on push.
52
+
53
+ ### Changed (BREAKING — path, not API)
54
+ - Default vault path: `~/Documents/prjct/<slug>/` where `<slug>` is
55
+ derived from the project directory name (basename, lowercased,
56
+ slugified). Callers that hard-coded `.prjct/wiki/` will no longer find
57
+ the vault there.
58
+ - `core/infrastructure/path-manager.ts` exposes a new `getWikiPath()`
59
+ resolver as the single source of truth. Both `wiki-generator.ts` and
60
+ `wiki-ingest.ts` route through it.
61
+
62
+ ### Added
63
+ - `vaultPath` field in `.prjct/prjct.config.json` (optional string) —
64
+ overrides the default. Accepts absolute paths, `~/...`, or
65
+ project-relative paths (e.g. `"./docs/wiki"` to keep the vault
66
+ in-repo). Use `"vaultPath": ".prjct/wiki"` to keep pre-2.2.0 behaviour
67
+ verbatim.
68
+ - Auto-migration: the first `prjct remember`/`ship`/`context wiki sync`
69
+ after upgrade detects a legacy `.prjct/wiki/` folder and moves its
70
+ contents to the new location. Cross-filesystem moves (EXDEV) fall
71
+ back to copy + delete. Idempotent.
72
+ - `.gitignore` gets a `.prjct/wiki/` entry appended when a git repo is
73
+ detected during migration, so the legacy folder doesn't show up in
74
+ `git status` if a tracked copy was ever committed.
75
+ - Tests:
76
+ - `core/__tests__/infrastructure/path-manager-wiki.test.ts` covers the
77
+ resolver (defaults, overrides, slug collisions, project-relative
78
+ rollback).
79
+ - `core/__tests__/services/wiki-migration.test.ts` covers the move
80
+ (no-op cases, conflict detection, gitignore dedup).
81
+
82
+ ### Migration notes
83
+
84
+ - **Nothing breaks for users who accept the default.** The first
85
+ wiki-touching command after upgrading moves your existing
86
+ `.prjct/wiki/` to `~/Documents/prjct/<repo-name>/` with a one-line
87
+ stderr notice, then continues. Second invocation is silent.
88
+ - **To keep the old path**, add `"vaultPath": ".prjct/wiki"` to
89
+ `.prjct/prjct.config.json`. The migration respects the override and
90
+ leaves the legacy folder alone.
91
+ - **Conflict handling**: if you somehow already have content at both
92
+ the legacy path and the new default, the migration refuses to
93
+ overwrite and prints a warning. Merge manually or pick a side via
94
+ `vaultPath`.
95
+
96
+ ## [2.1.2] - 2026-04-22
97
+
98
+ Upgrade-safety pass for clients coming from 1.x or 2.1.0. The 2.1.1
99
+ release fixed the CLI surface but left two upgrade hazards that clients
100
+ could hit in the wild.
101
+
102
+ ### Fixed
103
+ - **Zombie daemon after global upgrade.** pnpm's content-addressable
104
+ store leaves the previous-version files untouched on disk when a new
105
+ version is installed globally, so the long-lived daemon kept serving
106
+ requests from the old build. The thin shim's mtime-based stale check
107
+ never fired. Daemon now reads its own `package.json` at startup,
108
+ periodically probes the globally-installed `prjct` binary
109
+ (pnpm/npm/volta/asdf paths covered), and shuts itself down on
110
+ version mismatch — the next request spawns a fresh daemon.
111
+ (`core/daemon/daemon.ts`)
112
+ - **Orphan `workflow_rules` after v1 → v2.** v1 users could attach hooks
113
+ to command verbs that v2 narrowed `HookCommand` to `[task, done,
114
+ ship, sync]`. Rules keyed on `pause/resume/reopen/next/dash/bug/idea/
115
+ linear/jira/tokens/velocity/plan` survived the upgrade as dead rows
116
+ that `prjct workflow list` still surfaced. SQLite migration v15
117
+ disables them idempotently (enabled=0, not deleted — visible with
118
+ `--include-disabled` for rename/re-enable). Only the orphans —
119
+ `done/ship/task/sync` hooks are preserved.
120
+ (`core/storage/database.ts`, migration v15)
121
+
122
+ ### Added
123
+ - Upgrade-path test coverage in
124
+ `core/__tests__/storage/upgrade-v1-to-v2.test.ts`: seeds a v1-shaped
125
+ DB, asserts orphan rules are disabled, valid hooks survive, and the
126
+ legacy task-status values (`in_progress`/`done`/etc.) still coerce
127
+ correctly through the state machine.
128
+
129
+ ### Migration notes
130
+
131
+ - Upgrading from 1.x: no action required. On first `prjct <cmd>` after
132
+ install, any stale daemon detects the version drift and exits; the
133
+ next invocation starts a clean daemon and runs migration v15 the
134
+ first time each project's DB is touched.
135
+ - Orphan rules show as `disabled` in `prjct workflow list
136
+ --include-disabled`. Rename their `command` to a v2 `HookCommand`
137
+ value (`task`/`done`/`ship`/`sync`) and re-enable if still relevant.
138
+
3
139
  ## [2.1.1] - 2026-04-22
4
140
 
5
141
  Closes the v2 migration gap shipped (incompletely) in `2.1.0` and