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

Add metadata to mark peer dependencies as optional for npm7+ #62

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

Conversation

keeganstreet
Copy link

In npm 7 and npm 8, peer dependencies are installed by default.

iltorb and node-zopfli-es are only required for older versions of Node, and it doesn't make sense for them to be installed automatically when shrink-ray-current is installed.

This change adds a peerDependenciesMeta field to mark these peer dependencies as optional https://docs.npmjs.com/cli/v8/configuring-npm/package-json#peerdependenciesmeta

@keeganstreet
Copy link
Author

Hi @Alorel , any chance you could release this patch?

The iltorb installation errors out in environments without python available. We don't need iltorb to be installed automatically (which is the default behaviour for peer dependencies in recent npm versions).

@ShrijalFetchly
Copy link

@keeganstreet @Alorel will this be merged?

@keeganstreet
Copy link
Author

The maintainer is taking a bit of a break. The deprecated iltorb and node-zopfli-es packages can be blocked in consuming apps by adding the following config to the package.json file of the consuming app:

  "overrides": {
    "iltorb": "npm:node-noop",
    "node-zopfli-es": "npm:node-noop"
  }

This will install https://www.npmjs.com/package/node-noop (a placeholder package that doesn't do anything) instead of iltorb and node-zopfli-es.

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.

2 participants