fix(export): use managed stable version when rc dist-tag is stale (#407) - #409
fix(export): use managed stable version when rc dist-tag is stale (#407)#409Yonkoo11 wants to merge 1 commit into
Conversation
|
Friendly follow-up: the available check is green, and the fix keeps staging from exporting a stale RC when the dist-tag lags the managed version. Happy to adjust anything needed for review. |
There was a problem hiding this comment.
Pull request overview
This PR fixes staging-mode exports for @openzeppelin/adapter-* dependencies so that when versions.ts contains a stable semver and no RC snapshot exists, staging exports use the managed stable version (with a ^ prefix) instead of falling back to the potentially stale npm rc dist-tag. This aligns staging export behavior with how UI packages are versioned and prevents staging exports from silently shipping older adapter builds missing recently released features (e.g., ENS resolution).
Changes:
- Update staging adapter version selection to prefer the managed stable version (caret range) when no
-rcversion is present. - Preserve direct use of managed RC snapshot versions when
managedVersionincludes-rc.
Suppressed comments (1)
apps/builder/src/export/PackageManager.ts:539
- This staging behavior change (stable managed version with ^ when no RC is present) will make existing tests fail: apps/builder/src/export/tests/PackageManager.test.ts currently expects adapter deps in staging to match /^(rc|...-rc...)$/. The assertions should be updated to cover both cases (RC snapshot vs stable caret range).
updatedDependencies[pkgName] = managedVersion.startsWith('^')
? managedVersion
: `^${managedVersion}`;
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (managedVersion.includes('-rc')) { | ||
| updatedDependencies[pkgName] = managedVersion; | ||
| } else { | ||
| // Using the dist-tag ensures alignment with snapshot format 0.0.0-rc-YYYYMMDDHHMMSS | ||
| updatedDependencies[pkgName] = 'rc'; | ||
| updatedDependencies[pkgName] = managedVersion.startsWith('^') | ||
| ? managedVersion |
Closes #407
When
versions.tsholds a stable semver (e.g.2.3.0) and no RC snapshot exists, staging exports were falling back to the barercnpm dist-tag. That tag currently resolves to2.0.0-rc.1(April 2026), which predates features shipped in stable releases — most visibly ENS name resolution (landed in2.1.0→2.3.0).Fix: When no RC version is available, staging now uses the managed stable version directly (with
^prefix), matching the behavior of UI packages. This ensures staging exports always ship with the features documented inversions.ts.Production exports are unaffected — they already pin
^<managedVersion>.