ID:WORK-105Status:donePriority:highComplexity:moderateMilestone:v1.0.0
Add dual-signature support to createComponentRenderable and update RuneDescriptor
Phase 1 of ADR-005. Update createComponentRenderable to accept either the current Type first argument or a new inline { rune: string, schemaOrgType?: string } form. Update RuneDescriptor and Rune class to carry typeName?: string and schemaOrgType?: string instead of type?: Type.
Both signatures must work simultaneously so Phase 2 migration can happen incrementally.
Acceptance Criteria
createComponentRenderableinpackages/runes/src/lib/component.tsaccepts bothTypeand{ rune: string, schemaOrgType?: string, ...TransformResult }signatures- When called with the new signature, output is identical to the old signature (same
typeof,data-rune, RDFa attributes) RuneDescriptorinpackages/runes/src/rune.tshastypeName?: stringandschemaOrgType?: stringfields alongside the existingtype?: TypeRuneclass exposestypeNameandschemaOrgTypeas readonly fields, derived from either the new string fields or the legacyTypeinstance- All existing tests pass with no changes to rune schemas
- TypeScript compiles cleanly — no type errors in any package
Approach
- In
packages/runes/src/lib/component.ts, add a type guard to detect whether the first argument is aTypeinstance or an inline object withrunefield - Extract the
nameandschemaOrgTypefrom whichever form is provided, then continue with the existing logic - In
packages/runes/src/rune.ts, add optionaltypeNameandschemaOrgTypestring fields toRuneDescriptor - In the
Runeclass, computetypeNamefromdescriptor.typeName ?? descriptor.type?.nameand similarly forschemaOrgType - Update the
TypeandTypeFactoryexports inpackages/types/src/schema/index.tsto add deprecation JSDoc comments
Key Files
packages/runes/src/lib/component.ts—createComponentRenderablefunction (line 24)packages/runes/src/rune.ts—RuneDescriptorinterface (line 4) andRuneclass (line 37)packages/types/src/schema/index.ts—Type,TypeFactory,useSchemadefinitions
References
- ADR-005 (Phase 1)
Relationships
Related
- ADR-005accepteddecisionReplace the useSchema / Type class system with plain rune identifiers
- WORK-107doneworkMigrate community package runes to inline rune identifiers
- WORK-106doneworkMigrate core runes to inline rune identifiers
- WORK-109doneworkRemove Type system — delete schema classes, registries, and old signature
- WORK-108doneworkUpdate inspect tooling for string-based rune types