Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions packages/cli/src/cli-command.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { CLI_NAME } from "./cli-name";

export const PRISMA_CLI_PACKAGE_NAME = "@prisma/cli";
// `next` is the RC line's canonical dist-tag (docs/oss/versioning.md);
// `latest` still serves the 3.x beta until the deliberate cutover, so a
// hint spelling `@latest` would bounce users into the pre-8 command set.
export const PRISMA_CLI_PACKAGE_SPEC = `${PRISMA_CLI_PACKAGE_NAME}@next`;
// `latest` carries the RC line since the 2026-08-25 cutover; the publish
// path no longer moves `next` (docs/oss/versioning.md).
export const PRISMA_CLI_PACKAGE_SPEC = `${PRISMA_CLI_PACKAGE_NAME}@latest`;
export const DEFAULT_PRISMA_CLI_PACKAGE_RUNNER = ["npx", "-y"];
export const PRISMA_CLI_BINARY = CLI_NAME;

Expand Down
48 changes: 48 additions & 0 deletions packages/cli/tests/cli-command.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/**
* The package spec the CLI prints in its own hints. `latest` carries the
* RC line since the 2026-08-25 cutover and the publish path no longer
* moves `next` (docs/oss/versioning.md), so a hint spelling `@next`
* installs a release that lags the current one.
*/
import { describe, expect, it } from "vitest";

import {
formatPrismaCliCommand,
PRISMA_CLI_PACKAGE_SPEC,
} from "../src/cli-command";
import { projectDeleteBlockedError } from "../src/lib/project/provider";

describe("formatPrismaCliCommand", () => {
it("runs the package from the latest dist-tag", () => {
expect(PRISMA_CLI_PACKAGE_SPEC).toBe("@prisma/cli@latest");
expect(formatPrismaCliCommand(["skills", "sync"])).toBe(
"npx -y @prisma/cli@latest skills sync",
);
});

it("keeps the spec with a detected package runner", () => {
expect(
formatPrismaCliCommand(["skills", "sync"], {
packageRunner: ["pnpm", "dlx"],
}),
).toBe("pnpm dlx @prisma/cli@latest skills sync");
});

it("uses the binary name when asked for the binary", () => {
expect(
formatPrismaCliCommand(["skills", "sync"], { invocation: "binary" }),
).toBe("prisma skills sync");
});
});

describe("projectDeleteBlockedError", () => {
it("suggests a service delete command that runs the latest package", () => {
const error = projectDeleteBlockedError("proj_1", undefined);

expect(error.nextActions).toContainEqual({
kind: "run-command",
label: "npx -y @prisma/cli@latest service delete --service <name>",
command: "npx -y @prisma/cli@latest service delete --service <name>",
});
});
});
Loading