Skip to content

Minimal IStorageService seam (pattern 01 foundation)#39

Merged
astrapi69 merged 1 commit into
mainfrom
feature/storage-seam
Jun 29, 2026
Merged

Minimal IStorageService seam (pattern 01 foundation)#39
astrapi69 merged 1 commit into
mainfrom
feature/storage-seam

Conversation

@astrapi69

Copy link
Copy Markdown
Owner

Closes #38

The incremental-adoption seam for dual storage (pattern 01), without the big-bang rewire. Additive.

  • storage/types.tsIStorageService (minimal: settings + backup as the worked example; grow it per app).
  • storage/api-storage.tsApiStorage delegates to the existing typed api client (no behaviour added).
  • storage/index.tsgetStorage() factory; mode from VITE_STORAGE_MODE (api-only today; warns + falls back to api if dexie is requested before DexieStorage exists).
  • Proof (non-hollow): DataSettings now routes its backup export/import through getStorage() instead of api.* directly. Its existing test stays green through the seam (ApiStorage delegates to the mocked api).

A real DexieStorage (browser IndexedDB) + the Dexie-mode release gate (pattern 02) remain the per-app offline effort — this PR is just the foundation so that adoption is incremental, one component at a time.

Green

tsc + ESLint clean. Vitest 1209 passed (+2). Build OK. Complexity + dir-size gates OK.

)

Lays the incremental-adoption seam for dual storage without rewiring
components:
- storage/types.ts: IStorageService (minimal - settings + backup namespaces)
- storage/api-storage.ts: ApiStorage delegates to the existing api client
- storage/index.ts: getStorage() factory, mode via VITE_STORAGE_MODE
  (api-only; warns + falls back to api if dexie requested before it exists)
- DataSettings now reaches its backup calls through getStorage() as the
  worked, non-hollow example (its test stays green through the seam).

A real DexieStorage (browser IndexedDB, pattern 02 gate) is the per-app
offline effort to add later. Additive; tsc/eslint clean, Vitest 1209, build OK.

Closes #38
@astrapi69 astrapi69 merged commit c783ea0 into main Jun 29, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Minimal IStorageService seam (pattern 01 foundation)

2 participants