Commit d939e8d
chore(deps): bump vitest 4, vite 8, vite-plugin-svelte 7, typescript 6 (with adaptations) (#849)
## What
Bundles the four breaking major-version dependency bumps together with
the code adaptations they require, so they can land green as one unit:
| Package | From | To |
|---|---|---|
| `vitest` | 3.2.4 | 4.1.9 |
| `vite` | 7.x | 8.0.16 |
| `@sveltejs/vite-plugin-svelte` | 6.x | 7.1.2 |
| `typescript` | 5.3.3 | 6.0.3 |
| `svelte2tsx` | 0.7.x | 0.7.56 _(TS6 support)_ |
| `svelte-check` | 4.2.x | 4.6.0 _(TS6 support)_ |
`esbuild` drops out of the lockfile — Vite 8 replaces esbuild/Rollup
with Oxc/Rolldown, so it's no longer a transitive dependency.
## Code adaptations
- **`infinitescroll.mock.ts`** — `IntersectionObserverPassive` is now a
class. Vitest 4 forbids invoking a `vi.fn()` configured via
`mockReturnValue` with `new`. Also added `scrollMargin` to the observer
mocks (now required by the TS 6 `lib.d.ts` `IntersectionObserver`
interface).
- **`ScrollSentinel.spec.ts`** — the mock observer is stubbed via
`vi.stubGlobal`; Vitest 4 cannot construct an arrow-function mock
implementation with `new`. Added `scrollMargin` to the mock.
- **`vitest.setup.ts`** — cast Node's `TextEncoder` to the DOM type; TS
6 made `Uint8Array` generic, breaking the previous direct assignment.
- **`i18n.types.mjs`** — read the JSON file as `utf-8`; TS 6 types
`readFileSync` without an encoding as a `Buffer`, not a `string`.
## `overrides`
- `@dfinity/eslint-config-oisy-wallet` → `typescript: $typescript` — the
config still declares a `typescript@^5` peer; it works fine with TS 6,
so this satisfies the peer without `--legacy-peer-deps` (which would
break auto-install of the `svelte` peer).
- `@typescript-eslint/eslint-plugin` pinned to `8.58.1` (main's version)
so the refreshed lockfile doesn't change lint behavior.
## Verification
All gates that pass on `main` still pass locally:
- ✅ `tsc -p tsconfig.spec.json` — 0 errors
- ✅ tests — **331 passed** (60 files)
- ✅ `npm run check` (svelte-check + TS6) — 0 errors
- ✅ `npm run build` (Vite 8) and `npm run package` (svelte-package)
- ✅ formatting — clean
- 1 parent 76e1924 commit d939e8d
9 files changed
Lines changed: 1632 additions & 1377 deletions
File tree
- e2e
- busy-screen.e2e.ts-snapshots
- link.e2e.ts-snapshots
- scripts
- src/tests/lib
- components
- mocks
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
31 | 39 | | |
0 commit comments