@metaobjectsdev/codegen-ts 0.24.5 → 1.0.0-rc.1
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 +37 -12
- package/dist/api-surface.d.ts +29 -0
- package/dist/api-surface.d.ts.map +1 -1
- package/dist/api-surface.js +47 -0
- package/dist/api-surface.js.map +1 -1
- package/dist/column-mapper.d.ts +12 -0
- package/dist/column-mapper.d.ts.map +1 -1
- package/dist/column-mapper.js +1 -0
- package/dist/column-mapper.js.map +1 -1
- package/dist/constants.d.ts +24 -11
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +54 -19
- package/dist/constants.js.map +1 -1
- package/dist/db-emitting.d.ts +6 -0
- package/dist/db-emitting.d.ts.map +1 -0
- package/dist/db-emitting.js +26 -0
- package/dist/db-emitting.js.map +1 -0
- package/dist/generator-registry.d.ts.map +1 -1
- package/dist/generator-registry.js +14 -1
- package/dist/generator-registry.js.map +1 -1
- package/dist/generator.d.ts +5 -0
- package/dist/generator.d.ts.map +1 -1
- package/dist/generator.js.map +1 -1
- package/dist/generators/agent-docs-file.d.ts +19 -0
- package/dist/generators/agent-docs-file.d.ts.map +1 -0
- package/dist/generators/agent-docs-file.js +257 -0
- package/dist/generators/agent-docs-file.js.map +1 -0
- package/dist/generators/agent-requirements-page.d.ts +22 -0
- package/dist/generators/agent-requirements-page.d.ts.map +1 -0
- package/dist/generators/agent-requirements-page.js +175 -0
- package/dist/generators/agent-requirements-page.js.map +1 -0
- package/dist/generators/agent-schema-input.d.ts +69 -0
- package/dist/generators/agent-schema-input.d.ts.map +1 -0
- package/dist/generators/agent-schema-input.js +23 -0
- package/dist/generators/agent-schema-input.js.map +1 -0
- package/dist/generators/agent-schema-page.d.ts +21 -0
- package/dist/generators/agent-schema-page.d.ts.map +1 -0
- package/dist/generators/agent-schema-page.js +241 -0
- package/dist/generators/agent-schema-page.js.map +1 -0
- package/dist/generators/agent-ui-page.d.ts +22 -0
- package/dist/generators/agent-ui-page.d.ts.map +1 -0
- package/dist/generators/agent-ui-page.js +253 -0
- package/dist/generators/agent-ui-page.js.map +1 -0
- package/dist/generators/api-docs-file.d.ts.map +1 -1
- package/dist/generators/api-docs-file.js +13 -6
- package/dist/generators/api-docs-file.js.map +1 -1
- package/dist/generators/api-model.d.ts +6 -0
- package/dist/generators/api-model.d.ts.map +1 -1
- package/dist/generators/api-model.js +54 -35
- package/dist/generators/api-model.js.map +1 -1
- package/dist/generators/callable-file.js +1 -1
- package/dist/generators/callable-file.js.map +1 -1
- package/dist/generators/docs-data-builder.d.ts.map +1 -1
- package/dist/generators/docs-data-builder.js +47 -2
- package/dist/generators/docs-data-builder.js.map +1 -1
- package/dist/generators/docs-data.d.ts +6 -2
- package/dist/generators/docs-data.d.ts.map +1 -1
- package/dist/generators/index.d.ts +3 -8
- package/dist/generators/index.d.ts.map +1 -1
- package/dist/generators/index.js +19 -14
- package/dist/generators/index.js.map +1 -1
- package/dist/generators/names-file.d.ts +17 -0
- package/dist/generators/names-file.d.ts.map +1 -0
- package/dist/generators/names-file.js +95 -0
- package/dist/generators/names-file.js.map +1 -0
- package/dist/generators/requirements-markdown.d.ts +18 -1
- package/dist/generators/requirements-markdown.d.ts.map +1 -1
- package/dist/generators/requirements-markdown.js +11 -9
- package/dist/generators/requirements-markdown.js.map +1 -1
- package/dist/generators/routes-file-hono.d.ts +17 -2
- package/dist/generators/routes-file-hono.d.ts.map +1 -1
- package/dist/generators/routes-file-hono.js +9 -11
- package/dist/generators/routes-file-hono.js.map +1 -1
- package/dist/generators/routes-file.d.ts +17 -2
- package/dist/generators/routes-file.d.ts.map +1 -1
- package/dist/generators/routes-file.js +10 -8
- package/dist/generators/routes-file.js.map +1 -1
- package/dist/generators/template-generator.d.ts.map +1 -1
- package/dist/generators/template-generator.js +20 -6
- package/dist/generators/template-generator.js.map +1 -1
- package/dist/index.d.ts +20 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +43 -4
- package/dist/index.js.map +1 -1
- package/dist/metaobjects-config.d.ts +38 -1
- package/dist/metaobjects-config.d.ts.map +1 -1
- package/dist/metaobjects-config.js +9 -1
- package/dist/metaobjects-config.js.map +1 -1
- package/dist/names.d.ts +275 -0
- package/dist/names.d.ts.map +1 -0
- package/dist/names.js +433 -0
- package/dist/names.js.map +1 -0
- package/dist/overwrite-policy.d.ts.map +1 -1
- package/dist/overwrite-policy.js +15 -3
- package/dist/overwrite-policy.js.map +1 -1
- package/dist/projection/extract-view-spec.d.ts +25 -1
- package/dist/projection/extract-view-spec.d.ts.map +1 -1
- package/dist/projection/extract-view-spec.js +79 -6
- package/dist/projection/extract-view-spec.js.map +1 -1
- package/dist/reference-templates.d.ts +1 -1
- package/dist/reference-templates.d.ts.map +1 -1
- package/dist/reference-templates.js +1 -1
- package/dist/reference-templates.js.map +1 -1
- package/dist/render-context.d.ts +12 -1
- package/dist/render-context.d.ts.map +1 -1
- package/dist/render-context.js +1 -0
- package/dist/render-context.js.map +1 -1
- package/dist/retired-codegen-attrs.d.ts +32 -0
- package/dist/retired-codegen-attrs.d.ts.map +1 -0
- package/dist/retired-codegen-attrs.js +47 -0
- package/dist/retired-codegen-attrs.js.map +1 -0
- package/dist/routes-expose.d.ts +63 -0
- package/dist/routes-expose.d.ts.map +1 -0
- package/dist/routes-expose.js +57 -0
- package/dist/routes-expose.js.map +1 -0
- package/dist/runner.d.ts +18 -0
- package/dist/runner.d.ts.map +1 -1
- package/dist/runner.js +109 -7
- package/dist/runner.js.map +1 -1
- package/dist/templates/callable-file.d.ts +7 -2
- package/dist/templates/callable-file.d.ts.map +1 -1
- package/dist/templates/callable-file.js +54 -9
- package/dist/templates/callable-file.js.map +1 -1
- package/dist/templates/drizzle-schema.d.ts.map +1 -1
- package/dist/templates/drizzle-schema.js +236 -65
- package/dist/templates/drizzle-schema.js.map +1 -1
- package/dist/templates/entity-constants.d.ts +15 -6
- package/dist/templates/entity-constants.d.ts.map +1 -1
- package/dist/templates/entity-constants.js +85 -161
- 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 +38 -4
- package/dist/templates/entity-file.js.map +1 -1
- package/dist/templates/entity-meta-file.d.ts +15 -1
- package/dist/templates/entity-meta-file.d.ts.map +1 -1
- package/dist/templates/entity-meta-file.js +12 -2
- package/dist/templates/entity-meta-file.js.map +1 -1
- package/dist/templates/entity-ui-descriptor.d.ts +112 -0
- package/dist/templates/entity-ui-descriptor.d.ts.map +1 -0
- package/dist/templates/entity-ui-descriptor.js +238 -0
- package/dist/templates/entity-ui-descriptor.js.map +1 -0
- package/dist/templates/field-meta.d.ts +46 -9
- package/dist/templates/field-meta.d.ts.map +1 -1
- package/dist/templates/field-meta.js +95 -21
- package/dist/templates/field-meta.js.map +1 -1
- package/dist/templates/names-decl.d.ts +38 -0
- package/dist/templates/names-decl.d.ts.map +1 -0
- package/dist/templates/names-decl.js +104 -0
- package/dist/templates/names-decl.js.map +1 -0
- package/dist/templates/projection-decl.d.ts +21 -0
- package/dist/templates/projection-decl.d.ts.map +1 -1
- package/dist/templates/projection-decl.js +53 -29
- package/dist/templates/projection-decl.js.map +1 -1
- package/dist/templates/queries-file.d.ts.map +1 -1
- package/dist/templates/queries-file.js +17 -2
- package/dist/templates/queries-file.js.map +1 -1
- package/dist/templates/requirement-test.d.ts.map +1 -1
- package/dist/templates/requirement-test.js +13 -2
- package/dist/templates/requirement-test.js.map +1 -1
- package/dist/templates/routes-file-hono.d.ts +2 -1
- package/dist/templates/routes-file-hono.d.ts.map +1 -1
- package/dist/templates/routes-file-hono.js +11 -2
- package/dist/templates/routes-file-hono.js.map +1 -1
- package/dist/templates/routes-file.d.ts +2 -1
- package/dist/templates/routes-file.d.ts.map +1 -1
- package/dist/templates/routes-file.js +54 -21
- package/dist/templates/routes-file.js.map +1 -1
- package/dist/templates/value-object-file.d.ts.map +1 -1
- package/dist/templates/value-object-file.js +15 -1
- package/dist/templates/value-object-file.js.map +1 -1
- package/dist/templates/view-decl.d.ts +37 -1
- package/dist/templates/view-decl.d.ts.map +1 -1
- package/dist/templates/view-decl.js +27 -3
- package/dist/templates/view-decl.js.map +1 -1
- package/dist/templates/zod-validators.d.ts +21 -0
- package/dist/templates/zod-validators.d.ts.map +1 -1
- package/dist/templates/zod-validators.js +40 -5
- package/dist/templates/zod-validators.js.map +1 -1
- package/dist/view-context.d.ts +24 -0
- package/dist/view-context.d.ts.map +1 -0
- package/dist/view-context.js +81 -0
- package/dist/view-context.js.map +1 -0
- package/package.json +6 -6
- package/src/api-surface.ts +53 -0
- package/src/column-mapper.ts +13 -0
- package/src/constants.ts +91 -16
- package/src/db-emitting.ts +31 -0
- package/src/generator-registry.ts +14 -4
- package/src/generator.ts +5 -0
- package/src/generators/agent-docs-file.ts +297 -0
- package/src/generators/agent-requirements-page.ts +199 -0
- package/src/generators/agent-schema-input.ts +88 -0
- package/src/generators/agent-schema-page.ts +297 -0
- package/src/generators/agent-ui-page.ts +290 -0
- package/src/generators/api-docs-file.ts +13 -6
- package/src/generators/api-model.ts +63 -34
- package/src/generators/callable-file.ts +1 -1
- package/src/generators/docs-data-builder.ts +46 -2
- package/src/generators/docs-data.ts +6 -2
- package/src/generators/index.ts +25 -14
- package/src/generators/names-file.ts +98 -0
- package/src/generators/requirements-markdown.ts +36 -2
- package/src/generators/routes-file-hono.ts +19 -10
- package/src/generators/routes-file.ts +20 -7
- package/src/generators/template-generator.ts +20 -6
- package/src/index.ts +64 -4
- package/src/metaobjects-config.ts +48 -2
- package/src/names.ts +629 -0
- package/src/overwrite-policy.ts +15 -3
- package/src/projection/extract-view-spec.ts +85 -6
- package/src/reference/entity.ts +21 -2
- package/src/reference/names.ts +125 -0
- package/src/reference/queries.ts +19 -3
- package/src/reference/routes-hono.ts +19 -9
- package/src/reference/routes.ts +25 -9
- package/src/reference-templates.ts +1 -1
- package/src/render-context.ts +13 -1
- package/src/retired-codegen-attrs.ts +52 -0
- package/src/routes-expose.ts +86 -0
- package/src/runner.ts +122 -11
- package/src/templates/callable-file.ts +60 -8
- package/src/templates/drizzle-schema.ts +248 -60
- package/src/templates/entity-constants.ts +95 -184
- package/src/templates/entity-file.ts +46 -4
- package/src/templates/entity-meta-file.ts +16 -3
- package/src/templates/entity-ui-descriptor.ts +305 -0
- package/src/templates/field-meta.ts +100 -19
- package/src/templates/names-decl.ts +165 -0
- package/src/templates/projection-decl.ts +72 -31
- package/src/templates/queries-file.ts +17 -2
- package/src/templates/requirement-test.ts +13 -2
- package/src/templates/routes-file-hono.ts +14 -2
- package/src/templates/routes-file.ts +69 -24
- package/src/templates/value-object-file.ts +15 -1
- package/src/templates/view-decl.ts +53 -3
- package/src/templates/zod-validators.ts +41 -5
- package/src/view-context.ts +88 -0
package/src/index.ts
CHANGED
|
@@ -37,8 +37,16 @@ export {
|
|
|
37
37
|
} from "./generator-registry.js";
|
|
38
38
|
export type { GeneratorRegistryEntry, GeneratorTier } from "./generator-registry.js";
|
|
39
39
|
|
|
40
|
-
export type { MetaobjectsGenConfig, NormalizedMetaobjectsGenConfig, ResolvedGenConfig, Dialect, ExtStyle, ColumnNamingStrategy, MetaDataTypeProvider, GeneratorSpec, DocsConfig, ResolvedDocsConfig, DocsSurface, ApiSurface } from "./metaobjects-config.js";
|
|
40
|
+
export type { MetaobjectsGenConfig, NormalizedMetaobjectsGenConfig, ResolvedGenConfig, Dialect, ExtStyle, ColumnNamingStrategy, MetaDataTypeProvider, GeneratorSpec, DocsConfig, ResolvedDocsConfig, DocsSurface, ApiSurface, VerifyConfig } from "./metaobjects-config.js";
|
|
41
41
|
export { defineConfig, normalizeConfig, resolveGenerators, resolveDocsConfig } from "./metaobjects-config.js";
|
|
42
|
+
// The dialect every generator falls back to when a config declares none. Exported because
|
|
43
|
+
// `meta docs` must apply the SAME default `normalizeConfig` does — a command that resolved
|
|
44
|
+
// the dialect differently would document a schema the toolchain does not produce.
|
|
45
|
+
export { DEFAULT_DIALECT } from "./metaobjects-config.js";
|
|
46
|
+
// The runner's own "does this model need a dialect?" guard. `meta docs` must ask it rather
|
|
47
|
+
// than defaulting, because DEFAULT_DIALECT is inert and a DB project with no dialect is one
|
|
48
|
+
// `meta gen` REFUSES — documenting it as sqlite states an answer the toolchain never gave.
|
|
49
|
+
export { dbEmittingObjects, missingDialectMessage } from "./db-emitting.js";
|
|
42
50
|
export { apiLabel } from "./generators/api-label.js";
|
|
43
51
|
|
|
44
52
|
export type { ColumnSpec, DefaultExpr } from "./column-mapper.js";
|
|
@@ -70,7 +78,8 @@ export { decideAndWrite, GitMissingError } from "./overwrite-policy.js";
|
|
|
70
78
|
export { contentHash, readGeneratedHash, listGeneratedPaths } from "./overwrite-policy.js";
|
|
71
79
|
|
|
72
80
|
export { CodegenError } from "./errors.js";
|
|
73
|
-
export { GENERATED_HEADER,
|
|
81
|
+
export { GENERATED_HEADER, DEFAULT_OUT_DIR, RETIRED_CODEGEN_ATTRS, type RetiredCodegenAttr } from "./constants.js";
|
|
82
|
+
export { warnRetiredCodegenAttrs } from "./retired-codegen-attrs.js";
|
|
74
83
|
|
|
75
84
|
export { formatTs } from "./format.js";
|
|
76
85
|
|
|
@@ -90,14 +99,30 @@ export type { DocPageNode, DocPagePlacement } from "./docs-paths.js";
|
|
|
90
99
|
export { isProjection, isWriteThrough } from "./projection/projection-detector.js";
|
|
91
100
|
export { isAbstract, emitsInstanceArtifacts, emitsWriteArtifacts } from "./instance-artifacts.js";
|
|
92
101
|
// The UI tier asks THESE — "is there an endpoint?" — never the storage predicates.
|
|
93
|
-
export { servesReadApi, servesWriteApi } from "./api-surface.js";
|
|
102
|
+
export { hasGeneratedForm, restPath, servesReadApi, servesWriteApi } from "./api-surface.js";
|
|
103
|
+
// #356 — every emitter selects a field's view by the SURFACE it renders, never by
|
|
104
|
+
// declaration position. An owned generator (FR-040) composing the render layer must
|
|
105
|
+
// use this too, or it reinstates the order-dependence in its own copy.
|
|
106
|
+
export { viewForContext, VIEW_CONTEXT_FORM, VIEW_CONTEXT_GRID } from "./view-context.js";
|
|
107
|
+
// The shared per-field UI derivation. `valueObjectFor` is the predicate the React form
|
|
108
|
+
// generator and the `agent/ui.md` docs page must both ask — it decides whether a field is
|
|
109
|
+
// rendered as an input at all — and `humanize` is the one body behind every generated
|
|
110
|
+
// label. Both are exported so the react tier reads them rather than keeping a copy.
|
|
111
|
+
export { humanize, inferViewKind, labelFor, currencyMetaFor, valueObjectFor } from "./templates/field-meta.js";
|
|
94
112
|
// The DB-free descriptor module the UI tier imports from (see entity-meta-file.ts).
|
|
95
113
|
export { renderEntityMetaFile, entityMetaFileName, entityMetaSpecifier } from "./templates/entity-meta-file.js";
|
|
96
114
|
// FR-017 TPH helpers — used by the per-framework codegen packages (tanstack,
|
|
97
115
|
// react) to dispatch polymorphic/per-subtype emission and skip subtype files.
|
|
98
116
|
export { isTphDiscriminatorBase, tphConcreteSubtypes, collectTphSubtypeFields, tphPlan, tphRouteSegment } from "./templates/tph-discriminator.js";
|
|
99
117
|
export type { TphPlan, TphSubtypePlan } from "./templates/tph-discriminator.js";
|
|
100
|
-
export { isTphSubtype, tphDiscriminatorPin } from "./templates/zod-validators.js";
|
|
118
|
+
export { isTphSubtype, tphDiscriminatorBase, tphDiscriminatorPin } from "./templates/zod-validators.js";
|
|
119
|
+
|
|
120
|
+
// The ONE sortability rule. It builds the server-side `<Entity>SortAllowlist` and the
|
|
121
|
+
// client-side sort union, and it is public so a UI-tier generator (a data-grid column
|
|
122
|
+
// emitter, say) marks a column sortable by ASKING the server's rule rather than
|
|
123
|
+
// reimplementing its three branches out of tree. A hand-copied predicate is how the
|
|
124
|
+
// grid came to offer headers the allowlist rejects (#352/#354).
|
|
125
|
+
export { isSortableField, sortableFields } from "./templates/filter-shared.js";
|
|
101
126
|
|
|
102
127
|
// ADR-0034 reference-template composition helpers. Promoted to the public engine
|
|
103
128
|
// surface so a COPIED reference generator (src/reference/*.ts → consumer's
|
|
@@ -131,12 +156,19 @@ export {
|
|
|
131
156
|
renderFindByIdFn,
|
|
132
157
|
renderListFn,
|
|
133
158
|
renderCreateFn,
|
|
159
|
+
// #203 — the `insertPreserving<Entity>` escape hatch, emitted only for an entity with an
|
|
160
|
+
// `@autoSet` timestamp. Public because an OWNED queries generator must be able to emit it:
|
|
161
|
+
// without this primitive (and `hasAutoSetFields` below) an ejected copy silently drops the
|
|
162
|
+
// escape hatch on exactly the entities that have one, and the caller loses the only
|
|
163
|
+
// generated way to insert a row preserving its own `@autoSet` values.
|
|
164
|
+
renderInsertPreservingFn,
|
|
134
165
|
renderUpdateFn,
|
|
135
166
|
renderDeleteByIdFn,
|
|
136
167
|
renderReverseFinderFns,
|
|
137
168
|
reverseFksFor,
|
|
138
169
|
getPkInfo,
|
|
139
170
|
} from "./templates/queries.js";
|
|
171
|
+
export { hasAutoSetFields } from "./templates/zod-validators.js";
|
|
140
172
|
|
|
141
173
|
// Built-in template render functions — the composition seam for adopters who
|
|
142
174
|
// want to call a built-in template, then post-process / append to its output
|
|
@@ -160,9 +192,27 @@ export { renderFilterType } from "./templates/filter-type.js";
|
|
|
160
192
|
export { renderFilterAllowlist, renderSortAllowlist } from "./templates/filter-allowlist.js";
|
|
161
193
|
export { renderEntityConstants, resourcePath } from "./templates/entity-constants.js";
|
|
162
194
|
export { renderQueriesFile } from "./templates/queries-file.js";
|
|
195
|
+
// #348 — which CRUD verbs a generated routes file mounts. Public because an OWNED
|
|
196
|
+
// routes generator (ADR-0034) composes the same render call and needs the same option.
|
|
197
|
+
export { CRUD_VERBS, resolveExpose, intersectExpose, exposeLine } from "./routes-expose.js";
|
|
198
|
+
export type { CrudVerb, ExposeOption } from "./routes-expose.js";
|
|
163
199
|
export { renderRoutesFile } from "./templates/routes-file.js";
|
|
164
200
|
export { renderRoutesFileHono } from "./templates/routes-file-hono.js";
|
|
165
201
|
export { renderValueObjectFile } from "./templates/value-object-file.js";
|
|
202
|
+
export { renderNamesDecl } from "./templates/names-decl.js";
|
|
203
|
+
export type { NamesDeclOpts } from "./templates/names-decl.js";
|
|
204
|
+
export {
|
|
205
|
+
resolveObjectNames,
|
|
206
|
+
resolveSuperFragmentNames,
|
|
207
|
+
namesArtifactSuperOf,
|
|
208
|
+
namesRef,
|
|
209
|
+
namesConstArg,
|
|
210
|
+
physicalNameExpr,
|
|
211
|
+
columnExpr,
|
|
212
|
+
type ObjectNames,
|
|
213
|
+
type FieldNames,
|
|
214
|
+
type SuperNames,
|
|
215
|
+
} from "./names.js";
|
|
166
216
|
export { renderProjectionDecl } from "./templates/projection-decl.js";
|
|
167
217
|
export type { ProjectionDeclOpts } from "./templates/projection-decl.js";
|
|
168
218
|
export { extractViewSpec } from "./projection/extract-view-spec.js";
|
|
@@ -211,6 +261,16 @@ export { buildTemplateDocData } from "./generators/template-doc-builder.js";
|
|
|
211
261
|
// worse than the bug report this is meant to avoid.
|
|
212
262
|
export { requirementTests } from "./generators/requirement-tests.js";
|
|
213
263
|
export { requirementsFile } from "./generators/requirements-file.js";
|
|
264
|
+
// The `agent` docs surface. `AgentSchemaInput` is exported because the CLI SUPPLIES it —
|
|
265
|
+
// codegen-ts deliberately does not compute the physical schema (see agent-schema-input.ts).
|
|
266
|
+
export { agentDocsFile } from "./generators/agent-docs-file.js";
|
|
267
|
+
export type { AgentDocsFileOpts } from "./generators/agent-docs-file.js";
|
|
268
|
+
export type {
|
|
269
|
+
AgentSchemaInput,
|
|
270
|
+
SchemaColumnLike,
|
|
271
|
+
SchemaTableLike,
|
|
272
|
+
SchemaViewLike,
|
|
273
|
+
} from "./generators/agent-schema-input.js";
|
|
214
274
|
export type { RequirementRow } from "./generators/requirements-view.js";
|
|
215
275
|
// The projection itself, not just its type: it is the authority on WHICH doc slots a
|
|
216
276
|
// requirement surface actually renders, and `meta verify`'s authoring lint tells an
|
|
@@ -55,6 +55,14 @@ export interface ResolvedGenConfig {
|
|
|
55
55
|
* api-docs reads this to AUTO-DETECT whether to document the Hono CRUD surface
|
|
56
56
|
* (it otherwise mirrors the default Fastify-only suite). Undefined ⇒ false. */
|
|
57
57
|
includeHonoRoutes?: boolean;
|
|
58
|
+
/** §A6 — whether the OPT-IN names generator (namesFile) is active in the run,
|
|
59
|
+
* aggregated by the runner from the suite's `emitsNames` markers. A generator that
|
|
60
|
+
* wants to REFERENCE `<Entity>Names` reads this to know the artifact will exist:
|
|
61
|
+
* the names generator is opt-in under ADR-0034 scaffold-and-own, so an
|
|
62
|
+
* unconditional import would break every project that has not enabled it.
|
|
63
|
+
* Undefined ⇒ false. Templates read the same fact off `RenderContext.includeNames`,
|
|
64
|
+
* which the runner sets from this same aggregation. */
|
|
65
|
+
includeNames?: boolean;
|
|
58
66
|
/**
|
|
59
67
|
* FR-019 / ADR-0026: the module specifier from which an externally-PROVIDED
|
|
60
68
|
* shared enum (`@provided: true` on an abstract package-level `field.enum`) is
|
|
@@ -171,6 +179,9 @@ export interface MetaobjectsGenConfig extends Omit<ResolvedGenConfig, "dbImport"
|
|
|
171
179
|
emitAbstractShapes?: boolean;
|
|
172
180
|
/** Docs-output config consumed by the `meta docs` door. See {@link DocsConfig}. */
|
|
173
181
|
docs?: DocsConfig;
|
|
182
|
+
/** `meta verify` / `meta gen` advisory settings. Nothing here affects codegen.
|
|
183
|
+
* See {@link VerifyConfig}. */
|
|
184
|
+
verify?: VerifyConfig;
|
|
174
185
|
/** Named output destinations. Generators reference one via `target`. */
|
|
175
186
|
targets?: Record<string, TargetConfig>;
|
|
176
187
|
/** importBase for the default target (top-level outDir). */
|
|
@@ -221,7 +232,7 @@ export interface NormalizedMetaobjectsGenConfig
|
|
|
221
232
|
targets: Record<string, ResolvedTarget>;
|
|
222
233
|
}
|
|
223
234
|
|
|
224
|
-
export type DocsSurface = "model" | "api" | "requirements";
|
|
235
|
+
export type DocsSurface = "model" | "api" | "requirements" | "agent";
|
|
225
236
|
|
|
226
237
|
export interface ApiSurface {
|
|
227
238
|
lang: string;
|
|
@@ -232,6 +243,33 @@ export interface ApiSurface {
|
|
|
232
243
|
/** The single docs-output config: where ALL doc surfaces go, how pages are laid
|
|
233
244
|
* out, and which surfaces to emit. Read by the `meta docs` door (and, when the
|
|
234
245
|
* api surface fans out, by each port's docs command). */
|
|
246
|
+
/**
|
|
247
|
+
* `meta verify` settings. Nothing here changes what codegen emits.
|
|
248
|
+
*
|
|
249
|
+
* This block existed once before, for `verify.testFiles`, and was removed in 0.24.0 with
|
|
250
|
+
* the `@verifiedBy` vocabulary it served. It returns for exactly the reason it was added:
|
|
251
|
+
* the advisory scans carry a list of conventions that is, unavoidably, a guess about
|
|
252
|
+
* someone else's repository. Built-in defaults for the layouts that demonstrably exist,
|
|
253
|
+
* PLUS a project-declared list, is the shape that survives being wrong.
|
|
254
|
+
*/
|
|
255
|
+
export interface VerifyConfig {
|
|
256
|
+
/**
|
|
257
|
+
* Path globs the "you hand-rolled what MetaObjects models" advisory skips entirely.
|
|
258
|
+
* Relative to the project root, forward-slash, `**` spans separators; a glob matching a
|
|
259
|
+
* directory prunes the whole subtree. ADDS to the built-in exclusions rather than
|
|
260
|
+
* replacing them.
|
|
261
|
+
*
|
|
262
|
+
* verify: { antiPatternIgnore: ["db/changelog/**", "vendor/sql/**"] }
|
|
263
|
+
*
|
|
264
|
+
* Reach for this when the advisory reports a file you cannot act on — a vendored SQL
|
|
265
|
+
* archive, read-only reference DDL, a migration tool whose naming the built-ins do not
|
|
266
|
+
* recognise. It is deliberately narrower than `--no-antipatterns`: silencing the whole
|
|
267
|
+
* scan to quiet one directory is how a useful advisory gets switched off wholesale, the
|
|
268
|
+
* same failure `--no-requirement-lint` was carved out to avoid.
|
|
269
|
+
*/
|
|
270
|
+
antiPatternIgnore?: string[];
|
|
271
|
+
}
|
|
272
|
+
|
|
235
273
|
export interface DocsConfig {
|
|
236
274
|
outDir?: string;
|
|
237
275
|
layout?: OutputLayout;
|
|
@@ -264,7 +302,15 @@ export function resolveDocsConfig(
|
|
|
264
302
|
// files for a project declaring no `requirement.*` node — not an empty page. A
|
|
265
303
|
// project without a ledger sees byte-identical output to before the surface
|
|
266
304
|
// existed; see requirements-file.ts.
|
|
267
|
-
|
|
305
|
+
//
|
|
306
|
+
// `agent` defaults ON for the same reason and under the same discipline: each of
|
|
307
|
+
// its three pages renders "" when its tier has nothing to describe, and an empty
|
|
308
|
+
// render emits no file. It is additionally gated on a loadable gen config, exactly
|
|
309
|
+
// as `api` is — physical names, the dialect and view dispatch all come from there,
|
|
310
|
+
// so without one there is nothing true to say. Turning it on by default is what
|
|
311
|
+
// makes the always-on agent-context pointer able to name the files: a pointer to a
|
|
312
|
+
// page an adopter has to opt into is a pointer at nothing.
|
|
313
|
+
surfaces: cli.surfaces ?? block?.surfaces ?? ["model", "api", "requirements", "agent"],
|
|
268
314
|
apiSurfaces: cli.apiSurfaces ?? block?.apiSurfaces ?? [{ lang: "ts", subDir: "api" }],
|
|
269
315
|
};
|
|
270
316
|
}
|