prisma CLI: make @prisma/composer-cli optional — ORM-only projects install ~200 extra packages (~0.9 GB)

Đang mở
#318 1 bình luận 1 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ái cấu trúc
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
docker, typescript

Hướng nghiên cứu

Start by inspecting the prisma package dependency declaration and the CLI entry points for deploy, dev, project, git, and service. Compare install behavior for the ORM workflows against the platform commands, then verify that ORM-only installs no longer bring in Composer while those platform commands still work.

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

Mô tả

Versions: [email protected], @prisma/[email protected], pnpm 12.5.1, macOS arm64.

What happens. prisma has @prisma/composer-cli in dependencies, so every project that uses the CLI only for ORM workflows (contract emit, migration plan, db migrate, db verify) installs Composer and its whole deploy toolchain. In our pnpm monorepo:

  • 214 of the app's 727 packages are reachable only through @prisma/composer-cli;
  • they take ~0.9 GB of a 2.2 GB store. The largest are alchemy (216 MB), @distilled.cloud/aws (205 MB), @cloudflare/workerd-* (144 MB), @distilled.cloud/cloudflare (104 MB) and effect (52 MB);
  • the build scripts of workerd/sharp have to be reviewed in allowBuilds, since pnpm fails the install otherwise;
  • Composer's fresh releases need minimumReleaseAgeExclude entries;
  • it brings effect rc peer mismatches (see also prisma/orm#30257).

Production images are not affected when built with --prod, but dev machines, CI and Docker build stages pay the cost.

Request. Keep prisma lean for ORM use:

  1. make @prisma/composer-cli an optional or peer dependency that is installed on first use of deploy/dev/project/git/service, or
  2. ship the platform commands as a separate package.

Related: prisma/orm#30242 (CLI dependency weight in tests), prisma/orm#30437 (Composer ↔ engine coupling).

Ngôn ngữ chính
TypeScript
Star
26
Fork
4
Merge trung bình
12 giờ 11 phút
Pull request đã merge (30 ngày)
38

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

Tất cả issue của prisma/prisma-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.