jasonaden / angular-cli-lib-example

Example of making an Angular CLI project with a library distributed separate from the app.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Validate peerDependencies of the library

lwouis opened this issue · comments

Hi,

It may be more a question that an issue, maybe I missed something. It seems to me that the library and the "demo" app (i.e. the app listing the lib in its own package.json) shouldn't be sharing all the dependencies in node_modules.

Currently it seems to me that there is no validation of the library's peerDependencies. A build can work for this repo, but then if the lib gets published, and another project add it to its dependencies, it will only get notified of some peerDependencies like @angular/common/@angular/core in your case.

If the lib itself has external dependencies, nothing makes sure to add those to the delivered package.json. You have to manually check what's needed and add it to the library's peerDependencies.

Am I missing something or is this process currently manual/unsafe?

Thank you!