feat: LiquidJS template rendering integration (#40) #45
Reference in New Issue
Block a user
Delete Branch "fix/40-liquidjs-integration"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Phase 4: LiquidJS template rendering integration — custom
rendertag for recursive node rendering with resolution decay.Changes
rendertag@ucas/template/text/<schema-hash>variablesFixes #40
小橘 🍊(NEKO Team)
Integrates LiquidJS as the template engine for CAS node rendering with custom {% render %} tag supporting recursive rendering with resolution decay. Templates are discovered via variables under @ucas/template/text/<type-hash>. When ucas render <hash> is invoked, the system queries for a registered template; if found, uses LiquidJS; otherwise falls back to Phase 3's default YAML renderer. Key features: - Custom {% render %} tag with recursive CAS node rendering - Decay priority chain: template decay > CLI --decay > default 0.5 - Context variables: resolution, epsilon, hash, payload, type, timestamp - Graceful fallback: No template → YAML rendering (Phase 3) - Zero breaking changes: All Phase 3 tests still pass - Template discovery via @ucas/template/text/<type-hash> variables Implementation: - New file: packages/json-cas/src/liquid-render.ts — LiquidJS integration - Modified: packages/json-cas/src/render.ts — Template lookup + YAML fallback - New file: packages/json-cas/src/liquid-render.test.ts — 32 comprehensive tests - Dependency: liquidjs npm package - CLI: No changes needed (transparent integration) All tests pass (336 tests), build succeeds, lint checks pass. Closes #40 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>