Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration with typescript compiler's typing discovery and location plan #3

Open
weswigham opened this issue Nov 5, 2015 · 5 comments

Comments

@weswigham
Copy link

This issue is to support/mirror discussion on #5537 but from the typings side.

While we've not yet nailed down a plan on what out endgame is in the compiler, one thing I know I'd certainly love to see typings do really well is discovery for a package's type information. We want to see users go from npm install bluebird --save to actually having the third-party types for that package (of the correct version!) available for them to depend on and use in editor and compilation experiences as seamlessly as possible.

@blakeembrey mentioned a resource for typings to use to automate discovery of typings, and potentially browse-able by humans. This would be excellent - potentially being able to locate the corresponding types for a series of package.json entries is a big step towards making finding existing types as seamless as possible. We'd love to know how your design and implementation with this proceed.

Pinging @mhegazy @ahejlsberg @vladima @DanielRosenwasser for their thoughts.

@jasonswearingen
Copy link

sorry for the novice post, but what is this typings project? a cursory web search gleams nothing relevant.

@blakeembrey
Copy link
Member

@jasonswearingen A blog post and introduction will be coming in a few weeks, promise! Basically, it's an attempt to make typings just work. There's a CLI tool available at https://github.com/typings/cli which is working pretty smoothly (some minor issues, especially around UX), but a tighter integration with the compiler is planned to avoid duplication of information.

@blakeembrey
Copy link
Member

@weswigham I just completed a working implementation with https://github.com/typings/registry and https://github.com/typings/cli. The registry is a little sparse now, but works pretty fantastic.

@blakeembrey
Copy link
Member

@weswigham Is there a way to reuse something like microsoft/TypeScript#4913 and generate an output that could be used for the package.json typings reference? That way, it's almost all the same benefits and the end user doesn't need to know the author is using typings. If possible too, maybe having a special syntax to denote that this is a resolved lookup using a specific supported resolution in TypeScript - E.g. @filename: ~node_modules/a/index.d.ts (note the tilde). That would be used by the TypeScript symbol to merge duplicate symbols at compile time when the files are compatible.

@blakeembrey
Copy link
Member

@weswigham Just an update, over the weekend I published the registry API available here: http://api.typings.org/search. To see versions, use http://api.typings.org/versions/dt/react. To narrow it down you can use http://api.typings.org/versions/dt/react/%3E=0.14. There'll be a front-end for this soon to introduce typings and TypeScript, but the API was more important personally since all the tooling needs to rely on this. I integrated it into the CLI yesterday (it'll search and prompt the user right now, can narrow down preferred behaviour later). If the TypeScript team wants to use this API for something, please ping me for anything needs to be added or changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants