feat(storage): add opt-in XDG storage configuration - #108
Conversation
Resolve conflict in app/src/main/index.ts: keep resolver-based OBELISK_DIR/RECAP_DIR at module top, adopt upstream's createAdaptiveWatcher type and notify-debounce infrastructure. Update app-main-storage test to mock createAdaptiveWatcher instead of chokidar.
This reverts commit 4e95b05.
# Conflicts: # app/src/main/indexer.ts
Validation follow-upThe XDG storage coverage is passing locally:
I do not have a reliable native Electron/GUI environment locally. The full Could a maintainer please approve the fork workflow and help run the Electron validation in CI? The current workflow runs the focused storage contracts on Linux, but does not include the full Electron UI suite. Please let us know if you would like any additional checks, coverage, or changes to the validation scope before merging. |
|
hi @tommy0103 please review |
What and why
Adds opt-in XDG Base Directory support for Obelisk's storage locations, as discussed in #101.
Introduces a shared path resolver (
packages/core/src/paths.ts) used by Core, CLI, and Electron, with the following precedence (per the maintainer's confirmed design):OBELISK_HOME→ single directory for everything (highest precedence)~/.obelisk→ keep using itOBELISK_USE_XDG=1→ config at$XDG_CONFIG_HOME/obelisk, data at$XDG_DATA_HOME/obelisk(with per-user fallbacks)~/.obelisk(unchanged)No automatic migration into custom/XDG layouts. Obelisk emits a one-time warning linking to the new README section when
~/.claude/obelisk.sqliteis found in a non-legacy layout.Closes #101
Verification
npm test— 476/477 pass; 1 failure is an npm 12 packaging-test compatibility issue. Manualnpm pack --jsonsucceeds.npm run typecheck— 0 errors (root + app)npm run lint— 0 errors, 4 pre-existing warningsnpm run test:electron:all— 2/5 suites pass; 3 failures are WSL2/dzn GPU-related, unrelated to storage-path changes.--disable-gpufixeselectron-session-images(GPU crash was the cause);electron-session-virtualizationandelectron-session-reader-statestill fail due to WSLg software-rendering timing, not GPU. CI (ubuntu-latest) should not exhibit these.cli.ymldoes not include the new test files.--build, Electron mainsettings:get/settings:set, Electron indexer)Focused test results
tests/paths.test.mjs(11 tests)tests/app-storage-paths.test.mjs(2 tests)tests/app-main-storage.test.mjs(1 test)npm run build:core/build:cliDeliberately out of scope
cli.ymldoes not run the new storage-path tests. Can add a step if preferred.OBELISK_HOME; worker test covers both. Full XDG split through IPC handlers is a follow-up.better-sqlite3, writer leases, WSL path probing).~/.obelisk/obelisk.sqlitewhen switching toOBELISK_HOME— author confirmed no extra warnings beyond~/.claude/obelisk.sqlite.Files changed
packages/core/src/paths.tspackages/core/src/db.tspackages/core/src/core.tsresolveObeliskPathspackages/core/src/provider-settings.tspackages/core/package.json"./paths"exportapp/src/main/index.tsapp/src/main/indexer.tsapp/src/renderer/src/views/Settings.vueREADME.mdtests/paths.test.mjstests/app-storage-paths.test.mjstests/app-main-storage.test.mjs