@metaobjectsdev/codegen-ts 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/column-mapper.d.ts.map +1 -1
- package/dist/column-mapper.js +24 -8
- package/dist/column-mapper.js.map +1 -1
- package/dist/constants.d.ts +8 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +16 -0
- package/dist/constants.js.map +1 -1
- package/dist/docs-paths.d.ts +58 -0
- package/dist/docs-paths.d.ts.map +1 -0
- package/dist/docs-paths.js +89 -0
- package/dist/docs-paths.js.map +1 -0
- package/dist/enum-import.d.ts +14 -0
- package/dist/enum-import.d.ts.map +1 -0
- package/dist/enum-import.js +35 -0
- package/dist/enum-import.js.map +1 -0
- package/dist/enum-shared.d.ts +32 -0
- package/dist/enum-shared.d.ts.map +1 -0
- package/dist/enum-shared.js +83 -0
- package/dist/enum-shared.js.map +1 -0
- package/dist/generator-registry.d.ts +22 -0
- package/dist/generator-registry.d.ts.map +1 -0
- package/dist/generator-registry.js +161 -0
- package/dist/generator-registry.js.map +1 -0
- package/dist/generator.d.ts +6 -0
- package/dist/generator.d.ts.map +1 -1
- package/dist/generator.js.map +1 -1
- package/dist/generators/api-doc-render.d.ts +17 -0
- package/dist/generators/api-doc-render.d.ts.map +1 -0
- package/dist/generators/api-doc-render.js +431 -0
- package/dist/generators/api-doc-render.js.map +1 -0
- package/dist/generators/api-docs-file.d.ts +21 -0
- package/dist/generators/api-docs-file.d.ts.map +1 -0
- package/dist/generators/api-docs-file.js +112 -0
- package/dist/generators/api-docs-file.js.map +1 -0
- package/dist/generators/api-field-shape.d.ts +39 -0
- package/dist/generators/api-field-shape.d.ts.map +1 -0
- package/dist/generators/api-field-shape.js +92 -0
- package/dist/generators/api-field-shape.js.map +1 -0
- package/dist/generators/api-label.d.ts +3 -0
- package/dist/generators/api-label.d.ts.map +1 -0
- package/dist/generators/api-label.js +8 -0
- package/dist/generators/api-label.js.map +1 -0
- package/dist/generators/api-model.d.ts +122 -0
- package/dist/generators/api-model.d.ts.map +1 -0
- package/dist/generators/api-model.js +809 -0
- package/dist/generators/api-model.js.map +1 -0
- package/dist/generators/docs-data-builder.d.ts +26 -4
- package/dist/generators/docs-data-builder.d.ts.map +1 -1
- package/dist/generators/docs-data-builder.js +436 -164
- package/dist/generators/docs-data-builder.js.map +1 -1
- package/dist/generators/docs-data.d.ts +136 -27
- package/dist/generators/docs-data.d.ts.map +1 -1
- package/dist/generators/docs-data.js +1 -1
- package/dist/generators/docs-data.js.map +1 -1
- package/dist/generators/docs-file.d.ts +19 -0
- package/dist/generators/docs-file.d.ts.map +1 -1
- package/dist/generators/docs-file.js +154 -27
- package/dist/generators/docs-file.js.map +1 -1
- package/dist/generators/entity-file.d.ts.map +1 -1
- package/dist/generators/entity-file.js +29 -14
- package/dist/generators/entity-file.js.map +1 -1
- package/dist/generators/extractor-file.d.ts.map +1 -1
- package/dist/generators/extractor-file.js +2 -1
- package/dist/generators/extractor-file.js.map +1 -1
- package/dist/generators/field-anchor.d.ts +7 -0
- package/dist/generators/field-anchor.d.ts.map +1 -0
- package/dist/generators/field-anchor.js +23 -0
- package/dist/generators/field-anchor.js.map +1 -0
- package/dist/generators/index.d.ts +8 -1
- package/dist/generators/index.d.ts.map +1 -1
- package/dist/generators/index.js +6 -0
- package/dist/generators/index.js.map +1 -1
- package/dist/generators/mermaid-er.d.ts +14 -0
- package/dist/generators/mermaid-er.d.ts.map +1 -1
- package/dist/generators/mermaid-er.js +14 -0
- package/dist/generators/mermaid-er.js.map +1 -1
- package/dist/generators/output-parser-file.d.ts.map +1 -1
- package/dist/generators/output-parser-file.js +3 -4
- package/dist/generators/output-parser-file.js.map +1 -1
- package/dist/generators/output-prompt-file.d.ts.map +1 -1
- package/dist/generators/output-prompt-file.js +2 -2
- package/dist/generators/output-prompt-file.js.map +1 -1
- package/dist/generators/prompt-render-file.d.ts.map +1 -1
- package/dist/generators/prompt-render-file.js +3 -4
- package/dist/generators/prompt-render-file.js.map +1 -1
- package/dist/generators/queries-file.d.ts.map +1 -1
- package/dist/generators/queries-file.js +8 -3
- package/dist/generators/queries-file.js.map +1 -1
- package/dist/generators/render-helper-file.d.ts.map +1 -1
- package/dist/generators/render-helper-file.js +2 -2
- package/dist/generators/render-helper-file.js.map +1 -1
- package/dist/generators/routes-file-hono.d.ts.map +1 -1
- package/dist/generators/routes-file-hono.js +5 -1
- package/dist/generators/routes-file-hono.js.map +1 -1
- package/dist/generators/routes-file.d.ts +3 -0
- package/dist/generators/routes-file.d.ts.map +1 -1
- package/dist/generators/routes-file.js +6 -1
- package/dist/generators/routes-file.js.map +1 -1
- package/dist/generators/template-doc-builder.d.ts +19 -0
- package/dist/generators/template-doc-builder.d.ts.map +1 -0
- package/dist/generators/template-doc-builder.js +220 -0
- package/dist/generators/template-doc-builder.js.map +1 -0
- package/dist/generators/template-doc-data.d.ts +62 -0
- package/dist/generators/template-doc-data.d.ts.map +1 -0
- package/dist/generators/template-doc-data.js +16 -0
- package/dist/generators/template-doc-data.js.map +1 -0
- package/dist/generators/template-payload-tree.d.ts +15 -0
- package/dist/generators/template-payload-tree.d.ts.map +1 -0
- package/dist/generators/template-payload-tree.js +61 -0
- package/dist/generators/template-payload-tree.js.map +1 -0
- package/dist/generators/template-source-annotate.d.ts +74 -0
- package/dist/generators/template-source-annotate.d.ts.map +1 -0
- package/dist/generators/template-source-annotate.js +184 -0
- package/dist/generators/template-source-annotate.js.map +1 -0
- package/dist/generators/template-source-render.d.ts +24 -0
- package/dist/generators/template-source-render.d.ts.map +1 -0
- package/dist/generators/template-source-render.js +175 -0
- package/dist/generators/template-source-render.js.map +1 -0
- package/dist/generators/trace-helper-file.d.ts +9 -0
- package/dist/generators/trace-helper-file.d.ts.map +1 -0
- package/dist/generators/trace-helper-file.js +196 -0
- package/dist/generators/trace-helper-file.js.map +1 -0
- package/dist/index.d.ts +29 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +28 -2
- package/dist/index.js.map +1 -1
- package/dist/metaobjects-config.d.ts +75 -2
- package/dist/metaobjects-config.d.ts.map +1 -1
- package/dist/metaobjects-config.js +43 -0
- package/dist/metaobjects-config.js.map +1 -1
- package/dist/naming.d.ts +19 -0
- package/dist/naming.d.ts.map +1 -1
- package/dist/naming.js +41 -0
- package/dist/naming.js.map +1 -1
- package/dist/payload-codegen.d.ts.map +1 -1
- package/dist/payload-codegen.js +12 -4
- package/dist/payload-codegen.js.map +1 -1
- package/dist/projection/extract-view-spec.d.ts.map +1 -1
- package/dist/projection/extract-view-spec.js +51 -25
- package/dist/projection/extract-view-spec.js.map +1 -1
- package/dist/relation-resolver.d.ts +16 -0
- package/dist/relation-resolver.d.ts.map +1 -1
- package/dist/relation-resolver.js +82 -1
- package/dist/relation-resolver.js.map +1 -1
- package/dist/render-context.d.ts +4 -0
- package/dist/render-context.d.ts.map +1 -1
- package/dist/render-context.js.map +1 -1
- package/dist/render-engine/embedded-templates.generated.d.ts +2 -0
- package/dist/render-engine/embedded-templates.generated.d.ts.map +1 -0
- package/dist/render-engine/embedded-templates.generated.js +15 -0
- package/dist/render-engine/embedded-templates.generated.js.map +1 -0
- package/dist/render-engine/framework-provider.d.ts.map +1 -1
- package/dist/render-engine/framework-provider.js +26 -13
- package/dist/render-engine/framework-provider.js.map +1 -1
- package/dist/runner.d.ts.map +1 -1
- package/dist/runner.js +17 -0
- package/dist/runner.js.map +1 -1
- package/dist/templates/docs-file.d.ts +2 -6
- package/dist/templates/docs-file.d.ts.map +1 -1
- package/dist/templates/docs-file.js +2 -5
- package/dist/templates/docs-file.js.map +1 -1
- package/dist/templates/drizzle-schema.d.ts.map +1 -1
- package/dist/templates/drizzle-schema.js +30 -2
- package/dist/templates/drizzle-schema.js.map +1 -1
- package/dist/templates/entity-constants.d.ts +7 -0
- package/dist/templates/entity-constants.d.ts.map +1 -1
- package/dist/templates/entity-constants.js +1 -1
- package/dist/templates/entity-constants.js.map +1 -1
- package/dist/templates/entity-file.d.ts.map +1 -1
- package/dist/templates/entity-file.js +16 -5
- package/dist/templates/entity-file.js.map +1 -1
- package/dist/templates/enums-file.d.ts +11 -0
- package/dist/templates/enums-file.d.ts.map +1 -0
- package/dist/templates/enums-file.js +44 -0
- package/dist/templates/enums-file.js.map +1 -0
- package/dist/templates/extract-delegate-emitter.d.ts.map +1 -1
- package/dist/templates/extract-delegate-emitter.js +5 -7
- package/dist/templates/extract-delegate-emitter.js.map +1 -1
- package/dist/templates/extract-schema-emitter.d.ts.map +1 -1
- package/dist/templates/extract-schema-emitter.js +5 -1
- package/dist/templates/extract-schema-emitter.js.map +1 -1
- package/dist/templates/extractor.d.ts.map +1 -1
- package/dist/templates/extractor.js +56 -39
- package/dist/templates/extractor.js.map +1 -1
- package/dist/templates/field-meta.d.ts.map +1 -1
- package/dist/templates/field-meta.js +1 -5
- package/dist/templates/field-meta.js.map +1 -1
- package/dist/templates/filter-allowlist.d.ts +7 -2
- package/dist/templates/filter-allowlist.d.ts.map +1 -1
- package/dist/templates/filter-allowlist.js +17 -9
- package/dist/templates/filter-allowlist.js.map +1 -1
- package/dist/templates/filter-type.d.ts +7 -1
- package/dist/templates/filter-type.d.ts.map +1 -1
- package/dist/templates/filter-type.js +9 -5
- package/dist/templates/filter-type.js.map +1 -1
- package/dist/templates/find-templates.d.ts +4 -0
- package/dist/templates/find-templates.d.ts.map +1 -0
- package/dist/templates/find-templates.js +15 -0
- package/dist/templates/find-templates.js.map +1 -0
- package/dist/templates/fr010-field-mapping.d.ts +2 -0
- package/dist/templates/fr010-field-mapping.d.ts.map +1 -1
- package/dist/templates/fr010-field-mapping.js +10 -6
- package/dist/templates/fr010-field-mapping.js.map +1 -1
- package/dist/templates/inferred-types.d.ts +44 -7
- package/dist/templates/inferred-types.d.ts.map +1 -1
- package/dist/templates/inferred-types.js +107 -16
- package/dist/templates/inferred-types.js.map +1 -1
- package/dist/templates/mermaid-er.d.ts +35 -2
- package/dist/templates/mermaid-er.d.ts.map +1 -1
- package/dist/templates/mermaid-er.js +174 -7
- package/dist/templates/mermaid-er.js.map +1 -1
- package/dist/templates/output-parser.d.ts.map +1 -1
- package/dist/templates/output-parser.js +30 -79
- package/dist/templates/output-parser.js.map +1 -1
- package/dist/templates/output-prompt.d.ts.map +1 -1
- package/dist/templates/output-prompt.js +2 -2
- package/dist/templates/output-prompt.js.map +1 -1
- package/dist/templates/queries-file.d.ts.map +1 -1
- package/dist/templates/queries-file.js +112 -4
- package/dist/templates/queries-file.js.map +1 -1
- package/dist/templates/queries.d.ts +5 -0
- package/dist/templates/queries.d.ts.map +1 -1
- package/dist/templates/queries.js +7 -7
- package/dist/templates/queries.js.map +1 -1
- package/dist/templates/recover-schema-emitter.d.ts +8 -0
- package/dist/templates/recover-schema-emitter.d.ts.map +1 -0
- package/dist/templates/recover-schema-emitter.js +64 -0
- package/dist/templates/recover-schema-emitter.js.map +1 -0
- package/dist/templates/relations-block.js +10 -0
- package/dist/templates/relations-block.js.map +1 -1
- package/dist/templates/render-helper.d.ts.map +1 -1
- package/dist/templates/render-helper.js +4 -4
- package/dist/templates/render-helper.js.map +1 -1
- package/dist/templates/routes-file.d.ts.map +1 -1
- package/dist/templates/routes-file.js +183 -6
- package/dist/templates/routes-file.js.map +1 -1
- package/dist/templates/tph-discriminator.d.ts +56 -0
- package/dist/templates/tph-discriminator.d.ts.map +1 -0
- package/dist/templates/tph-discriminator.js +180 -0
- package/dist/templates/tph-discriminator.js.map +1 -0
- package/dist/templates/value-object-file.d.ts +2 -1
- package/dist/templates/value-object-file.d.ts.map +1 -1
- package/dist/templates/value-object-file.js +32 -4
- package/dist/templates/value-object-file.js.map +1 -1
- package/dist/templates/zod-validators.d.ts +64 -1
- package/dist/templates/zod-validators.d.ts.map +1 -1
- package/dist/templates/zod-validators.js +181 -8
- package/dist/templates/zod-validators.js.map +1 -1
- package/package.json +103 -34
- package/src/column-mapper.ts +25 -8
- package/src/constants.ts +18 -0
- package/src/docs-paths.ts +128 -0
- package/src/enum-import.ts +43 -0
- package/src/enum-shared.ts +95 -0
- package/src/generator-registry.ts +204 -0
- package/src/generator.ts +6 -0
- package/src/generators/api-doc-render.ts +572 -0
- package/src/generators/api-docs-file.ts +146 -0
- package/src/generators/api-field-shape.ts +114 -0
- package/src/generators/api-label.ts +7 -0
- package/src/generators/api-model.ts +1067 -0
- package/src/generators/docs-data-builder.ts +479 -185
- package/src/generators/docs-data.ts +139 -28
- package/src/generators/docs-file.ts +205 -39
- package/src/generators/entity-file.ts +31 -15
- package/src/generators/extractor-file.ts +2 -1
- package/src/generators/field-anchor.ts +24 -0
- package/src/generators/index.ts +8 -1
- package/src/generators/mermaid-er.ts +14 -0
- package/src/generators/output-parser-file.ts +3 -4
- package/src/generators/output-prompt-file.ts +2 -1
- package/src/generators/prompt-render-file.ts +3 -4
- package/src/generators/queries-file.ts +9 -3
- package/src/generators/render-helper-file.ts +2 -1
- package/src/generators/routes-file-hono.ts +5 -1
- package/src/generators/routes-file.ts +7 -1
- package/src/generators/template-doc-builder.ts +306 -0
- package/src/generators/template-doc-data.ts +85 -0
- package/src/generators/template-payload-tree.ts +71 -0
- package/src/generators/template-source-annotate.ts +290 -0
- package/src/generators/template-source-render.ts +203 -0
- package/src/generators/trace-helper-file.ts +301 -0
- package/src/index.ts +55 -4
- package/src/metaobjects-config.ts +117 -2
- package/src/naming.ts +48 -0
- package/src/payload-codegen.ts +14 -3
- package/src/projection/extract-view-spec.ts +49 -30
- package/src/relation-resolver.ts +103 -1
- package/src/render-context.ts +4 -0
- package/src/render-engine/embedded-templates.generated.ts +14 -0
- package/src/render-engine/framework-provider.ts +25 -11
- package/src/runner.ts +21 -0
- package/src/templates/docs-file.ts +2 -9
- package/src/templates/drizzle-schema.ts +31 -1
- package/src/templates/entity-constants.ts +1 -1
- package/src/templates/entity-file.ts +16 -5
- package/src/templates/enums-file.ts +50 -0
- package/src/templates/extract-delegate-emitter.ts +5 -6
- package/src/templates/extractor.ts +68 -38
- package/src/templates/field-meta.ts +0 -6
- package/src/templates/filter-allowlist.ts +17 -10
- package/src/templates/filter-type.ts +8 -6
- package/src/templates/find-templates.ts +15 -0
- package/src/templates/fr010-field-mapping.ts +10 -8
- package/src/templates/inferred-types.ts +108 -18
- package/src/templates/mermaid-er.ts +176 -8
- package/src/templates/output-parser.ts +30 -79
- package/src/templates/output-prompt.ts +2 -1
- package/src/templates/queries-file.ts +132 -3
- package/src/templates/queries.ts +15 -7
- package/src/templates/relations-block.ts +17 -0
- package/src/templates/render-helper.ts +4 -3
- package/src/templates/routes-file.ts +233 -6
- package/src/templates/tph-discriminator.ts +232 -0
- package/src/templates/value-object-file.ts +38 -4
- package/src/templates/zod-validators.ts +204 -7
- package/templates/api/agent-api.md.mustache +30 -0
- package/templates/api/entity-api.md.mustache +69 -0
- package/templates/api/index.md.mustache +21 -0
- package/templates/docs/entity-page.md.mustache +33 -21
- package/templates/docs/template-page.md.mustache +56 -0
- package/src/templates/extract-schema-emitter.ts +0 -111
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import { type Code } from "ts-poet";
|
|
2
2
|
import type { MetaObject, MetaField } from "@metaobjectsdev/metadata";
|
|
3
|
-
|
|
3
|
+
import type { RenderContext } from "../render-context.js";
|
|
4
|
+
/**
|
|
5
|
+
* Emit Drizzle's InferSelectModel / InferInsertModel aliases for an entity.
|
|
6
|
+
*
|
|
7
|
+
* `tphBase` (FR-017): when this entity is a TPH discriminator base, the
|
|
8
|
+
* discriminated-union type (emitted by the tph-discriminator template) owns the
|
|
9
|
+
* bare `<Base>` name, so the raw single-table row type is emitted as `<Base>Row`
|
|
10
|
+
* to avoid a duplicate `export type <Base>`. Insert/Update keep their names
|
|
11
|
+
* (no collision); they describe the physical TPH table row shape.
|
|
12
|
+
*/
|
|
13
|
+
export declare function renderInferredTypes(entity: MetaObject, tphBase?: boolean): Code;
|
|
4
14
|
/**
|
|
5
15
|
* The string-literal-union type-alias name for a `field.enum` field — the SINGLE
|
|
6
16
|
* source of truth for enum-union naming (reused by the entity inferred-types
|
|
@@ -16,12 +26,39 @@ export declare function enumUnionAliasName(ownerName: string, field: MetaField):
|
|
|
16
26
|
/** The `"A" | "B"` union string for a set of enum member values. */
|
|
17
27
|
export declare function enumUnionString(values: string[]): string;
|
|
18
28
|
/**
|
|
19
|
-
* Emit
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
29
|
+
* Emit the enum type-alias section for an entity file. Three cases per field:
|
|
30
|
+
*
|
|
31
|
+
* • inline enum (members declared directly on the field; no root-abstract super)
|
|
32
|
+
* → `export type <Entity><Field> = "A" | "B";` — UNCHANGED (byte-identical).
|
|
33
|
+
* • shared materialized enum (extends a NON-@provided root-level abstract
|
|
34
|
+
* field.enum) → re-export the materialized type from the shared `./enums`
|
|
35
|
+
* module (`export { type E } from "./enums"`) instead of redeclaring it. The
|
|
36
|
+
* type is materialized ONCE in enums.ts (FR-019).
|
|
37
|
+
* • provided enum (extends a @provided root-level abstract field.enum) →
|
|
38
|
+
* re-export the type from the configured external module
|
|
39
|
+
* (`export { type E } from "<providedEnumModule>"`); metaobjects emits no
|
|
40
|
+
* declaration for it. A missing config is a codegen-time error.
|
|
41
|
+
*
|
|
42
|
+
* `ctx` is required to compute the shared/provided import specifiers. Returns
|
|
43
|
+
* null when the entity has no enum-alias lines to emit.
|
|
44
|
+
*/
|
|
45
|
+
export declare function renderEnumTypeAliases(entity: MetaObject, ctx?: RenderContext): Code | null;
|
|
46
|
+
/**
|
|
47
|
+
* The PLAIN-STRING TS type expression for a field — the SINGLE source of truth
|
|
48
|
+
* for "what TS type does the codegen give this field". `valueObjectFieldType`
|
|
49
|
+
* (which returns a `Code` so cross-module `field.object` refs hoist via
|
|
50
|
+
* `imp(...)`) makes the SAME per-branch decisions; this string form exists for
|
|
51
|
+
* consumers (the api-docs field-shape builder) that need the type name as text,
|
|
52
|
+
* not a hoisting `Code`. The branch logic MUST stay in lock-step with
|
|
53
|
+
* `valueObjectFieldType` below.
|
|
54
|
+
*
|
|
55
|
+
* • field.object → the referenced object's bare (package-stripped) name, `[]`
|
|
56
|
+
* when an array; `unknown` / `unknown[]` when the @objectRef is missing.
|
|
57
|
+
* • field.enum → the same enum-union alias `enumUnionAliasName` emits
|
|
58
|
+
* (`<Owner><Field>` or the abstract super's PascalCase), `string` fallback.
|
|
59
|
+
* • scalar → SCALAR_TS_BY_SUBTYPE (else `unknown`), `[]` when an array.
|
|
23
60
|
*/
|
|
24
|
-
export declare function
|
|
61
|
+
export declare function fieldTsTypeString(ownerName: string, field: MetaField): string;
|
|
25
62
|
/**
|
|
26
63
|
* Emit a structural `interface <Name> { ... }` for a value-only object.
|
|
27
64
|
*
|
|
@@ -30,5 +67,5 @@ export declare function renderEnumTypeAliases(entity: MetaObject): Code | null;
|
|
|
30
67
|
* trip through Drizzle nullable columns, so the null-bridge is unnecessary
|
|
31
68
|
* here — and forces consumers into a residual cast at the call site.
|
|
32
69
|
*/
|
|
33
|
-
export declare function renderValueObjectInterface(entity: MetaObject): Code;
|
|
70
|
+
export declare function renderValueObjectInterface(entity: MetaObject, ctx?: RenderContext): Code;
|
|
34
71
|
//# sourceMappingURL=inferred-types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inferred-types.d.ts","sourceRoot":"","sources":["../../src/templates/inferred-types.ts"],"names":[],"mappings":"AASA,OAAO,EAAuB,KAAK,IAAI,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"inferred-types.d.ts","sourceRoot":"","sources":["../../src/templates/inferred-types.ts"],"names":[],"mappings":"AASA,OAAO,EAAuB,KAAK,IAAI,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAyBtE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,UAAQ,GAAG,IAAI,CAY7E;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,GAAG,MAAM,CAK9E;AAED,oEAAoE;AACpE,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAExD;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,CAAC,EAAE,aAAa,GAAG,IAAI,GAAG,IAAI,CAiC1F;AAwBD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,GAAG,MAAM,CAuB7E;AAmDD;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,CAAC,EAAE,aAAa,GAAG,IAAI,CAkBxF"}
|
|
@@ -7,18 +7,31 @@
|
|
|
7
7
|
// optional fields (matching Zod's `.optional()` inference — `T | undefined` —
|
|
8
8
|
// without the superfluous `| null` that Drizzle nullable columns introduce).
|
|
9
9
|
import { code, imp, joinCode } from "ts-poet";
|
|
10
|
-
import { FIELD_SUBTYPE_ENUM, FIELD_SUBTYPE_OBJECT, FIELD_SUBTYPE_STRING, FIELD_SUBTYPE_INT,
|
|
10
|
+
import { FIELD_SUBTYPE_ENUM, FIELD_SUBTYPE_OBJECT, FIELD_SUBTYPE_STRING, FIELD_SUBTYPE_INT, FIELD_SUBTYPE_LONG, FIELD_SUBTYPE_DOUBLE, FIELD_SUBTYPE_FLOAT, FIELD_SUBTYPE_DECIMAL, FIELD_SUBTYPE_CURRENCY, FIELD_SUBTYPE_BOOLEAN, FIELD_SUBTYPE_DATE, FIELD_SUBTYPE_TIME, FIELD_SUBTYPE_TIMESTAMP, FIELD_SUBTYPE_UUID, FIELD_ATTR_REQUIRED, FIELD_ATTR_OBJECT_REF, } from "@metaobjectsdev/metadata";
|
|
11
11
|
import { variableNameFromEntity, toPascalCase } from "../naming.js";
|
|
12
|
+
import { stripPackage } from "@metaobjectsdev/metadata";
|
|
12
13
|
import { enumValues } from "../enum-meta.js";
|
|
13
14
|
import { renderDocsFor } from "./jsdoc.js";
|
|
14
|
-
|
|
15
|
+
import { sharedEnumForField } from "../enum-shared.js";
|
|
16
|
+
import { sharedEnumImportSpecifier, providedEnumImportSpecifier } from "../enum-import.js";
|
|
17
|
+
/**
|
|
18
|
+
* Emit Drizzle's InferSelectModel / InferInsertModel aliases for an entity.
|
|
19
|
+
*
|
|
20
|
+
* `tphBase` (FR-017): when this entity is a TPH discriminator base, the
|
|
21
|
+
* discriminated-union type (emitted by the tph-discriminator template) owns the
|
|
22
|
+
* bare `<Base>` name, so the raw single-table row type is emitted as `<Base>Row`
|
|
23
|
+
* to avoid a duplicate `export type <Base>`. Insert/Update keep their names
|
|
24
|
+
* (no collision); they describe the physical TPH table row shape.
|
|
25
|
+
*/
|
|
26
|
+
export function renderInferredTypes(entity, tphBase = false) {
|
|
15
27
|
const varName = variableNameFromEntity(entity.name);
|
|
16
28
|
const selectSym = imp("InferSelectModel@drizzle-orm");
|
|
17
29
|
const insertSym = imp("InferInsertModel@drizzle-orm");
|
|
18
30
|
const docs = renderDocsFor(entity);
|
|
19
31
|
const docsPrefix = docs ? `${docs}\n` : "";
|
|
32
|
+
const rowName = tphBase ? `${entity.name}Row` : entity.name;
|
|
20
33
|
return code `
|
|
21
|
-
${docsPrefix}export type ${
|
|
34
|
+
${docsPrefix}export type ${rowName} = ${selectSym}<typeof ${varName}>;
|
|
22
35
|
export type ${entity.name}Insert = ${insertSym}<typeof ${varName}>;
|
|
23
36
|
export type ${entity.name}Update = Partial<${entity.name}Insert>;
|
|
24
37
|
`;
|
|
@@ -45,12 +58,23 @@ export function enumUnionString(values) {
|
|
|
45
58
|
return values.map((v) => JSON.stringify(v)).join(" | ");
|
|
46
59
|
}
|
|
47
60
|
/**
|
|
48
|
-
* Emit
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
61
|
+
* Emit the enum type-alias section for an entity file. Three cases per field:
|
|
62
|
+
*
|
|
63
|
+
* • inline enum (members declared directly on the field; no root-abstract super)
|
|
64
|
+
* → `export type <Entity><Field> = "A" | "B";` — UNCHANGED (byte-identical).
|
|
65
|
+
* • shared materialized enum (extends a NON-@provided root-level abstract
|
|
66
|
+
* field.enum) → re-export the materialized type from the shared `./enums`
|
|
67
|
+
* module (`export { type E } from "./enums"`) instead of redeclaring it. The
|
|
68
|
+
* type is materialized ONCE in enums.ts (FR-019).
|
|
69
|
+
* • provided enum (extends a @provided root-level abstract field.enum) →
|
|
70
|
+
* re-export the type from the configured external module
|
|
71
|
+
* (`export { type E } from "<providedEnumModule>"`); metaobjects emits no
|
|
72
|
+
* declaration for it. A missing config is a codegen-time error.
|
|
73
|
+
*
|
|
74
|
+
* `ctx` is required to compute the shared/provided import specifiers. Returns
|
|
75
|
+
* null when the entity has no enum-alias lines to emit.
|
|
52
76
|
*/
|
|
53
|
-
export function renderEnumTypeAliases(entity) {
|
|
77
|
+
export function renderEnumTypeAliases(entity, ctx) {
|
|
54
78
|
// De-duplicate by type-alias name — multiple fields can extend the same abstract enum.
|
|
55
79
|
const seen = new Set();
|
|
56
80
|
const lines = [];
|
|
@@ -64,7 +88,21 @@ export function renderEnumTypeAliases(entity) {
|
|
|
64
88
|
if (seen.has(typeName))
|
|
65
89
|
continue;
|
|
66
90
|
seen.add(typeName);
|
|
67
|
-
|
|
91
|
+
// Without a RenderContext (bare unit-test calls) the shared/provided import
|
|
92
|
+
// specifiers can't be computed — fall back to inline emission. Real runs
|
|
93
|
+
// always pass ctx (entity-file template), so shared materialization applies.
|
|
94
|
+
const shared = ctx !== undefined ? sharedEnumForField(field) : undefined;
|
|
95
|
+
if (shared === undefined) {
|
|
96
|
+
// Inline enum — emit the literal union exactly as before.
|
|
97
|
+
lines.push(`export type ${typeName} = ${enumUnionString(values)};`);
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
// Shared / provided enum — re-export from the materialized module or the
|
|
101
|
+
// configured external module; never redeclare the union here.
|
|
102
|
+
const spec = shared.provided
|
|
103
|
+
? providedEnumImportSpecifier(ctx, shared.name)
|
|
104
|
+
: sharedEnumImportSpecifier(ctx, entity.package);
|
|
105
|
+
lines.push(`export { type ${shared.name} } from ${JSON.stringify(spec)};`);
|
|
68
106
|
}
|
|
69
107
|
return lines.length > 0 ? code `${lines.join("\n")}` : null;
|
|
70
108
|
}
|
|
@@ -73,11 +111,8 @@ export function renderEnumTypeAliases(entity) {
|
|
|
73
111
|
// ---------------------------------------------------------------------------
|
|
74
112
|
const SCALAR_TS_BY_SUBTYPE = {
|
|
75
113
|
[FIELD_SUBTYPE_STRING]: "string",
|
|
76
|
-
[FIELD_SUBTYPE_CLASS]: "string",
|
|
77
114
|
[FIELD_SUBTYPE_UUID]: "string",
|
|
78
115
|
[FIELD_SUBTYPE_INT]: "number",
|
|
79
|
-
[FIELD_SUBTYPE_SHORT]: "number",
|
|
80
|
-
[FIELD_SUBTYPE_BYTE]: "number",
|
|
81
116
|
[FIELD_SUBTYPE_LONG]: "number",
|
|
82
117
|
[FIELD_SUBTYPE_DOUBLE]: "number",
|
|
83
118
|
[FIELD_SUBTYPE_FLOAT]: "number",
|
|
@@ -91,19 +126,61 @@ const SCALAR_TS_BY_SUBTYPE = {
|
|
|
91
126
|
[FIELD_SUBTYPE_TIME]: "string",
|
|
92
127
|
[FIELD_SUBTYPE_TIMESTAMP]: "string",
|
|
93
128
|
};
|
|
129
|
+
/**
|
|
130
|
+
* The PLAIN-STRING TS type expression for a field — the SINGLE source of truth
|
|
131
|
+
* for "what TS type does the codegen give this field". `valueObjectFieldType`
|
|
132
|
+
* (which returns a `Code` so cross-module `field.object` refs hoist via
|
|
133
|
+
* `imp(...)`) makes the SAME per-branch decisions; this string form exists for
|
|
134
|
+
* consumers (the api-docs field-shape builder) that need the type name as text,
|
|
135
|
+
* not a hoisting `Code`. The branch logic MUST stay in lock-step with
|
|
136
|
+
* `valueObjectFieldType` below.
|
|
137
|
+
*
|
|
138
|
+
* • field.object → the referenced object's bare (package-stripped) name, `[]`
|
|
139
|
+
* when an array; `unknown` / `unknown[]` when the @objectRef is missing.
|
|
140
|
+
* • field.enum → the same enum-union alias `enumUnionAliasName` emits
|
|
141
|
+
* (`<Owner><Field>` or the abstract super's PascalCase), `string` fallback.
|
|
142
|
+
* • scalar → SCALAR_TS_BY_SUBTYPE (else `unknown`), `[]` when an array.
|
|
143
|
+
*/
|
|
144
|
+
export function fieldTsTypeString(ownerName, field) {
|
|
145
|
+
if (field.subType === FIELD_SUBTYPE_OBJECT) {
|
|
146
|
+
const ref = field.ownAttr(FIELD_ATTR_OBJECT_REF);
|
|
147
|
+
if (typeof ref === "string" && ref.length > 0) {
|
|
148
|
+
const base = stripPackage(ref);
|
|
149
|
+
return field.isArray ? `${base}[]` : base;
|
|
150
|
+
}
|
|
151
|
+
return field.isArray ? "unknown[]" : "unknown";
|
|
152
|
+
}
|
|
153
|
+
if (field.subType === FIELD_SUBTYPE_ENUM) {
|
|
154
|
+
const values = enumValues(field);
|
|
155
|
+
if (values !== undefined) {
|
|
156
|
+
// The emitted TS type is an enum-union ALIAS (`<Owner><Field>`), but its
|
|
157
|
+
// definition IS this literal union — inline it so the documented shape is
|
|
158
|
+
// self-contained (an agent sees the exact allowed values, not an opaque
|
|
159
|
+
// alias name). Array enums wrap the parenthesized union: `(A | B)[]`.
|
|
160
|
+
const union = enumUnionString(values);
|
|
161
|
+
return field.isArray ? `(${union})[]` : union;
|
|
162
|
+
}
|
|
163
|
+
return field.isArray ? "string[]" : "string";
|
|
164
|
+
}
|
|
165
|
+
const scalar = SCALAR_TS_BY_SUBTYPE[field.subType] ?? "unknown";
|
|
166
|
+
return field.isArray ? `${scalar}[]` : scalar;
|
|
167
|
+
}
|
|
94
168
|
/**
|
|
95
169
|
* One-line TS type expression for a field on a value-only object.
|
|
96
170
|
* Returns a `Code` so cross-module `field.object` refs can be hoisted via
|
|
97
171
|
* ts-poet `imp(...)` — matching how the Zod emitter hoists `<Ref>InsertSchema`.
|
|
98
172
|
*/
|
|
99
|
-
function valueObjectFieldType(entity, field) {
|
|
173
|
+
function valueObjectFieldType(entity, field, ctx) {
|
|
100
174
|
// field.object: import the referenced TS interface from its sibling module
|
|
101
175
|
// so ts-poet hoists the import. Mirrors zod-validators.ts's `<Ref>InsertSchema`
|
|
102
176
|
// import strategy, just for the type alias instead of the schema constant.
|
|
103
177
|
if (field.subType === FIELD_SUBTYPE_OBJECT) {
|
|
104
178
|
const ref = field.ownAttr(FIELD_ATTR_OBJECT_REF);
|
|
105
179
|
if (typeof ref === "string" && ref.length > 0) {
|
|
106
|
-
|
|
180
|
+
// @objectRef may be authored fully-qualified (acme::sales::Brief) or bare; the
|
|
181
|
+
// referenced interface + its sibling module are named by the BARE short name.
|
|
182
|
+
const base = stripPackage(ref);
|
|
183
|
+
const refImp = imp(`${base}@./${base}.js`);
|
|
107
184
|
return field.isArray ? code `${refImp}[]` : code `${refImp}`;
|
|
108
185
|
}
|
|
109
186
|
return field.isArray ? code `unknown[]` : code `unknown`;
|
|
@@ -113,6 +190,20 @@ function valueObjectFieldType(entity, field) {
|
|
|
113
190
|
const values = enumValues(field);
|
|
114
191
|
if (values !== undefined) {
|
|
115
192
|
const alias = enumUnionAliasName(entity.name, field);
|
|
193
|
+
// FR-019: a shared/provided enum's type lives in another module (./enums or
|
|
194
|
+
// the provided module). Use imp() so ts-poet hoists `import { type E }` —
|
|
195
|
+
// the local interface can then reference E. Inline enums reference the
|
|
196
|
+
// locally-declared `<Entity><Field>` alias as before.
|
|
197
|
+
if (ctx !== undefined) {
|
|
198
|
+
const shared = sharedEnumForField(field);
|
|
199
|
+
if (shared !== undefined) {
|
|
200
|
+
const spec = shared.provided
|
|
201
|
+
? providedEnumImportSpecifier(ctx, shared.name)
|
|
202
|
+
: sharedEnumImportSpecifier(ctx, entity.package);
|
|
203
|
+
const sym = imp(`${shared.name}@${spec}`);
|
|
204
|
+
return field.isArray ? code `${sym}[]` : code `${sym}`;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
116
207
|
return field.isArray ? code `${alias}[]` : code `${alias}`;
|
|
117
208
|
}
|
|
118
209
|
return field.isArray ? code `string[]` : code `string`;
|
|
@@ -128,14 +219,14 @@ function valueObjectFieldType(entity, field) {
|
|
|
128
219
|
* trip through Drizzle nullable columns, so the null-bridge is unnecessary
|
|
129
220
|
* here — and forces consumers into a residual cast at the call site.
|
|
130
221
|
*/
|
|
131
|
-
export function renderValueObjectInterface(entity) {
|
|
222
|
+
export function renderValueObjectInterface(entity, ctx) {
|
|
132
223
|
const docs = renderDocsFor(entity);
|
|
133
224
|
const docsPrefix = docs ? `${docs}\n` : "";
|
|
134
225
|
const lines = [];
|
|
135
226
|
for (const field of entity.fields()) {
|
|
136
227
|
const required = field.ownAttr(FIELD_ATTR_REQUIRED) === true;
|
|
137
228
|
const optional = required ? "" : "?";
|
|
138
|
-
const tsType = valueObjectFieldType(entity, field);
|
|
229
|
+
const tsType = valueObjectFieldType(entity, field, ctx);
|
|
139
230
|
lines.push(code ` ${field.name}${optional}: ${tsType};`);
|
|
140
231
|
}
|
|
141
232
|
// joinCode with "\n" interpolates each Code segment on its own line and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inferred-types.js","sourceRoot":"","sources":["../../src/templates/inferred-types.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,gDAAgD;AAChD,EAAE;AACF,6EAA6E;AAC7E,2EAA2E;AAC3E,0EAA0E;AAC1E,8EAA8E;AAC9E,6EAA6E;AAE7E,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAa,MAAM,SAAS,CAAC;AAEzD,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,iB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IAAI,SAAS,CAAC;IAChE,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAA,GAAG,MAAM,IAAI,CAAC,CAAC,CAAC,IAAI,CAAA,GAAG,MAAM,EAAE,CAAC;AAC7D,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,0BAA0B,CAAC,MAAkB,EAAE,GAAmB;IAChF,MAAM,IAAI,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;IACnC,MAAM,UAAU,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;IAE3C,MAAM,KAAK,GAAW,EAAE,CAAC;IACzB,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC;QACpC,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,mBAAmB,CAAC,KAAK,IAAI,CAAC;QAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;QACrC,MAAM,MAAM,GAAG,oBAAoB,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;QACxD,KAAK,CAAC,IAAI,CAAC,IAAI,CAAA,KAAK,KAAK,CAAC,IAAI,GAAG,QAAQ,KAAK,MAAM,GAAG,CAAC,CAAC;IAC3D,CAAC;IAED,wEAAwE;IACxE,sEAAsE;IACtE,OAAO,IAAI,CAAA,GAAG,UAAU,oBAAoB,MAAM,CAAC,IAAI;EACvD,QAAQ,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC;;CAE9B,CAAC;AACF,CAAC"}
|
|
@@ -1,6 +1,39 @@
|
|
|
1
|
-
import type { MetaRoot } from "@metaobjectsdev/metadata";
|
|
1
|
+
import type { MetaObject, MetaRoot } from "@metaobjectsdev/metadata";
|
|
2
|
+
/** Render JUST the fenced ```mermaid erDiagram``` block for the whole model
|
|
3
|
+
* (entities + identity.reference relationships) — NO per-entity prose. This is
|
|
4
|
+
* the single neutral ER-diagram builder; both `renderMermaidModel()` (the
|
|
5
|
+
* standalone model.md body) AND the neutral docs OVERVIEW page (`README.md`,
|
|
6
|
+
* emitted by the Tier-2 `meta docs` engine) consume it, so there is exactly
|
|
7
|
+
* ONE place ER topology is computed — no duplicate graph logic (ADR-0020).
|
|
8
|
+
*
|
|
9
|
+
* Abstract entities are excluded — they have no physical table to put in a
|
|
10
|
+
* diagram (matches migrate-ts/expected-schema.ts's same filter). */
|
|
11
|
+
export declare function renderMermaidErBlock(root: MetaRoot): string;
|
|
2
12
|
/** Render a docs/model.md body: Mermaid erDiagram + per-entity prose. Abstract
|
|
3
13
|
* entities are excluded — they have no physical table to put in a diagram
|
|
4
|
-
* (matches migrate-ts/expected-schema.ts's same filter).
|
|
14
|
+
* (matches migrate-ts/expected-schema.ts's same filter). Reuses the shared
|
|
15
|
+
* `renderMermaidErBlock()` for the diagram so the ER logic is never duplicated. */
|
|
5
16
|
export declare function renderMermaidModel(root: MetaRoot): string;
|
|
17
|
+
/** Render a Mermaid flowchart for ONE focal entity and its direct neighbors
|
|
18
|
+
* (1-hop). Three node kinds are surfaced and styled distinctly:
|
|
19
|
+
*
|
|
20
|
+
* - **focal** — the entity this page is about (deeper blue)
|
|
21
|
+
* - **same** — entity in the focal's own package (blue)
|
|
22
|
+
* - **external** — entity in a different package (dashed gray)
|
|
23
|
+
* - **vo** — value object referenced via `field.object` (rounded
|
|
24
|
+
* purple) — composition rather than FK
|
|
25
|
+
*
|
|
26
|
+
* Every node has a Mermaid `click <node> "./<node>.md"` directive, so the
|
|
27
|
+
* rendered SVG is a true navigation surface — click any neighbor to jump to
|
|
28
|
+
* its page. Edges are labeled with the field name that connects them.
|
|
29
|
+
*
|
|
30
|
+
* This replaces the previous erDiagram-based renderer: Mermaid 10's erDiagram
|
|
31
|
+
* has near-zero styling and no click support, while flowchart supports both.
|
|
32
|
+
* The crow's-foot one-to-many notation is dropped — for a 1-hop context
|
|
33
|
+
* diagram, "what kind of node is this" matters more than ER cardinality.
|
|
34
|
+
*
|
|
35
|
+
* Returns `undefined` when the focal entity has no neighbors at all, so a
|
|
36
|
+
* template can `{{#mini}}…{{/mini}}` and skip the section cleanly. Abstract
|
|
37
|
+
* entities are excluded as neighbors (no physical rows). */
|
|
38
|
+
export declare function renderEntityNeighborhoodErBlock(focal: MetaObject, root: MetaRoot): string | undefined;
|
|
6
39
|
//# sourceMappingURL=mermaid-er.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mermaid-er.d.ts","sourceRoot":"","sources":["../../src/templates/mermaid-er.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"mermaid-er.d.ts","sourceRoot":"","sources":["../../src/templates/mermaid-er.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AASrE;;;;;;;;qEAQqE;AACrE,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAc3D;AAED;;;oFAGoF;AACpF,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAiBzD;AAED;;;;;;;;;;;;;;;;;;;;6DAoB6D;AAC7D,wBAAgB,+BAA+B,CAC7C,KAAK,EAAE,UAAU,EACjB,IAAI,EAAE,QAAQ,GACb,MAAM,GAAG,SAAS,CAsHpB"}
|
|
@@ -3,18 +3,22 @@
|
|
|
3
3
|
// 2. A per-entity prose section consuming the 6 user-facing doc attrs (notes excluded).
|
|
4
4
|
//
|
|
5
5
|
// D5: the notes attr is NEVER emitted. Per the Documentation Provider design.
|
|
6
|
-
import { DOC_ATTR_DESCRIPTION } from "@metaobjectsdev/metadata";
|
|
6
|
+
import { DOC_ATTR_DESCRIPTION, FIELD_SUBTYPE_OBJECT, FIELD_ATTR_OBJECT_REF, OBJECT_SUBTYPE_VALUE, } from "@metaobjectsdev/metadata";
|
|
7
7
|
import { readDocAttrs } from "./jsdoc.js";
|
|
8
|
-
/** Render
|
|
9
|
-
* entities
|
|
10
|
-
*
|
|
11
|
-
|
|
8
|
+
/** Render JUST the fenced ```mermaid erDiagram``` block for the whole model
|
|
9
|
+
* (entities + identity.reference relationships) — NO per-entity prose. This is
|
|
10
|
+
* the single neutral ER-diagram builder; both `renderMermaidModel()` (the
|
|
11
|
+
* standalone model.md body) AND the neutral docs OVERVIEW page (`README.md`,
|
|
12
|
+
* emitted by the Tier-2 `meta docs` engine) consume it, so there is exactly
|
|
13
|
+
* ONE place ER topology is computed — no duplicate graph logic (ADR-0020).
|
|
14
|
+
*
|
|
15
|
+
* Abstract entities are excluded — they have no physical table to put in a
|
|
16
|
+
* diagram (matches migrate-ts/expected-schema.ts's same filter). */
|
|
17
|
+
export function renderMermaidErBlock(root) {
|
|
12
18
|
const entities = root
|
|
13
19
|
.objects()
|
|
14
20
|
.filter((o) => o.isEntity() && !o.isAbstract);
|
|
15
21
|
const parts = [];
|
|
16
|
-
parts.push("# Data Model");
|
|
17
|
-
parts.push("");
|
|
18
22
|
parts.push("```mermaid");
|
|
19
23
|
parts.push("erDiagram");
|
|
20
24
|
for (const line of renderRelationships(entities))
|
|
@@ -25,6 +29,20 @@ export function renderMermaidModel(root) {
|
|
|
25
29
|
parts.push(` ${line}`);
|
|
26
30
|
}
|
|
27
31
|
parts.push("```");
|
|
32
|
+
return parts.join("\n");
|
|
33
|
+
}
|
|
34
|
+
/** Render a docs/model.md body: Mermaid erDiagram + per-entity prose. Abstract
|
|
35
|
+
* entities are excluded — they have no physical table to put in a diagram
|
|
36
|
+
* (matches migrate-ts/expected-schema.ts's same filter). Reuses the shared
|
|
37
|
+
* `renderMermaidErBlock()` for the diagram so the ER logic is never duplicated. */
|
|
38
|
+
export function renderMermaidModel(root) {
|
|
39
|
+
const entities = root
|
|
40
|
+
.objects()
|
|
41
|
+
.filter((o) => o.isEntity() && !o.isAbstract);
|
|
42
|
+
const parts = [];
|
|
43
|
+
parts.push("# Data Model");
|
|
44
|
+
parts.push("");
|
|
45
|
+
parts.push(renderMermaidErBlock(root));
|
|
28
46
|
parts.push("");
|
|
29
47
|
for (const entity of entities) {
|
|
30
48
|
for (const line of renderEntityProse(entity))
|
|
@@ -33,6 +51,155 @@ export function renderMermaidModel(root) {
|
|
|
33
51
|
}
|
|
34
52
|
return parts.join("\n");
|
|
35
53
|
}
|
|
54
|
+
/** Render a Mermaid flowchart for ONE focal entity and its direct neighbors
|
|
55
|
+
* (1-hop). Three node kinds are surfaced and styled distinctly:
|
|
56
|
+
*
|
|
57
|
+
* - **focal** — the entity this page is about (deeper blue)
|
|
58
|
+
* - **same** — entity in the focal's own package (blue)
|
|
59
|
+
* - **external** — entity in a different package (dashed gray)
|
|
60
|
+
* - **vo** — value object referenced via `field.object` (rounded
|
|
61
|
+
* purple) — composition rather than FK
|
|
62
|
+
*
|
|
63
|
+
* Every node has a Mermaid `click <node> "./<node>.md"` directive, so the
|
|
64
|
+
* rendered SVG is a true navigation surface — click any neighbor to jump to
|
|
65
|
+
* its page. Edges are labeled with the field name that connects them.
|
|
66
|
+
*
|
|
67
|
+
* This replaces the previous erDiagram-based renderer: Mermaid 10's erDiagram
|
|
68
|
+
* has near-zero styling and no click support, while flowchart supports both.
|
|
69
|
+
* The crow's-foot one-to-many notation is dropped — for a 1-hop context
|
|
70
|
+
* diagram, "what kind of node is this" matters more than ER cardinality.
|
|
71
|
+
*
|
|
72
|
+
* Returns `undefined` when the focal entity has no neighbors at all, so a
|
|
73
|
+
* template can `{{#mini}}…{{/mini}}` and skip the section cleanly. Abstract
|
|
74
|
+
* entities are excluded as neighbors (no physical rows). */
|
|
75
|
+
export function renderEntityNeighborhoodErBlock(focal, root) {
|
|
76
|
+
if (focal.isAbstract)
|
|
77
|
+
return undefined;
|
|
78
|
+
// Resolve neighbor kind so the flowchart can color/shape it accordingly.
|
|
79
|
+
// Same-package = focal's effective package; differing or unknown = external.
|
|
80
|
+
// Value object = object.value subtype. Aborts return classify→undefined.
|
|
81
|
+
//
|
|
82
|
+
// `node.package` is the OWN attr only — entities that take their package
|
|
83
|
+
// from the file-default (`metadata.root: { package: ... }`) leave it
|
|
84
|
+
// undefined. Use `fileDefaultPackage` as the fallback so cross-file
|
|
85
|
+
// boundary detection works in the common case where adopters set the
|
|
86
|
+
// package once at the root, not on every entity. Mirrors the same
|
|
87
|
+
// resolution rule docs-paths.ts uses for page placement.
|
|
88
|
+
const byName = new Map();
|
|
89
|
+
for (const obj of root.objects())
|
|
90
|
+
byName.set(obj.name, obj);
|
|
91
|
+
const effectivePkg = (n) => n.package ?? n.fileDefaultPackage;
|
|
92
|
+
const focalPackage = effectivePkg(focal);
|
|
93
|
+
const sameDomain = new Set();
|
|
94
|
+
const external = new Set();
|
|
95
|
+
const valueObjs = new Set();
|
|
96
|
+
function classify(name) {
|
|
97
|
+
if (name === focal.name)
|
|
98
|
+
return "same"; // self-reference (parent-id etc.)
|
|
99
|
+
const target = byName.get(name);
|
|
100
|
+
if (!target)
|
|
101
|
+
return undefined;
|
|
102
|
+
if (target.subType === OBJECT_SUBTYPE_VALUE) {
|
|
103
|
+
valueObjs.add(name);
|
|
104
|
+
return "vo";
|
|
105
|
+
}
|
|
106
|
+
if (target.isAbstract)
|
|
107
|
+
return undefined;
|
|
108
|
+
if (effectivePkg(target) === focalPackage) {
|
|
109
|
+
sameDomain.add(name);
|
|
110
|
+
return "same";
|
|
111
|
+
}
|
|
112
|
+
external.add(name);
|
|
113
|
+
return "external";
|
|
114
|
+
}
|
|
115
|
+
const edges = [];
|
|
116
|
+
// Outgoing FK — focal references other entities.
|
|
117
|
+
for (const ref of focal.referenceIdentities()) {
|
|
118
|
+
const target = ref.targetEntity;
|
|
119
|
+
const field = ref.fields[0];
|
|
120
|
+
if (typeof target !== "string" || typeof field !== "string")
|
|
121
|
+
continue;
|
|
122
|
+
const targetName = target.split("::").pop();
|
|
123
|
+
if (classify(targetName) === undefined)
|
|
124
|
+
continue;
|
|
125
|
+
edges.push({ from: focal.name, to: targetName, label: field });
|
|
126
|
+
}
|
|
127
|
+
// Incoming FK — entities that reference the focal.
|
|
128
|
+
for (const other of root.objects().filter(o => o.isEntity() && !o.isAbstract)) {
|
|
129
|
+
if (other.name === focal.name)
|
|
130
|
+
continue;
|
|
131
|
+
for (const ref of other.referenceIdentities()) {
|
|
132
|
+
const target = ref.targetEntity;
|
|
133
|
+
if (typeof target !== "string")
|
|
134
|
+
continue;
|
|
135
|
+
if (target.split("::").pop() !== focal.name)
|
|
136
|
+
continue;
|
|
137
|
+
const field = ref.fields[0];
|
|
138
|
+
if (typeof field !== "string")
|
|
139
|
+
continue;
|
|
140
|
+
if (classify(other.name) === undefined)
|
|
141
|
+
continue;
|
|
142
|
+
edges.push({ from: other.name, to: focal.name, label: field });
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
// Value-object composition — `field.object @objectRef ContactInfo` etc.
|
|
146
|
+
// These aren't FKs (no row-level identity); they're embedded composition.
|
|
147
|
+
// Surfaced because adopters care: "what's inside this entity's `jsonb`
|
|
148
|
+
// column?" Click-through to the VO docs answers that.
|
|
149
|
+
for (const field of focal.fields()) {
|
|
150
|
+
if (field.subType !== FIELD_SUBTYPE_OBJECT)
|
|
151
|
+
continue;
|
|
152
|
+
const ref = field.ownAttr(FIELD_ATTR_OBJECT_REF);
|
|
153
|
+
if (typeof ref !== "string" || ref.length === 0)
|
|
154
|
+
continue;
|
|
155
|
+
const targetName = ref.split("::").pop();
|
|
156
|
+
if (classify(targetName) === undefined)
|
|
157
|
+
continue;
|
|
158
|
+
edges.push({ from: focal.name, to: targetName, label: field.name });
|
|
159
|
+
}
|
|
160
|
+
if (edges.length === 0)
|
|
161
|
+
return undefined;
|
|
162
|
+
// Build the flowchart. Nodes first (so all are declared before edges),
|
|
163
|
+
// then edges, then click directives, then classDefs + class assignments.
|
|
164
|
+
const allNodes = new Set([focal.name, ...sameDomain, ...external, ...valueObjs]);
|
|
165
|
+
const parts = ["```mermaid", "flowchart TB"];
|
|
166
|
+
for (const name of allNodes) {
|
|
167
|
+
if (valueObjs.has(name)) {
|
|
168
|
+
// Stadium (rounded-rect) shape signals composition / embedded value.
|
|
169
|
+
parts.push(` ${name}(["${name}"])`);
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
// Sharp rectangle for entities.
|
|
173
|
+
parts.push(` ${name}["${name}"]`);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
for (const { from, to, label } of edges) {
|
|
177
|
+
parts.push(` ${from} -->|"${label}"| ${to}`);
|
|
178
|
+
}
|
|
179
|
+
// Click directives — link every node (focal + neighbors) to its docs page.
|
|
180
|
+
// Flat-layout assumption: `./<Name>.md` lives next to the focal's page.
|
|
181
|
+
// Package-layout adopters can override the template; the data plumbing
|
|
182
|
+
// is identical either way.
|
|
183
|
+
for (const name of allNodes) {
|
|
184
|
+
parts.push(` click ${name} "./${name}.md"`);
|
|
185
|
+
}
|
|
186
|
+
// Visual styling: 4 node kinds, 4 classes. Color choices are deliberately
|
|
187
|
+
// muted so the diagram reads as documentation, not infographic art.
|
|
188
|
+
parts.push(" classDef focal fill:#dbeafe,stroke:#1e40af,stroke-width:2px,color:#1e293b;");
|
|
189
|
+
parts.push(" classDef same fill:#eff6ff,stroke:#3b82f6,color:#1e293b;");
|
|
190
|
+
parts.push(" classDef external fill:#f3f4f6,stroke:#9ca3af,stroke-dasharray:4 3,color:#374151;");
|
|
191
|
+
parts.push(" classDef vo fill:#faf5ff,stroke:#9333ea,color:#1e293b;");
|
|
192
|
+
parts.push(` class ${focal.name} focal;`);
|
|
193
|
+
const sameOthers = [...sameDomain].filter(n => n !== focal.name);
|
|
194
|
+
if (sameOthers.length > 0)
|
|
195
|
+
parts.push(` class ${sameOthers.join(",")} same;`);
|
|
196
|
+
if (external.size > 0)
|
|
197
|
+
parts.push(` class ${[...external].join(",")} external;`);
|
|
198
|
+
if (valueObjs.size > 0)
|
|
199
|
+
parts.push(` class ${[...valueObjs].join(",")} vo;`);
|
|
200
|
+
parts.push("```");
|
|
201
|
+
return parts.join("\n");
|
|
202
|
+
}
|
|
36
203
|
function renderRelationships(entities) {
|
|
37
204
|
const lines = [];
|
|
38
205
|
for (const entity of entities) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mermaid-er.js","sourceRoot":"","sources":["../../src/templates/mermaid-er.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,8FAA8F;AAC9F,0FAA0F;AAC1F,EAAE;AACF,8EAA8E;AAG9E,OAAO,
|
|
1
|
+
{"version":3,"file":"mermaid-er.js","sourceRoot":"","sources":["../../src/templates/mermaid-er.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,8FAA8F;AAC9F,0FAA0F;AAC1F,EAAE;AACF,8EAA8E;AAG9E,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C;;;;;;;;qEAQqE;AACrE,MAAM,UAAU,oBAAoB,CAAC,IAAc;IACjD,MAAM,QAAQ,GAAG,IAAI;SAClB,OAAO,EAAE;SACT,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;IAChD,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACzB,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACxB,KAAK,MAAM,IAAI,IAAI,mBAAmB,CAAC,QAAQ,CAAC;QAAE,KAAK,CAAC,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;IAC5E,KAAK,MAAM,MAAM,IAAI,QAAQ,EAAE,CAAC;QAC9B,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,C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AAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACb,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAC1B,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,OAAO;YAAE,GAAG,CAAC,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC;IACzD,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output-parser.d.ts","sourceRoot":"","sources":["../../src/templates/output-parser.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"output-parser.d.ts","sourceRoot":"","sources":["../../src/templates/output-parser.ts"],"names":[],"mappings":"AAWA,OAAO,EACL,KAAK,QAAQ,EAUd,MAAM,0BAA0B,CAAC;AAmElC;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAmJ/E"}
|