a2ui-project / a2ui-project/a2ui

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

Abierto
#2,059 0 comentarios 0 reacciones 1 asignado Reclamado por @ditman Ver en GitHub
CI/CD P2
Lenguaje dominante
TypeScript
Estrellas
16.4k
Forks
1.3k
Merge medio
2 d 13 h
PR fusionados (30 d)
134

Descripción

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

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.