Node version bump

This commit is contained in:
jableader 2025-11-02 09:48:12 +11:00
parent f75512cffb
commit db9f364472
4 changed files with 13 additions and 0 deletions

1
.nvmrc Normal file
View file

@ -0,0 +1 @@
v20.19.0

View file

@ -6,6 +6,9 @@ Status of tests and typing
- All tests pass: 18 files, 27 tests (legacy JS tests removed; slug-only routes; memory history fallback; unauthenticated and refresh-401 guard redirects covered). - All tests pass: 18 files, 27 tests (legacy JS tests removed; slug-only routes; memory history fallback; unauthenticated and refresh-401 guard redirects covered).
- `tsc` and `vue-tsc` pass with no errors. - `tsc` and `vue-tsc` pass with no errors.
Prerequisites
- Node.js 20.19.0 LTS or newer (chrome-devtools-mcp requires >=20.19.0). An `.nvmrc` file is provided; run `nvm use` to switch.
# Frontend Specification: Household Multi-Tenancy (v2) # Frontend Specification: Household Multi-Tenancy (v2)
## 1. Objective ## 1. Objective

View file

@ -42,6 +42,10 @@
"vitest": "^1.6.0", "vitest": "^1.6.0",
"vue-tsc": "^2.0.29" "vue-tsc": "^2.0.29"
}, },
"engines": {
"node": ">=20.19.0",
"npm": ">=10.9.0"
},
"lint-staged": { "lint-staged": {
"*.{js,vue,css,scss,md}": [ "*.{js,vue,css,scss,md}": [
"prettier --write" "prettier --write"

View file

@ -1,4 +1,5 @@
import { createRouter, createWebHashHistory, createMemoryHistory, Router } from 'vue-router' import { createRouter, createWebHashHistory, createMemoryHistory, Router } from 'vue-router'
import { setHouseholdSlugProvider } from '@/api/client'
import type { RouteRecordRaw } from 'vue-router' import type { RouteRecordRaw } from 'vue-router'
// Lazy-loaded route components // Lazy-loaded route components
@ -53,6 +54,10 @@ export function createAppRouter(getCurrentUser: () => Promise<unknown> | unknown
}) })
router.beforeEach(async (to) => { router.beforeEach(async (to) => {
// Keep API client household slug in sync with the target route before components mount
const paramSlug = typeof to.params.householdSlug === 'string' ? to.params.householdSlug : null
setHouseholdSlugProvider(() => paramSlug)
// Allow public routes // Allow public routes
const publicNames = new Set(['login', 'create-account', 'welcome', 'invitation-accept']) const publicNames = new Set(['login', 'create-account', 'welcome', 'invitation-accept'])
if (publicNames.has(String(to.name))) return true if (publicNames.has(String(to.name))) return true