- 新增 ARCHITECTURE.md v3.0:portal-shell 架构权威文档 涵盖 §3.4 V3-A2/A3 认证链、§4 GraphQL 联邦、§5 安全、 §6 部署、§10 P0-P3 验收清单 - 新增 middleware.ts:认证 + 路由门禁 httpOnly cookie edu_session(JWT)读取 DEV_MODE 合成 dev-user/teacher 身份(NODE_ENV!=production && NEXT_PUBLIC_DEV_MODE=true) 生产模式 jose JWKS RS256 验签(iss/aud 校验) 路由权限位图注入 x-user-id/x-user-role/x-user-permissions 头 /shell/** 强制 checkRoutePermission,拒绝跳 /shell/forbidden - 新增 instrumentation.ts:生产环境 DEV_MODE 强制 false 防止生产环境误开 DEV_MODE 合成身份 - 新增 app/api/auth/login/route.ts + logout/route.ts 登录走 api-gateway /v1/iam/login 设置 httpOnly + Secure + SameSite=Strict cookie - 新增 app/api/graphql/route.ts:同域 GraphQL 代理 转发到 apollo-router,注入 router-authorization 头 - 新增 app/login/page.tsx + login-form.tsx zod 表单校验,next 参数支持 - 新增 app/shell/forbidden/page.tsx:403 页面 - 更新 route-permissions.ts:补全 P0 路由权限映射 - 更新 permission-bitmap.ts(shared-ts):位图编码/解码 - 更新 apollo-client.ts:DEV_MODE APQ 关闭,错误处理 - 更新 config-fetcher.ts:config-service 直连降级 - 更新 ApolloProvider.tsx:SSR/RSC 兼容 - 更新 eslint.config.js:design-tokens/no-hardcoded-fonts 白名单调整
73 lines
2.3 KiB
JSON
73 lines
2.3 KiB
JSON
{
|
|
"name": "@edu/portal-shell",
|
|
"version": "0.2.0",
|
|
"private": true,
|
|
"type": "module",
|
|
"scripts": {
|
|
"dev": "next dev -p 4010",
|
|
"build": "next build",
|
|
"start": "next start -p 4010",
|
|
"lint": "eslint src",
|
|
"lint:tokens": "eslint -c .eslintrc.tokens.js src",
|
|
"typecheck": "tsc --noEmit",
|
|
"test": "vitest run",
|
|
"test:watch": "vitest",
|
|
"codegen": "tsx scripts/normalize-schema.ts && graphql-codegen --config codegen.yml",
|
|
"codegen:watch": "graphql-codegen --config codegen.yml --watch",
|
|
"generate-pq-manifest": "tsx scripts/generate-pq-manifest.ts",
|
|
"prebuild": "pnpm run codegen && pnpm run generate-pq-manifest"
|
|
},
|
|
"dependencies": {
|
|
"@apollo/client": "^3.11.0",
|
|
"@edu/hooks": "workspace:*",
|
|
"@edu/ui-components": "workspace:*",
|
|
"@edu/ui-tokens": "workspace:*",
|
|
"@radix-ui/react-avatar": "^1.1.11",
|
|
"@radix-ui/react-collapsible": "^1.1.12",
|
|
"@radix-ui/react-dialog": "^1.1.15",
|
|
"@radix-ui/react-dropdown-menu": "^2.1.16",
|
|
"@radix-ui/react-scroll-area": "^1.2.10",
|
|
"@radix-ui/react-separator": "^1.1.8",
|
|
"@radix-ui/react-slot": "^1.2.4",
|
|
"@radix-ui/react-tabs": "^1.1.13",
|
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
"@tailwindcss/typography": "^0.5.16",
|
|
"class-variance-authority": "^0.7.1",
|
|
"clsx": "^2.1.1",
|
|
"crypto-hash": "^4.0.1",
|
|
"graphql": "^16.8.0",
|
|
"jose": "^5.9.6",
|
|
"lucide-react": "^0.562.0",
|
|
"next": "^16.0.10",
|
|
"next-themes": "^0.4.6",
|
|
"react": "^19.2.1",
|
|
"react-dom": "^19.2.1",
|
|
"sonner": "^2.0.7",
|
|
"swr": "^2.2.0",
|
|
"tailwind-merge": "^3.4.0",
|
|
"tailwindcss-animate": "^1.0.7",
|
|
"zod": "^3.23.8",
|
|
"zustand": "^5.0.9"
|
|
},
|
|
"devDependencies": {
|
|
"@graphql-codegen/cli": "^5.0.0",
|
|
"@graphql-codegen/typescript": "^4.0.0",
|
|
"@graphql-codegen/typescript-document-nodes": "^4.0.0",
|
|
"@graphql-codegen/typescript-operations": "^4.0.0",
|
|
"@tailwindcss/postcss": "^4.0.0",
|
|
"@testing-library/jest-dom": "^6.4.0",
|
|
"@testing-library/react": "^16.0.0",
|
|
"@types/node": "^22.0.0",
|
|
"@types/react": "^19.0.0",
|
|
"@types/react-dom": "^19.0.0",
|
|
"@vitejs/plugin-react": "^4.3.0",
|
|
"eslint": "^9.0.0",
|
|
"eslint-config-prettier": "^9.1.0",
|
|
"jsdom": "^25.0.0",
|
|
"tailwindcss": "^4.0.0",
|
|
"tsx": "^4.0.0",
|
|
"typescript": "^5.6.0",
|
|
"vitest": "^2.0.0"
|
|
}
|
|
}
|