CodeVetter · Repo Unpack · System map
prisma/prisma
The repo is a pnpm/Turbo workspace that requires Node >=24. Framework code lives under packages/1-framework, SQL and Mongo families under packages/2-*, concrete adapters under packages/3-targets and packages/3-mongo-target, and user-facing facades under packages/3-extensions with publishable shells in packages/9-public/@prisma. architecture.config.json assigns every glob a domain, layer, and plane; dependency-cruiser enforces those edges. The in-repo prisma binary is a stand-in that mounts the ORM command family; the published host is the separate prisma-cli repo. Local Postgres is docker-compose on port 5433; CI and npm publish run from GitHub Actions.
- The workspace root is the private package @internal/monorepo version 8.0.0-rc.11, with packageManager pnpm@10.27.0 and engines.node >=24. pnpm build delegates to turbo run build; pnpm test:all chains test:packages, test:examples, test:integration, and test:e2e.
- pnpm-workspace.yaml includes packages/**, examples/*, apps/*, and test/**, excludes **/dist-*, and pins a catalog (typescript 5.9.3, vitest 5.0.0-rc.2, arktype ^2.2.2, pg 8.22.0, vite 8.1.4). minimumReleaseAge is 1440 minutes, with explicit exclusions for @prisma/dev and prisma@7.10.0; trustPolicy is no-downgrade.
- architecture.config.json maps globs to domain, layer, and plane. Framework-components splits shared, migration (src/control, exports/control.ts, exports/emission.ts), and runtime (src/execution, exports/runtime.ts). pnpm lint:deps runs dependency-cruiser plus lint-framework-target-imports, lint-app-space-id, and lint-single-import-root.
- Cross-plane rule: migration must not import runtime; runtime may import migration only for artifacts; shared may be imported from either plane. Overlapping globs resolve most-specific-wins so src/core/migrations/** is migration even when src/core/** is shared.
- Documented domains are Framework (packages/framework in the overview; on disk packages/1-framework), SQL family, Targets, and Extensions. Named internal packages include @internal/contract, @internal/emitter, @internal/cli, @internal/sql-runtime, @internal/adapter-postgres, @internal/driver-postgres, and @internal/postgres.
- Two planes share contract.json: the control plane authors, plans, and applies contract changes; the execution plane compiles DSL/ORM/raw/TypedSQL plans. Both check storageHash and profileHash against a database marker and an append-only ledger.
- The in-repo binary is @internal/cli's bin prisma -> ./dist/bin.mjs. bin.ts calls runOrmCli(process) and then unrefs stdin so the lsp stdio session cannot keep the process alive after settlement.
- createOrmCli mounts ormCommandFamily under the binary name prisma. The file comment states this bin is a stand-in for the unified CLI whose real host lives in the prisma-cli repo and consumes ormCommandFamily. runtimeFromProcess sets managementApi.baseUrl to https://api.prisma.io and loadConfig to loadOrmConfig.
- The user-facing Postgres install is @prisma/orm-postgres, described as the one package a Postgres application installs. It depends on @prisma/orm-family-sql, @prisma/orm-framework, @prisma/orm-target-postgres, @prisma/orm-toolchain, and pg, and re-exports adapter, builder, contract, control, and driver subpaths. @prisma/orm-toolchain packages the CLI family, emitter, config loader, language server, telemetry, and Vite plugin.
- Turbo build depends on ^build and emits dist/**. typecheck depends on both ^build and build so packages that import their own published subpaths (for example @internal/extension-pgvector/pack) do not typecheck against a missing or stale dist.
- docker-compose.yaml runs postgres:15-alpine, publishes host port 5433 to container 5432, sets POSTGRES_PASSWORD=postgres, and stores data on tmpfs. CI service containers separately use postgres:15 on port 5432 with user/password/db postgres.
- Publish-to-npm triggers on push to main (tags excluded) and workflow_dispatch. An unchanged root version publishes a <base>-dev.N under the dev dist-tag; a version bump publishes latest and a GitHub Release (pre-release for 8.0.0-rc.N). docs/oss/versioning.md says publishing uses npm OIDC trusted publishing and that no long-lived NPM_TOKEN is stored.