[Feature]: Capacitor config "includePlugins" should support paths.

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

Maintainer thường phản hồi trong vòng 1 ngày

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

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
45/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
android, ios, typescript
Lĩnh vực
mobile-dev

Hướng nghiên cứu

Bắt đầu bằng cách theo dõi cách các mục includePlugins được phân tích cú pháp và ghi vào Podfile của iOS cũng như cấu hình dự án Android. So sánh các mục đường dẫn với các mục tên plugin; được xem là hoàn thành khi các đường dẫn tạo ra đúng tên plugin và đường dẫn trên cả hai nền tảng mà không làm hỏng hỗ trợ hiện có cho tên plugin.

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

Mô tả

triage
Description

Currently the includePlugins property only supports plugin names. If you pass in a path, the string is parsed incorrectly when it's added to the android & ios projects.

Platforms
  • iOS
  • Android
  • Web
Request or proposed solution

For example, currently in capcitor.config:

...
includePlugins: [
"./../../node_modules/@capacitor-community/file-opener",
]
...

Gets added to the Podfile as:

pod '._.._..NodeModulesCapacitorCommunityFileOpener', :path => '../../../../node_modules/@capacitor-community/file-opener'

When it should be added as::

pod 'CapacitorCommunityFileOpener', :path => '../../../../node_modules/@capacitor-community/file-opener'

A similar parsing issue is present on android.

Either this is a bug or the includePlugins array was never designed to handle paths.

For mono-repos this would be very useful as the capacitor project is stored in a separate folder as all our node_modules deps.

Alternatives

For mono-repos that rely on storing node_modules deps separately from a capacitor project, there is another approach detailed here: https://jorgevergara.co/blog/capacitor-monorepo/. However this approach doesn't currently work with some of the newest capacitor plugins as outlined in this bug: https://github.com/ionic-team/capacitor-file-viewer/issues/3.

Ngôn ngữ chính
TypeScript
Star
17.1k
Fork
1.3k
Merge trung bình
1 ngày 22 giờ
Pull request đã merge (30 ngày)
26

Chuẩn bị môi trường

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.

Issue khác của ionic-team/capacitor

Tất cả issue của ionic-team/capacitor

Issue tương tự

Thêm issue về TypeScript

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.