Repository navigation
fix: declare dependencies that were only available through hoisting - #12168
sebdanielsson wants to merge 13 commits into
Conversation
Changed Packages
|
…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]>
66316c4 to
59410bb
Compare
|
Hi 👋🏾 , thanks for this! FYI: Regarding |
There was a problem hiding this comment.
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. 🙏
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'snodeLinker: 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.tsimports@backstage/frontend-plugin-api(forTranslationRef) andluxon, so both@backstage/frontend-plugin-apiand@types/luxonare nowdependencies. It now forwards thereact-domandreact-router-dompeers that@backstage/core-app-apiand@backstage/core-plugin-apineed (also as dev dependencies), and has@types/reactas a dev dependency.plugin-announcements:dist/alpha.d.tsimports@backstage/filter-predicates, now a dependency.azure-devops
plugin-azure-devops:dist/alpha.d.tsimports@backstage/filter-predicates(emitted for the inferredfilterconfig types), now a dependency.@types/luxonis a new dev dependency, since the source importsluxon.cicd-statistics
plugin-cicd-statistics: the published types importreact, so@types/reactis now an optional peer with thereactpeer's range.dist/alpha.d.tsimports@backstage/filter-predicates, now a dependency. Knip reports it as unused because only the generated types use it, soknip-report.mdlists it, likeplugin-nexus-repository-managerdoes.@material-ui/pickersneedsprop-typesas a peer, now a dependency.quay
plugin-quay:@types/reactis now an optional peer, becausedist/legacy.d.tsimportsreact/jsx-runtime. It now depends on@backstage/plugin-permission-common, a peer ofplugin-quay-common. The unused@backstage/themedependency is removed rather than adding its@material-ui/corepeer (nothing in the source, dev app, tests or built output imports it).@types/luxonis a new dev dependency.plugin-quay-common: the unusedreactpeer is removed, soplugin-quay-backendno longer has an unmetreactpeer.copilot
plugin-copilot: the published types importreact, so@types/reactis now an optional peer.@backstage/thememoved to the dev dependencies, since only the dev app imports it. As a dependency it needed@material-ui/coreas a peer, which would have made every app install MUI 4.@mui/x-chartsneeds@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.react,react-dom,react-router-dom,@types/luxonand@react-types/shared.manage
plugin-manage,plugin-manage-react,plugin-manage-module-tech-insights: the published types importreact, so@types/reactis now an optional peer, andreact,react-domandreact-router-domare now also dev dependencies.plugin-manage-react: its published types import@backstage/config, now a dependency.@dnd-kit/utilitieswas a*peer that nothing provided. It's a plain utility library that@dnd-kit/coreand@dnd-kit/sortablealready depend on, so it's now a regular dependency, and packages that useplugin-manage-reactno longer need to install it.react-router-dompeer range6.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 importreact, so@types/reactis now an optional peer and a dev dependency.dist/alpha.d.tsimports@backstage/filter-predicates, now a dependency (listed inknip-report.mdas above). It now forwards thereact-domandreact-router-dompeers that@backstage/core-componentsneeds.@types/luxonis a new dev dependency.nodeLinker: pnpm,yarn tsc:fullfailed withTS7016before this change and passes after it, along with the build and tests.sonarqube
plugin-sonarqube-react: its published types inferApiReffrom@backstage/frontend-plugin-api, now a dependency.plugin-sonarqube:dist/alpha.d.tsimports@backstage/filter-predicates, now a dependency (it reuses the locked 0.2.0).@types/luxonis a new dev dependency.tech-insights
plugin-tech-insights-react: the published types importreact, so@types/reactis now an optional peer. It now forwards thereact-domandreact-router-dompeers its Backstage dependencies need, with the rangesplugin-tech-insightsalready uses (also as dev dependencies).plugin-tech-insights:@material-table/exportersneeds@material-table/core, which needs@date-io/core, so both are now dependencies, declared like@backstage/core-componentsdoes. Knip lists@date-io/coreas unused because nothing imports it directly, so the regeneratedknip-report.mdis included.plugin-tech-insights-commonalso has unmet React peers through@backstage/core-plugin-api, but it only uses that package forDiscoveryApiandIdentityApitypes, 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.package.jsonfiles.tekton
plugin-tekton-react: the published types importreact/jsx-runtime, so@types/reactis now an optional peer and a dev dependency.topology
plugin-topology:mobx-reactneedsmobx, now a dependency with the range@patternfly/react-topologyuses, so both share one copy. The unused@backstage/themedependency is removed rather than adding its@material-ui/corepeer (nothing in the source, dev app, tests or built output imports it).wheel-of-names
plugin-wheel-of-names: the published types importreact, so@types/reactis now an optional peer and a dev dependency. With a temporarynodeLinker: 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:
dist/*.d.tsfiles into a folder whosenode_modulesonly holds the packages each package declares, then type-checked them. Before:TS2307orTS7016for the packages above. After: no errors.yarn explain peer-requirementsno 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, andyarn build:knip-reportsmatches the committed reports.✔️ Checklist
Signed-off-byline in the message. (more info)🤖 Generated with Claude Code
https://claude.ai/code/session_01NZ521AzxwB3vLPS9t6fABT