web3modal icon indicating copy to clipboard operation
web3modal copied to clipboard

chore: Fix regex to support version prefixes and build suffixes

Open mdqst opened this issue 9 months ago • 3 comments

Description

I’ve updated the regular expression to handle version strings with optional prefixes (like -beta) and build suffixes (like +build). This fix ensures better compatibility with version formats commonly used in deployment workflows. Here’s the updated regex:

const versionRegex = /@reown\/appkit-cdn@(__VERSION__|[\d]+\.[\d]+\.[\d]+(-[\w\.]+)?(\+[\w\.]+)?)/;

This now correctly matches:

  • Core version (e.g., 1.2.3)
  • Optional prefix labels (e.g., -beta)
  • Optional build labels (e.g., +build)

Type of change

  • [x] Chore (non-breaking change that addresses non-functional tasks, maintenance, or code quality improvements)
  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • [x] Code in this PR is covered by automated tests (Unit tests, E2E tests)
  • [x] My changes generate no new warnings
  • [x] I have reviewed my own code
  • [x] I have filled out all required sections
  • [x] I have tested my changes on the preview link
  • [x] Approver of this PR confirms that the changes are tested on the preview link

mdqst avatar Mar 20 '25 11:03 mdqst

⚠️ No Changeset found

Latest commit: 9ae8688b45bc3c48a94bb6e2e69fefacc2e3e725

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

changeset-bot[bot] avatar Mar 20 '25 11:03 changeset-bot[bot]

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
appkit-basic-ep-example ⬜️ Ignored (Inspect) Mar 20, 2025 11:22am

vercel[bot] avatar Mar 20 '25 11:03 vercel[bot]

@mdqst is attempting to deploy a commit to the Reown Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Mar 20 '25 11:03 vercel[bot]

Thanks for the contribution - since the current solution already working for the canary version (that we release on every PR merged), no need to update the current logic. Best

enesozturk avatar Sep 18 '25 11:09 enesozturk