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

Offen
#318 1 Kommentar 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
35/100
Issue-Typ
Refactoring
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
docker, typescript

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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).

Vorherrschende Sprache
TypeScript
Sterne
26
Forks
4
Ø Merge
12 Std. 11 Min.
Gemergte PRs (30 T.)
38

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus prisma/prisma-cli

Alle Issues in prisma/prisma-cli

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.