Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #253: exclude peerDependencies by default even using '--lock' flag #254

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AumyF
Copy link

@AumyF AumyF commented Aug 11, 2021

Fixes #253.

  • peerDependencies are not included by default
  • setting --include-peer-dependencies makes node2nix works as previous default

@svanderburg
Copy link
Owner

I need a bit of clarification why this change is needed.

So originally the --include-peer-dependencies option was introduced to tune node2nix's own implementation of the dependency resolution algorithm (so for projects that have a package.json file but no lock file).

The way node2nix handles peer dependencies has changed in several versions. So originally, they were also included as regular dependencies, several versions later they only became a check, and in later revisions they were installed again.

As far as I can see, your change is lock file related -- if I'm not mistaken it should only install peer dependencies in lock files when the --include-peer-dependencies setting is enabled and if not, ignore them.

Is this is behaviour also consistent with what NPM does? And is this also fixing a specific problem?

So far this feature was only developed for the dependency resolution algorithm. Under normal circumstances, you should not directly use this option, but rather a flag that automatically propagates the right settings for a specific Node.js version, e.g. --nodejs-14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

There is no way to exclude peerDependencies when using package-lock.json
2 participants