Skip to content

fix: correct support for workspace:^ and backstage:^ dependency version resolution.#103

Merged
davidfestal merged 1 commit intomainfrom
fix-workspace-and-backstage-deps
Apr 27, 2026
Merged

fix: correct support for workspace:^ and backstage:^ dependency version resolution.#103
davidfestal merged 1 commit intomainfrom
fix-workspace-and-backstage-deps

Conversation

@davidfestal
Copy link
Copy Markdown
Member

Fix workspace:^ and backstage:^ dependency version resolution

Summary

Fixes how the dynamic plugin export resolves workspace:^ and backstage:^ version specs in plugin dependencies, which previously produced incorrect or unresolvable versions in the exported package.json.

Changes

  • New backstageVersion module (src/lib/backstageVersion.ts): Adds utilities to resolve backstage:^ version specs to concrete versions by fetching the Backstage release manifest (via @backstage/release-manifests). Replicates the logic from the Backstage Yarn plugin's beforeWorkspacePacking hook. Supports BACKSTAGE_MANIFEST_FILE and BACKSTAGE_VERSIONS_BASE_URL environment variables for offline / custom manifest usage.

  • Fix workspace:^ range specifier handling (backend.ts): The ^ / ~ range prefix was incorrectly applied inside the monorepo-package resolution branch, meaning it was lost in certain code paths. Moves the range-prefix prepending to run after all resolution branches so it is applied consistently.

  • Add backstage:^ protocol support (backend.ts): When a dependency uses the backstage:^ protocol, it is now resolved to a concrete ^<version> using the release manifest, with a log message showing the resolution.

  • Add @backstage/release-manifests as a production dependency.

  • Minor: simplify the bin field in package.json to a plain string.

@davidfestal davidfestal force-pushed the fix-workspace-and-backstage-deps branch 2 times, most recently from 8612f53 to aab722f Compare April 27, 2026 17:41
…on resolution.

Signed-off-by: David Festal <dfestal@redhat.com>
@davidfestal davidfestal force-pushed the fix-workspace-and-backstage-deps branch from aab722f to 87613a2 Compare April 27, 2026 17:42
@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Member

@PatAKnight PatAKnight left a comment

Choose a reason for hiding this comment

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

lgtm

@davidfestal davidfestal merged commit 15f256e into main Apr 27, 2026
6 checks passed
@davidfestal davidfestal deleted the fix-workspace-and-backstage-deps branch April 27, 2026 19:24
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.

2 participants