Minimal IStorageService seam (pattern 01 foundation)#39
Merged
Conversation
) 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #38
The incremental-adoption seam for dual storage (pattern 01), without the big-bang rewire. Additive.
storage/types.ts—IStorageService(minimal:settings+backupas the worked example; grow it per app).storage/api-storage.ts—ApiStoragedelegates to the existing typedapiclient (no behaviour added).storage/index.ts—getStorage()factory; mode fromVITE_STORAGE_MODE(api-only today; warns + falls back to api ifdexieis requested beforeDexieStorageexists).DataSettingsnow routes its backup export/import throughgetStorage()instead ofapi.*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.