Ionic-TypeScript-Starter icon indicating copy to clipboard operation
Ionic-TypeScript-Starter copied to clipboard

Migrate from TSD to Typings

Open KerryRitter opened this issue 8 years ago • 1 comments

Running npm install gives the following warning:

npm WARN deprecated [email protected]: TSD is deprecated in favor of Typings (https://github.com/typings/typings) - see https://github.com/DefinitelyTyped/tsd/issues/269 for more information

KerryRitter avatar Apr 29 '16 02:04 KerryRitter

Re-posting this from a comment on a PR to add replace tsd with typings:


Firstly, IMHO the main benefit of typings over tsd is the paradigm shift in how type definitions are written. This means moving away from ambient modules that pollute the global namespace towards external modules that are well contained. This is an excellent change!

Unfortunately, most of the type definitions in use by this project haven't been converted to external modules when I checked. So, while typings can include the existing ambient modules from the definitely typed repository, we'd still be using the original ambient modules.


Secondly, I found that the typings CLI tool isn't as flexible as tsd is.

Currently, this project has two tsd configuration files: tsd.json for type definitions used by the application and tsd.tests.json for type definitions specific to the unit testing.

The tsd command line tool allows you to specify which configuration file to use (tsd rebundle --config tsd.tests.json) while typings does not. So I would have to move from the current directory structure of:

│   tsd.json
│   tsd.tests.json
│
├───typings
└───typings-tests

to the the following directory structure (which is more convoluted IMO):

├───typings-app
│   │   typings.json
│   │
│   └───typings
└───typings-tests
    │   typings.json
    │
    └───typings

This also makes it more work to run the CLI tool as you have to cd into the appropriate directory before running the command.


I'll eventually move to typings are more type definitions become available as external modules and/or the tool becomes more flexible.

Justin-Credible avatar Aug 20 '16 22:08 Justin-Credible