feat(portal-shell): add MSW mock layer with production bundle exclusion (P1-5)

MSW v2.7.0 fallback layer covering dashboard/users/exams/grades domains.
NEXT_PUBLIC_MSW=1 enables browser Service Worker + SSR route handler mock
responses without backend. Production build excludes all mock data via
Turbopack resolveAlias redirecting @/mocks to empty stub.

Acceptance: build bundle (client+server) verified clean of mock strings;
typecheck/lint/vitest (231 tests) all pass.
This commit is contained in:
SpecialX
2026-07-22 14:48:30 +08:00
parent da05c9107a
commit 9358372657
16 changed files with 1292 additions and 67 deletions

View File

@@ -38,6 +38,7 @@
"graphql": "^16.8.0",
"jose": "^5.9.6",
"lucide-react": "^0.562.0",
"msw": "2.7.0",
"next": "^16.0.10",
"next-intl": "^4.13.2",
"next-themes": "^0.4.6",
@@ -69,5 +70,10 @@
"tsx": "^4.0.0",
"typescript": "^5.6.0",
"vitest": "^2.0.0"
},
"msw": {
"workerDirectory": [
"public"
]
}
}
}