Skip to content

fix(enhanced): support OR || operations in SemVer #3808

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

Merged
merged 3 commits into from
Jun 3, 2025
Merged

Conversation

ScriptedAlchemy
Copy link
Member

Description

This pull request enhances the satisfy function in the semver utility to support logical OR (||) conditions in version range parsing. It also improves error handling and simplifies the logic for wildcard and invalid range cases.

Enhancements to semver parsing:

  • Added support for logical OR (||) in version range parsing by splitting the range into sub-ranges, handling each independently, and returning true if any sub-range is satisfied. [1] [2]
  • Improved handling of wildcards (*, x) and empty range strings by explicitly treating them as valid matches.
  • Enhanced error handling by logging errors for invalid sub-ranges and continuing to evaluate other sub-ranges instead of failing entirely.

Codebase simplification:

  • Removed redundant parsing logic by consolidating version and range extraction into clearer steps.
  • Added comments to clarify the logic and ensure maintainability for future updates. [1] [2]

Documentation:

  • Updated the changeset file to reflect the patch-level update for the @module-federation/enhanced package, indicating the addition of || pipe support in semver parsing.

Related Issue

#3803

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have updated the documentation.

Sorry, something went wrong.

Verified

This commit was signed with the committer’s verified signature.
samueltardieu Samuel Tardieu

Verified

This commit was signed with the committer’s verified signature.
samueltardieu Samuel Tardieu
Copy link

changeset-bot bot commented May 30, 2025

🦋 Changeset detected

Latest commit: e82f2ac

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 32 packages
Name Type
@module-federation/enhanced Patch
@module-federation/modern-js Patch
@module-federation/nextjs-mf Patch
@module-federation/node Patch
@module-federation/rsbuild-plugin Patch
@module-federation/storybook-addon Patch
@module-federation/modernjsapp Patch
remote5 Patch
@module-federation/runtime Patch
@module-federation/rspack Patch
@module-federation/webpack-bundler-runtime Patch
@module-federation/sdk Patch
@module-federation/runtime-tools Patch
@module-federation/managers Patch
@module-federation/manifest Patch
@module-federation/dts-plugin Patch
@module-federation/third-party-dts-extractor Patch
@module-federation/devtools Patch
@module-federation/bridge-react Patch
@module-federation/bridge-vue3 Patch
@module-federation/bridge-shared Patch
@module-federation/bridge-react-webpack-plugin Patch
@module-federation/retry-plugin Patch
@module-federation/data-prefetch Patch
@module-federation/error-codes Patch
@module-federation/inject-external-runtime-core-plugin Patch
@module-federation/runtime-core Patch
create-module-federation Patch
@module-federation/cli Patch
@module-federation/esbuild Patch
@module-federation/utilities Patch
website-new Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

netlify bot commented May 30, 2025

Deploy Preview for module-federation-docs ready!

Name Link
🔨 Latest commit e82f2ac
🔍 Latest deploy log https://app.netlify.com/projects/module-federation-docs/deploys/68397f74e50bf40008b546c3
😎 Deploy Preview https://deploy-preview-3808--module-federation-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@ScriptedAlchemy ScriptedAlchemy marked this pull request as ready for review May 30, 2025 09:45

Verified

This commit was signed with the committer’s verified signature.
samueltardieu Samuel Tardieu
@zackarychapple zackarychapple merged commit ad446af into main Jun 3, 2025
17 checks passed
@zackarychapple zackarychapple deleted the semver-pipe branch June 3, 2025 14:11
@2heal1 2heal1 mentioned this pull request Jun 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants