@sweetener/compiler
v0.1.0-alpha.8
Published
Sweetener alpha package: compiler
Downloads
2,078
Maintainers
Readme
@sweetener/compiler
The Sweetener compiler: the expansion session every build-tool adapter is built on. Reach for an adapter first.
Part of Sweetener, hygienic declarative macros for TypeScript. Alpha: the language version is 1 and the package interfaces may still change.
Usage
import { createSweetenerSession } from "@sweetener/compiler";
const session = createSweetenerSession();
const result = await session.transform({ code, filename, configFile });Subpaths expose the layers a host reaches past the session for:
/typescript-host runs the official TypeScript compiler and language
service over expanded virtual files, and /reader, /syntax and
/shared read Sweetener source without expanding it. Everything else is
internal and has no stable API.
