Add new "common" schematic to share configurations for all schematics at once

Đang mở
#33,221 1 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ó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
typescript
Lĩnh vực
cli

Hướng nghiên cứu

Bắt đầu với lệnh generate và đường dẫn phân giải cấu hình schematic. So sánh cấu hình chung được đề xuất với cấu hình hiện tại theo từng artifact, sau đó xác định cách áp dụng các giá trị chung và cách các giá trị trực tiếp của artifact ghi đè chúng. Hoàn tất khi các schematic có thể kế thừa các giá trị mặc định dùng chung mà vẫn giữ các giá trị ghi đè theo từng artifact.

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

Mô tả

area: @angular-devkit/schematics gemini-triaged
Command

generate

Description

Implement an internal artifact to commonize the configuration of schematics so that all schematics can share a common configuration by default, and override on a per-artifact basis if needed. Currently, all configurations are duplicated, and while not that annoying to deal with for a single collection, it can quickly add up when using several collections.

Describe the solution you'd like

Actual :

{
  "schematics": {
    "@schematics/angular:component": { "skipSelector": true },
    "@schematics/angular:directive": { "skipSelector": true },
    "@schematics/angular:pipe": { "skipSelector": true }
  }
}

Proposed :

{
  "schematics": {
    "@schematics/angular:common": { "skipSelector": true }
  }
}

This new common schematic would contain either

  • only fields that are common to all artifacts
  • All fields possible, even if not applicable to certain artifacts

Resolving would follow this pattern :

  • Look for common artifact schematic value
  • If existing, apply value
    • If all fields are possible : also check if value is applicable to artifact
  • Look for direct artifact schematic value
  • Override value
Describe alternatives you've considered

Doing it by hand as already done today is the only solution

Ngôn ngữ chính
TypeScript
Star
27k
Fork
11.8k
Merge trung bình
1 ngày 2 giờ
Pull request đã merge (30 ngày)
225

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 angular/angular-cli

Tất cả issue của angular/angular-cli

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.