a2ui-project / a2ui-project/a2ui

ci: Add explicit `types` to prevent `@types/node` leakage.

Đang mở
#2,059 0 bình luận 0 reaction 1 người được giao Được @ditman nhận Xem trên GitHub
CI/CD P2
Ngôn ngữ chính
TypeScript
Star
16.4k
Fork
1.3k
Merge trung bình
2 ngày 13 giờ
Pull request đã merge (30 ngày)
134

Mô tả

In our monorepo, omitting the `"types"` property in a project's `tsconfig.json` causes TypeScript to automatically discover and include all type packages from `node_modules/@types`, including root-level packages like `@types/node` and `@types/jest`.

(See #1515)

For browser-only frontend projects targeting DOM (`"lib": ["DOM", "ESNext"]`), auto-including `@types/node` introduces global type namespace pollution and type collisions (for example, `setTimeout` returning `NodeJS.Timeout` instead of `number`, or conflicting `Console` and `Event` interfaces).

Most core libraries and Angular projects in the repository already specify `"types": []` or explicit type arrays. We should update the remaining browser frontend shells and community sample projects to prevent global type leakage.

#### Proposed changes

Add `"types": []` (or `"types": ["vite/client"]` for Vite applications) to `compilerOptions` in the following files:

- [ ] `samples/client/react/shell/tsconfig.json` (add `"types": ["vite/client"]`)
- [ ] `samples/community/client/lit/mcp-apps-in-a2ui-sample/tsconfig.json` (add `"types": []`)
- [ ] `samples/community/client/lit/personalized_learning/tsconfig.json` (add `"types": []`)
- [ ] `samples/community/mcp/a2ui-over-mcp-recipe/client/tsconfig.json` (add `"types": []`)

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.