compiler

module
v0.5.0-alpha.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2026 License: Apache-2.0

Directories

Path Synopsis
cmd
krate command
Package goext exposes the embedded sources of the goext helper packages (krate, runtime) so the compiler can vendor them into a project's generated Go module under the same real import path:
Package goext exposes the embedded sources of the goext helper packages (krate, runtime) so the compiler can vendor them into a project's generated Go module under the same real import path:
krate
Package krate provides HTML helpers for Go components.
Package krate provides HTML helpers for Go components.
runtime
Package runtime provides helpers for krate Go API route handlers.
Package runtime provides helpers for krate Go API route handlers.
internal
astjson
Package astjson encodes and decodes an *ast.Program to and from a kind-tagged JSON document.
Package astjson encodes and decodes an *ast.Program to and from a kind-tagged JSON document.
astprint
Package astprint renders an *ast.Program back to TypeScript/JSX source.
Package astprint renders an *ast.Program back to TypeScript/JSX source.
check
Package check implements compiler-enforced quality gates: static analysis rules over a page's AST and its resolved output (final HTML + JS weight).
Package check implements compiler-enforced quality gates: static analysis rules over a page's AST and its resolved output (final HTML + JS weight).
conformance
Package conformance holds a parser conformance corpus and the test that measures it.
Package conformance holds a parser conformance corpus and the test that measures it.
content
Package content implements typed content collections: a declarative schema (authored in `content.config.ts` via `defineContent`) is validated against the frontmatter of markdown/mdx entries, and TypeScript declarations are generated so content is fully typed.
Package content implements typed content collections: a declarative schema (authored in `content.config.ts` via `defineContent`) is validated against the frontmatter of markdown/mdx entries, and TypeScript declarations are generated so content is fully typed.
css
csssignals
Package csssignals implements the compiler-side analysis for the zero-JS CSS primitives: - createCSSChoice(initial, options?) - a radio group (tabs, segments).
Package csssignals implements the compiler-side analysis for the zero-JS CSS primitives: - createCSSChoice(initial, options?) - a radio group (tabs, segments).
deploy
Package deploy writes host-specific adapter files (redirects, config) into a built site so it can be dropped onto a static host without manual setup.
Package deploy writes host-specific adapter files (redirects, config) into a built site so it can be dropped onto a static host without manual setup.
diag
Package diag provides the unified compiler diagnostic type and formatting.
Package diag provides the unified compiler diagnostic type and formatting.
docfind
Package docfind embeds Microsoft's docfind WASM document-search engine into krate and drives it entirely in-process - no subprocess and no temporary JSON files on disk.
Package docfind embeds Microsoft's docfind WASM document-search engine into krate and drives it entirely in-process - no subprocess and no temporary JSON files on disk.
environ
Package environ loads project `.env` files and exposes the resolved set to the rest of the compiler.
Package environ loads project `.env` files and exposes the resolved set to the rest of the compiler.
escape
Package escape provides the canonical HTML, attribute, and JavaScript string escaping used across the compiler.
Package escape provides the canonical HTML, attribute, and JavaScript string escaping used across the compiler.
execx
Package execx runs external processes with a hard timeout and reliable process-tree termination.
Package execx runs external processes with a hard timeout and reliable process-tree termination.
fix
Package fix applies conservative, parse-gated source migrations for stable diagnostics.
Package fix applies conservative, parse-gated source migrations for stable diagnostics.
frontmatter
Package frontmatter parses YAML-style frontmatter found at the top of krate markdown/MDX doc files.
Package frontmatter parses YAML-style frontmatter found at the top of krate markdown/MDX doc files.
fsutil
Package fsutil provides shared filesystem helpers used across the compiler.
Package fsutil provides shared filesystem helpers used across the compiler.
gitinfo
Package gitinfo provides lightweight, cached git metadata (last-commit dates) for content files.
Package gitinfo provides lightweight, cached git metadata (last-commit dates) for content files.
gohost
Package gohost owns the Go host: it scans Go API routes and Go components, scaffolds the generated module (.krate/goapi) + vendored helper module (.krate/goext), compiles the host, renders components at build time, and generates TypeScript declarations.
Package gohost owns the Go host: it scans Go API routes and Go components, scaffolds the generated module (.krate/goapi) + vendored helper module (.krate/goext), compiles the host, renders components at build time, and generates TypeScript declarations.
gotsgen
Package gotsgen parses Go component files and generates TypeScript declaration files (.d.go.ts) so `import { Card } from "./card.go"` type-checks, and exposes the component metadata the Go host scaffolding needs.
Package gotsgen parses Go component files and generates TypeScript declaration files (.d.go.ts) so `import { Card } from "./card.go"` type-checks, and exposes the component metadata the Go host scaffolding needs.
htmlspec
Package htmlspec is the single source of truth for how Krate serializes JSX elements to HTML: void elements, boolean / booleanish / enumerated attributes, the React prop-name to attribute-name mapping (HTML, SVG, xlink and xml namespaces), form-control value handling, style objects, URL sanitization and tag/attribute name validation.
Package htmlspec is the single source of truth for how Krate serializes JSX elements to HTML: void elements, boolean / booleanish / enumerated attributes, the React prop-name to attribute-name mapping (HTML, SVG, xlink and xml namespaces), form-control value handling, style objects, URL sanitization and tag/attribute name validation.
jseval
Package jseval evaluates TypeScript/JavaScript in-process: it bundles an entry module (resolving imports) with esbuild and runs it in the embedded QuickJS runtime - no Node, no tsx, no subprocess.
Package jseval evaluates TypeScript/JavaScript in-process: it bundles an entry module (resolving imports) with esbuild and runs it in the embedded QuickJS runtime - no Node, no tsx, no subprocess.
jsvalue
Package jsvalue models JavaScript values for build-time evaluation.
Package jsvalue models JavaScript values for build-time evaluation.
kratedocs
Package kratedocs embeds Krate's own framework documentation (the content that powers the docs site) into the compiler so tooling - notably the MCP search_docs tool and the krate://docs/{slug} resource - can answer questions about Krate itself, independent of the project it is running in.
Package kratedocs embeds Krate's own framework documentation (the content that powers the docs site) into the compiler so tooling - notably the MCP search_docs tool and the krate://docs/{slug} resource - can answer questions about Krate itself, independent of the project it is running in.
lexer
Package lexer tokenizes TypeScript/TSX source for the Krate parser.
Package lexer tokenizes TypeScript/TSX source for the Krate parser.
mcp
Package mcp implements `krate mcp`, an MCP (Model Context Protocol) server that exposes the Krate compiler to agents over JSON-RPC 2.0.
Package mcp implements `krate mcp`, an MCP (Model Context Protocol) server that exposes the Krate compiler to agents over JSON-RPC 2.0.
migrate
Package migrate plans and applies framework migrations into a Krate project.
Package migrate plans and applies framework migrations into a Krate project.
parser
Package parser is Krate's TSX/JSX parser.
Package parser is Krate's TSX/JSX parser.
plugin/searchassets
Package searchassets embeds the docs search UI files (search.js + search.css) that the docs plugin writes into the output directory at build time.
Package searchassets embeds the docs search UI files (search.js + search.css) that the docs plugin writes into the output directory at build time.
pluginapi
Package pluginapi implements the paired capability surface Workstream B exposes to both JavaScript and Go plugins: resolving/reading files against the project root and node_modules, and writing static assets into the project root.
Package pluginapi implements the paired capability surface Workstream B exposes to both JavaScript and Go plugins: resolving/reading files against the project root and node_modules, and writing static assets into the project root.
pluginutil
Package pluginutil provides shared utilities for krate's built-in plugins (file walking, HTML template building, path helpers).
Package pluginutil provides shared utilities for krate's built-in plugins (file walking, HTML template building, path helpers).
reactive
Package reactive builds a compile-time signal dependency graph from emitted component signatures.
Package reactive builds a compile-time signal dependency graph from emitted component signatures.
renderer
CSSARIAJS is the tiny ARIA state synchroniser for CSS-signal scopes that need synthesized state the user agent does not maintain on a native control (tabs, listbox, disclosure/dialog/popover).
CSSARIAJS is the tiny ARIA state synchroniser for CSS-signal scopes that need synthesized state the user agent does not maintain on a native control (tabs, listbox, disclosure/dialog/popover).
resolver
Package resolver provides the shared node_modules package resolution used by the bundler (bare import specifiers) and the docs plugin (npm docs themes).
Package resolver provides the shared node_modules package resolution used by the bundler (bare import specifiers) and the docs plugin (npm docs themes).
routetypes
Package routetypes generates TypeScript declaration files describing a project's route surface.
Package routetypes generates TypeScript declaration files describing a project's route surface.
safe
Package safe turns panics into ordinary errors so a bug in one unit of work (a page, a plugin hook, an embedded-JS evaluation) is reported as a normal diagnostic instead of crashing the whole compiler.
Package safe turns panics into ordinary errors so a bug in one unit of work (a page, a plugin hook, an embedded-JS evaluation) is reported as a normal diagnostic instead of crashing the whole compiler.
sigutil
Package sigutil centralizes detection of reactive declarations (createSignal / createResource destructuring) across the compiler.
Package sigutil centralizes detection of reactive declarations (createSignal / createResource destructuring) across the compiler.
tsstrip
Package tsstrip removes TypeScript syntax from page/component sources before Krate's own lexer and parser see them.
Package tsstrip removes TypeScript syntax from page/component sources before Krate's own lexer and parser see them.
version
Package version exposes the running Krate compiler version to internal packages (plugin context assembly, diagnostics) so a single value is threaded everywhere instead of hardcoded strings.
Package version exposes the running Krate compiler version to internal packages (plugin context assembly, diagnostics) so a single value is threaded everywhere instead of hardcoded strings.
Package plug is the public SDK for writing Krate plugins in Go.
Package plug is the public SDK for writing Krate plugins in Go.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL