Skip to content

v1.1.0

Choose a tag to compare

@github-actions github-actions released this 08 Apr 15:29
· 112 commits to main since this release

feat: versioned localStorage migration framework

Adds `makeVersionedStore` — a self-contained store factory that walks backwards through old storage keys, applies typed migrations in sequence, writes the migrated value to the current key, and removes the old key (best-effort) before first render.

What's in this PR

  • Add `src/lib/versionedStore.ts` with `makeVersionedStore` — the generic migration utility described in the issue
  • Add `src/lib/billMigrations.ts` with `migrateV1toBillV2` (`assignedTo: []` → `null`) including shape validation, so malformed payloads throw and the store falls back to `DEFAULT_STATE`
  • Wire `billStore` into `useBillSplit`, replacing the inline `saveState` helper
  • Add `src/lib/versionedStore.test.ts` — 14 unit + fuzz tests covering happy path, migration, chained migrations, fallback, corrupt JSON, and 120+ randomized payloads via fuzzing
  • Add `.github/workflows/ci.yml` — CI runs `typecheck` + `npm test` on every push and PR to `main`
  • Exclude `*.test.ts` from the production `tsconfig.json` compile

Closes #6

PR: #10