ID:WORK-105Status:done
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.
Priority:highComplexity:moderateMilestone:v1.0.0Source:ADR-005
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
Relationships
Related
ID:WORK-107Status:done6/6
Migrate community package runes to inline rune identifiers
Priority:highComplexity:simpleMilestone:v1.0.0
ID:WORK-106Status:done5/5
Migrate core runes to inline rune identifiers
Priority:highComplexity:simpleMilestone:v1.0.0
ID:WORK-109Status:done11/11
Remove Type system — delete schema classes, registries, and old signature
Priority:mediumComplexity:moderateMilestone:v1.0.0
ID:WORK-108Status:done5/5
Update inspect tooling for string-based rune types
Priority:mediumComplexity:simpleMilestone:v1.0.0
History
- 59ded4aContent edited
- f262d7bsource+ADR-005
- f0a845a
- ☑ `createComponentRenderable` in `packages/runes/src/lib/component.ts` accepts both `Type` and `{ 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)
- ☑ `RuneDescriptor` in `packages/runes/src/rune.ts` has `typeName?: string` and `schemaOrgType?: string` fields alongside the existing `type?: Type`
- +3 more criteria
- c87b1c2statusready→done
- 721addbCreated (ready, high, moderate, runes, types, architecture, v1.0.0)