Part of EPIC #698.
Component props interfaces are maintained by hand next to the CND definition, and drift silently:
[hellojahia:blogPost] > jnt:content, mix:title, jmix:mainResource
- body (string, richtext) mandatory
- publicationDate (date)
- category (string, choicelist[blogCategories])
interface Props {
"jcr:title": string; // hand-written mirror of the CND
"body": string;
"publicationDate"?: string;
"category"?: string;
}
Renaming or retyping a CND property breaks nothing at build time — views keep compiling against the stale interface. By contrast, Astro derives content types from the zod schema: change the schema, every consumer re-type-checks on save.
Proposal: a build step (vite plugin or codegen script) that parses the module's .cnd files and emits props interfaces (mandatory vs optional, i18n, multiple, date/weakreference mappings, mixin inheritance), e.g. into a generated .d.ts importable as jahia:types/hellojahia:blogPost or similar. Fold Content Editor form types in later if useful.
Part of EPIC #698.
Component props interfaces are maintained by hand next to the CND definition, and drift silently:
Renaming or retyping a CND property breaks nothing at build time — views keep compiling against the stale interface. By contrast, Astro derives content types from the zod schema: change the schema, every consumer re-type-checks on save.
Proposal: a build step (vite plugin or codegen script) that parses the module's
.cndfiles and emits props interfaces (mandatory vs optional, i18n, multiple, date/weakreference mappings, mixin inheritance), e.g. into a generated.d.tsimportable asjahia:types/hellojahia:blogPostor similar. Fold Content Editor form types in later if useful.