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
Install @types packages as part of migrating #115
Comments
This is maybe too delayed to be helpful, but I'm wondering if you've seeing the package typesync. It is not perfect, but it works very well. It seems the lib tries to match minors, but if it can't makes the opinion of installing something rather than nothing. My workflow as I've been migrating a handful of repositories has been to create a |
I had not seen it! Thanks for pointing it out. That definitely seems like a better option than trying to roll something ourselves. I wonder if there'd be a good way to incorporate it into the ts-migrate workflow. There doesn't appear to be an API; only a CLI. Options I can imagine:
|
I definitely think the documentation is a good option, though it's made clumsy by the fact that one would have to run Adding it to the Any thoughts about what you'd like to do here? Can I offer documentation/development support? |
Following on from part of the discussion in #100, it would be really useful to install
@types
packages automatically as part of a migration.Some questions and ideas for how this might work:
Detect TS2307 and TS7016 diagnostics to decide which types packages would be useful. Alternatively, look through
package.json
and try to resolve types for each package. This seems harder and more error-prone.This seems like it may not fit in well with the existing plugin architecture. It doesn't transform source code, and it also seems like something you'd want to scan over all of your files and then run a single
npm install
oryarn add
to install things. We could try to figure out how to extend the existing architecture, but I think I'd be inclined to start with a one-off implementation and see what other patterns and use cases emerge over time, if any.How do we do the actual dependency installation? We'd need to detect npm/yarn/pnpm. Maybe there's a dependency we can pull in or other prior art.
How do we detect whether an appropriate types package exists?
How do we choose a version for the types package? Seems like it'd work in most cases to match up minor versions.
The text was updated successfully, but these errors were encountered: