Config files import definePrismaConfig, the engine's current name for the marker - #30129
Config files import definePrismaConfig, the engine's current name for the marker#30129wmadden-electric wants to merge 3 commits into
Conversation
… the marker `@prisma/cli-engine` has exported the config marker as `definePrismaConfig` since 0.2.0, keeping `defineConfig` as a deprecated alias. On the pinned 0.2.3 the two names are the same function object, so this sweep changes no behaviour today. Engine 0.3.0 drops the alias before launch, and every one of these files would then fail with `defineConfig is not a function`. 306 TypeScript files import the marker from `@prisma/cli-engine`; all of them move to the current name, at the import and at the call. Almost all are `prisma.config.ts` fixtures under `test/`, plus the example and app configs. Two things that share the name are untouched. The framework's own `defineConfig`, exported by the target facades and `@internal/cli/config-types`, is always imported aliased (`defineConfig as ormConfig`), so it never collided with the sweep. `defineConfigSection` is a separate and current engine export. 21 more files spell the old name out rather than importing it: - `scripts/regen-example-migrations.mjs` generates a temporary config file. Its `engineDefineConfig` alias existed only because the engine marker and the framework builder shared a name, so the alias goes with the rename. - The `CONFIG.VERSION_MARKER_MISSING` diagnostic told the reader to create the config with `defineConfig`. Its summary, explanation and fix now name `definePrismaConfig`, as does its entry in `docs/reference/error-reference.md` — which additionally pointed at the target package's `/config` entrypoint, the wrong import for the marker. - Doc comments in the config loader, the ORM loader and its config types, `init` and its package resolution, and the publish-surface import roots. - Four test names, and an `init` assertion that only checked for the substring `defineConfig` and so passed by accident against the scaffold's `definePrismaConfig`. The CHANGELOG, the rc.2 release notes and the rc.1-to-rc.2 upgrade recipes still say `defineConfig`, deliberately: they record releases where that was the name. This unblocks moving the engine pin to 0.3.0, which #30128 waits on. Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
|
|
|
Important Review skippedToo many files! This PR contains 329 files, which is 29 over the limit of 300. To get a review, reduce the PR to 300 files or fewer by splitting it into smaller PRs or changing its base branch. Usage-priced reviews support at most 300 files. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (329)
You can disable this status message by setting the Comment |
@prisma/orm-extension-arktype-json
@prisma/orm-extension-middleware-cache
@prisma/orm-extension-paradedb
@prisma/orm-extension-pgvector
@prisma/orm-extension-postgis
@prisma/orm-extension-supabase
@prisma/orm-family-mongo
@prisma/orm-family-sql
@prisma/orm-framework
@prisma/orm-mongo
@prisma/orm-postgres
@prisma/orm-sqlite
@prisma/orm-target-mongo
@prisma/orm-target-postgres
@prisma/orm-target-sqlite
@prisma/orm-toolchain
commit: |
size-limit report 📦
|
The app entry is new; the extension entry replaces the incidental changes: [] declaration, since the rename is a real user-facing step: the deprecated engine alias goes away with the next engine release. Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
Why now
@prisma/cli-enginehas exported the config marker asdefinePrismaConfigsince 0.2.0, keepingdefineConfigas a deprecated alias. Engine 0.3.0 drops the alias before launch. Everyprisma.config.tsin this repo still imports the old name, so on 0.3.0 they all fail at evaluation withdefineConfig is not a function.Doing the rename now, on the current 0.2.3 pin, costs nothing. The two names are literally the same function object there:
So this PR is mergeable today and changes no behaviour. It clears the last blocker on moving the engine pin to 0.3.0, which #30128 is waiting for.
What changed
306 TypeScript files import the marker from
@prisma/cli-engine. All move todefinePrismaConfig, at the import and at the call. Almost all areprisma.config.tsfixtures undertest/, plus the example and app configs.Two things that share the name are deliberately untouched:
defineConfig, exported by the target facades and@internal/cli/config-types. It is always imported aliased (defineConfig as ormConfig), so it never collided with the sweep.defineConfigSection, a separate and current engine export.Replacements were anchored on the exact import line and on
defineConfig(, never on a bare word match. After the sweep:defineConfigreference to@prisma/cli-engineremains in any.ts,.mts,.mjsor.jsfiledefineConfigSectionoccurrences are intact, and nodefinePrismaConfigSectionexists anywhere21 more files spell the old name out rather than importing it:
scripts/regen-example-migrations.mjsgenerates a temporary config file. ItsengineDefineConfigalias existed only because the engine marker and the framework builder shared a name, so the alias goes with the rename.CONFIG.VERSION_MARKER_MISSINGdiagnostic told the reader to create the config withdefineConfig. Its summary, explanation and fix now namedefinePrismaConfig. So does its entry indocs/reference/error-reference.md, which additionally pointed at the target package's/configentrypoint — the wrong import for the marker.initand its package resolution, and the publish-surface import roots.initassertion that only checked for the substringdefineConfigand so passed by accident against the scaffold'sdefinePrismaConfig. It now asserts the real name.The CHANGELOG, the rc.2 release notes and the rc.1-to-rc.2 upgrade recipes still say
defineConfig, deliberately: they record releases where that was the name.Verification
All on the current 0.2.3 pin — no override, no tarball.
pnpm buildturbo run typecheck --forceintegration-tests, whose tsconfig includestest/**/*, so all 262 fixture configs are typechecked.pnpm test:packagesmainbefore the change, so nothing was lost or silently skippedpnpm test:integration@internal/cli@internal/config-loader@internal/errors@internal/config@internal/language-serverpnpm lintpnpm lint:deps,lint:docs,lint:manifestspnpm check:conformancepnpm check:error-referenceThree test files fail somewhere in those runs. Each was checked and none is caused by this change:
test/ports/.../driver-adapters-error-forwardingfails identically on unmodifiedorigin/main— I checked outmainin this working copy and reproduced it.@prisma/orm-framework'smodule-identityalso fails on unmodifiedmainhere:pnpm packtrips over a leftover gitignoredskills/prisma-8directory.@internal/adapter-postgres'sorder-by-enumPGlite test fails only under parallel load; it passes on its own (7/7).Related
🤖 Generated with Claude Code