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

Open
#318 1 comment 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Active
Tech stack
docker, typescript

Research direction

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.

Written by the indexing model from the issue text.

Description

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

Dominant language
TypeScript
Stars
26
Forks
4
Avg merge
12h 11m
Merged PRs (30d)
38

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from prisma/prisma-cli

All issues in prisma/prisma-cli

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.