Files
pad/web/package.json
T
xarmian b759898d5b test(web): fake-indexeddb harness for the localIndex persistence layer (PLAN-2636 unit 1) (#1156)
The localIndex IndexedDB persistence layer ran as a no-op under vitest —
there is no IndexedDB in the node test environment, so `isSupported()`
returned false and every persist/hydrate call short-circuited. The entire
layer, and BUG-2609's seq-guard fix, shipped on live-browser evidence runs
only (the #1148 finding). This adds the harness that makes it testable, the
prerequisite for unit 2's order-and-merge regression matrix.

- fake-indexeddb dev dependency (exact-pinned).
- A dedicated `idb` vitest project (glob `*.idb.test.ts`, node env) whose
  setup installs fake-indexeddb's globals and a fresh IDBFactory per test.
  It self-disables when the dep can't be resolved — mirroring the jsdom
  project — so a symlinked worktree without it keeps `npm run test` green,
  and CI activates it once installed. The idb glob is excluded from the node
  project so the persistence layer can't no-op there and pass vacuously.
- Harness helpers unit 2 builds on: a second cross-tab connection to the
  same database (2635), a v1-database seed + higher-format-version reopen +
  downgrade VersionError (the v1→v2 migration exercise), a fresh-module
  loader that clears the connection cache, and raw ground-truth reads.
  `harnessDbName` mirrors the module's `dbName` exactly, pinned by a test so
  a drift can't make assertions read an empty sibling database.
- BUG-2609's evidence run is ported as a deterministic sequential regression:
  a newer delta commits its atomic rows+cursor transaction, then a stale
  older-seq snapshot lands last and is refused (IDB serializes overlapping
  transactions, so no interleaving control is needed). Plus a raw
  serialization characterization pinning that platform guarantee.

No production code changes.

Claude-Session: https://claude.ai/code/session_017jD6t1zjxGSq47SQpZfp1V
2026-08-18 15:20:13 -04:00

81 lines
2.3 KiB
JSON

{
"name": "web",
"private": true,
"version": "0.0.1",
"license": "Apache-2.0",
"type": "module",
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"prepare": "svelte-kit sync || echo ''",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"test": "vitest run",
"test:watch": "vitest",
"test:e2e": "playwright test",
"test:e2e:ui": "playwright test --ui",
"test:e2e:install": "playwright install --with-deps chromium",
"check:tiptap-pins": "node scripts/check-tiptap-pins.mjs"
},
"devDependencies": {
"@playwright/test": "^1.62.1",
"@sveltejs/adapter-auto": "^7.0.1",
"@sveltejs/adapter-static": "^3.0.10",
"@sveltejs/kit": "^2.70.2",
"@sveltejs/vite-plugin-svelte": "^7.2.0",
"@testing-library/jest-dom": "^7.0.1",
"@testing-library/svelte": "^5.2.8",
"@types/d3-scale": "4.0.9",
"@types/qrcode": "^1.5.6",
"fake-indexeddb": "6.2.5",
"jsdom": "^26.1.0",
"marked": "^18.0.9",
"svelte": "^5.56.8",
"svelte-check": "^4.7.5",
"typescript": "^6.0.3",
"vite": "^8.2.1",
"vitest": "4.1.10"
},
"overrides": {
"cookie": "^0.7.2",
"linkify-it": "^5.0.2",
"markdown-it": "^14.3.0",
"layercake": {
"typescript": "$typescript"
}
},
"dependencies": {
"@dagrejs/dagre": "3.1.0",
"@tiptap/core": "3.29.2",
"@tiptap/extension-bubble-menu": "^3.29.2",
"@tiptap/extension-code-block-lowlight": "^3.29.2",
"@tiptap/extension-collaboration": "3.29.2",
"@tiptap/extension-collaboration-caret": "3.29.2",
"@tiptap/extension-link": "^3.22.5",
"@tiptap/extension-placeholder": "^3.29.2",
"@tiptap/extension-table": "^3.29.2",
"@tiptap/extension-task-item": "^3.29.2",
"@tiptap/extension-task-list": "^3.29.2",
"@tiptap/pm": "3.29.2",
"@tiptap/starter-kit": "^3.29.2",
"@tiptap/suggestion": "^3.29.2",
"@tiptap/y-tiptap": "3.0.8",
"3d-force-graph": "1.80.0",
"d3-scale": "4.0.2",
"diff": "^9.0.0",
"dompurify": "^3.4.13",
"idb": "^8.0.3",
"layercake": "10.0.3",
"lowlight": "^3.3.0",
"mermaid": "^11.16.1",
"minisearch": "7.2.0",
"qrcode": "^1.5.4",
"svelte-dnd-action": "^0.9.78",
"three-spritetext": "1.10.0",
"tiptap-markdown": "^0.9.0",
"y-protocols": "^1.0.7",
"yjs": "^13.6.32"
}
}