diff --git a/compute/README.md b/compute/README.md index a5fc140c1aaa..77ee4873b2b4 100644 --- a/compute/README.md +++ b/compute/README.md @@ -1,7 +1,6 @@ # Prisma Compute examples -These examples show Prisma ORM apps deployed to Prisma Compute with the -latest `@prisma/cli`. +These examples show Prisma ORM apps deployed to Prisma Compute. | Example | Description | | --- | --- | @@ -12,5 +11,8 @@ latest `@prisma/cli`. Each example includes Prisma ORM, a PostgreSQL schema, seed data, and scripts for local development and Prisma Compute deployment. -The Compute scripts call `bunx @prisma/cli@latest` directly, so the examples do -not pin or install the Prisma CLI. +The Compute scripts call `bunx @prisma/cli@next` directly, so the examples do +not pin or install the Prisma CLI. They use `@next` because these examples +target the Prisma 8 release candidate, while the `latest` npm tag still points +at the earlier 3.x beta CLI with a different command set. When Prisma 8 reaches +general availability, the `@next` references will switch to `@latest`. diff --git a/compute/hono/README.md b/compute/hono/README.md index e6c6f25861a7..87d1ef98af11 100644 --- a/compute/hono/README.md +++ b/compute/hono/README.md @@ -1,7 +1,7 @@ # Prisma Compute Hono example This is a small Hono API that uses Prisma ORM with PostgreSQL and deploys to -Prisma Compute with the latest `@prisma/cli`. +Prisma Compute with `@prisma/cli@next` (Prisma 8 release candidate). ## Run locally @@ -26,16 +26,22 @@ available at [http://localhost:8080/api/users](http://localhost:8080/api/users). ## Deploy to Prisma Compute -Deploy the app. The script passes `.env` to Prisma Compute, so the deployed app -uses the same seeded database. +Connect this repository to a Prisma Compute project. Every push to the +connected branch then builds and deploys automatically. ```bash -bun run compute:deploy +bun run compute:connect ``` -After a successful deploy, inspect the app with: +After connecting, open the running service with: ```bash bun run compute:open -bun run compute:logs +``` + +Each push creates a build. To stream the full build log, copy the build ID +from the GitHub check run and run: + +```bash +npx -y @prisma/cli@next build logs ``` diff --git a/compute/hono/package.json b/compute/hono/package.json index 0df9636f9d4a..7cb5225d2075 100644 --- a/compute/hono/package.json +++ b/compute/hono/package.json @@ -10,11 +10,10 @@ "db:generate": "prisma generate", "db:migrate": "prisma migrate dev", "db:seed": "prisma db seed", - "compute:login": "bunx @prisma/cli@latest auth login", - "compute:database:create": "bunx @prisma/cli@latest database create prisma-compute-hono --branch main", - "compute:deploy": "bunx @prisma/cli@latest app deploy --env .env", - "compute:open": "bunx @prisma/cli@latest app open", - "compute:logs": "bunx @prisma/cli@latest app logs" + "compute:login": "bunx @prisma/cli@next auth login", + "compute:database:create": "bunx @prisma/cli@next postgres create prisma-compute-hono --branch main", + "compute:connect": "bunx @prisma/cli@next git connect", + "compute:open": "bunx @prisma/cli@next service open" }, "dependencies": { "@hono/node-server": "2.0.4", diff --git a/compute/nextjs/README.md b/compute/nextjs/README.md index ef0fadff208d..3f71bdc464d2 100644 --- a/compute/nextjs/README.md +++ b/compute/nextjs/README.md @@ -1,7 +1,7 @@ # Prisma Compute Next.js example This is a Next.js App Router app that uses Prisma ORM with PostgreSQL and -deploys to Prisma Compute with the latest `@prisma/cli`. +deploys to Prisma Compute with `@prisma/cli@next` (Prisma 8 release candidate). The app sets `output: "standalone"` in `next.config.ts`, which is the output shape Prisma Compute expects for Next.js. @@ -29,16 +29,22 @@ available at [http://localhost:3000/api/users](http://localhost:3000/api/users). ## Deploy to Prisma Compute -Deploy the app. The script passes `.env` to Prisma Compute, so the deployed app -uses the same seeded database. +Connect this repository to a Prisma Compute project. Every push to the +connected branch then builds and deploys automatically. ```bash -bun run compute:deploy +bun run compute:connect ``` -After a successful deploy, inspect the app with: +After connecting, open the running service with: ```bash bun run compute:open -bun run compute:logs +``` + +Each push creates a build. To stream the full build log, copy the build ID +from the GitHub check run and run: + +```bash +npx -y @prisma/cli@next build logs ``` diff --git a/compute/nextjs/package.json b/compute/nextjs/package.json index 0e95eb16ed50..456787d6f882 100644 --- a/compute/nextjs/package.json +++ b/compute/nextjs/package.json @@ -10,11 +10,10 @@ "db:generate": "prisma generate", "db:migrate": "prisma migrate dev", "db:seed": "prisma db seed", - "compute:login": "bunx @prisma/cli@latest auth login", - "compute:database:create": "bunx @prisma/cli@latest database create prisma-compute-nextjs --branch main", - "compute:deploy": "bunx @prisma/cli@latest app deploy --env .env", - "compute:open": "bunx @prisma/cli@latest app open", - "compute:logs": "bunx @prisma/cli@latest app logs" + "compute:login": "bunx @prisma/cli@next auth login", + "compute:database:create": "bunx @prisma/cli@next postgres create prisma-compute-nextjs --branch main", + "compute:connect": "bunx @prisma/cli@next git connect", + "compute:open": "bunx @prisma/cli@next service open" }, "dependencies": { "@prisma/adapter-pg": "7.8.0", diff --git a/compute/tanstack-start/README.md b/compute/tanstack-start/README.md index 2b9fdcae05c2..919f83db5283 100644 --- a/compute/tanstack-start/README.md +++ b/compute/tanstack-start/README.md @@ -1,7 +1,7 @@ # Prisma Compute TanStack Start example This is a TanStack Start app that uses Prisma ORM with PostgreSQL and deploys to -Prisma Compute with the latest `@prisma/cli`. +Prisma Compute with `@prisma/cli@next` (Prisma 8 release candidate). The app uses the Nitro Vite plugin so `vite build` emits the `.output/server` shape supported by Prisma Compute. @@ -29,16 +29,22 @@ available at [http://localhost:3000/api/users](http://localhost:3000/api/users). ## Deploy to Prisma Compute -Deploy the app. The script passes `.env` to Prisma Compute, so the deployed app -uses the same seeded database. +Connect this repository to a Prisma Compute project. Every push to the +connected branch then builds and deploys automatically. ```bash -bun run compute:deploy +bun run compute:connect ``` -After a successful deploy, inspect the app with: +After connecting, open the running service with: ```bash bun run compute:open -bun run compute:logs +``` + +Each push creates a build. To stream the full build log, copy the build ID +from the GitHub check run and run: + +```bash +npx -y @prisma/cli@next build logs ``` diff --git a/compute/tanstack-start/package.json b/compute/tanstack-start/package.json index 100b95bbf12e..372569c167f4 100644 --- a/compute/tanstack-start/package.json +++ b/compute/tanstack-start/package.json @@ -13,11 +13,10 @@ "db:generate": "prisma generate", "db:migrate": "prisma migrate dev", "db:seed": "prisma db seed", - "compute:login": "bunx @prisma/cli@latest auth login", - "compute:database:create": "bunx @prisma/cli@latest database create prisma-compute-tanstack-start --branch main", - "compute:deploy": "bunx @prisma/cli@latest app deploy --env .env", - "compute:open": "bunx @prisma/cli@latest app open", - "compute:logs": "bunx @prisma/cli@latest app logs" + "compute:login": "bunx @prisma/cli@next auth login", + "compute:database:create": "bunx @prisma/cli@next postgres create prisma-compute-tanstack-start --branch main", + "compute:connect": "bunx @prisma/cli@next git connect", + "compute:open": "bunx @prisma/cli@next service open" }, "dependencies": { "@prisma/adapter-pg": "7.8.0", diff --git a/tests/compute.test.ts b/tests/compute.test.ts index d9583b7ce23a..8edb00dca0bf 100644 --- a/tests/compute.test.ts +++ b/tests/compute.test.ts @@ -91,9 +91,9 @@ describe('Prisma Compute examples', () => { const computeScripts = Object.entries(packageJson.scripts ?? {}).filter( ([name]) => name.startsWith('compute:'), ) - expect(computeScripts).toHaveLength(5) + expect(computeScripts).toHaveLength(4) for (const [, command] of computeScripts) { - expect(command).toMatch(/^bunx @prisma\/cli@latest /) + expect(command).toMatch(/^bunx @prisma\/cli@next /) } await execa(