Skip to content

fix(export): use managed stable version when rc dist-tag is stale (#407) - #409

Open
Yonkoo11 wants to merge 1 commit into
OpenZeppelin:mainfrom
Yonkoo11:fix/staging-rc-dist-tag-stale
Open

fix(export): use managed stable version when rc dist-tag is stale (#407)#409
Yonkoo11 wants to merge 1 commit into
OpenZeppelin:mainfrom
Yonkoo11:fix/staging-rc-dist-tag-stale

Conversation

@Yonkoo11

Copy link
Copy Markdown

Closes #407

When versions.ts holds a stable semver (e.g. 2.3.0) and no RC snapshot exists, staging exports were falling back to the bare rc npm dist-tag. That tag currently resolves to 2.0.0-rc.1 (April 2026), which predates features shipped in stable releases — most visibly ENS name resolution (landed in 2.1.02.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 in versions.ts.

Production exports are unaffected — they already pin ^<managedVersion>.

@Yonkoo11
Yonkoo11 requested a review from a team as a code owner July 26, 2026 07:30
@Yonkoo11

Yonkoo11 commented Aug 2, 2026

Copy link
Copy Markdown
Author

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 -rc version is present.
  • Preserve direct use of managed RC snapshot versions when managedVersion includes -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.

Comment on lines 533 to +537
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
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.

Staging exports pin adapters to a stale rc dist-tag → shipped adapter predates published features (breaks ENS)

2 participants