How to associate tsd definitions automatically with bower and npm?

I am going to convert an existing project to TypeScript with many bower and npm dependencies (bower.json and package.json). According to the tsd github page ,

TSD supports the detection and binding of definitions from packages installed using a node or gazebo. Use the link command and your tsd.d.ts will be updated using the file paths in the node_modules or bower_modules folders.

However, when I run the command tsd linkafter tsd init, it just says no (new)packages to link, although my .json package is chalk filled with modules. It led me to discover, maybe it doesn’t do what I think.

This function scans the package.json and bower.json files for TypeScript. This element then contains the definition or sub-elements of the definitions containing relative paths to the .d.ts files:

What? What is the purpose of this function linkif it doesn't just get type definitions from my package.json? Is this command just to pull the tsd configurations from my package.json and not into the tsd.json file? What is the problem then, besides eliminating the tsd.json file?

So, if it is not tsd link, I ask if there is a better way to automatically include tsd definitions for all my dependencies. It seems crazy to me that they will all be manually controlled.

+4
source share
1

tsd link - . , , .

bower NPM, .d.ts, "typescript": { "definition": "..." } , .d.ts tsd.d.ts, :

/// <reference path="jquery/jquery.d.ts" />
/// <reference path="../bower_components/angular/angular.d.ts" />

d.ts, .

+2

Source: https://habr.com/ru/post/1615819/


All Articles