From 54dd60c61cadfbf5e72385aca49e80375e250fb0 Mon Sep 17 00:00:00 2001 From: alejoamiras Date: Fri, 6 Nov 2026 18:19:49 +0000 Subject: [PATCH] chore(docs): settle yarn's unmet peer requirements `yarn install` in docs/ printed YN0086 for 39 unmet peer requirements. None is a dependency docs uses without declaring: react, react-dom, @mdx-js/react and @docusaurus/plugin-content-docs are already direct dependencies. packageExtensions in .yarnrc.yml now: - mark optional the peers that no package loads where they go unprovided: Algolia autocomplete's client peers (.d.ts only), react on @docusaurus/types (types only) and on the helmet copies it holds for types, core's @mdx-js/react (core resolves it from the site directory), file-loader's webpack and ts-node's @types/node; - pass a real peer through from the parent where an intermediate dropped it: plugin-content-docs via theme-mermaid, and react and react-dom via plugin-css-cascade-layers. Each entry is pinned to the version it was checked against, so an upgrade brings the warning back. No package.json or yarn.lock change: a clean install resolves the same tree as before. --- docs/.yarnrc.yml | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/docs/.yarnrc.yml b/docs/.yarnrc.yml index 32ff30f414d..15e733b146d 100644 --- a/docs/.yarnrc.yml +++ b/docs/.yarnrc.yml @@ -8,3 +8,48 @@ npmMinimalAgeGate: 7d # @aztec-labs is what this repo publishes, @aztec-foundation holds the foundation packages it pins, # and @aztec holds the viem fork. npmPreapprovedPackages: ['@aztec/*', '@aztec-labs/*', '@aztec-foundation/*'] + +# Settles the peer requirements yarn reports unmet (YN0086). The optional ones are peers that no +# package loads in the contexts where they go unprovided. Each entry names the version it was +# checked against, so an upgrade brings the warning back for a fresh look. +packageExtensions: + # Imported only from .d.ts files; the insights plugin loads search-insights from a CDN itself. + '@algolia/autocomplete-shared@1.19.2 || 1.19.8': + peerDependenciesMeta: + '@algolia/client-search': { optional: true } + algoliasearch: { optional: true } + '@algolia/autocomplete-plugin-algolia-insights@1.19.2 || 1.19.8': + peerDependenciesMeta: + search-insights: { optional: true } + # A types-only package (no JS entry point). Helmet does load react, but only core runs it, and + # core requires react; the copies under @docusaurus/types and module-type-aliases are for types. + '@docusaurus/types@3.10.2': + peerDependenciesMeta: + react: { optional: true } + react-dom: { optional: true } + '@slorber/react-helmet-async@1.3.0': + peerDependenciesMeta: + react: { optional: true } + react-dom: { optional: true } + # Core needs @mdx-js/react at build time and resolves it from the site directory + # (resolveSitePkg), which declares it; the plugins whose core copy lacks it never run that copy. + '@docusaurus/core@3.10.2': + peerDependenciesMeta: + '@mdx-js/react': { optional: true } + # A loader run by the host bundler; it never requires webpack. + 'file-loader@6.2.0': + peerDependenciesMeta: + webpack: { optional: true } + # ts-node type-checks and transpiles TypeScript Netlify build plugins only, and docs has none. + 'ts-node@10.9.2': + peerDependenciesMeta: + '@types/node': { optional: true } + # These depend on a package whose peer is real (theme-common bundles requires of + # plugin-content-docs/client; core needs react), so they pass it through from their parent. + '@docusaurus/theme-mermaid@3.10.2': + peerDependencies: + '@docusaurus/plugin-content-docs': '*' + '@docusaurus/plugin-css-cascade-layers@3.10.2': + peerDependencies: + react: '^18.0.0 || ^19.0.0' + react-dom: '^18.0.0 || ^19.0.0'