reactjs / reactjs/react-docgen

react-docgen generates platform specific structure

Đang mở
#199 5 bình luận 0 reaction 0 người được giao Xem trên GitHub

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

needs-discussion
Ngôn ngữ chính
TypeScript
Star
3.8k
Fork
316
Merge trung bình
5 giờ 7 phút
Pull request đã merge (30 ngày)
4

Mô tả

react-docgen --pretty -o lib/metadata.json src/components

On Windows produces:

{
  "src\\components\\ExampleComponent.react.js": {
    "description": "ExampleComponent is an example component.\r\nIt takes a single property, `label`, and\r\ndisplays it.",
    "methods": [],
    "props": {
      "label": {
        "type": {
          "name": "string"
        },
        "required": true,
        "description": "A label that will be printed when this component is rendered."
      }
    }
  }
}

On Linux produces:

{
  "src/components/ExampleComponent.react.js": {
    "description": "ExampleComponent is an example component.\r\nIt takes a single property, `label`, and\r\ndisplays it.",
    "methods": [],
    "props": {
      "label": {
        "type": {
          "name": "string"
        },
        "required": true,
        "description": "A label that will be printed when this component is rendered."
      }
    }
  }
}

This makes some scripts which use results of react-docgen for code generation fail. One example is plotly/dash component generator. Would you consider this is as a bug?

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 với lệnh gọi CLI của react-docgen bằng cách sử dụng src/components và lib/metadata.json, sau đó theo dõi nơi các đường dẫn thành phần được tuần tự hóa. So sánh các ví dụ trên Windows và Linux và làm cho các khóa được tạo không phụ thuộc vào nền tảng; xác minh rằng cả hai môi trường đều tạo ra cùng một cấu trúc.

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
Lĩnh vực
cli
Loại issue
Lỗi
Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
45/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.