question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

feat: peerDependencies and devDependencies auto whitelist.

See original GitHub issue

Type of Issue

[ ] Bug Report
[X] Feature Request

Description

At the moment If I have a package.json like this;

 "peerDependencies": {
    "rxjs": "^5.5.2"
  },
  "devDependencies": {
    "rxjs": "^5.5.2"
  }

I’ll get an error Distributing npm packages with 'devDependencies' is not recommended. Please consider adding rxjs to 'peerDepenencies' or remove it from 'devDependencies'. on/consumers/ng-cli)!_

For development you cannot use peerDependencies as these don’t get installed. I’d expect that if the devDependencies is listed in the peerDependencies I don’t need to add it explicitly in the whitelist. It’s whitelisted automatically.

Expected Behaviour

No error.

Version Information

ng-packagr: 2.3.0

Please include all version numbers that might be relevant, e.g. third-party libraries

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:19
  • Comments:33 (8 by maintainers)

github_iconTop GitHub Comments

109reactions
alan-agius4commented, Mar 26, 2018

@codegagan you can remove the warnings by adding the below to ng-packagr.json, right next to lib property.

Example if the error is related to @angular/package one shall do the the below;

whitelistedNonPeerDependencies: ["angular"] // note: this will be matches as a regexp

If you want to turn off this feature completely you can do the below;

whitelistedNonPeerDependencies: ["."]
19reactions
jvanharncommented, Mar 27, 2018

That is pretty important documentation, maybe add it to the readme and/or changelog? Also add it to the package.schema.json?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Difference between dependencies, devDependencies and ...
DevDependencies are the packages a developer needs during development. A peer dependency specifies that our package is compatible with a ...
Read more >
dependencies, peerDependencies, devDependencies - Nil Seri
devDependencies are the dependencies which are needed for your project during development / release, such as testing libraries like Karma and ...
Read more >
package.json - npm Docs
In npm versions 3 through 6, peerDependencies were not automatically installed, and would raise a warning if an invalid version of the peer...
Read more >
10 Lessons I Learned From Architecting an Enterprise Application
Use an auto-complete in some specific columns to give the user the possibility to search for a value. Open a dialog showing a...
Read more >
Understanding Peer Dependencies in JavaScript
That's really up to the developer, since an automatic decision here would not be possible. This however, is the current behavior of NPM...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found