feat(blog): conformance manifest + self-asserting bind-production
This commit is contained in:
@@ -6,8 +6,10 @@ import {
|
|||||||
type ILogger,
|
type ILogger,
|
||||||
} from "@repo/core-shared/instrumentation";
|
} from "@repo/core-shared/instrumentation";
|
||||||
import type { BindProductionContext } from "@repo/core-shared/di";
|
import type { BindProductionContext } from "@repo/core-shared/di";
|
||||||
|
import { assertFeatureConformance } from "@repo/core-shared/conformance";
|
||||||
import { blogContainer } from "./container";
|
import { blogContainer } from "./container";
|
||||||
import { BLOG_SYMBOLS } from "./symbols";
|
import { BLOG_SYMBOLS } from "./symbols";
|
||||||
|
import { blogManifest } from "../feature.manifest";
|
||||||
import { ArticlesRepository } from "../infrastructure/repositories/articles.repository";
|
import { ArticlesRepository } from "../infrastructure/repositories/articles.repository";
|
||||||
import { getArticlesUseCase } from "../application/use-cases/get-articles.use-case";
|
import { getArticlesUseCase } from "../application/use-cases/get-articles.use-case";
|
||||||
import { getArticleBySlugUseCase } from "../application/use-cases/get-article-by-slug.use-case";
|
import { getArticleBySlugUseCase } from "../application/use-cases/get-article-by-slug.use-case";
|
||||||
@@ -138,4 +140,16 @@ export function bindProductionBlog(ctx: BindProductionContext): void {
|
|||||||
// <gen:event-handlers>
|
// <gen:event-handlers>
|
||||||
// <gen:jobs>
|
// <gen:jobs>
|
||||||
// <gen:realtime-handlers>
|
// <gen:realtime-handlers>
|
||||||
|
|
||||||
|
// Boot-time conformance check.
|
||||||
|
assertFeatureConformance(
|
||||||
|
blogContainer,
|
||||||
|
blogManifest,
|
||||||
|
{
|
||||||
|
getArticles: BLOG_SYMBOLS.IGetArticlesUseCase,
|
||||||
|
getArticleBySlug: BLOG_SYMBOLS.IGetArticleBySlugUseCase,
|
||||||
|
createArticle: BLOG_SYMBOLS.ICreateArticleUseCase,
|
||||||
|
},
|
||||||
|
ctx,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
33
packages/blog/src/feature.manifest.ts
Normal file
33
packages/blog/src/feature.manifest.ts
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
import { defineFeature } from "@repo/core-shared/conformance";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The blog feature's conformance manifest.
|
||||||
|
*/
|
||||||
|
export const blogManifest = defineFeature({
|
||||||
|
name: "blog",
|
||||||
|
requiredCores: [],
|
||||||
|
useCases: {
|
||||||
|
getArticles: {
|
||||||
|
mutates: false,
|
||||||
|
audits: [],
|
||||||
|
publishes: [],
|
||||||
|
consumes: [],
|
||||||
|
},
|
||||||
|
getArticleBySlug: {
|
||||||
|
mutates: false,
|
||||||
|
audits: [],
|
||||||
|
publishes: [],
|
||||||
|
consumes: [],
|
||||||
|
},
|
||||||
|
createArticle: {
|
||||||
|
mutates: true,
|
||||||
|
audits: [],
|
||||||
|
publishes: [],
|
||||||
|
consumes: [],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
realtimeChannels: [],
|
||||||
|
jobs: [],
|
||||||
|
} as const);
|
||||||
|
|
||||||
|
export type BlogManifest = typeof blogManifest;
|
||||||
@@ -33,3 +33,4 @@ export type { IGetArticleBySlugController } from "./interface-adapters/controlle
|
|||||||
|
|
||||||
// <gen:events>
|
// <gen:events>
|
||||||
// <gen:realtime-channels>
|
// <gen:realtime-channels>
|
||||||
|
export { blogManifest, type BlogManifest } from "./feature.manifest";
|
||||||
|
|||||||
Reference in New Issue
Block a user