compiler

package
v0.1.31 Latest Latest
Warning

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

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

Documentation

Overview

Package compiler provides a compiler for GoSPA Single File Components (.gospa).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompileOptions

type CompileOptions struct {
	Type       ComponentType
	IslandID   string
	Name       string
	PkgName    string
	Hydrate    bool
	ServerOnly bool
}

CompileOptions configures the compilation of a .gospa component.

type ComponentType

type ComponentType string

ComponentType represents the type of a compiled component.

const (
	ComponentTypeIsland ComponentType = "island"
	ComponentTypePage   ComponentType = "page"
	ComponentTypeLayout ComponentType = "layout"
	ComponentTypeStatic ComponentType = "static"
	ComponentTypeServer ComponentType = "server"
)

Component type constants.

type GospaCompiler

type GospaCompiler struct{}

GospaCompiler handles the compilation of .gospa files.

func NewCompiler

func NewCompiler() *GospaCompiler

NewCompiler creates a new GospaCompiler.

func (*GospaCompiler) Compile

func (c *GospaCompiler) Compile(opts CompileOptions, input string) (templ, ts string, err error)

Compile compiles a .gospa component into Templ and TypeScript.

func (*GospaCompiler) CompileLegacy

func (c *GospaCompiler) CompileLegacy(goName, islandID, input, pkgName string) (templ, ts string, err error)

CompileLegacy preserves the old island-only API.

Directories

Path Synopsis
Package sfc provides a parser for GoSPA Single File Components (.gospa).
Package sfc provides a parser for GoSPA Single File Components (.gospa).

Jump to

Keyboard shortcuts

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