feat(conformance): implement ReadOnly brand and reader generator
- Add ReadOnly<F> phantom brand to core-shared/conformance (compile-time enforcement that readers only wrap non-mutating use cases) - Add isReadOnly runtime predicate for boot-time assertReaderPurity - Scaffold pnpm turbo gen reader: creates integrations/readers/ with interface, implementation, test, barrel, and adds ./reader export subpath to package.json
This commit is contained in:
14
turbo/generators/templates/reader/reader.interface.ts.hbs
Normal file
14
turbo/generators/templates/reader/reader.interface.ts.hbs
Normal file
@@ -0,0 +1,14 @@
|
||||
// packages/{{kebabCase feature}}/src/integrations/readers/{{kebabCase feature}}.reader.interface.ts
|
||||
|
||||
/**
|
||||
* Cross-feature read-only query contract for the {{kebabCase feature}} vertical.
|
||||
* Consumers import this type from `@repo/{{kebabCase feature}}/reader`.
|
||||
* Implementation is private — constructed by the feature's binder.
|
||||
*
|
||||
* Rules: Q0 (cross-feature domain queries only), Q1 (interface public,
|
||||
* impl private), Q2 (read-only — wraps only mutates:false use cases).
|
||||
*/
|
||||
export interface I{{pascalCase feature}}Reader {
|
||||
// Add methods as consumers need them. Each method must delegate to a
|
||||
// use case declared mutates: false in feature.manifest.ts.
|
||||
}
|
||||
Reference in New Issue
Block a user