annotator

package
v0.3.0-beta.7 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Annotate

func Annotate(prog *ast.Program, cfg *config.Config, sourceFile string, rawSource string) *irtree.Annotations

Annotate performs static analysis on a parsed program to determine component tiers, signal declarations, streaming mode, and used components.

func MergeModuleFunctions

func MergeModuleFunctions(ann *irtree.Annotations, modules []ModuleSource)

MergeModuleFunctions collects function declarations from additional bundled modules and merges them into the annotations. Imported components (e.g. DocsLayout, SidebarNav) live in separate bundled modules that the entry module's AST doesn't contain. Each module's own source path/raw text is recorded so tier classification for imported components uses their own file conventions (e.g. *.runtime.tsx).

func ReclassifyTiers

func ReclassifyTiers(ann *irtree.Annotations, cfg *config.Config)

ReclassifyTiers re-runs tier classification for all used components. Call after MergeModuleFunctions so newly discovered components get classified against their own module sources.

Types

type ModuleSource

type ModuleSource struct {
	Program   *ast.Program
	Path      string
	RawSource string
}

ModuleSource carries a bundled module's program plus its source file path and raw text so imported components can be tier-classified against their own file.

Jump to

Keyboard shortcuts

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