@metaobjectsdev/sdk 0.15.16 → 0.15.17-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.
@@ -2,7 +2,8 @@
2
2
 
3
3
  The Kotlin port is a **codegen tier built on top of the Java port** — the loader,
4
4
  render engine, and Maven plugin are all Java; `metaobjects-codegen-kotlin` emits
5
- idiomatic Kotlin (KotlinPoet: `@Serializable data class`, Exposed `Table` objects,
5
+ idiomatic Kotlin (KotlinPoet: `data class` (no `@Serializable` — entities are
6
+ Jackson-compatible, not kotlinx-serialized), Exposed `Table` objects,
6
7
  Spring `@RestController`). Codegen runs as the same Maven plugin goal the Java port
7
8
  uses (`mvn metaobjects:generate`). Schema migration and live-DB drift are
8
9
  **Node-`meta`-only** (ADR-0015). The runtime persistence tier is **JetBrains Exposed**
@@ -601,6 +601,18 @@ child (`source.rdb: { kind: view, table: v_author }`) — codegen keys projectio
601
601
  detection + view DDL off that read-only source, so without it `meta gen` emits
602
602
  nothing for the projection.
603
603
 
604
+ **A `passthrough` field must match its `@from` source's type.** A passthrough
605
+ forwards the source value unchanged, so the projection field's `field.<subType>`
606
+ and array-ness must be identical to the source field's — a `field.uuid` source
607
+ declared as `field.string` on the projection fails load with
608
+ `ERR_PASSTHROUGH_TYPE_MISMATCH` (this is exactly the mismodeling that leaves a
609
+ view `String`-typed over a `uuid` column and forces hand-written coercion).
610
+ Declare the source's type. If the type genuinely must differ on purpose, set
611
+ `@convert: true` on the `origin.passthrough` to acknowledge it — an
612
+ acknowledgement only, it does **not** generate a cast (you own any coercion).
613
+ Nullability may differ (an outer-join view legitimately widens `NOT NULL` →
614
+ nullable) — only subType + array-ness are checked.
615
+
604
616
  ## Abstracts + `extends` (deferred resolution) + `overlay`
605
617
 
606
618
  An **abstract** node (`abstract: true`) describes a shape but is never emitted as
@@ -2,7 +2,8 @@
2
2
 
3
3
  The Kotlin port is a **codegen tier built on top of the Java port**. The loader,
4
4
  render engine, and Maven plugin are all Java; `codegen-kotlin` emits idiomatic
5
- Kotlin (`@Serializable data class`, Exposed `Table` objects, Spring
5
+ Kotlin (`data class` (no `@Serializable` — entities are Jackson-compatible, not
6
+ kotlinx-serialized), Exposed `Table` objects, Spring
6
7
  `@RestController`/`@Configuration`) via KotlinPoet. Codegen runs as the same
7
8
  build-time Maven plugin goal the Java port uses — there is no standalone `meta`
8
9
  binary on the JVM side (the Node `meta` is for schema migrations only; see the
@@ -94,7 +95,7 @@ All live in `metaobjects-codegen-kotlin` under
94
95
 
95
96
  | Generator | Output |
96
97
  |---|---|
97
- | `KotlinEntityGenerator` | `<Entity>.kt` — `@Serializable data class` per `object.entity` / `object.value`. A TPH `@discriminator` base's data class is the **union** of every subtype's columns (each folded nullable, validation dropped) so one wire shape backs the polymorphic + per-subtype endpoints. |
98
+ | `KotlinEntityGenerator` | `<Entity>.kt` — `data class` (no `@Serializable`; Jackson-compatible) per `object.entity` / `object.value`. A TPH `@discriminator` base's data class is the **union** of every subtype's columns (each folded nullable, validation dropped) so one wire shape backs the polymorphic + per-subtype endpoints. |
98
99
  | `KotlinExposedTableGenerator` | `<Entity>Table.kt` — Exposed `Table` object (PK + FK + `@storage` columns) for entities with `source.rdb`. A TPH `@discriminator` base emits ONE `Table` for the whole hierarchy — every subtype-only column folded in `.nullable()` (a row of another subtype stores null there) — single-table inheritance; subtype entities emit no table of their own. |
99
100
  | `KotlinRelationsGenerator` | `<Entity>Relations.kt` — extension fns for `@cardinality="many"` query helpers |
100
101
  | `KotlinSpringControllerGenerator` | `<Entity>Controller.kt` — Spring `@RestController`, five CRUD endpoints on the cross-port REST contract, for writable entities (`source.rdb` `@kind="table"`). A TPH `@discriminator` base emits ONE controller: polymorphic `GET /<base>(+/{id})` plus a per-subtype CRUD set at `/<base>/<discriminatorValue lowercased>` — create injects the discriminator from the URL (never the body); get/update/delete are scoped to the subtype (cross-subtype → 404); the discriminator is immutable. |
@@ -4,7 +4,7 @@ The Kotlin port runtime is **generated Exposed `Table` objects plus your own
4
4
  JetBrains Exposed transactions** — there is no Kotlin-specific persistence engine.
5
5
  `KotlinExposedTableGenerator` emits one `<Entity>Table.kt` per entity with a
6
6
  `source.rdb`; you hand-write the (trivial) transaction bodies, since the table
7
- column definitions and the `@Serializable` entity data class are both generated
7
+ column definitions and the generated `data class` entity are both generated
8
8
  from the same metadata.
9
9
 
10
10
  (If you want a fully metadata-driven engine instead of hand-written Exposed, the
@@ -20,7 +20,6 @@ emit a data class and an Exposed `Table`:
20
20
 
21
21
  ```kotlin
22
22
  // generated/acme/blog/Author.kt
23
- @Serializable
24
23
  data class Author(
25
24
  val id: Long,
26
25
  val name: String,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metaobjectsdev/sdk",
3
- "version": "0.15.16",
3
+ "version": "0.15.17-rc.1",
4
4
  "description": "Workspace helpers and agent-docs utilities for MetaObjects projects.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -56,7 +56,7 @@
56
56
  "access": "public"
57
57
  },
58
58
  "dependencies": {
59
- "@metaobjectsdev/metadata": "0.15.14",
59
+ "@metaobjectsdev/metadata": "0.15.17-rc.1",
60
60
  "zod": "^3.23.0"
61
61
  },
62
62
  "devDependencies": {