chore: enhance type checking and update UI package configuration

- Added a new typecheck command for the UI package in package.json to ensure type safety.
- Updated tsconfig.web.json to include UI paths for better module resolution.
- Modified the type-check command in the UI package to specify the tsconfig.json file.
- Adjusted the include paths in the UI tsconfig.json to focus on specific component directories.
This commit is contained in:
MyPrototypeWhat 2025-10-14 14:43:49 +08:00
parent 569572bfdc
commit c258035f6a
4 changed files with 10 additions and 6 deletions

View File

@ -50,9 +50,10 @@
"generate:icons": "electron-icon-builder --input=./build/logo.png --output=build",
"analyze:renderer": "VISUALIZER_RENDERER=true yarn build",
"analyze:main": "VISUALIZER_MAIN=true yarn build",
"typecheck": "concurrently -n \"node,web\" -c \"cyan,magenta\" \"npm run typecheck:node\" \"npm run typecheck:web\"",
"typecheck": "concurrently -n \"node,web,ui\" -c \"cyan,magenta,green\" \"npm run typecheck:node\" \"npm run typecheck:web\" \"npm run typecheck:ui\"",
"typecheck:node": "tsgo --noEmit -p tsconfig.node.json --composite false",
"typecheck:web": "tsgo --noEmit -p tsconfig.web.json --composite false",
"typecheck:ui": "cd packages/ui && npm run type-check",
"check:i18n": "dotenv -e .env -- tsx scripts/check-i18n.ts",
"sync:i18n": "dotenv -e .env -- tsx scripts/sync-i18n.ts",
"update:i18n": "dotenv -e .env -- tsx scripts/update-i18n.ts",

View File

@ -13,7 +13,7 @@
"test": "vitest run",
"test:watch": "vitest",
"lint": "eslint src --ext .ts,.tsx --fix",
"type-check": "tsc --noEmit",
"type-check": "tsc --noEmit -p tsconfig.json --composite false",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build"
},

View File

@ -24,5 +24,5 @@
"target": "ES2020"
},
"exclude": ["node_modules", "dist", "**/*.test.*", "**/__tests__/**"],
"include": ["src/**/*", "stories/**/*"]
"include": ["src/**/*", "stories/components/**/*"]
}

View File

@ -9,8 +9,7 @@
"packages/mcp-trace/**/*",
"packages/aiCore/src/**/*",
"src/main/integration/cherryai/index.js",
"packages/extension-table-plus/**/*",
"packages/ui/**/*"
"packages/extension-table-plus/**/*"
],
"compilerOptions": {
"composite": true,
@ -30,7 +29,11 @@
"@cherrystudio/ai-core/*": ["./packages/aiCore/src/*"],
"@cherrystudio/ai-core": ["./packages/aiCore/src/index.ts"],
"@cherrystudio/extension-table-plus": ["./packages/extension-table-plus/src/index.ts"],
"@cherrystudio/ui": ["./packages/ui/src/index.ts"]
"@cherrystudio/ui": ["./packages/ui/src/index.ts"],
"@/components/*": ["./packages/ui/src/components/*"],
"@/utils/*": ["./packages/ui/src/utils/*"],
"@/types": ["./packages/ui/src/types/index.ts"],
"@/hooks/*": ["./packages/ui/src/hooks/*"]
},
"experimentalDecorators": true,
"emitDecoratorMetadata": true,