Emitter framework: make the language-specific Alloy peer dependencies optional
Los mantenedores suelen responder en 1 día
@timotheeguerin ya está trabajando en esto.
Desde el 4/11/2026.
- #12495 de @copilot-swe-agent — abierto
Evaluación
- Dificultad
- 1/5
- Tiempo estimado
- Menos de una hora
- Aptitud para principiantes
- 62/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- csharp, python, typescript
- Área
- tooling
Línea de trabajo
La solución está en el package.json del framework de emisores, donde los peers de lenguaje de Alloy se declaran sin peerDependenciesMeta. Marca @alloy-js/csharp, @alloy-js/python y @alloy-js/typescript como opcionales, manteniendo @alloy-js/core y @typespec/compiler como requeridos. Comprueba que la página de documentación para autores de emisores siga siendo correcta y, después, confirma que una instalación con solo el paquete de TypeScript no produce advertencias de peers faltantes.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Clear and concise description of the problem
@typespec/emitter-framework declares all of its Alloy language packages as peer dependencies, with no peerDependenciesMeta, so every one of them is required:
"peerDependencies": {
"@alloy-js/core": "...",
"@alloy-js/csharp": "...",
"@alloy-js/python": "...",
"@alloy-js/typescript": "...",
"@typespec/compiler": "..."
}
An emitter for a single language therefore gets the other languages' packages too: package managers that install peers automatically (npm 7+, pnpm by default) download them, and the others print a missing-peer warning. A TypeScript-only emitter installs about 32 MB of C# and Python packages (27 MB and 4.8 MB unpacked) that it never loads.
Each language package is used by exactly one entry point (0.21.0, runtime imports in dist/src):
| Entry point | @alloy-js packages imported |
|---|---|
@typespec/emitter-framework (root) |
core |
@typespec/emitter-framework/typescript |
core, typescript |
@typespec/emitter-framework/csharp |
core, csharp |
@typespec/emitter-framework/python |
core, python |
@typespec/emitter-framework/testing |
core/testing |
I checked that an emitter that imports from the root and from /typescript generates and runs correctly with @alloy-js/csharp and @alloy-js/python absent. The same peers and the missing peerDependenciesMeta are on main and in 0.22.0-dev.1.
The emitter framework docs already tell emitter authors to install the packages they use as peers (npm install --save-peer @alloy-js/core @alloy-js/typescript @typespec/emitter-framework), so making the language packages optional would not change that workflow.
Proposal
Mark the language-specific peers as optional, keeping @alloy-js/core and @typespec/compiler required:
"peerDependenciesMeta": {
"@alloy-js/csharp": { "optional": true },
"@alloy-js/python": { "optional": true },
"@alloy-js/typescript": { "optional": true }
}
Checklist
- Follow our Code of Conduct
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
- Lenguaje dominante
- Java
- Estrellas
- 5.9k
- Forks
- 421
- Merge medio
- 2 d 3 h
- PR fusionados (30 d)
- 176
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de microsoft/typespec
-
bug emitter:client:csharp
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
microsoft/typespec#12572 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
Make website build cross-platform compatiblePosiblemente ocupada @pcbeingused333 la tomó hoy. Abiertobug meta:website
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
microsoft/typespec#12550 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
Upgrade C# generator Roslyn to 5.9.0Posiblemente ocupada @ArthurMa1978 la tomó hace 7 días. Abiertoemitter:client:csharp feature
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
microsoft/typespec#12445 · 2 comentarios · 1 reacción · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
bug emitter:client:python
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
microsoft/typespec#12360 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
[Bug]: http-client-js reports `unknown-encoding` for a raw `bytes` bodyPosiblemente ocupada @Roxen-AS la tomó hace 21 días. Abiertobug emitter:client:js
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
microsoft/typespec#12356 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 1 día
Todos los issues de microsoft/typespec
Issues similares
-
GCC 15.2: -Wcast-qual warning - cast discards const qualifier from pointer target type (H5trace.c)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
Los mantenedores suelen responder en 1 día
-
[Bug] RemotingHelper.connect swaps the socket send and receive buffer configurationPosiblemente ocupada @amalsaidov la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
needs-area-label
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 2 días
-
area/ai area/backend component/zeebe kind/task
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
spAnser/reacharound#38 ·