Skip to content

Fix: Match prerelease versions in whereFromPlugin/whereToPlugin (fixes #66) - #67

Merged
joe-replin merged 1 commit into
masterfrom
issue/66
Sep 22, 2026
Merged

joe-replin merged 1 commit into
masterfrom
issue/66

Conversation

@joe-replin

Copy link
Copy Markdown
Contributor

Fixes #66

Fix

  • Pass includePrerelease: true to semver.satisfies in whereFromPlugin and whereToPlugin (api/where.js), so a plugin on a prerelease version matches an ordinary range instead of being silently skipped.

Without this, node-semver excludes prereleases from every range unless a comparator shares their exact major.minor.patch — so 3.0.5-myfork-0.0.1 matches no range at all, including * and x. A gated migration returns false, which reads as "not applicable here", so the run reports success and the content arrives unmigrated. Prerelease contrib builds and locally patched forks both hit it.

Boundaries are unchanged for ordinary versions: 4.0.0-beta.1 satisfies <=4.0.0 (it precedes the release), while 4.0.1-alpha.1 and 4.0.1 do not.

Known limitation

Prereleases sort below their release, so a fork of X.Y.Z matches the gate ending at X.Y.Z, not the one starting there. For a genuine prerelease that is correct: the content predates the release and should migrate up to it. For a fork patched after X.Y.Z shipped, the migration to X.Y.Z re-runs on content already at that version. This is inherent to versioning a fork as a semver prerelease, and coercing to the base version has the mirror-image flaw. Those courses are skipped entirely today, so this is still strictly an improvement.

Testing

No test fixtures added — this repo has no test infrastructure, so verification was run through a consuming plugin's suite. Adding one is worth its own issue.

  1. adapt-pageNav migrations on stock 1.4.2: 31 pass, 0 fail. Same result with this branch, plus a prerelease fixture (adapt-quicknav@3.0.5-myfork-0.0.1) that fails on stock and passes here.
  2. All 84 contrib migration scripts in adapt-framework: 744 pass, 7 fail before and after, with an identical failing set. The 7 are pre-existing accordion and textInput content-mutation failures, unrelated to version gating.
  3. Boundary checks: 3.1.0-alpha.1 and 3.0.5-myfork-0.0.1 now satisfy <=4.0.0, * and x. 4.0.1-alpha.1 and 4.0.1 still excluded.

@taylortom taylortom left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me! ⭐

@joe-replin
joe-replin merged commit fdf3294 into master Sep 22, 2026
1 check passed
@joe-replin
joe-replin deleted the issue/66 branch September 22, 2026 21:40
@github-project-automation github-project-automation Bot moved this from Needs Reviewing to Recently Released in adapt_framework: The TODO Board Sep 22, 2026
github-actions Bot pushed a commit that referenced this pull request Sep 22, 2026
## [1.4.3](v1.4.2...v1.4.3) (2026-09-22)

### Fix

* match prerelease versions in whereFromPlugin/whereToPlugin (fixes #66) (#67) ([fdf3294](fdf3294)), closes [#66](#66) [#67](#67)
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.4.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Recently Released

Development

Successfully merging this pull request may close these issues.

whereFromPlugin/whereToPlugin never match prerelease versions, silently skipping migrations

3 participants