You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Config evaluation works through pnpm symlink layouts; engine 0.2.1 (#222)
## What
Any project whose `node_modules` reaches `@prisma/cli-engine` through a
pnpm symlink that is not realpath'd — this repo's own dev checkout, and
any install with `hoist=false` in `.npmrc` — cannot evaluate any
`prisma.config.ts`: every config-reading command fails with
`CLI.CONFIG_UNREADABLE` / `Cannot find package 'pathe' imported from
.../cli-engine/node_modules/c12/dist/index.mjs`. npm and default-pnpm
installs are unaffected.
**Why:** the engine loads c12 lazily with a bare `await import("c12")`.
When that specifier resolves through a symlink without realpathing,
c12's own `import "pathe"` walks up from the symlink path and misses
c12's store siblings.
## Changes
- **The fix:** the engine imports c12 through its real path
(`import.meta.resolve` → `realpathSync` → `pathToFileURL`). Evaluation
errors still surface as the existing unreadable-config diagnostic.
- **Import purity:** the module lexer cannot see `import.meta.resolve`,
so the engine's conformance subjects excuse c12 explicitly via
`allowedUnimported: ["c12"]` (conformance script ×2, engine conformance
test). The tarball check gains the per-package `allowedUnimported`
field.
- **Engine 0.2.1** (`pnpm bump-cli-engine-version patch`): the changed
engine must ship under a new version. The registry families still peer
0.2.0, so the tarball check carries two recorded transition exceptions;
the follow-up PR that pins the families' 0.2.1-peering releases removes
them (same train as the 0.2.0 transition, #200 → #207).
- The deferred ledger entry tracking this defect is removed.
## Verification
- Dev-layout A/B: with a marked `prisma.config.ts` in a scratch dir,
`node packages/cli/dist/cli.js migration list` built from main fails
with the pathe error; built from this branch it evaluates the config
(remaining error is the expected absent-`orm`-section complaint).
- Packed `@prisma/cli` + engine tarballs installed with pnpm and
`hoist=false`: config evaluates — the previously broken published shape.
- `pnpm run conformance` (packages/cli): **0 failing, 3 allowed** (the
recorded transition mismatches), 5 subjects.
- Engine suite 819 passed; CLI suite 831 passed; conformance package
tests 59 passed; credential-free e2e passed; `check-engine-version.mjs
origin/main`: 0.2.1 consistent; typecheck and grammar green.
## After merge
1. main's publish run ships `@prisma/cli-engine@0.2.1`.
2. prisma/composer and prisma/prisma release `@prisma/composer-cli` and
`@prisma/orm-toolchain` peering 0.2.1.
3. A follow-up PR here pins those releases and empties the exception
list.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
Copy file name to clipboardExpand all lines: .drive/projects/prisma-cli-v8/deferred.md
-1Lines changed: 0 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -93,7 +93,6 @@ composer can use it.
93
93
Running the shipped `prisma` binary against a scratch directory, rather than the ORM family through the test harness, turns up three things. The first is a defect a user hits on their first command.
94
94
95
95
- **`prisma orm init` scaffolds a project the `prisma` binary cannot read.** It writes `prisma-next.config.ts` — the standalone `prisma-next` bin's config file — and then fails its own last step, `Emit the contract`, with exit 5 and `Config is not a defineConfig result`. Nine files are already on disk at that point. Running any ORM command afterwards fails again, differently: the mounted family reads its configuration from an `orm` section of `prisma.config.ts` (`ormConfigSection`, `packages/1-framework/3-tooling/cli/src/orm/config-section.ts` in prisma/prisma), so it reports `CLI.CONFIG_SECTION_INVALID` and `CONFIG.FILE_NOT_FOUND` — "The orm config section is absent, so prisma-next.config.ts was never evaluated." So `prisma orm init && prisma contract emit` cannot work, and the two config surfaces have different shapes: the section nests the whole config under `orm`, while the scaffolded file exports a `defineConfig` result. Which side moves is the ORM's call; that it is broken today is not in question.
96
-
-**Loading a hand-written `prisma.config.ts` failed with `Cannot find package 'pathe'`**, imported by `c12` from `packages/cli-engine/node_modules/c12`. `c12` declares `pathe` and the package is in the workspace store, so this is probably a pnpm layout artifact of running the built binary from inside the monorepo rather than a shipping defect — **but it is unverified**, and if it does reproduce from a packed tarball then every command that reads a config file is broken on install. Worth one run of the S6 tarball check with a config file present.
97
96
-**The e2e coverage convention excludes all 22 ORM commands on reasoning #171 disproved.**`tests/e2e-coverage.test.ts` excuses them with "Real e2e lives in prisma/prisma (R7); the shell proves composition in orm-mount.test.ts (R8)." prisma/prisma's suite passed throughout the presentations change while the assembled binary exited 2, and `orm-mount.test.ts` proves composition for exactly one command, `migration list`, not per family. The operator's ruling (2026-08-13) is that every mounted command needs a happy path in this repo, precisely because the product repos cannot reproduce the assembled CLI. The exclusion should become a backlog entry once the first item above is fixed and the commands can run at all.
98
97
99
98
## A live bug carried out of the port (found closing PR #92, 2026-08-12)
0 commit comments