microsoft / microsoft/TypeScript
TS does not support resolving paths with colons
オープン
まだ誰も着手していません。
Bug
Domain: Module Resolution
Help Wanted
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.3k
- 平均マージ
- 1日 19時間
- マージ済み PR(30日)
- 117
説明
🔎 Search Terms
https://github.com/microsoft/TypeScript/issues?q=is%3Aissue+colon+exports+is%3Aclosed
colon, exports
🕗 Version & Regression Information
- This is the behavior in every version I tried
⏯ Playground Link
💻 Code
Consumer module:
import a from 'my-library';
import b from 'my-library/foo';
import c from 'my-library/foo:virtual';
import d from 'my-library/bar';
import e from 'my-library/colon:here';
console.log({ a, b, c, d, e });
package.json for my-library:
{
"name": "my-library",
"version": "0.0.1",
"type": "module",
"exports": {
".": {
"types": "./foo.d.ts",
"default": "./foo.js"
},
"./foo": {
"types": "./foo.d.ts",
"import": "./foo.js"
},
"./foo:virtual": {
"types": "./foo.d.ts",
"default": "./foo.js"
},
"./*": {
"types": "./*.d.ts",
"default": "./*.js"
}
},
"scripts": {
"lint": "attw --pack; pnpm publint"
},
"dependencies": {
"@arethetypeswrong/cli": "^0.14.1",
"publint": "^0.2.7"
}
}
every imported module is supposed to resolve, and then print:
{ a: 2, b: 2, c: 2, d: 2, e: 'two' }
(pnpm start in the consumer package in the repro link shows this)
🙁 Actual behavior
Errors, cannot find module
🙂 Expected behavior
align with JS, resolve the module
Additional information about the issue
No response
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
StackBlitz の repro と consumer パッケージの pnpm start から始め、次に、コロンを含む、表示された package.json の exports エントリを調べます。これらのパッケージサブパスに対する TypeScript のモジュール解決の動作を追跡し、JavaScript ランタイムの結果と比較します。5 つすべての import が解決され、期待される出力が生成されれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript, typescript
- 領域
- compilers
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 45/100