@tylix/compiler
v0.3.6
Published
Compiles `.tyx` page and component files into runnable JavaScript, with full TypeScript support.
Readme
@tylix/compiler
Compiles .tyx page and component files into runnable JavaScript,
with full TypeScript support.
What's included
- Lexer/Parser —
Lexer,tokenTypes,Parser,parseComponent,parseTemplate,parseExpressionStringturn.tyxsource into an AST (ast/nodes.js) - Codegen —
generateExpression,generateStatement,generateMethod,generatePage,generateTemplateturn the AST into JS output - Typecheck —
buildVirtualTs,typecheckVirtualFile,typecheckPage, andtranspileHelperSourcerun.tyxscripts through the TypeScript Compiler API for full type-annotation support - Imports —
extractImports,resolvePackageComponentsresolve component imports from external packages (e.g.import { IconPlus } from "tylix-icons") by reading atylix-components.jsonmanifest from the package'snode_modulesfolder — a plain JSON map of exported name →.tyxfile path — then reading that.tyxfile's source so it can be compiled inline alongside locally-defined components. No bundler or specialpackage.jsonexports map required; any package that ships a manifest and some.tyxfiles works. - Runtime —
reactiveprimitives compileComponentandrenderPageDocumentas the main entry points tying parsing → typecheck → codegen together
Usage
Used internally by @tylix/core (dev server) and @tylix/cli
(build, dev) to turn .tyx files into runnable pages/components.
Not typically imported directly in application code.
License
MIT
