@rhinostone/swig-core
v2.3.0
Published
Shared IR, backend, and runtime for the @rhinostone/swig family of template engines.
Maintainers
Readme
@rhinostone/swig-core
Shared runtime for the
@rhinostone/swigfamily of template engines. Not intended for direct consumption unless you are building a custom frontend. Install @rhinostone/swig for the default Swig (Jinja2/Django-inspired) flavor, or @rhinostone/swig-twig for the Twig flavor — both pull this package in pinned to the matching version.
Extracted from @rhinostone/[email protected] during the 2.0.0-alpha.1 multi-flavor carve. See ROADMAP.md for the release narrative.
What lives here
- IR types and helpers (
lib/ir.js) — the intermediate representation emitted by frontend parsers and consumed by the backend. - Backend (
lib/backend.js) — lowers IR to compiled JavaScript source vianew Function(...). - Engine wiring (
lib/engine.js) —engine.install(self, frontend)glues a frontend (tags, filters, parser, lexer) onto the shared runtime. - Expression-level TokenParser (
lib/tokenparser.js) — IR emission for inline expressions, shared across frontends. - Runtime primitives (
lib/utils.js,lib/security.js,lib/cache.js,lib/loaders/,lib/filters.js,lib/dateformatter.js,lib/tokentypes.js).
Consumers
- @rhinostone/swig — default Swig flavor.
- @rhinostone/swig-twig — Twig parity frontend.
Versioning
Frontends and the core release in lockstep. Cross-package dependencies pin to the matching exact version (no caret, no tilde). Do not upgrade swig-core independently of the frontend that consumes it.
Repository
Source lives in the @rhinostone/swig monorepo: gina-io/swig/packages/swig-core. File issues and PRs at gina-io/swig.
License
MIT. See LICENSE in the monorepo root.
