I am using TSD to manage the TypeScript definition files for a web application I am developing.
Should I check the TypeScript definition files for the external libraries I am using (managed via Bower) into git in addition to the tsd.json
file?
Similar discussions exist for Bower and NPM dependencies, where the NPM documentation says no, and afaik Bower no longer gives a recommendation (used to say yes).
The definition files are quite lightweight, so I am leaning towards checking them in. Any opinions?
If a developer should run npm install
after checking out your repo, why not have tsd install
run automatically? It's easy to add it to scripts
in package.json
:
// package.json
"scripts": {
"postinstall": "tsd install"
}
The argument for not checking in generated files and dependencies is not merely to reduce the weight of the repository. It's also about trusting a script to keep things up-to-date, rather than human decision. And it reduces noise in commits when minor changes occur in the generated files.
A contrary argument could be made: if you're concerned that the tsd
resources will go missing, checking them into your repo will guard against that. But the paranoid should check in the npm modules as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With