facebook / docusaurus

Easy to maintain open source documentation websites.
https://docusaurus.io
MIT License
56.76k stars 8.55k forks source link

Unsatisfied peer dependencies on fresh project with `3.6.1` #10668

Open MorrisonCole opened 6 days ago

MorrisonCole commented 6 days ago

Have you read the Contributing Guidelines on issues?

Prerequisites

Description

A fair few core packages have unsatisfied peer dependencies with a fresh project on 3.6.1. This is most obvious with something like yarn 3.5.0, but also reproducable with pnpm and auto-install-peers=false.

Full set of warnings below.

Reproducible demo

https://github.com/MorrisonCole/docusaurus-peer-dependencies-repro/

Steps to reproduce

  1. Run npm init docusaurus@latest
    • (use any name)
    • classic
    • TypeScript
  2. (make sure yarn is available with corepack enable
  3. Run yarn from the new project. Depending on the version, different warnings will be printed at this time, but you can see all peer warnings with yarn explain peer-requirements.

Expected behavior

No YN0002 warnings / missing peers.

Actual behavior

Fair few missing peers, e.g., with (yarn set version 3.5.0):

➤ YN0002: │ @docusaurus/bundler@npm:3.6.1 [fb9bc] doesn't provide react (p61e2d), requested by @docusaurus/types
➤ YN0002: │ @docusaurus/bundler@npm:3.6.1 [fb9bc] doesn't provide react-dom (p19f9f), requested by @docusaurus/types
➤ YN0002: │ @docusaurus/plugin-content-blog@npm:3.6.1 [38fed] doesn't provide @mdx-js/react (p7dbc9), requested by @docusaurus/core
➤ YN0002: │ @docusaurus/plugin-content-docs@npm:3.6.1 [38fed] doesn't provide @mdx-js/react (p9f38b), requested by @docusaurus/core
➤ YN0002: │ @docusaurus/plugin-content-pages@npm:3.6.1 [38fed] doesn't provide @mdx-js/react (p77e7e), requested by @docusaurus/core
➤ YN0002: │ @docusaurus/plugin-debug@npm:3.6.1 [38fed] doesn't provide @mdx-js/react (p6f0af), requested by @docusaurus/core
➤ YN0002: │ @docusaurus/plugin-google-analytics@npm:3.6.1 [38fed] doesn't provide @mdx-js/react (p9f6c6), requested by @docusaurus/core
➤ YN0002: │ @docusaurus/plugin-google-gtag@npm:3.6.1 [38fed] doesn't provide @mdx-js/react (p7a09c), requested by @docusaurus/core
➤ YN0002: │ @docusaurus/plugin-google-tag-manager@npm:3.6.1 [38fed] doesn't provide @mdx-js/react (p0011e), requested by @docusaurus/core
➤ YN0002: │ @docusaurus/plugin-sitemap@npm:3.6.1 [38fed] doesn't provide @mdx-js/react (p93365), requested by @docusaurus/core
➤ YN0002: │ @docusaurus/preset-classic@npm:3.6.1 [e1d64] doesn't provide @mdx-js/react (p45d1a), requested by @docusaurus/core
➤ YN0002: │ @docusaurus/theme-search-algolia@npm:3.6.1 [38fed] doesn't provide @mdx-js/react (p4a912), requested by @docusaurus/core
➤ YN0002: │ @docusaurus/utils-common@npm:3.6.1 doesn't provide react (pc078f), requested by @docusaurus/types
➤ YN0002: │ @docusaurus/utils-common@npm:3.6.1 doesn't provide react-dom (p5bd66), requested by @docusaurus/types
➤ YN0002: │ @docusaurus/utils@npm:3.6.1 doesn't provide react (p8d75d), requested by @docusaurus/types
➤ YN0002: │ @docusaurus/utils@npm:3.6.1 doesn't provide react-dom (pb357f), requested by @docusaurus/types

Your environment

Self-service

Josh-Cena commented 2 days ago

https://github.com/facebook/docusaurus/pull/10391 added a peer dependency of core on MDX, so all dependents of core must also peerly depend on MDX. I don't fancy this idea especially since the core should be content-agnostic. @slorber is it possible for the core to expose a plugin API that injects module aliases for bundlers?