Skip to content
Merged
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
10 changes: 6 additions & 4 deletions compute/README.md
Original file line number Diff line number Diff line change
@@ -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 |
| --- | --- |
Expand All @@ -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`.
18 changes: 12 additions & 6 deletions compute/hono/README.md
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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 <build-id>
```
9 changes: 4 additions & 5 deletions compute/hono/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Comment thread
coderabbitai[bot] marked this conversation as resolved.
},
"dependencies": {
"@hono/node-server": "2.0.4",
Expand Down
18 changes: 12 additions & 6 deletions compute/nextjs/README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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 <build-id>
```
9 changes: 4 additions & 5 deletions compute/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
18 changes: 12 additions & 6 deletions compute/tanstack-start/README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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 <build-id>
```
9 changes: 4 additions & 5 deletions compute/tanstack-start/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions tests/compute.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Loading