You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 6d2624c
Browse filesBrowse the repository at this point in the historyBrowse files
refactor(codegen): one naming layer per port for a value object's types
A cleanup pass over the ADR-0056 diff, kept where four suites prove it
behaviour-neutral.
- Kotlin: strictRef / mirrorRef / requireReferenceable move from
KotlinExtractSchemaEmitter to KotlinNaming, so every tier asks the naming layer
for a value object's types instead of an emitter. The "a no-package template
emits into the root package, where no `package` line may appear" rule is
spelled once as KotlinNaming.packageHeader, not in four generators.
- Python: the `_pkg_of` helper was copied into four modules; they now import the
shared value_objects.pkg_of, which itself defers to naming.package_of_resolution_key.
object_ref_target caches its per-field resolution (the tree is read-only after
load, and the model/type-map/read/create/patch tiers each resolve the same ref).
- Java: the render PayloadAccessors reflects a record's components once per class
rather than per node per render; Spring/apidocs doc comments now name the symbols
that exist after ADR-0056 removed the payload tier.
- TypeScript: the `ctx ? ctx.valueObjectEmittedName(vo) : vo.name` conditional is
emittedVoName(), called by the five sites that re-spelled it.
The C# half of the pass was REVERTED, not kept: it dropped an optional parameter
from the public CSharpNaming.MapValueType (an API break a cleanup may not make in
a patch) and narrowed EntityGenerator.ValueShapes to abstract value objects only,
which changes which POCOs a run emits. Neither is a simplification.
Verified on this tree: Python 2254 passed; mvn render+codegen-spring+codegen-kotlin
BUILD SUCCESS (385 Kotlin tests); codegen-ts 1687 passed + typecheck clean.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M1mRRB1K2WdYy82kntMQdx
Copy file name to clipboardExpand all lines: server/java/codegen-kotlin/src/main/kotlin/com/metaobjects/generator/kotlin/KotlinOutputParserGenerator.kt
+4-5Lines changed: 4 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -97,10 +97,10 @@ open class KotlinOutputParserGenerator : MultiFileDirectGeneratorBase<MetaObject
97
97
val (templatePkg, templateShort) =PackageMapping.splitFqn(template.name)
98
98
val outPkg =KotlinNaming.promptsPackage(templatePkg)
99
99
val parserClass =KotlinNaming.parserName(templateShort)
Copy file name to clipboardExpand all lines: server/java/codegen-kotlin/src/main/kotlin/com/metaobjects/generator/kotlin/KotlinOutputPromptGenerator.kt
+1-2Lines changed: 1 addition & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -101,8 +101,7 @@ open class KotlinOutputPromptGenerator : MultiFileDirectGeneratorBase<MetaObject
101
101
append("// GENERATED — DO NOT EDIT — output-format prompt for template.output `")
102
102
append(template.name)
103
103
append("`\n")
104
-
// A no-package template emits into the root package (see KotlinNaming.promptsPackage).
105
-
if (outPkg.isNotEmpty()) append("package ").append(outPkg).append("\n\n")
Copy file name to clipboardExpand all lines: server/java/codegen-kotlin/src/main/kotlin/com/metaobjects/generator/kotlin/KotlinRenderHelperGenerator.kt
+3-4Lines changed: 3 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -105,8 +105,8 @@ open class KotlinRenderHelperGenerator : MultiFileDirectGeneratorBase<MetaObject
105
105
// ADR-0056 — the payload IS the @payloadRef value object's own data class, the one
106
106
// KotlinEntityGenerator emits in the value object's package. Referenced fully qualified;
107
107
// this generator declares no payload type of its own.
0 commit comments