grunt-tsd icon indicating copy to clipboard operation
grunt-tsd copied to clipboard

Task to verify if necessary typings are installed, and update if not?

Open teamdandelion opened this issue 11 years ago • 3 comments

Would it make sense to build-in functionality to grunt-tsd that checks if all specified typings are present in the typings folder, and install them if any are missing?

This seems like a very fundamental use case, then you can put grunt-tsd-verify in the build task and developers never have to think about their typing files or tsd.

teamdandelion avatar Feb 06 '14 05:02 teamdandelion

I'm not quite clear on what your use case is:

Could be this is covered in TSD itself but not fully exposed in grunt-tsd (yet)?

If you've saved to tsd.json and want to reinstall missing files but not overwrite existing you can update without using --overwrite flag.

Bartvds avatar Feb 06 '14 12:02 Bartvds

So, the use case is I setup a project and don't check the typing files into git, and then when someone downloads the library and runs grunt, it will detect that the typing files are missing and install them automagically.

This could be solved by just checking the definitions into git which probably makes more sense. I don't like to do that because it messes up Github's language statistics and lines-of-code counter.

teamdandelion avatar Feb 06 '14 19:02 teamdandelion

If you use TSD and install your definitions using --save, and check-in your tsd.json you can do this already (unless I miss-read your case).

When somebody downloads your project they can run TSD (either from cli or from grunt-tsd) and use reinstall (or update) and it will read the tsd.json and get those files.

Reinstall is safest as it is pinned to a commit-sha1 on DefinitelyTyped: sometimes definitions have breaking changes so a 'blind' update is risky.

If you want this automated you could look into npm scripts (post-install) and run grunt-tsd from there.

Bartvds avatar Feb 06 '14 20:02 Bartvds