diff --git a/.node-version b/.node-version index 2bd5a0a..6f4247a 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -22 +26 diff --git a/package-lock.json b/package-lock.json index 68eaa8c..57d4828 100644 --- a/package-lock.json +++ b/package-lock.json @@ -55,6 +55,9 @@ "vite": "^8.3.4", "vitest": "^4.1.11", "wrangler": "4.149.0" + }, + "engines": { + "node": ">=26" } }, "node_modules/@adobe/css-tools": { diff --git a/package.json b/package.json index ff8ac1f..f6a314f 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,9 @@ "private": true, "license": "Apache-2.0", "type": "module", + "engines": { + "node": ">=26" + }, "scripts": { "dev": "vite", "build": "tsc && vite build", diff --git a/vitest.config.ts b/vitest.config.ts index c2f1d97..0014c3e 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -20,6 +20,13 @@ export default defineConfig({ }, test: { globals: true, + // Node 25+ defines a global `localStorage` that is `undefined` unless + // `--localstorage-file` is given. zustand's persist only falls back to + // memory when reading the storage *throws*, so every store `set` then + // crashes on `undefined.setItem`. Without Web Storage the global is gone + // and the stores fall back the way they always did on Node 22. The flag is + // accepted by Node 22 too. + execArgv: ["--no-experimental-webstorage"], // `.tsx` was absent until v0.35.0, so any component test written here // would have been collected by nobody and passed silently. Note that the // default environment is node — a test that renders needs an explicit