Skip to content

Commit 9012eb8

Browse files
docs: describe the Prisma CLI's second-copy check on the versioning page (#9034)
* docs(versioning): the Prisma CLI runs ORM commands only with the project's own copy of the ORM packages Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io> * docs(versioning): the CLI depends on the ORM toolchain; it does not always run its own copy Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io> * docs(versioning): name the prisma release that first checks for a second copy Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io> * docs: Composer commands also check @prisma/composer; the ORM error reference names prisma 8.0.0-rc.37 Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io> * docs(versioning): the check applies when the project has its own copy, and also refuses one version installed twice Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io> * docs: leave the generated ORM error reference to its generator Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io> * docs(versioning): matching versions normally share one copy; the error names each package that differs Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io> --------- Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
1 parent bf97da7 commit 9012eb8

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎apps/docs/content/docs/(index)/versioning-and-support.mdx‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,12 @@ The Prisma ORM commands, such as `prisma db migrate`, come from `@prisma/orm-too
6767

6868
### Prisma CLI
6969

70-
The [Prisma CLI](/cli) is the `prisma` package. It runs three sets of commands: the Prisma ORM commands, such as `prisma db migrate`, from the copy of `@prisma/orm-toolchain` it includes; the Prisma Composer commands, such as `prisma dev` and `prisma deploy`, from `@prisma/composer-cli`; and its own commands for Prisma's hosted services, such as `prisma postgres`. The first two have the level of the package they come from. The CLI's own commands do not have maturity levels yet.
70+
The [Prisma CLI](/cli) is the `prisma` package. It runs three sets of commands: the Prisma ORM commands, such as `prisma db migrate`, from `@prisma/orm-toolchain`, a package it depends on at one exact version; the Prisma Composer commands, such as `prisma dev` and `prisma deploy`, from `@prisma/composer-cli`; and its own commands for Prisma's hosted services, such as `prisma postgres`. The first two have the level of the package they come from. The CLI's own commands do not have maturity levels yet.
7171

7272
The CLI is published as release candidates today, numbered `8.0.0-rc.N` like Prisma ORM's but counted on their own, so a CLI version does not tell you which Prisma ORM release it includes. Like Prisma ORM's, they are test builds, not the Release Candidate level. Each one may contain breaking changes, including to how it runs the Prisma ORM commands, how it loads `prisma.config.ts`, and the commands' `--json` output and error codes, and only the newest one gets fixes.
7373

74+
When your project has its own copy of the Prisma ORM packages, the CLI runs a Prisma ORM command only with that copy. Your project lists `@prisma/orm-toolchain` and `@prisma/orm-framework` in its `package.json`, and the CLI depends on them too. When `prisma` is installed in your project and uses the same Prisma ORM version as your project, your package manager normally installs one copy for both, and the commands run. Since `prisma` 8.0.0-rc.37, when they are two separate copies, the command stops with the error [`CLI.SECOND_PACKAGE_COPY`](/cli/error-reference#CLI.SECOND_PACKAGE_COPY) before it reads your configuration. That happens when you run a globally installed `prisma` in a project that has the Prisma ORM packages, when the `prisma` in your project uses a different Prisma ORM version from the project's own, and when your package manager installs one version twice. The error names each package that differs, with both versions and both locations, and says what to do. So install `prisma` in your project, and update it together with your Prisma ORM packages. The Prisma Composer commands also check `@prisma/composer` in the same way.
75+
7476
### Prisma Composer
7577

7678
[Prisma Composer](/composer) is a TypeScript framework for describing an application's services and the resources they use, and deploying them. It is in early access, and its packages, such as `@prisma/composer`, do not have a level under this policy yet. Their versions are `0.x` today, such as `0.40.0`, and any release may break them. Only the newest release gets fixes.
@@ -82,7 +84,7 @@ Everything the reference documentation describes is public and covered by this p
8284
- **Your code.** Code that compiles against one release compiles against every later one, and what the reference documentation says it does stays the same.
8385
- **Your files.** Your configuration and your Prisma ORM contract, which describes your models, keep working: what the reference documentation says one release accepts, every later release accepts.
8486
- **What Prisma ORM stores.** Every later release reads the files Prisma ORM generated, your migration files, and the tables Prisma ORM keeps in your database. You never regenerate anything after an upgrade. Sometimes a newer release writes one of these files or tables in a newer format. If a teammate upgrades and that happens, you need to upgrade too: an older version stops with an error and changes nothing.
85-
- **Commands.** A command or flag of a GA package that works in one release works in every later one, and so do its error codes and output meant for programs, such as `--json`. You run the Prisma ORM commands, and load your configuration, through the Prisma CLI, which does not follow this policy yet: see [Prisma CLI](#prisma-cli) for what its release candidates may still change.
87+
- **Commands.** A command or flag of a GA package that works in one release works in every later one, and so do its error codes and output meant for programs, such as `--json`. You run the Prisma ORM commands, and load your configuration, through the Prisma CLI, which does not follow this policy yet: see [Prisma CLI](#prisma-cli) for what its release candidates may still change. When your project has its own copy of the Prisma ORM packages, the CLI runs these commands only with that copy, so update `prisma` and your Prisma ORM packages together.
8688
- **Nothing GA is removed.** When we replace an API, the old one stays, marked deprecated, until the next major version. Your editor shows it struck through and names the replacement.
8789

8890
New features can appear in any release. When we add a property or method to an interface that your extension implements, we make it optional, so your extension still compiles. A new error code can appear at any time, so give a `switch` over error codes a `default` branch. A new built-in name in a Prisma ORM contract never changes the meaning of a name you defined: if a release adds a built-in type named `Vector`, your own model named `Vector` still means your model.

0 commit comments

Comments
 (0)