Skip to content
This repository was archived by the owner on Nov 25, 2026. It is now read-only.

correct dependencies, remove tsconfig paths, and break cycles - #31

Merged
rtbenfield merged 21 commits into
mainfrom
fix-project-dependencies
Dec 10, 2025
Merged

rtbenfield merged 21 commits into
mainfrom
fix-project-dependencies

Conversation

@rtbenfield

@rtbenfield rtbenfield commented Dec 6, 2025 •

Copy link
Copy Markdown
Contributor

This PR eliminates the ability to import from other packages in the monorepo without explicitly including the workspace dependency in the package.json of the consumer.

The paths option of tsconfig enables these mistakes to be easily made, so we rely on pnpm workspace links instead. TurboRepo ensures we compile dependencies in the correct order as well.

TODO

  • Remove tsconfig path aliases from base config
  • Add rootDir option to package tsconfig to address ambiguous root directory
  • Add missing runtime dependencies to packages
  • Eliminate cyclic dependencies in tests

Summary by CodeRabbit

  • New Features

    • CLI now exposes multiple importable commands and a config-loader; SQL family adds a public verify entrypoint.
  • Architecture & Configuration

    • Cross-domain import policy moved to directional with domain-specific allowlists; TypeScript projects standardized rootDir and base tsconfig updated.
  • Documentation

    • Added guidance on excluding test fixtures from typechecking, workspace dependency workflows, and CLI subpath/export usage.
  • Chores / Tests

    • Tests and fixtures reorganized; many tests now use stub adapters, package-based imports, and new CLI-focused test helpers and integration fixtures.

✏️ Tip: You can customize this high-level summary in your review settings.

@rtbenfield
rtbenfield requested a review from wmadden December 6, 2025 13:19
@rtbenfield rtbenfield self-assigned this Dec 6, 2025
@coderabbitai

coderabbitai Bot commented Dec 6, 2025 •

Copy link
Copy Markdown
Contributor

Walkthrough

Repository-wide rework: added CLI subpath exports and build entries, introduced directional cross-domain rules with domain allow-lists, centralized/refactored test and CLI helpers (stub adapters, fixtures), set rootDir across many tsconfigs, updated package manifests and tests to use workspace package imports and a TS-based emit flow.

Changes

Cohort / File(s) Change Summary
Architecture & dependency tooling
architecture.config.json, dependency-cruiser.config.mjs
rules.crossDomain changed to "directional"; new crossDomainRules allow-lists added and dependency-cruiser updated to honor them and include reasons in denial messages.
CLI package: exports & build
packages/framework/tooling/cli/package.json, packages/framework/tooling/cli/tsup.config.ts, packages/framework/tooling/cli/README.md, .cursor/rules/cli-package-exports.mdc
Added multiple CLI subpath exports (./commands/*, ./config-loader) and matching tsup build entries; README and rulecard document subpath exports and import patterns.
Docs & import rules
.cursor/rules/*.md, docs/reference/Package Naming and Path Aliases.md, .cursor/rules/README.md
Added rulecards (including test-fixture-typechecking.mdc); replaced sibling-relative import guidance with workspace-qualified imports and workspace:* dependency workflow; added subpath export guidance.
TypeScript configs & base
tsconfig.base.json, test/integration/tsconfig.json, many packages/*/tsconfig.json
Added rootDir: "." to many package tsconfigs; removed base path aliases and added declarationMap in base; integration tsconfig excludes fixtures.
SQL family: verify export & build
packages/sql/family/package.json, packages/sql/family/tsup.config.ts, packages/sql/family/src/exports/verify.ts, packages/sql/family/README.md
Added ./verify export and tsup entry; added re-export barrel for parseContractMarkerRow, readMarker, readMarkerSql; docs updated.
SQL runtime: test utilities refactor
packages/sql/sql-runtime/test/utils.ts, packages/sql/sql-runtime/package.json, packages/sql/sql-runtime/tsconfig.json
Introduced createStubAdapter() and removed heavier Postgres-specific test scaffolding; adjusted runtime test exports and dependencies to reduce Postgres coupling.
Integration CLI helpers & fixtures
test/integration/test/utils.ts, test/integration/test/utils/cli-test-helpers.ts, test/integration/tsconfig.json, test/integration/test/fixtures/cli/*
Centralized CLI/integration helpers, added fixture-driven setup and CLI helpers, excluded fixtures from TS compile, and added helpers to emit/load contracts in tests.
Integration tests: CLI → package imports & TS emit flow
many test/integration/test/cli*.test.ts, test/integration/test/cli.emit.test.ts
Tests switched to import CLI commands/config-loader from @prisma-next/cli/*; CLI emit tests reworked from spawning the CLI to invoking a TS-based emit flow using assembly helpers and direct emit calls.
Tests: adapter stubs & inline CodecTypes
packages/sql/lanes/*/test/*, packages/sql/lanes/*/test/fixtures/*.d.ts, various packages/sql tests
Replaced Postgres adapter usage with createStubAdapter() in many tests; inlined/stubbed CodecTypes in fixtures; updated tests to use local builders/barrels or public test utils.
Emitter & CLI test deletions / adjustments
packages/framework/tooling/cli/test/emit.test.ts (deleted), packages/framework/tooling/emitter/test/* (deleted/adjusted)
Removed several emitter/CLI tests; remaining emitter tests updated to import ContractIR from @prisma-next/contract/ir.
Workspace manifests & examples
examples/*/package.json, multiple packages/*/package.json, test/*/package.json
Added and reshuffled numerous workspace dependencies (e.g., @prisma-next/contract, sql-contract, operations, runtime-executor), plus some devDependency changes and new exports.
Widespread test import relocations
many packages/sql/lanes/relational-core/test/*, packages/sql/authoring/*/test/*, test/e2e/framework/*, test/integration/test/*
Updated tests to import types/utilities from local barrels or public package exports instead of internal relative paths, aligning with new public surfaces.
Small examples & package updates
examples/prisma-next-demo/src/**/*.ts, examples/*/package.json, packages/extensions/*/package.json
Adjusted several type import subpaths (e.g., @prisma-next/contract/types), and added/reshuffled workspace dependencies across examples and extensions.

Sequence Diagram

sequenceDiagram
    autonumber
    participant Test as Integration Test
    participant CLI as `@prisma-next/cli` (subpath)
    participant Family as packages/sql/family
    participant Contract as `@prisma-next/contract`
    participant Runtime as SQL Runtime (createStubAdapter)

    Note over Test,CLI: Integration tests use TS-based emit flow (no spawned CLI)
    Test->>CLI: import or call emit API / config-loader
    Test->>Contract: load/parse TS contract fixtures
    Test->>Family: call assembly helpers (extract codec/operation imports, build registry)
    Family->>Contract: resolve codec & operation types from packs
    Test->>Runtime: createStubAdapter() to build runtime/context
    Runtime-->>Test: runtime context for emit/plan
    Test->>CLI: invoke emit(contract, options)
    CLI->>Family: request emission (contract.json / contract.d.ts)
    Family->>Contract: produce emitted artifacts
    Contract-->>Test: emitted artifacts returned for assertions
Loading

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Lite

📥 Commits

Reviewing files that changed from the base of the PR and between a773795 and cfe7684.

📒 Files selected for processing (1)
  • packages/extensions/compat-prisma/package.json (1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/packages/**/package.json

📄 CodeRabbit inference engine (.cursor/rules/moving-packages.mdc)

In package.json script paths, update references to root-level files like biome.json and scripts/clean.mjs based on the new package directory depth

Files:

  • packages/extensions/compat-prisma/package.json
**/package.json

📄 CodeRabbit inference engine (.cursor/rules/multi-plane-entrypoints.mdc)

Export subpath entrypoints in package.json with correct types and import mappings for ./adapter, ./control, and ./runtime paths

Files:

  • packages/extensions/compat-prisma/package.json
packages/**/package.json

📄 CodeRabbit inference engine (.cursor/rules/shared-plane-packages.mdc)

packages/**/package.json: Shared plane packages must have sideEffects: false in package.json
Use explicit export paths in package.json following the pattern with separate export identifiers for types, validators, and factories
Shared plane packages should depend only on framework core packages and validation libraries (Arktype), not on migration-plane or runtime-plane packages

Files:

  • packages/extensions/compat-prisma/package.json
{**/package.json,**/index.{ts,tsx}}

📄 CodeRabbit inference engine (.cursor/rules/README.md)

Follow multi-plane entrypoints in a single package (see .cursor/rules/multi-plane-entrypoints.mdc)

Files:

  • packages/extensions/compat-prisma/package.json
🔇 Additional comments (3)
packages/extensions/compat-prisma/package.json (3)

34-39: Verify multi-plane entrypoint export coverage.

The exports section provides only a root entrypoint. Per the coding guidelines, packages should "Export subpath entrypoints in package.json with correct types and import mappings for ./adapter, ./control, and ./runtime paths."

Confirm whether compat-prisma requires these subpath exports or whether the root-only export structure is intentional.


5-5: Scripts and package metadata look correct.

The sideEffects: false declaration and root-level script path references (../../../biome.json, ../../../scripts/clean.mjs) are correctly configured for the package's directory depth.

Also applies to: 11-12


14-22: The review comment is based on an incorrect classification. compat-prisma is an extensions-plane package, not a shared-plane package. The coding guideline that restricts dependencies ("Shared plane packages should depend only on framework core packages and validation libraries...") applies specifically to shared-plane packages (located in packages/shared/), not extensions.

As an extension package, compat-prisma appropriately depends on SQL and adapter packages to provide compatibility functionality with Prisma. The added dependencies on @prisma-next/sql-runtime, @prisma-next/adapter-postgres, @prisma-next/driver-postgres, @prisma-next/sql-contract, and @prisma-next/sql-relational-core are correct and necessary for this package's function.


Comment @coderabbitai help to get the list of available commands and usage tips.

@wmadden wmadden left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

enjoy your extra 1k LOC changed

@rtbenfield
rtbenfield marked this pull request as ready for review December 8, 2025 17:40

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 7

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (8)
packages/sql/lanes/relational-core/src/ast/join.ts (1)

38-39: Replace blind type casts with type predicates to ensure type safety.

Blind type casts (as unknown as X) are forbidden in production code per coding guidelines. Instead, use a type predicate function to narrow types properly.

The isColumnBuilder function should be a type predicate (returning is AnyColumnBuilder) so that after the guard check at line 29, TypeScript narrows left and right to the correct type without needing casts.

Apply this pattern to fix the type safety issue:

-    // TypeScript can't narrow ColumnBuilder properly, so we assert
-    const leftCol = left as unknown as { table: string; column: string };
-    const rightCol = right as unknown as { table: string; column: string };
-    if (leftCol.table === rightCol.table) {
+    if (left.table === right.table) {
       throw planInvalid('Self-joins are not supported in MVP');
     }
 
     return {
       kind: 'join-on',
-      left: left as AnyColumnBuilder,
-      right: right as AnyColumnBuilder,
+      left,
+      right,
     };

Ensure that isColumnBuilder is implemented as a proper type predicate:

function isColumnBuilder(value: unknown): value is AnyColumnBuilder {
  // validation logic
}
packages/targets/postgres-adapter/package.json (1)

15-28: Remove unused dependencies: @prisma-next/contract and @prisma-next/core-control-plane are not imported anywhere.

The search reveals that @prisma-next/contract and @prisma-next/core-control-plane have no imports in the postgres-adapter source code and should be removed from dependencies. @prisma-next/contract-authoring is correctly listed and used for the ColumnTypeDescriptor type in src/exports/column-types.ts. Additionally, @prisma-next/cli is also unused and should be removed.

packages/extensions/pgvector/package.json (1)

25-36: Add external configuration to tsup.config.ts to prevent bundling of workspace packages.

The devDependencies are correctly scoped to testing and build (vitest.config.ts uses @prisma-next/test-utils for timeouts; test files import adapter-postgres, sql-contract, sql-contract-ts). However, tsup.config.ts is missing the external array configuration. Add the following to mark workspace packages as external:

external: [
  '@prisma-next/adapter-postgres',
  '@prisma-next/operations',
  '@prisma-next/sql-contract',
  '@prisma-next/sql-contract-ts',
  '@prisma-next/sql-lane',
  '@prisma-next/test-utils',
]

This prevents accidental bundling of CommonJS dependencies into the ESM bundle and avoids vite parsing errors.

packages/sql/authoring/sql-contract-ts/test/contract.structure.test.ts (1)

28-136: Consider using a concrete contract type instead of SqlContract<SqlStorage> in validateContract tests

Current calls like validateContract<SqlContract<SqlStorage>>(…) use the generic contract type; the sql guidelines recommend using a fully-typed contract (from contract.d.ts) with validateContract<T>() so type inference stays precise and mirrors real usage. If a concrete contract type is available, it would be better to use that here.

examples/prisma-next-demo/src/queries/similarity-search.ts (1)

1-31: Type import path is correct; consider moving the type test out of example code

  • Importing ResultType from @prisma-next/contract/types matches the contract-type import guidelines and keeps this example aligned with other callers.
  • The // @ts-expect-error type check on Row['distance'] lives in a non-test source file, which conflicts with the rule to avoid disabling type checking outside tests. Consider moving this assertion into a dedicated *.test-d.ts/type test using expectTypeOf and removing the @ts-expect-error from this example.
tsconfig.base.json (1)

19-51: Enable declaration maps is fine; consider deduplicating project reference

Adding "declarationMap": true is a good tooling improvement and removing path mappings from this base config aligns with the goal of avoiding cross-package TS-only imports. However, ./packages/framework/core-control-plane appears twice in the references array (Line 29 and Line 35); it’s harmless but redundant and could be cleaned up in this PR or a follow-up.

examples/prisma-next-demo/src/queries/get-user-posts.ts (1)

23-25: Remove @ts-expect-error from example code and move type check into tests

This example file isn’t a test, so suppressing a type error with @ts-expect-error conflicts with the rule that production/example code must not disable type checking. The _Test alias is purely a type-level assertion and can live in a dedicated .test-d.ts instead.

Consider removing the in-file assertion:

   const plan = sql
@@
-  type Row = ResultType<typeof plan>;
-  // @ts-expect-error - This is to test the type inference
-  type _Test = Row['embedding'];
+  type Row = ResultType<typeof plan>;

and, if you still need to verify inference, reintroduce the _Test check in a small type test that uses expectTypeOf rather than @ts-expect-error.

As per coding guidelines, @ts-expect-error is only acceptable in test files with explicit justification.

packages/sql/lanes/sql-lane/test/plan-types.test-d.ts (1)

643-649: Replace deprecated expectTypeOf().toMatchTypeOf with toExtend

In the “result typing is derived solely from projection, unaffected by joins” test, this line:

expectTypeOf<Row>().not.toMatchTypeOf<{ email: unknown }>();

uses the deprecated toMatchTypeOf matcher. To follow the current Vitest type-test guidelines, you can express the same intent with:

expectTypeOf<Row>().not.toExtend<{ email: unknown }>();

which still asserts that Row does not have an email property while avoiding the deprecated API.

♻️ Duplicate comments (2)
packages/sql/lanes/orm-lane/test/fixtures/contract.d.ts (1)

6-12: Duplicate: CodecTypes duplication already flagged.

This is the same duplication issue identified in contract-with-relations.d.ts. See the previous comment for the recommendation to extract to a shared test utility.

packages/sql/lanes/sql-lane/test/fixtures/contract.d.ts (1)

7-13: Duplicate: CodecTypes duplication already flagged.

This file has the same CodecTypes duplication. However, the comment here is more descriptive (mentioning createStubAdapter) than in the other two fixture files. Consider using this comment style when extracting to a shared location.

Comment on lines +11 to +16
import {
assembleOperationRegistryFromPacks,
extractCodecTypeImportsFromPacks,
extractExtensionIdsFromPacks,
extractOperationTypeImportsFromPacks,
} from '../../../packages/sql/family/src/core/assembly';

@coderabbitai coderabbitai Bot Dec 8, 2025 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Import from package exports instead of source paths.

Line 16 imports from ../../../packages/sql/family/src/core/assembly, which bypasses the package's public API. According to the coding guidelines, test files should either:

  • Import from package exports when available
  • Use relative imports only within the same package

Since this is a test file in a different package (test/integration), check if these functions are exported from @prisma-next/family-sql package exports. If so, update the import:

-import {
-  assembleOperationRegistryFromPacks,
-  extractCodecTypeImportsFromPacks,
-  extractExtensionIdsFromPacks,
-  extractOperationTypeImportsFromPacks,
-} from '../../../packages/sql/family/src/core/assembly';
+import {
+  assembleOperationRegistryFromPacks,
+  extractCodecTypeImportsFromPacks,
+  extractExtensionIdsFromPacks,
+  extractOperationTypeImportsFromPacks,
+} from '@prisma-next/family-sql/assembly';

If these functions are not yet exported, they should be added to the package's exports to support this programmatic usage pattern.

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
test/integration/test/cli.emit.test.ts lines 11-16: the test imports internal
source paths from ../../../packages/sql/family/src/core/assembly which bypasses
the package public API; update the test to import these symbols from the package
export (e.g. @prisma-next/family-sql) if those functions are already exported,
otherwise add them to the package's exports (package.json "exports" or index
barrel) and then change the import to the package path so tests consume the
public API rather than internal source files.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our goal was to prevent packages having untracked interdependencies. This package is just integration tests and I don't think we care enough to address this right now.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wmadden, understood! Since the main goal of preventing untracked interdependencies between packages is already met, and this is specific to integration test code, it makes sense to defer this. Thanks for the clarification! 👍

Comment on lines +14 to +17
// Note: executeCommand and other test helpers are re-exported at the bottom of this file
// They come from the CLI package's test utilities but are not exported from the package
// We import them directly from the source file
import { executeCommand } from '../../../../packages/framework/tooling/cli/test/utils/test-helpers';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Document or export test utilities from CLI package.

The imports from packages/framework/tooling/cli/test/utils/test-helpers.ts bypass the package's public API. While the comment acknowledges this (lines 14-16), it indicates a design gap.

Consider one of these approaches:

  1. Export test utilities from CLI package (preferred):
    Add to packages/framework/tooling/cli/package.json:

    "./test/utils": {
      "types": "./dist/test/utils.d.ts",
      "import": "./dist/test/utils.js"
    }
  2. Move shared test utilities to @prisma-next/test-utils:
    If these utilities don't depend on CLI-specific logic, they could be moved to the shared test-utils package per the learnings about avoiding circular dependencies.

  3. Accept the current pattern: If this is intentional for test-only utilities, update the comment to explain why these aren't exported and document this pattern for other test files.

Also applies to: 331-338

🤖 Prompt for AI Agents
In test/integration/test/utils/cli-test-helpers.ts around lines 14 to 17, the
test helper is importing directly from the CLI package source (bypassing the
package public API); fix by either 1) exporting the test utilities from
packages/framework/tooling/cli via its package.json exports map (add an export
entry for "./test/utils" pointing to the built JS and types and then update the
import to the package public path), or 2) move the shared helpers into the
shared @prisma-next/test-utils package (move the file, update its
imports/exports, and update all test imports), or 3) if intentional, expand the
comment to explain why these utilities are not exported and document the allowed
internal import pattern for tests; implement the chosen approach and update all
duplicate occurrences (notably lines 331-338) accordingly.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 9

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Lite

📥 Commits

Reviewing files that changed from the base of the PR and between 09836b0 and 7ef2d8f.

📒 Files selected for processing (1)
  • packages/sql/lanes/relational-core/test/column-builder-operations.test.ts (3 hunks)
🧰 Additional context used
📓 Path-based instructions (16)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/arktype-usage.mdc)

**/*.{ts,tsx}: Use the 'key?' syntax with the ? suffix for optional keys in Arktype schemas instead of using 'string | undefined' type unions
Reference schemas directly as object property values in Arktype schemas - this works seamlessly without special syntax
Use type({ '[string]': Schema }) syntax to create Record<string, Schema> types in Arktype instead of using Record<string, Schema> string notation
Use the .array() method on Arktype schemas to create array types instead of wrapping schemas in type([Schema]) or using manual validation
Extract TypeScript types from Arktype schemas using the .infer property instead of manually duplicating type definitions
Use type.declare<>() to ensure Arktype schemas match pre-existing TypeScript types for compile-time type safety, especially when working with readonly properties
Use .array().readonly() method chaining to create readonly array types in Arktype instead of using string notation like 'string[]'
Don't manually re-validate what Arktype has already checked - once validation passes, trust the structure matches the schema
Use instanceof type.errors to check for Arktype validation errors instead of other error checking patterns, for proper type narrowing
Return the original input value from validation functions instead of returning the Arktype validation result to preserve literal types

**/*.{ts,tsx}: Always use Control*Descriptor types (ControlFamilyDescriptor, ControlTargetDescriptor, ControlAdapterDescriptor, ControlDriverDescriptor, ControlExtensionDescriptor). Legacy descriptor types have been completely removed.
All descriptors must include required properties: kind (discriminator), id (string identifier), familyId (literal type), targetId (literal type for target/adapter/driver/extension), manifest (ExtensionPackManifest), and create() factory method
Use base instance interfaces: ControlFamilyInstance, ControlTargetInstance, ControlAdapterInstance, `ControlDriverIn...

Files:

  • packages/sql/lanes/relational-core/test/column-builder-operations.test.ts
**/*.test.ts

📄 CodeRabbit inference engine (.cursor/rules/contract-normalization-responsibilities.mdc)

**/*.test.ts: Contract builder tests must verify that normalization happens correctly with all required fields receiving their default values
Validator tests must verify that validation fails when required fields are missing, and must NOT test normalization behavior
Parser and emitter hook tests must test functionality with normalized contracts and must NOT test normalization behavior

**/*.test.ts: In tests using withDevDatabase() from @prisma-next/test-utils, avoid selecting or using extension-dependent columns (like pgvector, pg_trgm) when testing features unrelated to extension functionality, as pglite does not support PostgreSQL extensions
When tests must verify extension functionality end-to-end (e.g., pgvector queries), use a real PostgreSQL database instead of withDevDatabase() via withClient() and process.env['DATABASE_URL']
When writing ORM tests with includes, relation filters, or other non-extension features, explicitly exclude extension-dependent columns from select statements to ensure compatibility with pglite-based test databases

**/*.test.ts: Within-package tests should import from source files directly (e.g., '../src/...') rather than from package exports (e.g., '@prisma-next/package-name/...')
Cross-package tests should import from package exports rather than relative source paths
Test files should never import from their own package using package aliases (e.g., '@prisma-next/package-name/...'); always use relative imports (e.g., '../src/...')
When importing from sibling packages within the same domain in test files, use relative paths instead of workspace package names
When extracting code between packages, move tests to the new package and update test imports to use relative source paths ('../src/...')
The 'exports/' folder contains the public API surface and should not be imported from in test files; import directly from source files instead

**/*.test.ts: Avoid using type assertions in tests to bypass type checking or test i...

Files:

  • packages/sql/lanes/relational-core/test/column-builder-operations.test.ts
packages/sql/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/directory-layout.mdc)

packages/sql/**/*.{ts,tsx}: Place all SQL target-family packages (all layers and planes) under packages/sql/** - family internals including contract types, operations, emitter hooks, and lanes must be target-agnostic and not contain concrete dialect code
Do not place concrete target code (dialects, adapters, drivers) under packages/sql/**

packages/sql/**/*.{ts,tsx}: Use a generic type parameter that accumulates include definitions (with an Includes type parameter) in includeMany builder implementations to track include definitions across multiple calls and infer correct array types in the final result
Use a helper type like ExtractIncludeType<K extends string, Includes> that safely extracts types from accumulated include maps with a fallback to unknown if the key doesn't exist
Handle boolean true in type inference to allow select({ posts: true }) syntax to infer Array<ChildShape> from the accumulated Includes map
Implement runtime capability checks in builder methods (like returning() and includeMany()) that verify required capabilities exist and are set to true before proceeding with implementation, throwing a planInvalid error if missing
For features requiring multiple capabilities (e.g., includeMany requiring both 'lateral' and 'jsonAgg'), check that all required capabilities are present and set to true in a single runtime validation

packages/sql/**/*.{ts,tsx}: Import and use tables directly from query.ts instead of accessing through schema.tables for improved readability (e.g., tables.user instead of schema.tables.user)
Extract table and column variables only when the same table/columns are used multiple times in a function or when it improves readability; use direct access for single-use queries
Use ResultType<typeof plan> to extract row types from Prisma query plans instead of manually defining types
Use DML operations with returning() clause for INSERT, UPDATE, and DELETE queries to retrieve affected rows (e...

Files:

  • packages/sql/lanes/relational-core/test/column-builder-operations.test.ts
packages/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/import-validation.mdc)

packages/**/*.{ts,tsx}: Same-layer imports are allowed: packages in the same layer can import from each other (e.g., orm-lane can import from sql-relational-core if both are in the lanes layer)
Cross-layer imports must flow inward (toward core): packages can only import from inner layers (closer to core). Outer layers cannot import from inner layers (e.g., core layer cannot import from lanes layer)

Import SQL emitter hook (sqlTargetFamilyHook) from @prisma-next/sql-contract-emitter

Files:

  • packages/sql/lanes/relational-core/test/column-builder-operations.test.ts
**/*.ts

📄 CodeRabbit inference engine (.cursor/rules/modular-refactoring-patterns.mdc)

**/*.ts: Start refactoring by extracting pure, side-effect-free utility functions as thin wrappers around AST factories and error constructors
Extract state management into separate modules defining immutable state shapes and interfaces
Replace any types with proper generic type parameters during function extraction, using existing type definitions like ModelColumnAccessor
Use the compact helper function to remove undefined values from objects when TypeScript's exactOptionalPropertyTypes is enabled
Organize imports in the following order: external type imports, external value imports, internal type imports, internal value imports

Do not export functions, types, or utilities solely for test use; instead, tests should import from source using relative paths within the same package or refactor to use public APIs

**/*.ts: Prefer assertions over defensive checks when data is guaranteed to be valid in TypeScript. Use non-null assertions (!) after validation checks instead of optional chaining or defensive conditionals.
Use assertions to access validated properties directly (e.g., columnMeta.codecId, columnMeta.nullable) instead of optional chaining (columnMeta?.codecId) after validation has already occurred.

Files:

  • packages/sql/lanes/relational-core/test/column-builder-operations.test.ts
**/packages/**/+(*.test|*.spec).{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/moving-packages.mdc)

In test files, update paths to other packages, extension pack manifests, fixtures, and import paths based on the new package location's directory depth from root

Files:

  • packages/sql/lanes/relational-core/test/column-builder-operations.test.ts
**/*.{test,spec}.{ts,js}

📄 CodeRabbit inference engine (.cursor/rules/omit-should-in-tests.mdc)

Omit the word 'should' in test descriptions - write concise, direct descriptions instead (e.g., 'equals 1' instead of 'should equal 1')

Files:

  • packages/sql/lanes/relational-core/test/column-builder-operations.test.ts
packages/sql/**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/postgres-lateral-patterns.mdc)

packages/sql/**/*.{ts,tsx,js}: Don't quote identifiers early in functions. Quote them only when needed in SQL generation to avoid double-quoting issues.
When using LATERAL joins in PostgreSQL adapters, use different aliases for table and column: table alias as {alias}_lateral, column alias as {alias}, and select using table_alias.column_alias
When both ORDER BY and LIMIT are present in a LATERAL subquery, wrap the query in an inner SELECT that projects individual columns with aliases, then use json_agg(row_to_json(sub.*))
Use column aliases in ORDER BY clauses when the column is in the SELECT list, mapping column references to their aliases before generating the ORDER BY clause

Files:

  • packages/sql/lanes/relational-core/test/column-builder-operations.test.ts
**/*.{test,spec}.ts

📄 CodeRabbit inference engine (.cursor/rules/prefer-object-matcher.mdc)

Prefer object matchers with .toMatchObject() over multiple individual expect().toBe() calls when checking 2+ related values in tests

**/*.{test,spec}.ts: Test files must not exceed 500 lines; split files that exceed this limit into multiple files organized by logical functionality
Split test files by logical groupings: by functionality (basic, errors, structure), by feature area (joins, projections, includes), or by test type (unit, integration, edge-cases)
Use descriptive test file names following the pattern {base}.{category}.test.ts, where base name indicates the subject being tested and category indicates the test type (e.g., .basic.test.ts, .errors.test.ts, .joins.test.ts)
Ensure each split test file contains all necessary imports, setup/teardown code, and is independently runnable without dependencies on other test files
Prefer object comparison assertions using toEqual or toMatchObject instead of piece-by-piece property checks with toHaveProperty or individual type assertions
Use expect.any() for type-only checks and expect.not.objectContaining() for absence checks when performing partial object comparisons
Compare entire plan structures using object comparison assertions instead of checking individual AST fields piecemeal to ensure all fields are present and correct

Use factory functions (such as createColumnRef, createParamRef, createLiteralExpr, createTableRef, createBinaryExpr) for creating AST nodes in tests instead of manual object creation

Use factory functions (e.g., createContractIR()) instead of manual object creation when creating ContractIR objects in tests. Ensure all required fields (schemaVersion, targetFamily, target, models, relations, storage, extensions, capabilities, meta, sources) are present through the factory function rather than manual construction.

**/*.{test,spec}.ts: Do not use the deprecated toMatchTypeOf() matcher in Vitest's expectTypeOf API; use toExtend() instead for verifying ...

Files:

  • packages/sql/lanes/relational-core/test/column-builder-operations.test.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/shared-plane-packages.mdc)

Import from shared plane packages using the package name and export identifier (e.g., @prisma-next/sql-contract/types), not /exports/ paths

**/*.{ts,tsx,js,jsx}: Use arktype instead of zod for schema validation
Don't add comments if avoidable; prefer code which expresses its intent
Don't add exports for backwards compatibility unless explicitly requested
Do not reexport things from one file in another, except in the exports/ folders

**/*.{ts,tsx,js,jsx}: Prefer links to canonical docs over long comments
Package layering is enforced; fix violations rather than bypassing via import validation

If you need to disable a Biome rule for more than a couple of lines in a file, use a file-level disable comment at the top instead of many inline disable comments.

Files:

  • packages/sql/lanes/relational-core/test/column-builder-operations.test.ts
packages/**/test/**/*.{ts,test.ts}

📄 CodeRabbit inference engine (.cursor/rules/shared-plane-packages.mdc)

Shared plane packages should include unit tests for validators and factories, type tests for exported types, and no integration tests requiring migration or runtime plane packages

Files:

  • packages/sql/lanes/relational-core/test/column-builder-operations.test.ts
**/*.test.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/testing-guide.mdc)

**/*.test.{ts,tsx,js}: Test descriptions should omit 'should' - use direct action-oriented phrases like 'returns correct value' instead of 'should return correct value'
Test fixtures should not depend on specific adapters (e.g., @prisma-next/adapter-postgres). Define CodecTypes inline in test fixtures to remain adapter-agnostic and use createStubAdapter() from @prisma-next/runtime/test/utils instead of specific adapter factories.
Import test utilities from specific packages to avoid circular dependencies: Use @prisma-next/test-utils for generic database/async utilities, @prisma-next/runtime/test/utils for runtime-specific utilities, and e2e-tests/test/utils.ts for contract-related E2E utilities.
Use withDevDatabase for automatic database cleanup and ensure only one connection at a time. Close the withClient connection before running CLI commands that need their own database connection.
Use collectAsync() or executePlanAndCollect() to collect all results from async iterables, or drainAsyncIterable()/drainPlanExecution() to drain without collecting.
Keep test files under 500 lines maximum. Split large files by functionality (basic, errors, structure, generation), feature area (joins, projections, includes), or test type (unit, integration, edge-cases). Use descriptive file names like codecs.registry.test.ts, runtime.joins.test.ts, driver.errors.test.ts.
Prefer object comparison using toEqual() or toMatchObject() instead of piece-by-piece property checks with toHaveProperty() and type casts.
Use toMatchObject() for JSON parsing assertions without type casts. Use expect.anything() for nested objects when verifying existence.
Use the extension mechanism via createTestContext with an extensions parameter to register operations and codecs programmatically, rather than manually creating operation registries.
Let TypeScript automatically infer return types from plans using ResultType<typeof plan> rather than manual type param...

Files:

  • packages/sql/lanes/relational-core/test/column-builder-operations.test.ts
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/testing-guide.mdc)

Always quote table names in SQL statements to handle PostgreSQL reserved keywords (e.g., use "user" instead of user).

**/*.{ts,tsx,js}: Follow layering rules and exceptions (see .cursor/rules/import-validation.mdc)
Resolve cyclic dependencies by checking for unused dependencies (see .cursor/rules/resolving-cyclic-dependencies.mdc)
Prefer declarative configuration over hardcoded logic (see .cursor/rules/declarative-config.mdc)
Prohibit inline type imports in source files (see .cursor/rules/no-inline-imports.mdc)
Use Object.hasOwn() instead of hasOwnProperty() (see .cursor/rules/object-hasown.mdc)

Files:

  • packages/sql/lanes/relational-core/test/column-builder-operations.test.ts
**/*.{test,spec}.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/use-correct-tools.mdc)

Use local pnpm test scripts for testing; use pnpm test:coverage for all packages or pnpm coverage:packages for packages only

Keep tests concise; omit 'should' from test names

Files:

  • packages/sql/lanes/relational-core/test/column-builder-operations.test.ts
**/*.{test,spec}.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/README.md)

**/*.{test,spec}.{ts,tsx,js}: Test descriptions omit 'should' (see .cursor/rules/omit-should-in-tests.mdc)
Follow testing guide pointers and patterns (see .cursor/rules/testing-guide.mdc)
Use test import patterns: source files, relative paths, don't export for tests (see .cursor/rules/test-import-patterns.mdc)
Organize test files with max 500 lines, split by functionality (see .cursor/rules/test-file-organization.mdc)
Follow test database limitations and patterns (see .cursor/rules/test-database-limitations.mdc)
Prefer object matchers over multiple individual expect().toBe() calls (see .cursor/rules/prefer-object-matcher.mdc)
Use factory functions for creating AST nodes instead of manual object creation (see .cursor/rules/use-ast-factories.mdc)
Use factory functions for ContractIR objects in tests (see .cursor/rules/use-contract-ir-factories.mdc)

Files:

  • packages/sql/lanes/relational-core/test/column-builder-operations.test.ts
**/*.{test,spec}.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/README.md)

Use type test patterns with vitest.expectTypeOf (see .cursor/rules/vitest-expect-typeof.mdc)

**/*.{test,spec}.{ts,tsx}: Always validate contracts in tests using validateContract() function. Contracts must have fully qualified type IDs (e.g., 'pg/text@1') not bare scalars (e.g., 'text'). Type canonicalization happens at authoring time, not during validation.
In test files only, use @ts-expect-error comments with explanations when working with dynamic proxy objects or complex type scenarios that require intentional type assertions.
When creating test mocks that don't perfectly match types, use as unknown as Type (double cast). Use unknown instead of any to maintain type safety. This is only acceptable in test code.
When mocking class instances in tests, never use the spread operator (...) as it loses methods. Use Object.create() and Object.assign() to preserve the prototype chain.
Common patterns in test files should be extracted into helper functions with JSDoc comments. Check @prisma-next/test-utils and @prisma-next/runtime/test/utils for shared helpers before creating new ones.

Files:

  • packages/sql/lanes/relational-core/test/column-builder-operations.test.ts
🧠 Learnings (20)
📓 Common learnings
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/test-file-organization.mdc:0-0
Timestamp: 2025-12-04T12:15:57.358Z
Learning: Applies to **/*integration*.{test,spec}.ts : When splitting test files with multiple packages, place integration tests that depend on multiple packages in `prisma-next/integration-tests` to avoid cyclic dependencies
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/cli-e2e-test-patterns.mdc:0-0
Timestamp: 2025-12-05T14:23:28.220Z
Learning: Applies to packages/framework/tooling/cli/test/cli-e2e-test-app/package.json : Keep the root `package.json` in `packages/framework/tooling/cli/test/cli-e2e-test-app/` static with dependencies installed via `pnpm install` for workspace dependency resolution
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/resolving-cyclic-dependencies.mdc:0-0
Timestamp: 2025-12-04T12:15:08.433Z
Learning: Remove unused dependencies from package.json when they create cyclic dependencies, then run `pnpm install` and `pnpm typecheck` to verify no breaks occur
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/testing-guide.mdc:0-0
Timestamp: 2025-12-04T12:16:51.399Z
Learning: Applies to **/*.test.{ts,tsx,js} : Import test utilities from specific packages to avoid circular dependencies: Use `prisma-next/test-utils` for generic database/async utilities, `prisma-next/runtime/test/utils` for runtime-specific utilities, and `e2e-tests/test/utils.ts` for contract-related E2E utilities.
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/moving-packages.mdc:0-0
Timestamp: 2025-12-04T12:13:35.471Z
Learning: Test packages moved to `test/` directory must remain in `pnpm-workspace.yaml` for dependency resolution, be marked as `private: true` in `package.json`, use `workspace:*` protocol for dependencies, not be included in `architecture.config.json`, and be excluded from dependency cruiser checks
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/moving-packages.mdc:0-0
Timestamp: 2025-12-04T12:13:35.471Z
Learning: Applies to **/packages/**/+(*.test|*.spec).{ts,tsx,js,jsx} : In test files, update paths to other packages, extension pack manifests, fixtures, and import paths based on the new package location's directory depth from root
Learnt from: CR
Repo: prisma/prisma PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-05T14:05:24.382Z
Learning: When adding features that span multiple packages, build from root (`pnpm build`) to ensure correct dependency order
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/README.md:0-0
Timestamp: 2025-12-05T14:23:14.550Z
Learning: Applies to **/*.{ts,tsx,js} : Resolve cyclic dependencies by checking for unused dependencies (see .cursor/rules/resolving-cyclic-dependencies.mdc)
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/test-import-patterns.mdc:0-0
Timestamp: 2025-12-04T12:16:13.591Z
Learning: Applies to **/*.test.ts : When importing from sibling packages within the same domain in test files, use relative paths instead of workspace package names
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/testing-guide.mdc:0-0
Timestamp: 2025-12-04T12:16:51.399Z
Learning: Applies to tsup.config.ts : Mark workspace packages and external dependencies as external in `tsup.config.ts` to prevent bundling CommonJS dependencies into ESM bundles and avoid vite parsing errors.
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/README.md:0-0
Timestamp: 2025-12-05T14:23:14.550Z
Learning: Applies to **/*.{test,spec}.{ts,tsx,js} : Use test import patterns: source files, relative paths, don't export for tests (see .cursor/rules/test-import-patterns.mdc)
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/moving-packages.mdc:0-0
Timestamp: 2025-12-04T12:13:35.471Z
Learning: Applies to tsconfig.base.json : In `tsconfig.base.json`, update path mappings and project references to reflect new package locations after moves
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/test-import-patterns.mdc:0-0
Timestamp: 2025-12-04T12:16:13.591Z
Learning: Applies to **/*.test.ts : When extracting code between packages, move tests to the new package and update test imports to use relative source paths ('../src/...')
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/multi-plane-entrypoints.mdc:0-0
Timestamp: 2025-12-04T12:13:43.878Z
Learning: Applies to **/package.json : Export subpath entrypoints in `package.json` with correct types and import mappings for `./adapter`, `./control`, and `./runtime` paths
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/moving-packages.mdc:0-0
Timestamp: 2025-12-04T12:13:35.471Z
Learning: Applies to dependency-cruiser.config.mjs : In `dependency-cruiser.config.mjs`, update exclude patterns to reflect new package locations after moves
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/test-import-patterns.mdc:0-0
Timestamp: 2025-12-04T12:16:13.591Z
Learning: Applies to **/test/fixtures/**/*.ts : Test fixtures should import from package exports using workspace package names, not relative source paths
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/README.md:0-0
Timestamp: 2025-12-05T14:23:14.550Z
Learning: Applies to **/*.e2e.{test,spec}.{ts,tsx,js} : Use CLI e2e test fixture patterns with shared fixture app (see .cursor/rules/cli-e2e-test-patterns.mdc)
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/multi-plane-packages.mdc:0-0
Timestamp: 2025-12-04T12:13:53.734Z
Learning: Applies to **/src/exports/**/*.ts : Exports directory (`src/exports/`) should include re-export files (adapter.ts, codec-types.ts, types.ts) in addition to plane-specific entry points (control.ts, runtime.ts)
📚 Learning: 2025-12-04T12:15:37.900Z
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/sql-types-imports.mdc:0-0
Timestamp: 2025-12-04T12:15:37.900Z
Learning: Applies to packages/sql/**/*.{ts,tsx} : Import SQL-specific operations (`OperationSignature`, `LoweringSpec`, `assembleOperationRegistry`) from `prisma-next/sql-operations` (shared plane package)

Applied to files:

  • packages/sql/lanes/relational-core/test/column-builder-operations.test.ts
📚 Learning: 2025-12-04T12:15:37.900Z
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/sql-types-imports.mdc:0-0
Timestamp: 2025-12-04T12:15:37.900Z
Learning: Applies to **/*.{ts,tsx} : Import target-neutral operations (`OperationRegistry`, `ArgSpec`, `ReturnSpec`, `createOperationRegistry`) from `prisma-next/operations`

Applied to files:

  • packages/sql/lanes/relational-core/test/column-builder-operations.test.ts
📚 Learning: 2025-12-04T12:17:25.153Z
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/use-ast-factories.mdc:0-0
Timestamp: 2025-12-04T12:17:25.153Z
Learning: Applies to **/*.{test,spec}.ts : Use factory functions (such as `createColumnRef`, `createParamRef`, `createLiteralExpr`, `createTableRef`, `createBinaryExpr`) for creating AST nodes in tests instead of manual object creation

Applied to files:

  • packages/sql/lanes/relational-core/test/column-builder-operations.test.ts
📚 Learning: 2025-12-05T14:24:04.497Z
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/typescript-patterns.mdc:0-0
Timestamp: 2025-12-05T14:24:04.497Z
Learning: Applies to **/*.{ts,tsx} : When extracting types from `ColumnBuilder` instances, use `infer` for all type parameters to allow correct type inference. Avoid constraining type parameters too strictly with `infer T extends SomeType` when it prevents matching specific operation types.

Applied to files:

  • packages/sql/lanes/relational-core/test/column-builder-operations.test.ts
📚 Learning: 2025-12-04T12:15:46.557Z
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/test-database-limitations.mdc:0-0
Timestamp: 2025-12-04T12:15:46.557Z
Learning: Applies to **/*.test.ts : In tests using `withDevDatabase()` from `prisma-next/test-utils`, avoid selecting or using extension-dependent columns (like pgvector, pg_trgm) when testing features unrelated to extension functionality, as pglite does not support PostgreSQL extensions

Applied to files:

  • packages/sql/lanes/relational-core/test/column-builder-operations.test.ts
📚 Learning: 2025-12-05T14:24:04.497Z
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/typescript-patterns.mdc:0-0
Timestamp: 2025-12-05T14:24:04.497Z
Learning: Applies to **/*.{ts,tsx} : `AnyColumnBuilder` must use `any` for the `Operations` parameter due to TypeScript's variance limitations. This exception requires a documented explanation of why `any` is necessary.

Applied to files:

  • packages/sql/lanes/relational-core/test/column-builder-operations.test.ts
📚 Learning: 2025-12-04T12:16:59.752Z
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/type-extraction-from-contract.mdc:0-0
Timestamp: 2025-12-04T12:16:59.752Z
Learning: Applies to **/*.{ts,tsx} : Never pass `CodecTypes` or `OperationTypes` as separate type parameters to `schema()`, `sql()`, or `orm()` functions

Applied to files:

  • packages/sql/lanes/relational-core/test/column-builder-operations.test.ts
📚 Learning: 2025-12-05T14:23:37.092Z
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/prefer-assertions-over-defensive-checks.mdc:0-0
Timestamp: 2025-12-05T14:23:37.092Z
Learning: Applies to **/*.test.ts : Avoid using type assertions in tests to bypass type checking or test impossible states. Remove tests that use type assertions (e.g., 'as SqlContract<SqlStorage>') to test scenarios that contradict validated schemas.

Applied to files:

  • packages/sql/lanes/relational-core/test/column-builder-operations.test.ts
📚 Learning: 2025-12-05T14:23:14.550Z
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/README.md:0-0
Timestamp: 2025-12-05T14:23:14.550Z
Learning: Applies to **/*.{ts,tsx} : Import SQL types from prisma-next/sql-contract/types (see .cursor/rules/sql-types-imports.mdc)

Applied to files:

  • packages/sql/lanes/relational-core/test/column-builder-operations.test.ts
📚 Learning: 2025-12-04T12:15:46.557Z
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/test-database-limitations.mdc:0-0
Timestamp: 2025-12-04T12:15:46.557Z
Learning: Applies to **/*.test.ts : When writing ORM tests with includes, relation filters, or other non-extension features, explicitly exclude extension-dependent columns from select statements to ensure compatibility with pglite-based test databases

Applied to files:

  • packages/sql/lanes/relational-core/test/column-builder-operations.test.ts
📚 Learning: 2025-12-04T12:16:51.399Z
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/testing-guide.mdc:0-0
Timestamp: 2025-12-04T12:16:51.399Z
Learning: Applies to **/*.test.{ts,tsx,js} : Test fixtures should not depend on specific adapters (e.g., `prisma-next/adapter-postgres`). Define `CodecTypes` inline in test fixtures to remain adapter-agnostic and use `createStubAdapter()` from `prisma-next/runtime/test/utils` instead of specific adapter factories.

Applied to files:

  • packages/sql/lanes/relational-core/test/column-builder-operations.test.ts
📚 Learning: 2025-12-04T12:16:51.399Z
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/testing-guide.mdc:0-0
Timestamp: 2025-12-04T12:16:51.399Z
Learning: Applies to **/*.test-d.ts : Use `expectTypeOf` from Vitest for type testing in type test files (not runtime assertions)

Applied to files:

  • packages/sql/lanes/relational-core/test/column-builder-operations.test.ts
📚 Learning: 2025-11-25T12:27:11.738Z
Learnt from: CR
Repo: prisma/pdp-control-plane PR: 0
File: packages/interactors/AGENTS.md:0-0
Timestamp: 2025-11-25T12:27:11.738Z
Learning: Applies to packages/interactors/**/*.test.ts : Tests are written using Vitest

Applied to files:

  • packages/sql/lanes/relational-core/test/column-builder-operations.test.ts
📚 Learning: 2025-12-04T12:16:51.399Z
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/testing-guide.mdc:0-0
Timestamp: 2025-12-04T12:16:51.399Z
Learning: Applies to **/*.test.{ts,tsx,js} : Import test utilities from specific packages to avoid circular dependencies: Use `prisma-next/test-utils` for generic database/async utilities, `prisma-next/runtime/test/utils` for runtime-specific utilities, and `e2e-tests/test/utils.ts` for contract-related E2E utilities.

Applied to files:

  • packages/sql/lanes/relational-core/test/column-builder-operations.test.ts
📚 Learning: 2025-12-04T12:15:46.557Z
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/test-database-limitations.mdc:0-0
Timestamp: 2025-12-04T12:15:46.557Z
Learning: Applies to **/*.test.ts : When tests must verify extension functionality end-to-end (e.g., pgvector queries), use a real PostgreSQL database instead of `withDevDatabase()` via `withClient()` and `process.env['DATABASE_URL']`

Applied to files:

  • packages/sql/lanes/relational-core/test/column-builder-operations.test.ts
📚 Learning: 2025-12-04T12:12:15.848Z
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/contract-normalization-responsibilities.mdc:0-0
Timestamp: 2025-12-04T12:12:15.848Z
Learning: Applies to prisma-next/sql-query/src/contract.ts : The `validateContract()` function must assume the contract passed to it is already normalized (all required fields present) and throw errors if required fields are missing or have incorrect types

Applied to files:

  • packages/sql/lanes/relational-core/test/column-builder-operations.test.ts
📚 Learning: 2025-12-04T12:12:15.848Z
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/contract-normalization-responsibilities.mdc:0-0
Timestamp: 2025-12-04T12:12:15.848Z
Learning: Applies to prisma-next/sql-query/src/contract.ts : The `validateContract()` function must validate contract structure and types only, using Arktype schemas for structural validation and checking logical consistency (e.g., FK references), but must NOT normalize the contract or set default values for missing fields

Applied to files:

  • packages/sql/lanes/relational-core/test/column-builder-operations.test.ts
📚 Learning: 2025-12-04T12:12:15.848Z
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/contract-normalization-responsibilities.mdc:0-0
Timestamp: 2025-12-04T12:12:15.848Z
Learning: Applies to prisma-next/sql-query/src/contract-builder.ts : The contract builder must always output a fully normalized contract with all required ContractIR fields present (non-optional), allowing empty objects/arrays but ensuring no fields are missing

Applied to files:

  • packages/sql/lanes/relational-core/test/column-builder-operations.test.ts
📚 Learning: 2025-12-04T12:12:15.848Z
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/contract-normalization-responsibilities.mdc:0-0
Timestamp: 2025-12-04T12:12:15.848Z
Learning: Applies to prisma-next/cli/src/load-ts-contract.ts : The `loadContractFromTs()` function must assume contracts loaded from manually-written files should be normalized elsewhere (e.g., in the contract builder) and not perform normalization itself

Applied to files:

  • packages/sql/lanes/relational-core/test/column-builder-operations.test.ts
🧬 Code graph analysis (1)
packages/sql/lanes/relational-core/test/column-builder-operations.test.ts (1)
packages/sql/lanes/relational-core/src/ast/types.ts (1)
  • OperationExpr (31-39)
🔇 Additional comments (1)
packages/sql/lanes/relational-core/test/column-builder-operations.test.ts (1)

326-348: Good removal of inline type imports.

Replacing the inline type imports with a top-level import reduces dependency on tsconfig path mappings and aligns with the PR objectives. The type references are now cleaner and easier to maintain.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Lite

📥 Commits

Reviewing files that changed from the base of the PR and between 7ef2d8f and f0eade8.

📒 Files selected for processing (1)
  • packages/framework/tooling/cli/vitest.config.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (9)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/arktype-usage.mdc)

**/*.{ts,tsx}: Use the 'key?' syntax with the ? suffix for optional keys in Arktype schemas instead of using 'string | undefined' type unions
Reference schemas directly as object property values in Arktype schemas - this works seamlessly without special syntax
Use type({ '[string]': Schema }) syntax to create Record<string, Schema> types in Arktype instead of using Record<string, Schema> string notation
Use the .array() method on Arktype schemas to create array types instead of wrapping schemas in type([Schema]) or using manual validation
Extract TypeScript types from Arktype schemas using the .infer property instead of manually duplicating type definitions
Use type.declare<>() to ensure Arktype schemas match pre-existing TypeScript types for compile-time type safety, especially when working with readonly properties
Use .array().readonly() method chaining to create readonly array types in Arktype instead of using string notation like 'string[]'
Don't manually re-validate what Arktype has already checked - once validation passes, trust the structure matches the schema
Use instanceof type.errors to check for Arktype validation errors instead of other error checking patterns, for proper type narrowing
Return the original input value from validation functions instead of returning the Arktype validation result to preserve literal types

**/*.{ts,tsx}: Always use Control*Descriptor types (ControlFamilyDescriptor, ControlTargetDescriptor, ControlAdapterDescriptor, ControlDriverDescriptor, ControlExtensionDescriptor). Legacy descriptor types have been completely removed.
All descriptors must include required properties: kind (discriminator), id (string identifier), familyId (literal type), targetId (literal type for target/adapter/driver/extension), manifest (ExtensionPackManifest), and create() factory method
Use base instance interfaces: ControlFamilyInstance, ControlTargetInstance, ControlAdapterInstance, `ControlDriverIn...

Files:

  • packages/framework/tooling/cli/vitest.config.ts
**/*config.ts

📄 CodeRabbit inference engine (.cursor/rules/config-validation-and-normalization.mdc)

**/*config.ts: Use Arktype for validation in defineConfig() functions when implementing config files
Validate config structure using Arktype schemas and throw errors with clear messages when structure is invalid
Apply default values for optional config fields in defineConfig() and return a fully normalized config object
Use join() and dirname() from node:path for default path resolution in normalized config outputs
Validate and normalize nested config structures at each level using Arktype schemas
Join multiple Arktype validation error messages with semicolons for clear, actionable error reporting to users

Files:

  • packages/framework/tooling/cli/vitest.config.ts
**/cli/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/control-plane-descriptors.mdc)

Always pass a driver parameter to ControlFamilyDescriptor.create(), even for commands that don't use it (e.g., contract emit). This ensures consistent descriptor patterns across all commands.

Files:

  • packages/framework/tooling/cli/vitest.config.ts
**/*.config.*

📄 CodeRabbit inference engine (.cursor/rules/declarative-config.mdc)

Prefer declarative configuration over hardcoded logic in config generators - use declarative data structures (JSON config files) instead of hardcoded conditionals for validation rules, constraints, and configuration logic

Files:

  • packages/framework/tooling/cli/vitest.config.ts
packages/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/import-validation.mdc)

packages/**/*.{ts,tsx}: Same-layer imports are allowed: packages in the same layer can import from each other (e.g., orm-lane can import from sql-relational-core if both are in the lanes layer)
Cross-layer imports must flow inward (toward core): packages can only import from inner layers (closer to core). Outer layers cannot import from inner layers (e.g., core layer cannot import from lanes layer)

Import SQL emitter hook (sqlTargetFamilyHook) from @prisma-next/sql-contract-emitter

Files:

  • packages/framework/tooling/cli/vitest.config.ts
**/*.ts

📄 CodeRabbit inference engine (.cursor/rules/modular-refactoring-patterns.mdc)

**/*.ts: Start refactoring by extracting pure, side-effect-free utility functions as thin wrappers around AST factories and error constructors
Extract state management into separate modules defining immutable state shapes and interfaces
Replace any types with proper generic type parameters during function extraction, using existing type definitions like ModelColumnAccessor
Use the compact helper function to remove undefined values from objects when TypeScript's exactOptionalPropertyTypes is enabled
Organize imports in the following order: external type imports, external value imports, internal type imports, internal value imports

Do not export functions, types, or utilities solely for test use; instead, tests should import from source using relative paths within the same package or refactor to use public APIs

**/*.ts: Prefer assertions over defensive checks when data is guaranteed to be valid in TypeScript. Use non-null assertions (!) after validation checks instead of optional chaining or defensive conditionals.
Use assertions to access validated properties directly (e.g., columnMeta.codecId, columnMeta.nullable) instead of optional chaining (columnMeta?.codecId) after validation has already occurred.

Files:

  • packages/framework/tooling/cli/vitest.config.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/shared-plane-packages.mdc)

Import from shared plane packages using the package name and export identifier (e.g., @prisma-next/sql-contract/types), not /exports/ paths

**/*.{ts,tsx,js,jsx}: Use arktype instead of zod for schema validation
Don't add comments if avoidable; prefer code which expresses its intent
Don't add exports for backwards compatibility unless explicitly requested
Do not reexport things from one file in another, except in the exports/ folders

**/*.{ts,tsx,js,jsx}: Prefer links to canonical docs over long comments
Package layering is enforced; fix violations rather than bypassing via import validation

If you need to disable a Biome rule for more than a couple of lines in a file, use a file-level disable comment at the top instead of many inline disable comments.

Files:

  • packages/framework/tooling/cli/vitest.config.ts
**/vitest.config.ts

📄 CodeRabbit inference engine (.cursor/rules/test-import-patterns.mdc)

**/vitest.config.ts: Vitest configuration should use the 'vite-tsconfig-paths' plugin to automatically resolve workspace dependencies using tsconfig path mappings instead of manual aliases
In vitest.config.ts, external packages in imports should be sorted alphabetically and Biome will enforce this ordering

Files:

  • packages/framework/tooling/cli/vitest.config.ts
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/testing-guide.mdc)

Always quote table names in SQL statements to handle PostgreSQL reserved keywords (e.g., use "user" instead of user).

**/*.{ts,tsx,js}: Follow layering rules and exceptions (see .cursor/rules/import-validation.mdc)
Resolve cyclic dependencies by checking for unused dependencies (see .cursor/rules/resolving-cyclic-dependencies.mdc)
Prefer declarative configuration over hardcoded logic (see .cursor/rules/declarative-config.mdc)
Prohibit inline type imports in source files (see .cursor/rules/no-inline-imports.mdc)
Use Object.hasOwn() instead of hasOwnProperty() (see .cursor/rules/object-hasown.mdc)

Files:

  • packages/framework/tooling/cli/vitest.config.ts
🧠 Learnings (18)
📓 Common learnings
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/test-file-organization.mdc:0-0
Timestamp: 2025-12-04T12:15:57.358Z
Learning: Applies to **/*integration*.{test,spec}.ts : When splitting test files with multiple packages, place integration tests that depend on multiple packages in `prisma-next/integration-tests` to avoid cyclic dependencies
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/testing-guide.mdc:0-0
Timestamp: 2025-12-04T12:16:51.399Z
Learning: Applies to **/*.test.{ts,tsx,js} : Import test utilities from specific packages to avoid circular dependencies: Use `prisma-next/test-utils` for generic database/async utilities, `prisma-next/runtime/test/utils` for runtime-specific utilities, and `e2e-tests/test/utils.ts` for contract-related E2E utilities.
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/resolving-cyclic-dependencies.mdc:0-0
Timestamp: 2025-12-04T12:15:08.433Z
Learning: Remove unused dependencies from package.json when they create cyclic dependencies, then run `pnpm install` and `pnpm typecheck` to verify no breaks occur
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/cli-e2e-test-patterns.mdc:0-0
Timestamp: 2025-12-05T14:23:28.220Z
Learning: Applies to packages/framework/tooling/cli/test/cli-e2e-test-app/package.json : Keep the root `package.json` in `packages/framework/tooling/cli/test/cli-e2e-test-app/` static with dependencies installed via `pnpm install` for workspace dependency resolution
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/moving-packages.mdc:0-0
Timestamp: 2025-12-04T12:13:35.471Z
Learning: Test packages moved to `test/` directory must remain in `pnpm-workspace.yaml` for dependency resolution, be marked as `private: true` in `package.json`, use `workspace:*` protocol for dependencies, not be included in `architecture.config.json`, and be excluded from dependency cruiser checks
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/README.md:0-0
Timestamp: 2025-12-05T14:23:14.550Z
Learning: Applies to **/*.{ts,tsx,js} : Resolve cyclic dependencies by checking for unused dependencies (see .cursor/rules/resolving-cyclic-dependencies.mdc)
Learnt from: carlagn
Repo: prisma/website PR: 1272
File: app/mcp/HeroBg.tsx:236-245
Timestamp: 2025-10-09T18:46:35.603Z
Learning: In PR #1272 for the prisma/website repository, the user carlagn requested not to provide additional review comments on the file `app/mcp/HeroBg.tsx` after initial suggestions were made, to avoid piling up changes while they implement fixes.
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/moving-packages.mdc:0-0
Timestamp: 2025-12-04T12:13:35.471Z
Learning: Applies to **/packages/**/+(*.test|*.spec).{ts,tsx,js,jsx} : In test files, update paths to other packages, extension pack manifests, fixtures, and import paths based on the new package location's directory depth from root
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/test-import-patterns.mdc:0-0
Timestamp: 2025-12-04T12:16:13.591Z
Learning: Applies to **/*.test.ts : When importing from sibling packages within the same domain in test files, use relative paths instead of workspace package names
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/test-import-patterns.mdc:0-0
Timestamp: 2025-12-04T12:16:13.591Z
Learning: Applies to **/*.test.ts : Cross-package tests should import from package exports rather than relative source paths
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/test-import-patterns.mdc:0-0
Timestamp: 2025-12-04T12:16:13.591Z
Learning: Applies to **/test/fixtures/**/*.ts : Test fixtures should import from package exports using workspace package names, not relative source paths
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/README.md:0-0
Timestamp: 2025-12-05T14:23:14.550Z
Learning: Applies to **/*.{test,spec}.{ts,tsx,js} : Use test import patterns: source files, relative paths, don't export for tests (see .cursor/rules/test-import-patterns.mdc)
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/test-import-patterns.mdc:0-0
Timestamp: 2025-12-04T12:16:13.591Z
Learning: Applies to **/*.test.ts : When extracting code between packages, move tests to the new package and update test imports to use relative source paths ('../src/...')
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/README.md:0-0
Timestamp: 2025-12-05T14:23:14.550Z
Learning: Applies to **/*.e2e.{test,spec}.{ts,tsx,js} : Use CLI e2e test fixture patterns with shared fixture app (see .cursor/rules/cli-e2e-test-patterns.mdc)
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/test-file-organization.mdc:0-0
Timestamp: 2025-12-04T12:15:57.358Z
Learning: Applies to **/*.{test,spec}.ts : Ensure each split test file contains all necessary imports, setup/teardown code, and is independently runnable without dependencies on other test files
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/moving-packages.mdc:0-0
Timestamp: 2025-12-04T12:13:35.471Z
Learning: Applies to dependency-cruiser.config.mjs : In `dependency-cruiser.config.mjs`, update exclude patterns to reflect new package locations after moves
📚 Learning: 2025-12-04T12:16:51.399Z
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/testing-guide.mdc:0-0
Timestamp: 2025-12-04T12:16:51.399Z
Learning: Applies to vitest.config.{ts,js} : Configure coverage explicitly in vitest config with `include: ['src/**/*.ts']` to ensure source files are tracked. Import from source in tests (e.g., `../src/index`) not from package exports.

Applied to files:

  • packages/framework/tooling/cli/vitest.config.ts
📚 Learning: 2025-12-03T14:12:46.151Z
Learnt from: CR
Repo: prisma/ppg-canaries PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-03T14:12:46.151Z
Learning: Applies to tests/**/*.test.ts : All tests must pass with pnpm test and coverage must be maintained or improved

Applied to files:

  • packages/framework/tooling/cli/vitest.config.ts
📚 Learning: 2025-12-05T14:23:37.092Z
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/prefer-assertions-over-defensive-checks.mdc:0-0
Timestamp: 2025-12-05T14:23:37.092Z
Learning: Applies to **/*.test.ts : Remove tests that use type assertions to test impossible states or test code coverage without testing real scenarios. After refactoring to use assertions, clean up unrealistic test cases.

Applied to files:

  • packages/framework/tooling/cli/vitest.config.ts
📚 Learning: 2025-11-25T12:27:11.738Z
Learnt from: CR
Repo: prisma/pdp-control-plane PR: 0
File: packages/interactors/AGENTS.md:0-0
Timestamp: 2025-11-25T12:27:11.738Z
Learning: Applies to packages/interactors/**/*.test.ts : Tests are written using Vitest

Applied to files:

  • packages/framework/tooling/cli/vitest.config.ts
📚 Learning: 2025-11-25T09:20:46.384Z
Learnt from: CR
Repo: prisma/pdp-cloudflare PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2025-11-25T09:20:46.384Z
Learning: When modifying TypeScript files in the services directory (matching 'services/**/*.ts'), you must also add or modify at least one corresponding test file matching either '**/*.test.ts' or '**/*.spec.ts' to ensure proper test coverage

Applied to files:

  • packages/framework/tooling/cli/vitest.config.ts
📚 Learning: 2025-12-04T12:16:13.591Z
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/test-import-patterns.mdc:0-0
Timestamp: 2025-12-04T12:16:13.591Z
Learning: Applies to **/vitest.config.ts : Vitest configuration should use the 'vite-tsconfig-paths' plugin to automatically resolve workspace dependencies using tsconfig path mappings instead of manual aliases

Applied to files:

  • packages/framework/tooling/cli/vitest.config.ts
📚 Learning: 2025-12-04T12:16:51.399Z
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/testing-guide.mdc:0-0
Timestamp: 2025-12-04T12:16:51.399Z
Learning: Applies to **/*.test-d.ts : Use `expectTypeOf` from Vitest for type testing in type test files (not runtime assertions)

Applied to files:

  • packages/framework/tooling/cli/vitest.config.ts
📚 Learning: 2025-12-05T14:23:28.220Z
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/cli-e2e-test-patterns.mdc:0-0
Timestamp: 2025-12-05T14:23:28.220Z
Learning: Applies to packages/framework/tooling/cli/test/**/*.test.{ts,tsx} : Do not pass `stdio` option with `execFile`; use `execFile` (not `spawn`) which captures stdout/stderr by default without needing the `stdio` option

Applied to files:

  • packages/framework/tooling/cli/vitest.config.ts
📚 Learning: 2025-12-05T14:23:28.220Z
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/cli-e2e-test-patterns.mdc:0-0
Timestamp: 2025-12-05T14:23:28.220Z
Learning: Applies to packages/framework/tooling/cli/test/**/*.test.{ts,tsx} : Use `setupTestDirectoryFromFixtures()` helper to create isolated ephemeral test directories from fixture subdirectories in CLI e2e tests

Applied to files:

  • packages/framework/tooling/cli/vitest.config.ts
📚 Learning: 2025-12-05T14:23:14.550Z
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/README.md:0-0
Timestamp: 2025-12-05T14:23:14.550Z
Learning: Applies to **/*.e2e.{test,spec}.{ts,tsx,js} : Use CLI e2e test fixture patterns with shared fixture app (see .cursor/rules/cli-e2e-test-patterns.mdc)

Applied to files:

  • packages/framework/tooling/cli/vitest.config.ts
📚 Learning: 2025-12-04T12:16:51.399Z
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/testing-guide.mdc:0-0
Timestamp: 2025-12-04T12:16:51.399Z
Learning: Applies to **/*.test.{ts,tsx,js} : Keep test files under 500 lines maximum. Split large files by functionality (basic, errors, structure, generation), feature area (joins, projections, includes), or test type (unit, integration, edge-cases). Use descriptive file names like `codecs.registry.test.ts`, `runtime.joins.test.ts`, `driver.errors.test.ts`.

Applied to files:

  • packages/framework/tooling/cli/vitest.config.ts
📚 Learning: 2025-12-05T14:23:14.550Z
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/README.md:0-0
Timestamp: 2025-12-05T14:23:14.550Z
Learning: Applies to **/*.{test,spec}.{ts,tsx,js} : Organize test files with max 500 lines, split by functionality (see .cursor/rules/test-file-organization.mdc)

Applied to files:

  • packages/framework/tooling/cli/vitest.config.ts
📚 Learning: 2025-12-04T12:15:57.358Z
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/test-file-organization.mdc:0-0
Timestamp: 2025-12-04T12:15:57.358Z
Learning: Applies to **/*.{test,spec}.ts : Test files must not exceed 500 lines; split files that exceed this limit into multiple files organized by logical functionality

Applied to files:

  • packages/framework/tooling/cli/vitest.config.ts
📚 Learning: 2025-12-04T12:15:30.047Z
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/shared-plane-packages.mdc:0-0
Timestamp: 2025-12-04T12:15:30.047Z
Learning: Applies to packages/**/test/**/*.{ts,test.ts} : Shared plane packages should include unit tests for validators and factories, type tests for exported types, and no integration tests requiring migration or runtime plane packages

Applied to files:

  • packages/framework/tooling/cli/vitest.config.ts
📚 Learning: 2025-12-03T09:31:15.792Z
Learnt from: CR
Repo: prisma/pdp-cloudflare PR: 0
File: services/tenant-manager/AGENTS.md:0-0
Timestamp: 2025-12-03T09:31:15.792Z
Learning: Applies to services/tenant-manager/tests/**/*.test.ts : Test suite must cover all critical paths including provisioning, cleanup, and error scenarios

Applied to files:

  • packages/framework/tooling/cli/vitest.config.ts
📚 Learning: 2025-12-08T11:20:55.987Z
Learnt from: CR
Repo: prisma/pdp-cloudflare PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-08T11:20:55.987Z
Learning: Applies to **/test/**/*.test.ts : Write unit tests for individual functions and classes

Applied to files:

  • packages/framework/tooling/cli/vitest.config.ts
📚 Learning: 2025-12-05T14:23:14.550Z
Learnt from: CR
Repo: prisma/prisma-next PR: 0
File: .cursor/rules/README.md:0-0
Timestamp: 2025-12-05T14:23:14.550Z
Learning: Applies to **/*.{test,spec}.{ts,tsx,js} : Follow testing guide pointers and patterns (see .cursor/rules/testing-guide.mdc)

Applied to files:

  • packages/framework/tooling/cli/vitest.config.ts

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants