Integrates LiquidJS template rendering into the CLI render command.
When a template is registered for a node's schema type via the variable
system (@ucas/template/text/<schema-hash>), the CLI will use the template
for rendering. Otherwise, it falls back to YAML output.
Changes:
- Modified cmdRender in index.ts to use renderAsync with variable store
- Added Suite 6: CLI Integration with Templates (5 comprehensive tests)
- Fixed template file format: templates must be JSON-encoded strings
- Removed unused render import from index.ts
- Renamed unused globalDecay parameter in liquid-render.ts
Test coverage increased from 336 to 341 tests, all passing.
Fixes#40
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fixes reviewer feedback:
1. Fixed TypeScript strict mode error where ctx.engine was possibly null
- Refactored to pass store/varStore/globalDecay directly to createLiquidEngine
- Eliminated RenderContext type that caused circular dependency
- Engine is now properly typed as Liquid (non-nullable)
2. Removed dynamic imports from production code
- Changed render.ts to use static import of renderWithTemplate
- Changed hasTemplate to use static import of putSchema
- Complies with CLAUDE.md convention against dynamic imports
All tests pass (336 tests), build succeeds with no TypeScript errors,
lint checks pass with only 1 minor warning about unused parameter
(which is actually used in recursive calls).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>