feat: standalone module-build readiness for the public @ekklesia packages (ADR 0053)
CI / verify (pull_request) Successful in 1m2s
CI / infrastructure-smoke (pull_request) Successful in 28s
CI / migration-smoke (pull_request) Successful in 1m52s
CI / standalone-module (pull_request) Successful in 26s
CI / image-build (pull_request) Successful in 30s
CI / deploy-smoke (same-origin) (pull_request) Successful in 50s
CI / deploy-smoke (split) (pull_request) Successful in 1m42s
CI / verify (pull_request) Successful in 1m2s
CI / infrastructure-smoke (pull_request) Successful in 28s
CI / migration-smoke (pull_request) Successful in 1m52s
CI / standalone-module (pull_request) Successful in 26s
CI / image-build (pull_request) Successful in 30s
CI / deploy-smoke (same-origin) (pull_request) Successful in 50s
CI / deploy-smoke (split) (pull_request) Successful in 1m42s
Makes the public module-development package set usable from a module repository outside the monorepo. Nothing is published. - Curated @ekklesia/module-sdk: an explicit author API, no contracts barrel, no identity/authorization internals, no Drizzle and no legacy ModuleDatabase type. defineModuleRuntime returns the SDK's own named interfaces so a module's emitted declarations never reach into @ekklesia/contracts. defineModuleSchema is gone; createModuleTable and defineModuleSchemaMetadata live in @ekklesia/module-database. - Drizzle: no longer a dependency of module-sdk or contracts. Core keeps the legacy Drizzle schema validator (moved to core/src/modules) and its legacy runtime support; drizzle-orm is an optional peer only. - React is a peer (plus devDependency) of @ekklesia/ui; the boundary checker allows exactly that consumer-selected peer. - @ekklesia/typescript-config is publishable; module-ui-host is private. Every public package carries "ekklesia.distribution": "module-development" and no monorepo-root prepack. - module-pack reads the Node.js range from the module's own engines.node and recognizes Ekklesia packages by name plus that marker, so registry-installed packages are incorporated, SDK-compatibility checked, and never credited as third-party. - scripts/pack-public-packages.ts (pnpm packages:pack) rebuilds, packs and inspects the nine public tarballs; scripts/test-standalone-module.sh (pnpm test:standalone-module, new CI job) installs them into a fixture module outside the repository and proves it typechecks, builds, packages, and verifies. - Public-package boundary tests and module-development docs. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
9426c83109
commit
89d5d0f2da
@@ -6,8 +6,12 @@ import type {
|
||||
ModuleId,
|
||||
ModuleSchemaMetadataDefinition,
|
||||
} from "@ekklesia/contracts";
|
||||
import { parseModuleSchemaMetadataDefinition } from "@ekklesia/contracts";
|
||||
import { type AnyPgTable, getTableConfig } from "drizzle-orm/pg-core";
|
||||
import {
|
||||
moduleTableName,
|
||||
moduleTablePrefix,
|
||||
parseModuleSchemaMetadataDefinition,
|
||||
} from "@ekklesia/contracts";
|
||||
import { type AnyPgTable, getTableConfig, pgTableCreator } from "drizzle-orm/pg-core";
|
||||
import { drizzle, type PgRemoteDatabase } from "drizzle-orm/pg-proxy";
|
||||
import type { DrizzleConfig } from "drizzle-orm/utils";
|
||||
|
||||
@@ -110,3 +114,13 @@ export function moduleDrizzleSchemaMetadata(
|
||||
});
|
||||
return parseModuleSchemaMetadataDefinition({ moduleId, tables: metadata });
|
||||
}
|
||||
|
||||
/**
|
||||
* A Drizzle table factory for this module's tables: every table it creates gets the module's
|
||||
* mandatory namespace (ADR 0007), so `createModuleTable("care-team")("members", …)` is the physical
|
||||
* table `care_team_members`.
|
||||
*/
|
||||
export function createModuleTable(moduleId: ModuleId) {
|
||||
moduleTablePrefix(moduleId);
|
||||
return pgTableCreator((localName) => moduleTableName(moduleId, localName));
|
||||
}
|
||||
|
||||
@@ -3,8 +3,54 @@ import {
|
||||
type ModuleDatabaseError,
|
||||
type ModuleDatabaseParameter,
|
||||
type ModuleDatabaseQuery,
|
||||
type ModuleSchemaMetadataDefinition,
|
||||
parseModuleSchemaMetadataDefinition,
|
||||
} from "@ekklesia/contracts";
|
||||
|
||||
/**
|
||||
* `@ekklesia/module-database`: everything a module needs for the Module Database ABI v1 (ADR 0050),
|
||||
* with no ORM. Drizzle support lives in the `@ekklesia/module-database/drizzle` subpath, the only
|
||||
* place that needs Drizzle (ADR 0053).
|
||||
*/
|
||||
export {
|
||||
isModuleDatabaseError,
|
||||
MODULE_DATABASE_ABI_VERSION,
|
||||
MODULE_DATABASE_ERROR_CODES,
|
||||
type ModuleDatabaseAbiVersion,
|
||||
type ModuleDatabaseArrayRow,
|
||||
ModuleDatabaseError,
|
||||
type ModuleDatabaseErrorCode,
|
||||
type ModuleDatabaseExecutor,
|
||||
type ModuleDatabaseField,
|
||||
type ModuleDatabaseIsolationLevel,
|
||||
type ModuleDatabaseObjectRow,
|
||||
type ModuleDatabaseParameter,
|
||||
type ModuleDatabaseQuery,
|
||||
type ModuleDatabaseQueryable,
|
||||
type ModuleDatabaseQueryResult,
|
||||
type ModuleDatabaseRowMode,
|
||||
type ModuleDatabaseScalar,
|
||||
type ModuleDatabaseTransaction,
|
||||
type ModuleDatabaseTransactionOptions,
|
||||
type ModuleDatabaseValue,
|
||||
type ModuleSchemaForeignKeyMetadata,
|
||||
type ModuleSchemaMetadataDefinition,
|
||||
type ModuleSchemaTableMetadata,
|
||||
moduleTableName,
|
||||
moduleTablePrefix,
|
||||
} from "@ekklesia/contracts";
|
||||
|
||||
/**
|
||||
* A module's plain schema metadata (ADR 0050): the tables it owns and their foreign keys, with no
|
||||
* ORM object. Validated and frozen; a Drizzle module derives the same data with
|
||||
* `moduleDrizzleSchemaMetadata` from `@ekklesia/module-database/drizzle`.
|
||||
*/
|
||||
export function defineModuleSchemaMetadata<const Definition extends ModuleSchemaMetadataDefinition>(
|
||||
definition: Definition,
|
||||
): Readonly<Definition> {
|
||||
return parseModuleSchemaMetadataDefinition(definition) as Readonly<Definition>;
|
||||
}
|
||||
|
||||
/** SQL text and values ready to pass directly to a Module Database ABI v1 executor. */
|
||||
export type ModuleSqlQuery = Readonly<Required<Pick<ModuleDatabaseQuery, "text" | "values">>>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user