GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Resolve with -lib in TypeScript lib lookup via node-style resolution by orta · Pull Request #46046 · microsoft/TypeScript

Conversation

@orta

@orta Orta Therox (orta) commented Sep 24, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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-dom
  • lib.dom.iterable.d.ts -> @typescript/lib-dom/iterable
  • lib.es2015.symbol.wellknown.d.ts -> @typescript/lib-es2015/symbol-wellknown

If you made a package which just sets up @typescript/lib-es2015/symbol-wellknown.d.ts without @typescript/lib-es2015/index.d.ts, then es2015 would still resolve to the TypeScript hosted version.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

DanielRosenwasser and ExE-Boss reacted with thumbs up emoji
All reactions
  • 👍 2 reactions
@orta
Resolve with -lib in TypeScript lib node lookup
980ec3d
@orta Orta Therox (orta) self-assigned this Sep 24, 2021
@typescript-bot TypeScript Bot (typescript-bot) added Author: Team For Milestone Bug PRs that fix a bug with a specific milestone labels Sep 24, 2021
@orta
Orta Therox (orta) requested a review from Andrew Branch (andrewbranch) September 24, 2021 16:17
@andrewbranch

Andrew Branch (andrewbranch) commented Sep 24, 2021

Copy link
Copy Markdown
Member

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 @typescript/lib.dom.d.ts, and then we wouldn’t have to do any of the name parsing.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@andrewbranch

Andrew Branch (andrewbranch) commented Sep 24, 2021

Copy link
Copy Markdown
Member

Maybe leaving on the .d.ts would look confusing to some people (though it’s not actually ambiguous), but I’d be tempted to at least leave the dots instead of dashes. I don’t guess it really matters, though.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@orta

Orta Therox (orta) commented Sep 24, 2021

Copy link
Copy Markdown
Contributor Author

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@orta
Orta Therox (orta) merged commit 90e83ad into microsoft:main Sep 24, 2021
@orta Orta Therox (orta) mentioned this pull request Sep 24, 2021
Support resolving @typescript/[lib] in node modules #45771
Merged
@andrewbranch

Andrew Branch (andrewbranch) commented Sep 24, 2021

Copy link
Copy Markdown
Member

Ah, I forgot about that 👍

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

uhyo (uhyo) added a commit to uhyo/better-typescript-lib that referenced this pull request Sep 25, 2021
@uhyo
support @typescript/lib-[lib] format
4ce24c5
See: microsoft/TypeScript#46046
@microsoft Microsoft (microsoft) locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@andrewbranch Andrew Branch (andrewbranch) Awaiting requested review from andrewbranch

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@orta Orta Therox (orta)

Labels

Author: Team For Milestone Bug PRs that fix a bug with a specific milestone

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Ensure @typescript/[lib] package names are explicitly prefixed with lib

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@orta @andrewbranch @typescript-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.