Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Move Schematic dependencies to `peerDependencies` or `devDependencies`

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

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

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
52/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
angular, typescript
Lĩnh vực
build-system, security

Hướng nghiên cứu

Bắt đầu với src/package.json và kiểm tra các tham chiếu bên dưới src/schematics và tools/ để xác định các tác vụ build-time đó yêu cầu cách bố trí dependency nào. Chạy pnpm production dependency check đã được báo cáo và sử dụng pm why picomatch để so sánh production graph. Được xem là hoàn tất khi các gói schematic không còn được 포함 trong production dependencies và các tác vụ tạo mã cục bộ bắt buộc vẫn hoạt động.

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

Mô tả

Description

In src/package.json, @schematics/angular and @angular-devkit/schematics are currently listed under dependencies. Since these packages are only utilized for build-time tasks and schematic generation (found in src/schematics and tools/), they should not be included in production bundles.

Including them in dependencies causes unnecessary bloat and, more critically, pulls in downstream vulnerabilities that wouldn't otherwise affect the production environment.

Current Configuration
  "dependencies": {
    "firebase": "^12.4.0",
    "rxfire": "^6.1.0",
    "@angular-devkit/schematics": "^21.0.0", // Move or Remove
    "@schematics/angular": "^21.0.0",        // Move or Remove
    "tslib": "^2.3.0"
  },
Impact: Dependency Vulnerability

This misconfiguration currently introduces a vulnerability via picomatch, which is a sub-dependency of the Angular devkit. Running a production-only dependency check confirms these are being pulled into the prod graph:

❯ pm why picomatch --prod
Using pnpm
picomatch@4.0.3
├─┬ @angular-devkit/core@21.2.0
│ ├─┬ @angular-devkit/schematics@21.2.0
│ │ └─┬ @schematics/angular@21.2.0
│ │   └─┬ @angular/fire@21.0.0-rc.0
│ │     └── @my-project/source@0.0.0 (dependencies)
│ └── @schematics/angular@21.2.0 [deduped]
└─┬ @angular-devkit/core@21.2.2
  └─┬ @angular-devkit/schematics@21.2.2
    └── @angular/fire@21.0.0-rc.0 [deduped]

Found 1 version of picomatch
Proposed Solution
  1. Remove @schematics/angular and @angular-devkit/schematics if they are only needed for generating code in local development. Any Angular project will have them.
  2. Alternatively, move them to peerDependencies (marked as optional if necessary).
Ngôn ngữ chính
TypeScript
Star
7.8k
Fork
2.2k
Merge trung bình
3 ngày 6 giờ
Pull request đã merge (30 ngày)
5

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.

Issue khác của angular/angularfire

Tất cả issue của angular/angularfire

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.