CAP Node.js packages define stable public entry points through package root
declarations and, where present, package exports maps. Treat those entry
points as the supported application contract.
Package roots stay framework-neutral unless the package is itself a framework
integration. Optional framework wrappers live behind explicit framework
subpaths, such as /nest.
Use package roots for framework-neutral APIs and for packages whose primary purpose is a framework integration:
import { CapEngine } from '@mikara89/cap-core';
import { createCapMessageEnvelope } from '@mikara89/cap-core';
import type { CapStorageCapabilities } from '@mikara89/cap-core';
import { CapModule, CapService, CapSubscribe } from '@mikara89/cap-nest';
import { createTestCapEngine } from '@mikara89/cap-testing';
import { createCapExpress } from '@mikara89/cap-express';
import { MikroPublishStorage } from '@mikara89/cap-storage-mikro-orm';
import { KnexPublishStorage } from '@mikara89/cap-storage-knex';
import { TypeOrmPublishStorage } from '@mikara89/cap-storage-typeorm';
import { PrismaPublishStorage } from '@mikara89/cap-storage-prisma';
import { ServiceBusPublisher } from '@mikara89/cap-transport-azure-servicebus';
import { NestjsMicroservicesTransportModule } from '@mikara89/cap-transport-nestjs-microservices';
import { KafkaPublisher, KafkaSubscriber } from '@mikara89/cap-transport-kafka';
import {
AwsSnsPublisher,
AwsSqsSubscriber,
} from '@mikara89/cap-transport-aws-sns-sqs';
import { CapDashboardModule } from '@mikara89/cap-dashboard-nest';
import { createCapDashboardRouter } from '@mikara89/cap-dashboard-express';
The supported package roots are:
@mikara89/cap-core@mikara89/cap-nest@mikara89/cap-testing@mikara89/cap-express@mikara89/cap-storage-mikro-orm@mikara89/cap-storage-knex@mikara89/cap-storage-typeorm@mikara89/cap-storage-prisma@mikara89/cap-transport-azure-servicebus@mikara89/cap-transport-nestjs-microservices@mikara89/cap-transport-rabbitmq@mikara89/cap-transport-kafka@mikara89/cap-transport-aws-sns-sqs@mikara89/cap-dashboard-core@mikara89/cap-dashboard-nest@mikara89/cap-dashboard-express@mikara89/cap-dashboard@mikara89/cap-dashboard remains supported as a compatibility alias for the
Nest dashboard package root.
@mikara89/cap-core exports the versioned envelope constants, types, creator,
guard, decoder, and typed decode errors from its package root. @mikara89/cap-nest
mirrors that envelope surface because it already mirrors core messaging types.
The v2.3 storage roots expose their complete framework-free APIs:
| Package | Public root surface |
|---|---|
@mikara89/cap-storage-knex |
Schema initializer and options, publish/received storage classes, transaction manager, and capability helper |
@mikara89/cap-storage-typeorm |
Schema initializer and options, publish/received storage classes, transaction manager, and capability helper |
@mikara89/cap-storage-prisma |
Raw-SQL schema initializer and options, Prisma client/executor types, publish/received storage classes, transaction manager, and capability helper |
These roots export no NestJS or Express integration and no test fixtures. The
Prisma root works through raw SQL and does not require CAP models in the
application Prisma schema. Their transaction contexts are Knex.Transaction,
TypeORM EntityManager, and Prisma.TransactionClient, respectively.
Planned packages are not exported until they are implemented and released. Do
not import future storage package names such as
@mikara89/cap-storage-drizzle, and do not import future transport package
names such as @mikara89/cap-transport-nats, unless those packages
exist in the workspace and are listed here as supported package roots.
Adapter package roots do not export Nest wrappers. Import Nest integrations
from explicit /nest subpaths:
import { MikroStorageModule } from '@mikara89/cap-storage-mikro-orm/nest';
import { KnexStorageModule } from '@mikara89/cap-storage-knex/nest';
import { TypeOrmStorageModule } from '@mikara89/cap-storage-typeorm/nest';
import { PrismaStorageModule } from '@mikara89/cap-storage-prisma/nest';
import { ServiceBusTransportModule } from '@mikara89/cap-transport-azure-servicebus/nest';
The supported Nest wrapper subpaths are:
@mikara89/cap-storage-mikro-orm/nest@mikara89/cap-storage-mikro-orm/nest/mikro-storage.module@mikara89/cap-storage-knex/nest@mikara89/cap-storage-knex/nest/knex-storage.module@mikara89/cap-storage-typeorm/nest@mikara89/cap-storage-typeorm/nest/typeorm-storage.module@mikara89/cap-storage-prisma/nest@mikara89/cap-storage-prisma/nest/prisma-storage.module@mikara89/cap-transport-azure-servicebus/nest@mikara89/cap-transport-azure-servicebus/nest/servicebus-transport.moduleNest peer dependencies for adapter packages are required only when using these
/nest exports.
The module-specific Nest subpaths are intentional compatibility exports:
@mikara89/cap-storage-mikro-orm/nest/mikro-storage.module@mikara89/cap-storage-knex/nest/knex-storage.module@mikara89/cap-storage-typeorm/nest/typeorm-storage.module@mikara89/cap-storage-prisma/nest/prisma-storage.module@mikara89/cap-transport-azure-servicebus/nest/servicebus-transport.moduleKeep these subpaths stable so existing Nest-facing consumers can migrate away from package-root wrapper imports without taking another breaking change.
Imports from package internals are not part of the public API:
// Avoid: internal path, not covered by compatibility guarantees.
import { CapService } from '@mikara89/cap-nest/dist/cap/cap.service';
Do not rely on dist/*, source-folder, or other implementation paths in
application code. If an internal symbol is useful to applications, promote it
through a documented package export before recommending it.