a2ui-project / a2ui-project/a2ui

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

未关闭 适合新手
#2,059 0 条评论 0 个 reaction 已指派 1 人 已被 @ditman 认领 在 GitHub 查看
CI/CD P2
主要语言
TypeScript
星标
16.4k
派生
1.3k
平均合并
2 天 13 小时
30 天内合并 PR
134

描述

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": []`)

贡献指南

打开贡献指南

调研方向

The issue lists four specific tsconfig.json files to update. Start by locating each file in the repository. For the Vite application, add `"types": ["vite/client"]`; for the others, add `"types": []`. Verify the change by checking the TypeScript compiler options and ensuring no type errors appear in the respective projects.

由索引模型根据 Issue 内容生成。

评估

技术栈
typescript, vite
领域
build-system, frontend
Issue 类型
缺陷
难度
1/5
预计耗时
1 小时以内
活跃度
冷清
描述清晰度
描述清楚
新手友好度
75/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。