Emitter framework: make the language-specific Alloy peer dependencies optional
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 1/5
- 見積もり時間
- 1時間未満
- 初心者へのやさしさ
- 62/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- csharp, python, typescript
- 領域
- tooling
調査の方向性
修正は、エミッターフレームワークの package.json にあります。そこでは Alloy 言語の peer が peerDependenciesMeta なしで宣言されています。@alloy-js/csharp、@alloy-js/python、@alloy-js/typescript を optional に設定し、@alloy-js/core と @typespec/compiler は必須のままにしてください。エミッター作成者向けのドキュメントページがまだ正しく読めるか確認し、そのうえで TypeScript パッケージだけをインストールしたときに peer の不足に関する警告が出ないことを確認してください。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Java
- スター
- 5.9k
- フォーク
- 421
- 平均マージ
- 2日 3時間
- マージ済み PR(30日)
- 176
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/typespec のほかの issue
-
bug emitter:client:csharp
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
microsoft/typespec#12572 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Make website build cross-platform compatible対応中かも @pcbeingused333 が今日担当しました。 オープンbug meta:website
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
microsoft/typespec#12550 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Upgrade C# generator Roslyn to 5.9.0対応中かも @ArthurMa1978 が 7 日前に担当しました。 オープンemitter:client:csharp feature
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
microsoft/typespec#12445 · コメント 2 件 · リアクション 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
bug emitter:client:python
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
microsoft/typespec#12360 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: http-client-js reports `unknown-encoding` for a raw `bytes` body対応中かも @Roxen-AS が 21 日前に担当しました。 オープンbug emitter:client:js
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
microsoft/typespec#12356 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
microsoft/typespec の issue をすべて見る
似ている issue
-
GCC 15.2: -Wcast-qual warning - cast discards const qualifier from pointer target type (H5trace.c)オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
メンテナーはふだん 1 日以内に返信
-
[Bug] RemotingHelper.connect swaps the socket send and receive buffer configuration対応中かも @amalsaidov が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
needs-area-label
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 2 日以内に返信
-
area/ai area/backend component/zeebe kind/task
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
spAnser/reacharound#38 ·