vormabuild

package
v0.85.0-pre.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2026 License: BSD-3-Clause Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BuildtimePublicURLFuncName_Schema = jsonschema.OptionalString(jsonschema.Def{
	Description: `Name of the global function injected by the Vite plugin for resolving public asset URLs at build time.`,
	Default:     "waveBuildtimeURL",
	Examples:    []string{"waveBuildtimeURL", "getAssetURL"},
})
View Source
var ClientEntry_Schema = jsonschema.RequiredString(jsonschema.Def{
	Description: `Path to your client-side entry file.`,
	Examples:    []string{"frontend/src/vorma.entry.tsx"},
})
View Source
var ClientRouteDefsFile_Schema = jsonschema.RequiredString(jsonschema.Def{
	Description: `Path to your client route definitions file.`,
	Examples:    []string{"frontend/src/vorma.routes.ts"},
})
View Source
var HTMLTemplateLocation_Schema = jsonschema.RequiredString(jsonschema.Def{
	Description: `Path to your HTML template file, relative to the private static directory.`,
	Examples:    []string{"entry.go.html"},
})
View Source
var IncludeDefaults_Schema = jsonschema.OptionalBoolean(jsonschema.Def{
	Description: `If true (default), Vorma injects default watch patterns for routes, templates, and Go files.`,
	Default:     true,
})
View Source
var MainBuildEntry_Schema = jsonschema.RequiredString(jsonschema.Def{
	Description: `Path to the Vorma build command entry point.`,
	Examples:    []string{"backend/cmd/build", "cmd/build"},
})
View Source
var TSGenOutDir_Schema = jsonschema.RequiredString(jsonschema.Def{
	Description: `Directory where Vorma will generate TypeScript types and configuration.`,
	Examples:    []string{"frontend/src/vorma.gen"},
})
View Source
var UIVariant_Schema = jsonschema.RequiredString(jsonschema.Def{
	Description: `The UI framework to use for client-side rendering.`,
	Enum:        []string{"react", "preact", "solid"},
})
View Source
var Vorma_Schema = jsonschema.OptionalObject(jsonschema.Def{
	Description:      "Vorma framework configuration.",
	RequiredChildren: []string{"UIVariant", "HTMLTemplateLocation", "ClientEntry", "ClientRouteDefsFile", "TSGenOutDir", "MainBuildEntry"},
	Properties: struct {
		IncludeDefaults            jsonschema.Entry
		MainBuildEntry             jsonschema.Entry
		UIVariant                  jsonschema.Entry
		HTMLTemplateLocation       jsonschema.Entry
		ClientEntry                jsonschema.Entry
		ClientRouteDefsFile        jsonschema.Entry
		TSGenOutDir                jsonschema.Entry
		BuildtimePublicURLFuncName jsonschema.Entry
	}{
		IncludeDefaults:            IncludeDefaults_Schema,
		MainBuildEntry:             MainBuildEntry_Schema,
		UIVariant:                  UIVariant_Schema,
		HTMLTemplateLocation:       HTMLTemplateLocation_Schema,
		ClientEntry:                ClientEntry_Schema,
		ClientRouteDefsFile:        ClientRouteDefsFile_Schema,
		TSGenOutDir:                TSGenOutDir_Schema,
		BuildtimePublicURLFuncName: BuildtimePublicURLFuncName_Schema,
	},
})

Functions

func Build

func Build(v *vormaruntime.Vorma)

Build parses flags and runs the build or dev server.

func WriteGeneratedTS

func WriteGeneratedTS(l *vormaruntime.LockedVorma) error

WriteGeneratedTS generates and writes the complete TypeScript output file.

Types

type RouteCall

type RouteCall struct {
	Pattern  string
	Module   string
	Key      string
	ErrorKey string
}

type TSGenInput

type TSGenInput struct {
	LoadersRouter *mux.NestedRouter
	ActionsRouter *mux.Router
	Paths         map[string]*vormaruntime.Path
	Config        *vormaruntime.VormaConfig
	AdHocTypes    []*tsgen.AdHocType
	ExtraTSCode   string
}

TSGenInput contains all data needed for TypeScript generation. This makes the function pure - it takes inputs and returns output.

type UnresolvedRouteCall

type UnresolvedRouteCall struct {
	Pattern       string
	RawModuleExpr string
	Reason        string
}

UnresolvedRouteCall represents a route() call where the module path could not be statically determined. This happens when the module argument is a variable, function call, or other dynamic expression.

Jump to

Keyboard shortcuts

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