Skip to content

Commit 7d37593

Browse files
manzoorwanijkmirka
andauthored
Packages: Declare missing peer dependencies and check them in CI (#83765)
* Packages: Forward the React peer dependencies of their dependencies Declare react-dom (and react where missing) with optional types as peers of every package that depends on a package peering on them, so strict package managers such as Yarn PnP can resolve them. * Theme: Make the React peer dependencies optional The design tokens, stylelint, and bundler plugins do not load React, so consumers such as @wordpress/eslint-plugin and @wordpress/stylelint-config need not provide it. * Build tools: Declare the missing peers of third-party dependencies Add @babel/core to @wordpress/build for esbuild-plugin-babel, add stylelint-scss to @wordpress/scripts for @wordpress/stylelint-config, and make the types-only @types/node peer of @wordpress/e2e-test-utils-playwright optional. * Validation: Check that published packages declare the peers of their dependencies npm hoists and auto-installs peers, so a package that does not forward the peers of its dependencies only fails under strict package managers such as Yarn PnP. The check reads package-lock.json only, so it works with both the hoisted and linked install strategies. * Changelogs: Link the pull request Co-authored-by: manzoorwanijk <manzoorwanijk@git.wordpress.org> Co-authored-by: mirka <0mirka00@git.wordpress.org>
1 parent 7ba4164 commit 7d37593

64 files changed

Lines changed: 712 additions & 43 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/static-checks.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ jobs:
8787
- name: Lint dependency versions across workspaces
8888
run: npm run lint:deps
8989

90+
- name: Check peer dependencies of published packages
91+
run: npm run lint:peer-deps
92+
9093
- name: Check root dependencies
9194
if: ${{ matrix.annotations && github.event_name == 'pull_request' }}
9295
run: |

0 commit comments

Comments
 (0)