v0.6.1
Patch Changes
-
#91
e8cfb37Thanks @kimjbstar! - Bump the runtimedependencies@prisma/generator-helperand@prisma/internalsfrom
6.19.3 to 7.9.1.devDependenciesprismaand@prisma/clientstay on 6.19.3 -- those two
specifically refuse to install on Node < 20.19 (their ownpreinstallscript hard-fails).The first attempt at this bump broke
yarn installon Node 18 in CI:@prisma/internals@7.9.1
pulls inchokidar@5.0.0transitively (via@prisma/config->c12), and chokidar 5 requires
Node >= 20.19. Traced it:c12only reaches for chokidar via a lazyawait import("chokidar")
inside its config-watch feature, which this generator's code (getDMMF/parseEnvValue/
loggeronly) never triggers -- so the actual chokidar module is never loaded at runtime here.
Added aresolutionsoverride pinningchokidarto^4.0.3(the same major that
prisma@6.19.3's ownc12dependency already resolves to, so it's a well-exercised version)
to sidestep the install-time engine check without touching any code path this package uses.
Verified with a cleanyarn install --frozen-lockfile+ fulltypecheck/build/testrun on
real Node 18.20.8 (via nvm, with engine-strict actually enforced -- not just locally-lenient
npm/yarn config).This also removes the local
FieldWithNativeTypetype augmentation in convertor.ts --
nativeTypeis now part of the officialDMMF.Fieldtype as of@prisma/generator-helper7.x,
so the workaround cast is redundant.Prisma 7 also dropped the
urlfield fromdatasourceblocks entirely (moved to
prisma.config.ts), which broke every test that builds a schema string and feeds it through
getDMMF(now on 7.9.1). Fixed by droppingurlfrom the inline schema templates in
convertor.spec.ts/file.component.spec.ts, and by stripping theurlline at read-time in
fixtures.spec.ts before parsing -- the checked-inprisma/*.prismafixture files themselves
keepurluntouched, sincenpm run generate:*still drives them through the pinned Prisma 6
CLI, which still expects it.Verified against real
prisma generateruns for all 6 fixture databases (unaffected -- they go
through the pinnedprismadevDependency, not the bumped runtime deps), and confirmed the
builtdist/index.js(compiled against 7.9.1 types) still works correctly when invoked by the
Prisma 6.19.3 CLI, proving the generator-helper JSON-RPC protocol is compatible across that
version gap. -
b1075f8Thanks @kimjbstar! - Bumpsts-nodeto its latest patch (10.9.2, no functional change -- devDependency only,
doesn't ship to consumers). Cherry-picked out of dependabot PR #90 (a grouped
dev-dependencies bump), which also tried to jumptypescript5.9.3 -> 7.0.2 and
@types/node18 -> 26 in the same PR and brokenpm teston every CI leg (ts-jest
doesn't expose TypeScript 7's restructured compiler API yet). Addedignorerules to
.github/dependabot.ymlfor major-version bumps on bothtypescript(until ts-jest
supports TS7) and@types/node(kept tracking this repo's ownengines.nodefloor of
18, not a hypothetical future Node major) so this doesn't recur. -
9752f41Thanks @kimjbstar! - Fixes three Windows-specific bugs found while adding awindows-latestleg to CI:getRelativeTSPath(used to build every relation/index-barrel import path) fed
path.relative()'s output straight into a generatedimport ... from '...'string.
On Windows,path.relative()returns\-separated paths, which produced an invalid
module specifier likeimport ... from '..\foo'. Now normalized to forward slashes
unconditionally (a POSIX import specifier is required regardless of host OS).- The
testnpm script used bash'sVAR=value commandsyntax
(NODE_OPTIONS=--experimental-vm-modules jest), which fails outright under Windows'
defaultcmd.exeshell. Switched tocross-env. - The
cleanscript usedrm -rf dist, also bash-only. Switched torimraf.
Both
cross-envandrimrafare pinned to majors that still support Node 18
(cross-env@^7.0.3,rimraf@^5.0.10) -- their latest majors require Node 20+, which would
have undone the Node 18 support this project maintains.