1

I have a large team working on a repo using Typescript, and nobody checks in the /typings folder into the team's shared repository, they only check in the typings.json file which specifies the version information for each definition set required by the project.

Sometimes someone will delete a definition set from typings.json, since the part of the project they are working on no longer uses that library (or we found a better definition set), using
typings uninstall --global --save dt~whatever, and that works fine on their local machine, BUT when they push up the new typings.json and I or someone else pulls it down, when we then run typings install, the command only adds new definitions to the typings folder, and does not delete definitions from the typings folder which are no longer present in typings.json.

Is there a command which I can run to both add new definition sets and delete removed sets by diffing the current typings.json from the state of typings.json when the typings command was last run?

Currently we just have everyone delete the entire typings folder and run typings install again each time they pull, but that is getting to be a bit inefficient, since we have a lot of definition sets now.

NOTE: we tried typings uninstall and typings uninstall --save but those just throw errors (it seems you may only specify specific definition sets to uninstall).

4

1 回答 1

1

利用

typings prune

在您的项目目录中。它将删除typings目录中存在且未在typings.json文件中列出的所有类型。

有关Typings 文档的更多信息。

于 2016-07-07T09:23:03.643 回答