Skip to content

Fixed extension package version replacement#1498

Merged
carterworks merged 5 commits into
mainfrom
fix-extension-package-version-token
May 7, 2026
Merged

Fixed extension package version replacement#1498
carterworks merged 5 commits into
mainfrom
fix-extension-package-version-token

Conversation

@carterworks
Copy link
Copy Markdown
Collaborator

@carterworks carterworks commented May 7, 2026

Changed Packages

  • core
  • reactor-extension

Description

  • Replaces the __VERSION__ placeholder during Forge-style reactor extension builds by applying Rollup's replace plugin with the installed @adobe/alloy version.
  • Includes @rollup/plugin-replace in the generated extension package dependencies so zipped packages can rebuild after npm ci.
  • Adds a regression test that builds the extracted extension package and asserts the generated bundle no longer contains __VERSION__.

Related Issue

Related to #1495.

Motivation and Context

PR #1495 made the extension zip self-contained by vendoring @adobe/alloy and @adobe/alloy-core, but the Forge rebuild path no longer replaced Alloy's __VERSION__ token. That left rebuilt extension bundles with the placeholder string instead of the package version.

This change makes the extension Rollup config mirror the browser package build behavior for version replacement.

Screenshots (if appropriate):

N/A - build and packaging change only.

Documentation

N/A - no consumer-facing documentation change.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Improvement (non-breaking change which does not add functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have added a Changeset file with a consumer-facing description of my changes.
  • I have signed the Adobe Open Source CLA or I'm an Adobe employee.
  • I have made any necessary test changes and all tests pass.
  • I have run the Sandbox successfully.

Test plan

  • pnpm exec vitest run --project scripts packages/reactor-extension/scripts/extensionBuild.spec.js
  • pnpm -C packages/reactor-extension package
  • Extracted package-adobe-alloy-2.35.0-beta.2.zip, then ran npm ci and npm run build
  • Searched rebuilt extension output for __VERSION__

Made with Cursor

carterworks and others added 2 commits May 7, 2026 09:55
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@carterworks carterworks self-assigned this May 7, 2026
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 7, 2026

🦋 Changeset detected

Latest commit: 531a456

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

This PR includes changesets to release 0 packages

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

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

@carterworks carterworks marked this pull request as draft May 7, 2026 16:08
Co-authored-by: Cursor <cursoragent@cursor.com>
@carterworks carterworks changed the title Fix extension package version replacement Fixed extension package version replacement May 7, 2026
@carterworks
Copy link
Copy Markdown
Collaborator Author

For context: packages/browser/rollup.config.js does replace __VERSION__, but the Forge rebuild path for the reactor extension does not use that config. The generated extension package runs scripts/buildAlloy.mjs, which invokes packages/reactor-extension/rollup.config.mjs directly.

Since @adobe/alloy exports source (./src/index.js) rather than a prebuilt bundle, that rebuild path pulls in @adobe/alloy-core/src/constants/libraryVersion.js, where the placeholder still exists. This fix adds the same version replacement behavior to the reactor extension Rollup config so rebuilt extension bundles no longer leak __VERSION__.

@carterworks carterworks marked this pull request as ready for review May 7, 2026 16:28
@carterworks carterworks merged commit d5c7f92 into main May 7, 2026
9 checks passed
@carterworks carterworks deleted the fix-extension-package-version-token branch May 7, 2026 16:52
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.

3 participants