patternfly / patternfly/patternfly-react

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

Đang mở Phù hợp với người mới
#11,923 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Stale
Ngôn ngữ chính
TypeScript
Star
862
Fork
392
Merge trung bình
4 ngày 8 giờ
Pull request đã merge (30 ngày)
9

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu trong package manifest của gói @patternfly/react-code-editor và kiểm tra cách monaco-editor được khai báo so với peer dependency của @monaco-editor/react. Cập nhật khai báo dependency cho phù hợp, sau đó chạy yarn install và xác minh rằng cảnh báo về peer dependency đã biến mất.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
react, typescript
Lĩnh vực
frontend
Loại issue
Lỗi
Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
68/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.