Resolve with -lib in TypeScript lib lookup via node-style resolution#46046
Resolve with -lib in TypeScript lib lookup via node-style resolution#46046orta merged 1 commit intomicrosoft:mainfrom
Conversation
|
This looks good, though it does make me consider, why do any transform on the lib file name at all? Package names can have dots, so there’s no reason our lookup name can’t be |
|
Maybe leaving on the |
|
I think it's more about the form factor for how I think people would use it - for dom that means we can ship dom and dom.iterable correctly in a single package, instead of via 2 separate npm packages The same would then apply for 'my runtime's version of es2018' which you can opt-in specific files. |
|
Ah, I forgot about that 👍 |
Fixes #45993
#45771 introduced a way to write something like:
{ "dependencies": { "@typescript/dom": "npm:@types/web" } }This PR changes that to be:
{ "dependencies": { "@typescript/lib-dom": "npm:@types/web" } }Thus the node-style resolution for:
lib.dom.d.ts->@typescript/lib-domlib.dom.iterable.d.ts->@typescript/lib-dom/iterablelib.es2015.symbol.wellknown.d.ts->@typescript/lib-es2015/symbol-wellknownIf you made a package which just sets up
@typescript/lib-es2015/symbol-wellknown.d.tswithout@typescript/lib-es2015/index.d.ts, thenes2015would still resolve to the TypeScript hosted version.