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(deps): support pre-release as allowed peer dependency #15

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

Conversation

HugoPoi
Copy link

@HugoPoi HugoPoi commented Aug 20, 2024

The problem

  • npm doesnt take pre-release as candidate versions so [email protected] isn't a valid version for ^3.1.0 || ^4.0.0
  • As a result without using npm --legacy-peer-deps, we can't use version 4

Capture d’écran du 2024-08-20 11-22-35

Suggested solution is to add pre-release allowed in peerDeps

require('semver').satisfies('4.0.0-alpha.9', '^3.1.0 || ^4.0.0'); // return false
require('semver').satisfies('4.0.0-alpha.9', '^3.1.0 || ^4.0.0-alpha'); // return true
require('semver').satisfies('4.0.12', '^3.1.0 || ^4.0.0-alpha'); // return true
require('semver').satisfies('4.0.0-beta.1', '^3.1.0 || ^4.0.0-alpha'); // return true
require('semver').satisfies('4.0.3-alpha.2', '^3.1.0 || ^4.0.0-alpha'); // return false

Workaround

Capture d’écran du 2024-08-20 11-28-26

PS: if this is the intended behavior please close this PR

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.

1 participant