oc-generic-template-compiler is a module for creating a generic compiler that orchestrates view, server, and static compilers in the OpenComponents ecosystem. Version 2.2.0 is current, with stable releases following OpenComponents' cadence. It enables processing of templates across multiple compilers, supporting JavaScript and HTML. Key differentiator: acts as a unified interface for composing compilers, reducing integration complexity in OC-based projects. Supports TypeScript via bundled types.
npm install oc-generic-template-compilerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a generic compiler with mock view, server, and statics compilers and compiles a simple template.
Ensure custom compilers conform to this interface; previously compilers could return strings.
Update custom compilers to return objects with 'result' and 'dependencies'.
Ensure viewCompiler, serverCompiler, and staticsCompiler are objects implementing compile.
Ensure all compilers return { result: string, dependencies: any[] }.Check that each compiler property is an object with a compile method.