Commit 7833e62
feat(cli): migrate Compute commands to the App/Deployment surface (#99)
**M6 client migration for `@prisma/cli`**
([PRS-90](https://linear.app/prisma-company/issue/PRS-90)). Points the
CLI at the renamed `@prisma/compute-sdk@0.30.0` and the new `/v1/apps` +
`/v1/deployments` Management API surface (both already shipped +
deployed). Compile-only / behavior-preserving — the CLI's user-facing
`compute app` / `compute deployment` commands and help text are
unchanged.
## What changed
**1. compute-SDK call sites → App/Deployment**
`showService`→`showApp`, `listServices`→`listApps`,
`createService`→`createApp`, `listVersions`→`listDeployments`,
`showVersion`→`showDeployment` (+ start/stop/delete/destroy); option
keys `serviceId`→`appId`, `versionId`→`deploymentId`,
`serviceName`→`appName`; response fields `.appEndpointDomain` /
`.latestDeploymentId` / `.deploymentId` / `.previous*`; the progress
callbacks the CLI implements (`onVersionCreated`→`onDeploymentCreated`,
`selectService`→`selectApp`, …); and the SDK error/domain types
(`ServiceInfo`→`AppInfo`,
`NoExistingVersionError`→`NoExistingDeploymentError`, …).
**2. Raw Management API calls → `/v1/apps`**
The CLI also makes raw HTTP calls (outside the SDK) for app
reads/domains. Repointed `GET /v1/compute-services` → `GET /v1/apps`,
`GET/POST /v1/compute-services/:id/domains` → `/v1/apps/:appId/domains`,
`POST /v1/compute-services` → `POST /v1/apps`; `RawComputeServiceRecord`
→ `RawAppRecord` (`latestVersionId`→`latestDeploymentId`,
`serviceEndpointDomain`→`appEndpointDomain`, `type: "app"`).
**3. Dependencies**
- `@prisma/compute-sdk` → `0.30.0` (the renamed SDK).
- `@prisma/management-api-sdk` → `^1.44.0` (first version exposing
`/v1/apps` typed paths; also satisfies the compute-sdk peer).
- `minimumReleaseAgeExclude`: **package-level** exempts for
`@prisma/compute-sdk` and `@prisma/management-api-sdk` (our own internal
packages; version-pinned exempts aren't honored by pnpm's lockfile
supply-chain check).
## Validation
| Gate | Result |
| --- | --- |
| `pnpm --recursive exec tsc --noEmit` | ✅ 0 errors (was 38) |
| `pnpm --recursive test` (vitest) | ✅ 531 passed (cli 523 / compute 8)
|
| `pnpm exec biome ci .` | ✅ exit 0 |
| supply-chain (lockfile) | ✅ passes |
`grep -rE
"/v1/compute-services|showService|listServices|latestVersionId|serviceEndpointDomain"
packages/cli/src` → no SDK/old-surface leftovers.
## Note
Implemented by sub-agents against a precise spec; I independently re-ran
every gate and hardened the min-age exempt before opening. Companion PR:
**build-runner** (pdp-control-plane) bumps the same SDK next.
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>1 parent 3a25c73 commit 7833e62
9 files changed
Lines changed: 154 additions & 155 deletions
File tree
- packages/cli
- src
- controllers
- lib/app
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4656 | 4656 | | |
4657 | 4657 | | |
4658 | 4658 | | |
4659 | | - | |
| 4659 | + | |
4660 | 4660 | | |
4661 | 4661 | | |
4662 | | - | |
| 4662 | + | |
4663 | 4663 | | |
4664 | 4664 | | |
4665 | 4665 | | |
| |||
4689 | 4689 | | |
4690 | 4690 | | |
4691 | 4691 | | |
4692 | | - | |
4693 | | - | |
| 4692 | + | |
| 4693 | + | |
4694 | 4694 | | |
4695 | 4695 | | |
4696 | 4696 | | |
| |||
4702 | 4702 | | |
4703 | 4703 | | |
4704 | 4704 | | |
4705 | | - | |
| 4705 | + | |
4706 | 4706 | | |
4707 | 4707 | | |
4708 | 4708 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | | - | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
| 17 | + | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | | - | |
33 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
0 commit comments