M1 Task 2: 配置 graphql-codegen 与 federation schema 预处理 - codegen.yml: schema 从 combined-schema.graphql 读取(federation 已剥离) - scripts/normalize-schema.ts: 把 7 个子图的 extend type Query 合并为 type Query - package.json: 新增 codegen/codegen:watch scripts + 4 个 codegen deps + tsx - .gitignore: 忽略 src/lib/api/__generated__/ - documents 配置暂注释,Task 3 创建 operations 文件后启用
51 lines
1.5 KiB
JSON
51 lines
1.5 KiB
JSON
{
|
|
"name": "@edu/portal-shell",
|
|
"version": "0.1.0",
|
|
"private": true,
|
|
"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"
|
|
},
|
|
"dependencies": {
|
|
"@apollo/client": "^3.11.0",
|
|
"@edu/hooks": "workspace:*",
|
|
"@edu/ui-components": "workspace:*",
|
|
"@edu/ui-tokens": "workspace:*",
|
|
"graphql": "^16.8.0",
|
|
"next": "^14.2.0",
|
|
"react": "^18.3.0",
|
|
"react-dom": "^18.3.0",
|
|
"swr": "^2.2.0",
|
|
"zustand": "^4.5.0"
|
|
},
|
|
"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",
|
|
"@testing-library/jest-dom": "^6.4.0",
|
|
"@testing-library/react": "^16.0.0",
|
|
"@types/node": "^22.0.0",
|
|
"@types/react": "^18.3.0",
|
|
"@types/react-dom": "^18.3.0",
|
|
"@vitejs/plugin-react": "^4.3.0",
|
|
"autoprefixer": "^10.4.0",
|
|
"eslint": "^9.0.0",
|
|
"eslint-config-prettier": "^9.1.0",
|
|
"jsdom": "^25.0.0",
|
|
"postcss": "^8.4.0",
|
|
"tailwindcss": "^3.4.0",
|
|
"tsx": "^4.0.0",
|
|
"typescript": "^5.6.0",
|
|
"vitest": "^2.0.0"
|
|
}
|
|
}
|