feat(types): semilla con fields para 11 tipos + CLI --test-types-yaml
- examples/types.yaml: principal_field + fields para Person, Email,
Domain, Phone, Org, IBAN, Account, Document, Address, Url, Table.
44 fields totales. Documentacion del formato en cabecera.
- project_manager.cpp: seed con fields para los tipos basicos (fallback
cuando no se encuentra examples/types.yaml).
- main.cpp:
- Log de carga incluye conteo de schemas y total de fields.
- --test-types-yaml <path>: smoke test que carga, serializa a temp y
recarga. Compara entidades/relaciones/fields field-a-field. Salida
PASS/FAIL con exit code 0/1. Permite verificar round-trip sin
framework de tests.
Verificado: examples/types.yaml round-trip estable (11 entities, 44
fields, 6 relations).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
+15
-8
@@ -123,29 +123,33 @@ CREATE TABLE IF NOT EXISTS logs (
|
||||
);
|
||||
)SQL";
|
||||
|
||||
// Semilla types.yaml minima si examples/types.yaml no se encuentra.
|
||||
// Semilla types.yaml minima si examples/types.yaml no se encuentra. Incluye
|
||||
// `fields` (issue 0005) y el tipo Table como cuadrado (issue 0010 preview).
|
||||
static const char* k_seed_types_yaml = R"YAML(# types.yaml — generado al crear el proyecto. Editable desde el Type Editor.
|
||||
# Todos los nodos son circulo, salvo "Table" que es cuadrado.
|
||||
# Iconos: nombres ti-* mapeados en types_registry.cpp
|
||||
# Estilos de relacion: solid | dashed | dotted
|
||||
# Tipos de campo: string | int | float | bool | date | url | enum.
|
||||
|
||||
entities:
|
||||
- name: Person
|
||||
color: "#5B8DEF"
|
||||
icon: ti-user
|
||||
principal_field: name
|
||||
fields:
|
||||
- { name: name, type: string, required: true }
|
||||
- { name: first_name, type: string }
|
||||
- { name: last_name, type: string }
|
||||
|
||||
- name: Email
|
||||
color: "#58CA8C"
|
||||
icon: ti-mail
|
||||
principal_field: address
|
||||
fields:
|
||||
- { name: address, type: string, required: true }
|
||||
|
||||
- name: Domain
|
||||
color: "#F4B860"
|
||||
icon: ti-world
|
||||
|
||||
- name: Phone
|
||||
color: "#E36AC0"
|
||||
icon: ti-phone
|
||||
|
||||
- name: Org
|
||||
color: "#C780E8"
|
||||
icon: ti-building
|
||||
@@ -154,10 +158,13 @@ entities:
|
||||
color: "#C9C9C9"
|
||||
icon: ti-file
|
||||
|
||||
# Nodo tabla — cuadrado (issue 0010).
|
||||
- name: Table
|
||||
color: "#0EA5E9"
|
||||
icon: ti-database
|
||||
principal_field: name
|
||||
fields:
|
||||
- { name: name, type: string, required: true }
|
||||
- { name: row_type, type: string }
|
||||
|
||||
relations:
|
||||
- name: owns
|
||||
|
||||
Reference in New Issue
Block a user