Skip to content

fix: declare dependencies that were only available through hoisting - #12168

Closed
sebdanielsson wants to merge 13 commits into
backstage:mainfrom
sebdanielsson:fix/announcements-declare-hoisted-deps
Closed

sebdanielsson wants to merge 13 commits into
backstage:mainfrom
sebdanielsson:fix/announcements-declare-hoisted-deps

Conversation

@sebdanielsson

@sebdanielsson sebdanielsson commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Hey, I just made a Pull Request!

These published packages use packages they don't declare. That works with a hoisted node_modules, but strict installs (pnpm, Yarn's nodeLinker: pnpm, Yarn PnP) can only resolve what a package declares, so apps that use them get type errors and missing peer dependencies. There's one commit and changeset per workspace, so maintainers can review each workspace on its own. They're in one PR because of the repository's open pull request limit.

announcements

  • plugin-announcements-react: dist/index.d.ts imports @backstage/frontend-plugin-api (for TranslationRef) and luxon, so both @backstage/frontend-plugin-api and @types/luxon are now dependencies. It now forwards the react-dom and react-router-dom peers that @backstage/core-app-api and @backstage/core-plugin-api need (also as dev dependencies), and has @types/react as a dev dependency.
  • plugin-announcements: dist/alpha.d.ts imports @backstage/filter-predicates, now a dependency.
  • chore(announcements): drop support for React 17, require React 18 as peer dependency #12073 also changes the React peer ranges of these packages, so whichever merges second needs a small rebase.

azure-devops

  • plugin-azure-devops: dist/alpha.d.ts imports @backstage/filter-predicates (emitted for the inferred filter config types), now a dependency. @types/luxon is a new dev dependency, since the source imports luxon.

cicd-statistics

  • plugin-cicd-statistics: the published types import react, so @types/react is now an optional peer with the react peer's range. dist/alpha.d.ts imports @backstage/filter-predicates, now a dependency. Knip reports it as unused because only the generated types use it, so knip-report.md lists it, like plugin-nexus-repository-manager does.
  • @material-ui/pickers needs prop-types as a peer, now a dependency.

quay

  • plugin-quay: @types/react is now an optional peer, because dist/legacy.d.ts imports react/jsx-runtime. It now depends on @backstage/plugin-permission-common, a peer of plugin-quay-common. The unused @backstage/theme dependency is removed rather than adding its @material-ui/core peer (nothing in the source, dev app, tests or built output imports it). @types/luxon is a new dev dependency.
  • plugin-quay-common: the unused react peer is removed, so plugin-quay-backend no longer has an unmet react peer.
  • The automated version bump in quay - version:bump to v1.57.1 #12132 also changes these files, so whichever merges second needs a small rebase.

copilot

  • plugin-copilot: the published types import react, so @types/react is now an optional peer. @backstage/theme moved to the dev dependencies, since only the dev app imports it. As a dependency it needed @material-ui/core as a peer, which would have made every app install MUI 4. @mui/x-charts needs @mui/system, now a dependency with the same range as @mui/material, which the plugin already depends on and which brings its own @mui/system. That keeps both on one copy without apps having to add it.
  • Dev dependencies the source and tests used without declaring: react, react-dom, react-router-dom, @types/luxon and @react-types/shared.

manage

  • plugin-manage, plugin-manage-react, plugin-manage-module-tech-insights: the published types import react, so @types/react is now an optional peer, and react, react-dom and react-router-dom are now also dev dependencies.
  • plugin-manage-react: its published types import @backstage/config, now a dependency. @dnd-kit/utilities was a * peer that nothing provided. It's a plain utility library that @dnd-kit/core and @dnd-kit/sortable already depend on, so it's now a regular dependency, and packages that use plugin-manage-react no longer need to install it.
  • The react-router-dom peer range 6.30.5 ^6.30.5 (from Update dependency react-router-dom to v6.30.5 [SECURITY] - abandoned #10645) only allows exactly 6.30.5. I left it unchanged.

npm

  • plugin-npm: the published types import react, so @types/react is now an optional peer and a dev dependency. dist/alpha.d.ts imports @backstage/filter-predicates, now a dependency (listed in knip-report.md as above). It now forwards the react-dom and react-router-dom peers that @backstage/core-components needs. @types/luxon is a new dev dependency.
  • With a temporary nodeLinker: pnpm, yarn tsc:full failed with TS7016 before this change and passes after it, along with the build and tests.

sonarqube

  • plugin-sonarqube-react: its published types infer ApiRef from @backstage/frontend-plugin-api, now a dependency.
  • plugin-sonarqube: dist/alpha.d.ts imports @backstage/filter-predicates, now a dependency (it reuses the locked 0.2.0). @types/luxon is a new dev dependency.

tech-insights

  • plugin-tech-insights-react: the published types import react, so @types/react is now an optional peer. It now forwards the react-dom and react-router-dom peers its Backstage dependencies need, with the ranges plugin-tech-insights already uses (also as dev dependencies).
  • plugin-tech-insights: @material-table/exporters needs @material-table/core, which needs @date-io/core, so both are now dependencies, declared like @backstage/core-components does. Knip lists @date-io/core as unused because nothing imports it directly, so the regenerated knip-report.md is included.
  • plugin-tech-insights-common also has unmet React peers through @backstage/core-plugin-api, but it only uses that package for DiscoveryApi and IdentityApi types, and forwarding React peers would push React onto its backend consumers. Replacing those types changes the public API, so it isn't part of this PR.
  • feat(tech-insights): migrate frontend plugins from MUI to BUI #11473 also edits these package.json files.

tekton

  • plugin-tekton-react: the published types import react/jsx-runtime, so @types/react is now an optional peer and a dev dependency.

topology

  • plugin-topology: mobx-react needs mobx, now a dependency with the range @patternfly/react-topology uses, so both share one copy. The unused @backstage/theme dependency is removed rather than adding its @material-ui/core peer (nothing in the source, dev app, tests or built output imports it).

wheel-of-names

  • plugin-wheel-of-names: the published types import react, so @types/react is now an optional peer and a dev dependency. With a temporary nodeLinker: pnpm, yarn tsc, the build and tests pass.

The lockfiles only change the workspace entries and reuse versions they already have.

Verification

For each workspace:

  • I copied the built dist/*.d.ts files into a folder whose node_modules only holds the packages each package declares, then type-checked them. Before: TS2307 or TS7016 for the packages above. After: no errors.
  • yarn explain peer-requirements no longer reports the peers listed above as missing.
  • yarn install --immutable, yarn fix --check, yarn tsc:full, yarn build:api-reports:only --ci, lint, builds and tests of the changed packages pass, and yarn build:knip-reports matches the committed reports.

✔️ Checklist

  • A changeset describing the change and affected packages. (more info)
  • Added or updated documentation
  • Tests for new functionality and regression tests for bug fixes
  • Screenshots attached (for UI changes)
  • All your commits have a Signed-off-by line in the message. (more info)

🤖 Generated with Claude Code

https://claude.ai/code/session_01NZ521AzxwB3vLPS9t6fABT

@sebdanielsson
sebdanielsson requested review from a team, gaelgoth and kurtaking as code owners November 22, 2026 09:58
@backstage-service backstage-service added the workspace/announcements Used to tag announcements workspace isses and pull requests label Nov 22, 2026
@backstage-goalie

backstage-goalie Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Changed Packages

Package Name Package Path Changeset Bump Current Version
@backstage-community/plugin-announcements-react workspaces/announcements/plugins/announcements-react patch v0.31.0
@backstage-community/plugin-announcements workspaces/announcements/plugins/announcements patch v2.15.0
@backstage-community/plugin-azure-devops workspaces/azure-devops/plugins/azure-devops patch v0.38.0
@backstage-community/plugin-cicd-statistics workspaces/cicd-statistics/plugins/cicd-statistics patch v0.22.0
@backstage-community/plugin-copilot workspaces/copilot/plugins/copilot patch v1.10.0
@backstage-community/plugin-manage-module-tech-insights workspaces/manage/plugins/manage-module-tech-insights patch v0.8.0
@backstage-community/plugin-manage-react workspaces/manage/plugins/manage-react patch v2.2.1
@backstage-community/plugin-manage workspaces/manage/plugins/manage patch v1.3.0
@backstage-community/plugin-npm workspaces/npm/plugins/npm patch v1.30.0
@backstage-community/plugin-quay-common workspaces/quay/plugins/quay-common patch v1.24.0
@backstage-community/plugin-quay workspaces/quay/plugins/quay patch v1.39.0
@backstage-community/plugin-sonarqube-react workspaces/sonarqube/plugins/sonarqube-react patch v1.5.0
@backstage-community/plugin-sonarqube workspaces/sonarqube/plugins/sonarqube patch v1.5.0
@backstage-community/plugin-tech-insights-react workspaces/tech-insights/plugins/tech-insights-react patch v1.7.0
@backstage-community/plugin-tech-insights workspaces/tech-insights/plugins/tech-insights patch v1.5.0
@backstage-community/plugin-tekton-react workspaces/tekton/plugins/tekton-react patch v0.9.1
@backstage-community/plugin-topology workspaces/topology/plugins/topology patch v3.1.0
@backstage-community/plugin-wheel-of-names workspaces/wheel-of-names/plugins/wheel-of-names patch v0.8.0

sebdanielsson and others added 12 commits November 24, 2026 20:00
…ugh hoisting

The published alpha types of plugin-azure-devops import
@backstage/filter-predicates without declaring it, which strict installs
(pnpm, Yarn's pnpm linker, PnP) can't resolve. Also declare @types/luxon
as a dev dependency, since the source uses luxon.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NZ521AzxwB3vLPS9t6fABT
Signed-off-by: Sebastian Danielsson <[email protected]>
…hrough hoisting

The published types of plugin-cicd-statistics import react and
@backstage/filter-predicates, but the package declares neither
@types/react nor @backstage/filter-predicates. It also depends on
@material-ui/pickers without providing its prop-types peer. Strict
installs (pnpm, Yarn's pnpm linker, PnP) can't resolve undeclared
packages.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NZ521AzxwB3vLPS9t6fABT
Signed-off-by: Sebastian Danielsson <[email protected]>
…ting

The published types of plugin-quay use React types without declaring
@types/react, and plugin-quay didn't provide the
@backstage/plugin-permission-common peer that plugin-quay-common
requires. It also depended on the unused @backstage/theme, whose
@material-ui/core peer it didn't provide. plugin-quay-common declared an
unused react peer, which plugin-quay-backend can't provide. Strict
installs (pnpm, Yarn's pnpm linker, PnP) can't resolve undeclared
packages.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NZ521AzxwB3vLPS9t6fABT
Signed-off-by: Sebastian Danielsson <[email protected]>
…oisting

The published types of plugin-copilot import react, but @types/react was
only a dev dependency. The plugin also didn't provide the
@material-ui/core peer of @backstage/theme or the @mui/system peer of
@mui/x-charts. Strict installs (pnpm, Yarn's pnpm linker, PnP) can't
resolve undeclared packages.

Forward @material-ui/core as a peer. Add @mui/system as a dependency,
next to the existing @mui/material dependency that already brings it.
Also declare the dev dependencies the source and tests need: the react,
react-dom and react-router-dom peers, @types/luxon and
@react-types/shared.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NZ521AzxwB3vLPS9t6fABT
Signed-off-by: Sebastian Danielsson <[email protected]>
…isting

The published types of plugin-manage, plugin-manage-react and
plugin-manage-module-tech-insights import react, but @types/react was
only a dev dependency, and the types of plugin-manage-react import
@backstage/config without declaring it. plugin-manage-react also
required @dnd-kit/utilities as a peer that nothing provided, although
it is a plain utility library that its own @dnd-kit dependencies
already depend on. Strict installs (pnpm, Yarn's pnpm linker, PnP)
can't resolve undeclared packages.

Make @dnd-kit/utilities a regular dependency, and declare the react,
react-dom and react-router-dom peers as dev dependencies so the
packages build and test without hoisting.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NZ521AzxwB3vLPS9t6fABT
Signed-off-by: Sebastian Danielsson <[email protected]>
The published types of plugin-npm import react and
@backstage/filter-predicates, but the package declares neither
@types/react nor @backstage/filter-predicates. It also didn't forward
the react-dom and react-router-dom peers that its Backstage
dependencies require. Strict installs (pnpm, Yarn's pnpm linker, PnP)
can't resolve undeclared packages.

Also declare @types/react and @types/luxon as dev dependencies, since
the source uses them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NZ521AzxwB3vLPS9t6fABT
Signed-off-by: Sebastian Danielsson <[email protected]>
… hoisting

The published types of plugin-sonarqube-react import
@backstage/frontend-plugin-api, and the alpha types of plugin-sonarqube
import @backstage/filter-predicates, without declaring them. Strict
installs (pnpm, Yarn's pnpm linker, PnP) can't resolve undeclared
packages.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NZ521AzxwB3vLPS9t6fABT
Signed-off-by: Sebastian Danielsson <[email protected]>
…ough hoisting

The published types of plugin-tech-insights-react use React types
without declaring @types/react, and it didn't forward the react-dom and
react-router-dom peers that @backstage/core-plugin-api requires.
plugin-tech-insights didn't provide the @material-table/core peer that
@material-table/exporters requires. Strict installs (pnpm, Yarn's pnpm
linker, PnP) can't resolve undeclared packages.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NZ521AzxwB3vLPS9t6fABT
Signed-off-by: Sebastian Danielsson <[email protected]>
…n-react

The published types of plugin-tekton-react use React types without
declaring @types/react. Strict installs (pnpm, Yarn's pnpm linker, PnP)
can't resolve undeclared packages.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NZ521AzxwB3vLPS9t6fABT
Signed-off-by: Sebastian Danielsson <[email protected]>
…heme dependency

plugin-topology didn't provide the mobx peer that mobx-react requires,
and depended on the unused @backstage/theme, whose @material-ui/core
peer it didn't provide. Strict installs (pnpm, Yarn's pnpm linker, PnP)
can't resolve undeclared packages.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NZ521AzxwB3vLPS9t6fABT
Signed-off-by: Sebastian Danielsson <[email protected]>
The published types of plugin-wheel-of-names use React types without
declaring @types/react. Strict installs (pnpm, Yarn's pnpm linker, PnP)
can't resolve undeclared packages.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NZ521AzxwB3vLPS9t6fABT
Signed-off-by: Sebastian Danielsson <[email protected]>
Only the local dev app imports @backstage/theme, so it doesn't need to
be a published dependency. Having it there forced every app that
installs plugin-copilot to provide @material-ui/core as a peer.

Move @backstage/theme to dev dependencies and drop the @material-ui/core
peer. The dev app keeps @material-ui/core as a dev dependency.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NZ521AzxwB3vLPS9t6fABT
Signed-off-by: Sebastian Danielsson <[email protected]>
@sebdanielsson
sebdanielsson force-pushed the fix/announcements-declare-hoisted-deps branch from 66316c4 to 59410bb Compare November 24, 2026 19:01
@gaelgoth

Copy link
Copy Markdown
Member

Hi 👋🏾 , thanks for this!

FYI: Regarding announcements plugin, I've started handling it in the PR mentioned in the description. For the rest, I'm waiting for the 1.57 version bump so I can do a more in-depth cleanup of the dependencies and replace the deprecated ones (like the api-refs)

@awanlin awanlin 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.

Hi @sebdanielsson, the Community Plugins repo works differently than the Backstage repo with ownership by workspace. Plugin Owners working here as volunteers based on their own availability. The PR limit is put in place for that reason as well.

Please break this up into one PR per workspace, I'm sure you can easily come up with which workspaces you feel should be prioritized. You'll also find that some workspaces are more active than others and your PRs will get approved and merged faster.

A general for future comment: log an issue first, this give us (Community Plugin Maintainers) and/or plugin owners a chance to give you feedback early. 🙏

@sebdanielsson

Copy link
Copy Markdown
Contributor Author

I've split this into one PR per workspace, rebased on main, so each one can be reviewed and merged on its own:

Closing this one in favor of those. The first three are ready for review. The rest stay drafts for now so I stay within the open pull request limit, and I'll mark them ready as the others get merged.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants