Emitter framework: make the language-specific Alloy peer dependencies optional
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 1/5
- Thời gian dự kiến
- Dưới một giờ
- Mức phù hợp với người mới
- 62/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- csharp, python, typescript
- Lĩnh vực
- tooling
Hướng nghiên cứu
Bản sửa nằm trong package.json của framework emitter, nơi các peer ngôn ngữ Alloy được khai báo mà không có peerDependenciesMeta. Đánh dấu @alloy-js/csharp, @alloy-js/python và @alloy-js/typescript là tùy chọn (optional), đồng thời giữ @alloy-js/core và @typespec/compiler là bắt buộc. Kiểm tra xem trang tài liệu dành cho tác giả emitter còn đọc đúng hay không, rồi xác nhận rằng khi chỉ cài gói TypeScript thì không có cảnh báo peer bị thiếu.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Java
- Star
- 5.9k
- Fork
- 421
- Merge trung bình
- 2 ngày 3 giờ
- Pull request đã merge (30 ngày)
- 176
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/typespec
-
bug emitter:client:csharp
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
microsoft/typespec#12572 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Make website build cross-platform compatibleCó thể đã có người làm @pcbeingused333 đã nhận hôm nay. Đang mởbug meta:website
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
microsoft/typespec#12550 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Upgrade C# generator Roslyn to 5.9.0Có thể đã có người làm @ArthurMa1978 đã nhận 7 ngày trước. Đang mởemitter:client:csharp feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
microsoft/typespec#12445 · 2 bình luận · 1 reaction · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug emitter:client:python
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
microsoft/typespec#12360 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: http-client-js reports `unknown-encoding` for a raw `bytes` bodyCó thể đã có người làm @Roxen-AS đã nhận 21 ngày trước. Đang mởbug emitter:client:js
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
microsoft/typespec#12356 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của microsoft/typespec
Issue tương tự
-
GCC 15.2: -Wcast-qual warning - cast discards const qualifier from pointer target type (H5trace.c)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug] RemotingHelper.connect swaps the socket send and receive buffer configurationCó thể đã có người làm @amalsaidov đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
needs-area-label
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 2 ngày
-
area/ai area/backend component/zeebe kind/task
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
spAnser/reacharound#38 ·