patternfly / patternfly/patternfly-react

Bug - react-code-editor - unsatisfied peer dependency from @monaco/react

Aperta Adatta ai principianti
#11,923 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Stale
Lingua principale
TypeScript
Stelle
862
Fork
392
Merge medio
4g 8h
PR unite (30g)
9

Descrizione

Describe the problem

@patternfly/react-code-editor has:

  • dependency on @monaco-editor/react

  • devDependency on monaco-editor

@monaco-editor/react has:

  • peer dependency "monaco-editor": ">= 0.25.0 [ 1"

I (@hawtio/react) have a peer+dev dependency on @patternfly/react-code-editor and during yarn install I get Some peer dependencies are incorrectly met by dependencies; run yarn explain peer-requirements for details.

The details:

$ yarn explain peer-requirements pce8ff
Package @patternfly/react-code-editor@npm:5.4.18 [9caf3] is requested to provide monaco-editor by its descendants

@patternfly/react-code-editor@npm:5.4.18 [9caf3]
└─ @monaco-editor/react@npm:4.7.0 [0e353] (via ]= 0.25.0 [ 1)

✘ Package @patternfly/react-code-editor@npm:5.4.18 [9caf3] does not provide monaco-editor.

At @hawtio/react level, I can't satisfy the transitive peer dependency on monaco-editor by adding it to my dependencies.
I also can't hoist the peer requirement to my package by adding monaco-editor to my peerDependencies.

How do you reproduce the problem?
See the description

Expected behavior
No warnings during yarn install.

Also @patternfly/react-code-editor should do one of these:

  • add monaco-editor to its dependencies

  • add monaco-editor to its peerDependencies

adding it to devDependencies breaks the peer contract.

I verified the suggestions with my .yarnrc.yml:

packageExtensions:
  "@patternfly/react-code-editor@*":
    dependencies:
      "monaco-editor": "^0.52.0"

when using:

peerDependencies:
      "monaco-editor": "^0.52.0"

I got expected error at my @hawtio/react level:

$ yarn explain peer-requirements p3f5f3
Package @hawtio/react@workspace:packages/hawtio is requested to provide monaco-editor by its descendants

@hawtio/react@workspace:packages/hawtio
└─ @patternfly/react-code-editor@npm:5.4.18 [9caf3] (via ^0.52.0)
   └─ @monaco-editor/react@npm:4.7.0 [0e353] (via ]= 0.25.0 < 1)

✘ Package @hawtio/react@workspace:packages/hawtio does not provide monaco-editor.

But this one can be fixed when @hawtio/react adds a dependency or dev dependency on monaco-editor.

And to make things more confusing - @patternfly/react-code-editor is actually satisfying peer dependency on monaco-editor from @monaco/react by adding monaco-editor to its devDependencies.

But when I (@hawtio/react) use @patternfly/react-code-editor, this peer satisfaction breaks.

I believe you have to add monaco-editor as peer dependency to @patternfly/react-code-editor.

Is this issue blocking you?
No

What is your environment?

  • OS: Linux

  • Browser (build time issue)

  • Version: 5.4.18

What is your product and what release date are you targeting?
It's Hawtio, no strict release date.


Jira Issue: PF-2361

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia dal manifest del pacchetto @patternfly/react-code-editor e verifica come è dichiarato monaco-editor rispetto alla peer dependency di @monaco-editor/react. Aggiorna la dichiarazione della dipendenza secondo necessità, quindi esegui yarn install e verifica che l'avviso relativo alla peer dependency sia scomparso.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
react, typescript
Ambito
frontend
Tipo di issue
Bug
Difficoltà
2/5
Tempo stimato
1-3 ore
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
68/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.