Commit 9458ee3
committed
feat: typed prisma.compute.ts compute config
Adds a typed, committed deploy configuration for Prisma Compute and makes
the whole app command surface config-aware.
Config:
- prisma.compute.ts (.mts/.js/.mjs/.cjs) with defineComputeConfig from the
new @prisma/cli/config export; single `app` or multi-target `apps` with
name, root, framework, entry, httpPort, env, and build per app
- compile-time safety (literal unions, app/apps exclusivity, typo
suggestions) plus runtime validation reporting every issue at once
- loaded via jiti with an alias so configs resolve @prisma/cli/config even
when the package is not installed locally
Resolution:
- upward discovery from cwd to the source root (.git/workspace markers);
nearest config wins and discovery never escapes the repository
- the config directory is the project directory: local pin, state cache,
and the --db schema scan anchor there; config-relative paths (root,
env.file) resolve from the config file
- target inference: commands run inside a target's root select it
- app selection precedence: --app > PRISMA_APP_ID > config target >
remembered selection > inference
Command surface:
- app deploy/build/run and every management command (show, open, logs,
list-deploys, promote, rollback, remove, domain *) accept an [app]
target argument
- bare app deploy with a multi-app config deploys every target in
declaration order, fail-fast with already-live/not-attempted reporting;
per-app flags are rejected in deploy-all
- run/build share deploy's framework detection (one detection, three
commands), driven by a framework capability registry that replaces
scattered framework literals
Build settings:
- the config build block owns build settings; otherwise they are inferred
with sources shown; prisma.app.json is no longer read or written -
leftover matching files warn, customized files fail with
BUILD_SETTINGS_MIGRATION_REQUIRED including the exact build block
- workspace builds: package-manager detection walks up to the workspace
root, ancestor node_modules/.bin dirs join the build PATH, and Next.js
standalone staging flattens bun's isolated store alongside pnpm's
Database (--db flag flow, no config surface in this PR):
- provision-only: deploy creates the branch database and wires
DATABASE_URL/DIRECT_URL but never runs schema, migration, or generate
commands; it suggests the detected command and a one-time connection URL
via database connection create instead
Packaging:
- exports map with ./config (+ d.ts), jiti dependency, publish-prep now
carries exports into the published manifest
Spec updated across command-spec, resource-model, output- and
error-conventions. 462 tests.1 parent ee7c648 commit 9458ee3
37 files changed
Lines changed: 3298 additions & 1103 deletions
File tree
- docs/product
- packages/cli
- src
- commands/app
- controllers
- lib
- app
- fs
- project
- presenters
- shell
- types
- tests
- helpers
- scripts
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
226 | | - | |
| 226 | + | |
| 227 | + | |
227 | 228 | | |
228 | 229 | | |
229 | 230 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
338 | 338 | | |
339 | 339 | | |
340 | 340 | | |
341 | | - | |
| 341 | + | |
342 | 342 | | |
343 | 343 | | |
344 | 344 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
| 107 | + | |
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
9 | 16 | | |
10 | 17 | | |
11 | 18 | | |
| |||
49 | 56 | | |
50 | 57 | | |
51 | 58 | | |
| 59 | + | |
52 | 60 | | |
53 | 61 | | |
54 | 62 | | |
| |||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
0 commit comments