Skip to content

composer-prisma-cloud pulls @prisma/cli-engine into every app through orm-toolchain #30437

Open

Description

@wmadden-electric

@prisma/composer-prisma-cloud (prisma/composer) lists @prisma/orm-toolchain in dependencies, because it imports config-loader and migration-tools from it. orm-toolchain peers @prisma/cli-engine at an exact version, so every application that installs composer-prisma-cloud also gets the CLI engine. ADR 0004 (prisma-cli) says product libraries carry no engine relationship at all.

Proposed fix: publish config-loader and migration-tools in a package with no engine peer, and have composer-prisma-cloud depend on that instead.

Recorded in the prisma-cli-v8 project ledger, which is being deleted at close-out: https://github.com/prisma/prisma-cli/blob/4356b361adf7044bae59aa0bc70340eda89fdad6/.drive/projects/prisma-cli-v8/deferred.md#L439

🤖 Generated with Claude Code

Activity

  1. wmadden-electric commented on Nov 23, 2026

    @wmadden-electric
    ContributorAuthor

    Evidence from real installs, gathered on 2026-11-24 while deciding whether @prisma/composer-prisma-cloud should work around this by declaring @prisma/cli-engine as a peer itself. We decided against that, because the installs below show the peer does none of the things a peer is for: it does not make the toolchain find the engine where it cannot today (Yarn), it does not change how many engine copies are installed, and it does not make a mismatched prisma fail at install. Its one effect is that Yarn's warning names the engine. The fix proposed in this issue is the one that helps.

    Versions: prisma 8.0.0-rc.35, @prisma/cli-engine 0.10.4, @prisma/orm-toolchain and @prisma/orm-postgres 8.0.0-rc.25, @prisma/composer and @prisma/composer-prisma-cloud 0.40.0. Package managers: npm 11.19.0, pnpm 10.27.0, Bun 1.3.13, Yarn 4.19.0.

    Where the engine is reached. Only the toolchain's config-loader entry reaches the engine. Its shared chunk has a static, top-level import { configSchema, defineConfigSection, reference, validateSectionWithSchema } from "@prisma/cli-engine" and calls three of them at load to build the orm config section. The migration-tools/refs, migration-tools/spaces and migration-tools/io entries that Composer also imports do not reach the engine. So an engine-free package needs a home for those four config-schema helpers, or a config loader that does not use them.

    What an app sees today. The app lists @prisma/composer, @prisma/composer-prisma-cloud, @prisma/orm-postgres and prisma. The probe imports @prisma/composer-prisma-cloud/control, which loads the toolchain's config loader.

    Package manager Engine copies Does the probe load?
    npm 1 yes
    Bun 1 yes
    pnpm, defaults 1 yes
    Yarn 4, nodeLinker: node-modules 1, under prisma no: the toolchain cannot reach the engine
    Yarn 4, Plug'n'Play 1 no: @prisma/orm-toolchain tried to access @prisma/cli-engine (a peer dependency) but it isn't provided by its ancestors

    Under Yarn the install prints only the summary YN0086: Some peer dependencies are incorrectly met by dependencies, which does not name the engine.

    What a peer on the library would change. With "@prisma/cli-engine": "0.10.4" added to the peerDependencies of a repacked @prisma/composer-prisma-cloud: nothing under npm, Bun or pnpm. Under Yarn the probe still fails; the warning becomes YN0002: … doesn't provide @prisma/cli-engine, requested by @prisma/composer-prisma-cloud.

    What makes Yarn work. The app lists @prisma/cli-engine itself. That has a side effect under Yarn and under pnpm: two engine instances. The engine peers on @prisma/management-api-sdk, prisma pins the SDK exactly (1.101.0), other ranges in the app resolve to a newer SDK (1.103.0), and both package managers make one engine instance per set of peers. Pinning @prisma/management-api-sdk in the app to the version prisma pins brings it back to one engine, shared with prisma.

    A mismatched pair is not caught at install. With prisma 8.0.0-rc.34 (engine 0.10.0) beside toolchain 8.0.0-rc.25: npm installs two engines with no warning; pnpm prints unmet peer @prisma/[email protected]: found 0.10.0, exits 0, and the rc.25 toolchain then runs on engine 0.10.0.

    The same gap applies to @prisma/orm-postgres, @prisma/orm-mongo, @prisma/orm-target-postgres and @prisma/orm-family-sql, which depend on the toolchain and do not pass its engine peer on. #30928 reports it from a user's side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions