This document describes the package layering structure and naming conventions for Prisma Next, as defined in ADR 140.
The package structure encodes three orthogonal ideas:
- Domains (framework vs target families). The framework domain is target-agnostic; target families (SQL, document, etc.) are family-specific.
- Layers (responsibility-based layers). Layers express dependency direction: packages may depend on peers in the same layer (lateral relationships) and on layers closer to core (downward), but never "upward."
- Planes (migration vs runtime). Migration plane (authoring, tooling, targets) must not import runtime plane code. Runtime plane may consume artifacts (JSON/manifests) from migration, but not code imports.
This separation keeps the architecture flexible (per the original Clean Architecture guidance) while still making it obvious where SQL/document packages live and enforcing clear boundaries between migration and runtime concerns.
The repository uses numbered prefixes in directory names to make the hierarchy explicit:
packages/
1-framework/ # Domain 1: Framework (target-agnostic)
0-foundation/ # Layer 0: Foundation
1-core/ # Layer 1: Core
2-authoring/ # Layer 2: Authoring
3-tooling/ # Layer 3: Tooling
2-document/ # Domain 2: Document (placeholder)
2-mongo-family/ # Domain 2: Mongo family
2-sql/ # Domain 2: SQL family
1-core/ # Layer 1: Core
2-authoring/ # Layer 2: Authoring
3-tooling/ # Layer 3: Tooling
4-lanes/ # Layer 4: Lanes
5-runtime/ # Layer 5: Runtime
3-mongo-target/ # Domain 3: Mongo target
3-extensions/ # Domain 3: Extensions
3-targets/ # Domain 3: Targets
3-targets/ # Layer 3: Target descriptors
6-adapters/ # Layer 6: Adapters
7-drivers/ # Layer 7: Drivers
The numbered prefixes serve two purposes:
- Visual hierarchy: Makes domain/layer relationships clear at a glance
- Dependency direction: Lower numbers can be imported by higher numbers, never the reverse
Planes are a conceptual grouping recorded in architecture.config.json but do not appear as intermediate subdirectories.
The framework domain (packages/1-framework/) contains target-agnostic packages that work across all target families:
* 1-framework
|-- 0-foundation
| |-- contract/ → @prisma-next/contract
|-- 1-core
| |-- config/ → @prisma-next/config
| |-- errors/ → @prisma-next/errors
| |-- framework-components/ → @prisma-next/framework-components
| |-- operations/ → @prisma-next/operations
|-- 2-authoring (migration plane)
| |-- contract/ → @prisma-next/contract-authoring
| |-- psl-parser/ → @prisma-next/psl-parser
|-- 3-tooling (migration plane)
|-- cli/ → @prisma-next/cli
|-- emitter/ → @prisma-next/emitter
|-- migration/ → @prisma-next/migration-tools
The SQL domain (packages/2-sql/) contains SQL-specific packages organized by layer:
* 2-sql
|-- 1-core (shared plane)
| |-- contract/ → @prisma-next/sql-contract
| |-- operations/ → @prisma-next/sql-operations
| |-- schema-ir/ → @prisma-next/sql-schema-ir
|-- 2-authoring (migration plane)
| |-- contract-ts/ → @prisma-next/sql-contract-ts
|-- 3-tooling (migration plane)
| |-- emitter/ → @prisma-next/sql-contract-emitter
|-- 4-lanes (runtime plane)
| |-- relational-core/ → @prisma-next/sql-relational-core
| |-- sql-lane/ → @prisma-next/sql-lane
| |-- orm-lane/ → @prisma-next/sql-orm-lane
| |-- query-builder/ → @prisma-next/sql-lane-query-builder
|-- 5-runtime (runtime plane)
|-- → @prisma-next/sql-runtime
|-- 9-family (migration plane)
|-- → @prisma-next/family-sql
The Mongo family domain (packages/2-mongo-family/) contains Mongo-specific packages organized by layer:
* 2-mongo-family
|-- 1-foundation (shared plane)
| |-- mongo-contract/ → @prisma-next/mongo-contract
|-- 2-authoring (migration plane)
| |-- contract-psl/ → @prisma-next/mongo-contract-psl
| |-- contract-ts/ → @prisma-next/mongo-contract-ts
|-- 3-tooling (migration plane)
| |-- emitter/ → @prisma-next/mongo-emitter
|-- 4-query (runtime plane)
| |-- query-ast/ → @prisma-next/mongo-query-ast
|-- 5-query-builders (runtime plane)
| |-- orm/ → @prisma-next/mongo-orm
| |-- query-builder/ → @prisma-next/mongo-query-builder
|-- 6-transport (shared plane)
| |-- mongo-lowering/ → @prisma-next/mongo-lowering
| |-- mongo-wire/ → @prisma-next/mongo-wire
|-- 7-runtime (runtime plane)
| |-- → @prisma-next/mongo-runtime
|-- 9-family (migration plane)
|-- → @prisma-next/family-mongo
The targets domain (packages/3-targets/) contains concrete target extension packs (e.g., Postgres, MySQL). Dialect (target), adapter, and driver are kept as separate packages to enable mix-and-match:
* 3-targets
|-- 3-targets/postgres (migration plane)
| |-- → @prisma-next/target-postgres (target descriptor)
|-- 6-adapters/postgres (multi-plane: shared, migration, runtime)
| |-- → @prisma-next/adapter-postgres (adapter with control/runtime entrypoints)
|-- 7-drivers/postgres (runtime plane)
|-- → @prisma-next/driver-postgres (driver implementation)
Mongo-specific target packages live under packages/3-mongo-target/:
* 3-mongo-target
|-- 1-mongo-target (migration plane)
| |-- → @prisma-next/target-mongo (target descriptor / pack)
|-- 2-mongo-adapter (multi-plane)
| |-- → @prisma-next/adapter-mongo
|-- 3-mongo-driver (runtime plane)
|-- → @prisma-next/driver-mongo
The extensions domain (packages/3-extensions/) contains ecosystem extensions and compatibility layers:
* 3-extensions
|-- sql-orm-client/ (runtime plane)
| |-- → @prisma-next/sql-orm-client
|-- pgvector/ (multi-plane)
|-- → @prisma-next/extension-pgvector
Clean Architecture layers for Prisma Next:
- Core – target-agnostic contracts, plan metadata, shared operations, runtime kernel.
- Authoring – PSL/TS authoring surfaces plus shared descriptor types that produce contracts.
- Targets – family-specific contract types and emitter hooks.
- Lanes – query DSLs/ORMs that produce AST plans.
- Runtime – per-family runtime implementations that extend
RuntimeCorefrom@prisma-next/framework-components/runtime(core layer). - Adapters – database adapters/drivers and optional compat layers.
Dependencies flow downward (toward core); lateral dependencies within the same layer are permitted. Example: @prisma-next/sql-lane and @prisma-next/sql-orm-lane both live in the Lanes layer, so they may share helpers via @prisma-next/sql-relational-core, but neither may depend on Runtime or Adapters. Optional compat packages live at the edge alongside adapters; they can depend on inner layers but do not form a separate layer.
Core → Authoring → Targets → Lanes → Runtime → Adapters
(lateral deps allowed within each layer)
graph LR
Core[Core] --> Authoring
Authoring --> Targets
Targets --> Lanes
Lanes --> Runtime
Runtime --> Adapters
%% lateral relationships (same ring) shown as loops
Core --> Core
Authoring --> Authoring
Targets --> Targets
Lanes --> Lanes
Runtime --> Runtime
Adapters --> Adapters
Compat --> Compat
style Core fill:#e1f5ff,stroke:#01579b,stroke-width:2px
style Authoring fill:#f3e5f5,stroke:#4a148c,stroke-width:2px
style Targets fill:#fff3e0,stroke:#e65100,stroke-width:2px
style Lanes fill:#e8f5e9,stroke:#1b5e20,stroke-width:2px
style Runtime fill:#fce4ec,stroke:#880e4f,stroke-width:2px
style Adapters fill:#e0f2f1,stroke:#004d40,stroke-width:2px
The runtime ring is a single layer: RuntimeCore (the abstract base) lives on @prisma-next/framework-components/runtime (core layer) and is extended directly by family runtimes (@prisma-next/sql-runtime, @prisma-next/mongo-runtime). See ADR 204.
Within a domain:
- Layers may depend laterally (same layer) and downward (toward core), never upward.
- Example:
@prisma-next/sql-laneand@prisma-next/sql-orm-laneboth live in the Lanes layer, so they may share helpers via@prisma-next/sql-relational-core, but neither may depend on Runtime or Adapters.
Cross-domain:
- Cross-domain imports are forbidden except when importing framework packages.
- Example: SQL domain packages can import from framework domain packages, but not from other target families.
Plane boundaries:
- Migration plane (authoring, tooling, targets) must not import runtime plane code.
- Runtime plane may consume artifacts (JSON/manifests) from migration, but not code imports.
- Shared plane must not import from migration or runtime planes.
- Example:
@prisma-next/sql-contract-ts(migration plane) cannot import from@prisma-next/sql-lane(runtime plane).
Plane import constraints are enforced declaratively via planeRules in architecture.config.json. Each plane specifies which planes it can import from (allow) and which are forbidden (forbid), with optional exceptions for temporary refactoring needs.
The innermost layer containing target-family agnostic types and utilities.
packages/1-framework/0-foundation/contract/→@prisma-next/contract- Core contract types + plan metadatapackages/1-framework/1-core/operations/→@prisma-next/operations- Target-neutral operation registry + capability helperspackages/1-framework/1-core/framework-components/→@prisma-next/framework-components- Component descriptors, control-plane types (./control), execution-plane types (./execution), emission SPI types (./emission)packages/1-framework/1-core/errors/→@prisma-next/errors- CLI/runtime error factories and error types (./control)packages/1-framework/1-core/config/→@prisma-next/config- Config authoring types and validation
Dependency Rules: Cannot import from any other layer.
Contract authoring surfaces for creating contracts programmatically.
Framework Domain (Migration Plane):
packages/1-framework/2-authoring/contract/→@prisma-next/contract-authoring- shared target-neutral authoring descriptors (ColumnTypeDescriptor,IndexDef, FK metadata)packages/1-framework/2-authoring/psl-parser/→@prisma-next/psl-parser- PSL parser + IR (future)
SQL Domain (Migration Plane):
packages/2-sql/2-authoring/contract-ts/→@prisma-next/sql-contract-ts- SQL TS authoring surface, composed helper DSL, and lowering pipeline
Mongo Domain (Migration Plane):
packages/2-mongo-family/2-authoring/contract-psl/→@prisma-next/mongo-contract-psl- PSL interpretation into Mongo contract inputpackages/2-mongo-family/2-authoring/contract-ts/→@prisma-next/mongo-contract-ts- Mongo TS authoring surface fordefineContract(...)
Dependency Rules: Can import from core/* only. SQL authoring may also import from SQL tooling layer; Mongo authoring may also import from Mongo tooling layer.
Target-family specific emitter hooks and family-provided helpers for CLI assembly.
packages/2-sql/3-tooling/emitter/→@prisma-next/sql-contract-emitter- SQL emitter hookpackages/2-sql/9-family/→@prisma-next/family-sql- SQL family descriptor and authoring-time family packpackages/2-mongo-family/3-tooling/emitter/→@prisma-next/mongo-emitter- Mongo emitter hookpackages/2-mongo-family/9-family/→@prisma-next/family-mongo- Mongo family descriptor and authoring-time family packpackages/1-framework/3-tooling/cli/src/pack-assembly.ts- Generic assembly functions that loop over descriptors and delegate to family'sconvertOperationManifest()for conversion- Pack entrypoints: use
/controlfor control plane descriptors and helpers (no runtime),/runtimefor factories (runtime only). The app config imports from/controlto keep emit pure.
Dependency Rules: Can import from core/* and authoring/* only.
Lanes consume targets and relational-core helpers to produce AST plans. Packages in this layer may depend laterally on other lane utilities (e.g., shared relational helpers) and on inner layers, but not on runtime/adapter layers.
packages/2-sql/4-lanes/relational-core/→@prisma-next/sql-relational-core– shared schema/column builders, operation attachment, AST factoriespackages/2-sql/4-lanes/sql-lane/→@prisma-next/sql-lane– SQL DSL + raw lane (Phase 1 refactor keeps API stable while using shared factories)packages/2-sql/4-lanes/orm-lane/→@prisma-next/sql-orm-lane– ORM builder (Phase 1 removes dependency onsql-lane)packages/2-sql/4-lanes/query-builder/→@prisma-next/sql-lane-query-builder– Query builder lane
Per-family runtime implementations that extend the abstract RuntimeCore from @prisma-next/framework-components/runtime (core layer). There is no separate target-agnostic runtime package; the kernel collapsed into framework-components per ADR 204.
SQL Domain (Runtime Plane):
packages/2-sql/5-runtime/→@prisma-next/sql-runtime– SQL family runtime that extendsRuntimeCorefrom@prisma-next/framework-components/runtimewith SQL adapters (future document runtimes will mirror this)
Mongo Domain (Runtime Plane):
packages/2-mongo-family/7-runtime/→@prisma-next/mongo-runtime– Mongo family runtime that extendsRuntimeCorefrom@prisma-next/framework-components/runtimewith the Mongo adapter
Dependency Rules: Family runtimes import the runtime SPI (RuntimeCore, RuntimeMiddleware, RuntimeExecutor, runWithMiddleware) from @prisma-next/framework-components/runtime (core layer) and may also import from their family's lanes, transport, and adapter packages. There is no separate target-agnostic runtime package; per ADR 204, the runtime kernel collapsed into @prisma-next/framework-components and family runtimes extend it directly.
Database adapters, drivers, and targets (dialects) live in the Targets domain as separate packages. Adapters use multi-plane entrypoints to support both control (migration) and runtime usage.
Targets (Migration Plane):
packages/3-targets/3-targets/postgres/→@prisma-next/target-postgres- Postgres target descriptor
Adapters (Multi-Plane: Shared, Migration, Runtime):
packages/3-targets/6-adapters/postgres/→@prisma-next/adapter-postgres- Postgres adapter with multi-plane entrypoints:src/core/**→ shared plane (adapter SPI implementation)src/exports/control.ts→ migration plane (control plane descriptor)src/exports/runtime.ts→ runtime plane (runtime factory)
Drivers (Runtime Plane):
packages/3-targets/7-drivers/postgres/→@prisma-next/driver-postgres- Postgres driver
Key Principle: Published package name is the import specifier. Directory layout is for humans and guardrails.
- Use the published package name as the only import specifier
- Encode target family in the package name prefix (e.g.,
@prisma-next/sql-...) - Collapse nested directories to hyphenated names (no slashes after scope)
- Keep conventional names for adapters/drivers (e.g.,
@prisma-next/adapter-postgres,@prisma-next/driver-postgres). They are located underpackages/3-targets/**as separate packages (target, adapter, driver) to enable mix-and-match. - Layers constrain dependencies but don't generally appear in package names
| Directory | Published Package Name |
|---|---|
packages/1-framework/0-foundation/contract/ |
@prisma-next/contract |
packages/1-framework/1-core/operations/ |
@prisma-next/operations |
packages/1-framework/1-core/framework-components/ |
@prisma-next/framework-components |
packages/1-framework/1-core/errors/ |
@prisma-next/errors |
packages/1-framework/1-core/config/ |
@prisma-next/config |
packages/1-framework/2-authoring/contract/ |
@prisma-next/contract-authoring |
packages/1-framework/2-authoring/psl-parser/ |
@prisma-next/psl-parser |
packages/1-framework/3-tooling/cli/ |
@prisma-next/cli |
packages/1-framework/3-tooling/emitter/ |
@prisma-next/emitter |
packages/2-mongo-family/1-foundation/mongo-contract/ |
@prisma-next/mongo-contract |
packages/2-mongo-family/2-authoring/contract-psl/ |
@prisma-next/mongo-contract-psl |
packages/2-mongo-family/2-authoring/contract-ts/ |
@prisma-next/mongo-contract-ts |
packages/2-mongo-family/3-tooling/emitter/ |
@prisma-next/mongo-emitter |
packages/2-mongo-family/4-query/query-ast/ |
@prisma-next/mongo-query-ast |
packages/2-mongo-family/5-query-builders/orm/ |
@prisma-next/mongo-orm |
packages/2-mongo-family/5-query-builders/query-builder/ |
@prisma-next/mongo-query-builder |
packages/2-mongo-family/6-transport/mongo-lowering/ |
@prisma-next/mongo-lowering |
packages/2-mongo-family/6-transport/mongo-wire/ |
@prisma-next/mongo-wire |
packages/2-mongo-family/7-runtime/ |
@prisma-next/mongo-runtime |
packages/2-mongo-family/9-family/ |
@prisma-next/family-mongo |
packages/2-sql/1-core/contract/ |
@prisma-next/sql-contract |
packages/2-sql/1-core/operations/ |
@prisma-next/sql-operations |
packages/2-sql/1-core/schema-ir/ |
@prisma-next/sql-schema-ir |
packages/2-sql/2-authoring/contract-ts/ |
@prisma-next/sql-contract-ts |
packages/2-sql/3-tooling/emitter/ |
@prisma-next/sql-contract-emitter |
packages/2-sql/3-tooling/family/ |
@prisma-next/family-sql |
packages/2-sql/4-lanes/relational-core/ |
@prisma-next/sql-relational-core |
packages/2-sql/4-lanes/sql-lane/ |
@prisma-next/sql-lane |
packages/2-sql/4-lanes/orm-lane/ |
@prisma-next/sql-orm-lane |
packages/2-sql/4-lanes/query-builder/ |
@prisma-next/sql-lane-query-builder |
packages/2-sql/5-runtime/ |
@prisma-next/sql-runtime |
packages/3-mongo-target/1-mongo-target/ |
@prisma-next/target-mongo |
packages/3-mongo-target/2-mongo-adapter/ |
@prisma-next/adapter-mongo |
packages/3-mongo-target/3-mongo-driver/ |
@prisma-next/driver-mongo |
packages/3-targets/3-targets/postgres/ |
@prisma-next/target-postgres |
packages/3-targets/6-adapters/postgres/ |
@prisma-next/adapter-postgres |
packages/3-targets/7-drivers/postgres/ |
@prisma-next/driver-postgres |
packages/3-extensions/sql-orm-client/ |
@prisma-next/sql-orm-client |
packages/3-extensions/pgvector/ |
@prisma-next/extension-pgvector |
- Within a domain, layers may depend laterally (same layer) and downward (toward core), never upward - This is enforced by directory structure and import validation
- Cross-domain imports are forbidden except when importing framework packages - SQL domain packages can import from framework domain, but not from other target families
- Migration plane must not import runtime plane code - Authoring, tooling, and targets (migration plane) cannot import from lanes, runtime, or adapters (runtime plane)
- Runtime plane may consume artifacts (JSON/manifests) from migration, but not code imports - Runtime packages can read contract.json and manifest.json files, but cannot import TypeScript code from migration plane packages
- Directory placement dictates allowed dependencies (domain + layer + plane); package name dictates how consumers import
core/*→ cannot import from any other layerauthoring/*→ can import fromcore/*only2-sql/3-tooling/*→ can import from1-core/*and2-authoring/*only2-mongo-family/3-tooling/*and2-mongo-family/9-family→ can import from1-core/*and2-authoring/*only2-sql/4-lanes/*→ can import from1-core/*,2-authoring/*,2-sql/3-tooling/*only2-sql/5-runtime→ can import from1-framework/1-core/framework-components(forRuntimeCore/RuntimeMiddleware/runWithMiddleware),2-sql/3-tooling/*,2-sql/4-lanes/*, and3-targets/6-adapters/*only2-mongo-family/4-query/*,5-query-builders/*,6-transport/*,7-runtime→ follow the same downward-only rule within the Mongo family plus allowed framework imports (notably1-framework/1-core/framework-componentsfor the runtime SPI)3-targets/6-adapters/*→ can import from2-sql/3-tooling/*and2-sql/5-runtimeonly3-mongo-target/2-mongo-adapter→ can import from Mongo family shared/runtime layers, not SQL family packages
- Framework domain packages are target-agnostic and can be imported by any target family
- SQL domain packages can import from framework domain and their own SQL family packages
- Mongo domain packages can import from framework domain and their own Mongo family packages
- Family packages cannot import from other target families (e.g.,
sql/*cannot importmongo/*, andmongo/*cannot importsql/*) - SQL family packages use the
@prisma-next/sql-...prefix and Mongo family packages use the@prisma-next/mongo-...prefix for discoverability
Use curated subpath exports to keep public API stable across internal moves:
{
"name": "@prisma-next/sql-lane",
"type": "module",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js"
},
"./sql": {
"types": "./dist/exports/sql.d.ts",
"import": "./dist/exports/sql.js"
},
"./schema": {
"types": "./dist/exports/schema.d.ts",
"import": "./dist/exports/schema.js"
},
"./param": {
"types": "./dist/exports/param.d.ts",
"import": "./dist/exports/param.js"
}
},
"files": ["dist"]
}The pnpm-workspace.yaml includes patterns for all packages:
packages:
- packages/**
- examples/*
- test/**The numbered directory prefixes ensure packages appear in dependency order when browsing the filesystem.
Import dependencies are validated using Dependency Cruiser:
pnpm lint:depsDependency Cruiser:
- Scans all TypeScript files in
packages/ - Validates imports against domain, layer, and plane rules
- Reports violations with detailed context
- Can be run locally or in CI
- Supports incremental checks for lint-staged hooks
- Enforces the dependency direction:
core → authoring → targets → lanes → runtime → adapters
Implementation:
- Uses data-driven configuration from
architecture.config.json - Maps package directory globs to {domain, layer, plane} based on configuration
- Converts glob patterns to regex patterns in
dependency-cruiser.config.mjs - Uses TypeScript path resolution for accurate module resolution
- Allows same-layer imports (e.g.,
orm-lanecan import fromsql-relational-core) - Enforces cross-domain rules (only framework can be imported cross-domain)
- Enforces plane boundaries via declarative
planeRulesinarchitecture.config.json:- Shared plane cannot import from migration or runtime
- Migration plane cannot import from runtime
- Runtime plane cannot import from migration (with documented exceptions)
Status: ✅ Import validation is active and enforces Domains/Layers/Planes dependency rules using Dependency Cruiser with data-driven configuration. Plane rules are defined declaratively in architecture.config.json rather than hardcoded in the dependency cruiser config.
When adding a new package:
- Choose the correct domain (framework or target family like sql, or targets for extension packs)
- Choose the correct layer based on dependencies and purpose
- Choose the correct plane (migration, runtime, or shared)
- Follow naming conventions - use hyphenated names, encode family in prefix
- Add package mapping to
architecture.config.jsonwith domain/layer/plane- For multi-plane packages, add separate globs for each plane (e.g.,
src/core/**for shared,src/exports/cli.tsfor migration,src/exports/runtime.tsfor runtime)
- For multi-plane packages, add separate globs for each plane (e.g.,
- Add project references to
tsconfig.base.json. - Add workspace pattern to
pnpm-workspace.yamlif needed - Create README.md documenting purpose, dependencies, and architecture with domain/layer/plane labels
- Run import check to verify no violations
Some packages span multiple planes (e.g., adapters that have both control plane entry points and runtime code). These packages use a structured layout:
src/core/**: Shared plane code that can be imported by both migration and runtime planessrc/exports/control.ts: Migration plane entry point (control plane descriptors)src/exports/runtime.ts: Runtime plane entry point (runtime factories)
Example: @prisma-next/adapter-postgres spans three planes:
packages/3-targets/6-adapters/postgres/src/core/**→ domain:targets, layer:adapters, plane:sharedpackages/3-targets/6-adapters/postgres/src/exports/control.ts→ domain:targets, layer:adapters, plane:migrationpackages/3-targets/6-adapters/postgres/src/exports/runtime.ts→ domain:targets, layer:adapters, plane:runtime
Note: Dialect (target), adapter, and driver are separate packages under packages/3-targets/** to enable mix-and-match. The adapter package uses multi-plane entrypoints to support both control plane configuration (migration plane) and runtime usage (runtime plane) while keeping shared core code (shared plane) accessible to both.
This structure allows the same package to provide both control plane configuration (migration plane) and runtime implementation (runtime plane) while keeping shared code (core) accessible to both.
Directory Structure Status: ✅ Complete
The package layering structure uses numbered directory prefixes for visual hierarchy:
- All domain directories created with numbered prefixes (
1-framework/,2-sql/,2-document/,3-targets/,3-extensions/) - Active Mongo domains also live under numbered prefixes (
2-mongo-family/,3-mongo-target/) - All layer directories created with numbered prefixes (e.g.,
1-core/,2-authoring/,3-tooling/,4-lanes/,5-runtime/) - Plane subdirectories removed (
shared/,migration/,runtime/intermediate directories flattened) - Workspace configuration updated (
pnpm-workspace.yaml) - TypeScript project references updated (
tsconfig.base.json) - Import validation configured (Dependency Cruiser with
dependency-cruiser.config.mjs) - Architecture configuration file updated (
architecture.config.json) pnpm lint:depsscript validates dependency direction
Package Layout:
packages/1-framework/- Framework domain (target-agnostic)packages/2-mongo-family/- Mongo family domainpackages/2-sql/- SQL family domainpackages/2-document/- Document family domain (placeholder)packages/3-mongo-target/- Mongo target domain (target pack, adapter, driver)packages/3-targets/- Targets domain (concrete dialects, adapters, drivers)packages/3-extensions/- Extensions domain (compat layers, extension packs)
The numbered prefixes ensure:
- Packages appear in dependency order when browsing the filesystem
- Visual reinforcement of the architecture hierarchy
- Lower numbers can be imported by higher numbers, never the reverse