Open-Source Wikis

/

Prisma

/

Cleanup opportunities

prisma/prisma

Cleanup opportunities

Surfaces actionable maintenance signals from prisma/prisma as of 2026-04-30 against main at commit d6d9fc9ed. None of these are pressing — they're nudges for the next time someone is in the area.

Accumulated TODOs

There are roughly 250 TODO/FIXME/HACK comments across 163 TypeScript files in the repo. Concentration is low (an average of ~1.5 per file), so individual files aren't unusually marked up.

The TODOs are scattered across helpers/blaze/, helpers/compile/, several adapter packages, and the client runtime. A focused TODO-burndown PR would be feasible — most look like minor cleanups rather than deep architectural work.

The five files most often flagged with TODO/FIXME (sample, not exhaustive):

  • helpers/blaze/merge.ts
  • helpers/blaze/pipe.ts
  • helpers/blaze/record.ts
  • helpers/compile/plugins/fill-plugin/fillers/fs.ts
  • packages/adapter-libsql/src/libsql.ts

Complexity hotspots

The hand-written source files with the largest line counts:

File Lines
packages/client/src/__tests__/__helpers__/dmmf-types.ts (generated fixture) 7,910
packages/client/src/__tests__/buffer-small.test.ts (test fixture) 6,235
packages/client/src/runtime/core/errorRendering/applyValidationError.test.ts 3,620
packages/client/tests/functional/extensions/query.ts 2,097
packages/integration-tests/src/__tests__/integration/postgresql/__scenarios.ts 2,024
packages/integration-tests/src/__tests__/integration/mariadb/__scenarios.ts 1,921
packages/integration-tests/src/__tests__/integration/mysql/__scenarios.ts 1,847
packages/migrate/src/__tests__/MigrateDev.test.ts 1,794

The largest runtime file is packages/client/src/runtime/getPrismaClient.ts at ~37KB. It's a single function-style factory that returns the PrismaClient class; splitting it has been considered but its tight coupling to the constructed class makes refactoring tricky.

packages/migrate/src/SchemaEngineCLI.ts (21KB) and packages/cli/src/Init.ts (24KB) are the two other large files worth a look.

Legacy test layouts

packages/client/src/__tests__/integration/happy/** and errors/** are flagged as legacy in TESTING.md:

Legacy integration tests for the happy path. Please, write functional tests instead.

The folder still contains many tests that would be more discoverable and consistent if migrated to packages/client/tests/functional/. Migration is incremental — convert tests as you touch them, or do a focused PR to convert a related group.

Mixed Jest + Vitest

packages/cli runs both Jest and Vitest. Per AGENTS.md:

packages/cli uses both for different tests as it's in the process of transition, older packages still use Jest.

This is intentional during the migration but adds friction for contributors. A future cleanup PR per package would consolidate test framework usage. New tests are typically Vitest-flavored.

"WASM" → "Wasm" capitalization

The codebase has stale "WASM" usages that contradict the official "Wasm" convention. From AGENTS.md:

Fix the capitalization whenever you incidentally touch the corresponding lines or surrounding code for other reasons.

A search for \bWASM\b (case-sensitive) finds occurrences scattered through code, docs, and comments. Bulk replacement isn't ideal because some external tool names are spelled WASM; per-occurrence judgment is what AGENTS.md recommends.

Engine-version churn

pnpm-lock.yaml and per-package package.json files dominate the recent-churn list because of automated engine bumps:

File Changes (90d)
pnpm-lock.yaml 52
packages/internals/package.json 31
packages/client/package.json 29
packages/client-generator-ts/package.json 29
packages/client-generator-js/package.json 29

This isn't a bug — Prismo (the engine bump bot) drives this volume. But anyone investigating "what's actually changing in this codebase" should filter automated commits to find the human signal. Most chart-toppers are bot churn.

Bundle-size ceiling

The CLI bundle (packages/cli/build/index.js) ceiling is ~6MB. Recent changes that meaningfully grow CLI dependencies need to fight against that ceiling. The bundle-size GitHub action (bundle-size.yml) reports per-PR; reviewers watch the comment.

If you're adding a heavy dependency, expect to either:

  • Lazy-load it (only import when the relevant subcommand runs)
  • Tree-shake aggressively
  • Find a smaller alternative

See also

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Cleanup opportunities – Prisma wiki | Factory