From db9f3644723c61d99f5f164ab6532b59430f1cf9 Mon Sep 17 00:00:00 2001 From: jableader Date: Sun, 2 Nov 2025 09:48:12 +1100 Subject: [PATCH] Node version bump --- .nvmrc | 1 + frontend-spec.md | 3 +++ package.json | 4 ++++ src/router/index.ts | 5 +++++ 4 files changed, 13 insertions(+) create mode 100644 .nvmrc diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..3bf34c2 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +v20.19.0 \ No newline at end of file diff --git a/frontend-spec.md b/frontend-spec.md index d48197f..ad81b8a 100644 --- a/frontend-spec.md +++ b/frontend-spec.md @@ -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). - `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) ## 1. Objective diff --git a/package.json b/package.json index c330366..6a11779 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,10 @@ "vitest": "^1.6.0", "vue-tsc": "^2.0.29" }, + "engines": { + "node": ">=20.19.0", + "npm": ">=10.9.0" + }, "lint-staged": { "*.{js,vue,css,scss,md}": [ "prettier --write" diff --git a/src/router/index.ts b/src/router/index.ts index c76953a..7e1eaa9 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -1,4 +1,5 @@ import { createRouter, createWebHashHistory, createMemoryHistory, Router } from 'vue-router' +import { setHouseholdSlugProvider } from '@/api/client' import type { RouteRecordRaw } from 'vue-router' // Lazy-loaded route components @@ -53,6 +54,10 @@ export function createAppRouter(getCurrentUser: () => Promise | unknown }) 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 const publicNames = new Set(['login', 'create-account', 'welcome', 'invitation-accept']) if (publicNames.has(String(to.name))) return true