prjct-cli 2.1.2 → 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,98 @@
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
+
3
96
  ## [2.1.2] - 2026-04-22
4
97
 
5
98
  Upgrade-safety pass for clients coming from 1.x or 2.1.0. The 2.1.1