code

package
v0.0.0-...-f0049f5 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildErrorPage

func BuildErrorPage(componentPath string, errorMessages []string) *Node

BuildErrorPage creates a complete error page for build failures

func CommonJSComponentPage

func CommonJSComponentPage(c config.AppConfig, componentName, compiledJS string) *Node

CommonJSComponentPage creates a page that renders a React component using CommonJS/IIFE bundle

func CommonJSLoader

func CommonJSLoader(componentName, compiledJS string) *Node

CommonJSLoader creates a script that loads and renders a bundled React component using CommonJS

func ComponentErrorStyles

func ComponentErrorStyles() *Node

ComponentErrorStyles returns CSS styles for error displays

func ComponentLoader

func ComponentLoader(componentPath, componentName string, useModuleEndpoint bool) *Node

ComponentLoader creates the JavaScript module loader for a component

func ComponentPageLayout

func ComponentPageLayout(title string, children ...*Node) *Node

ComponentPageLayout creates the standard layout for component pages

func ComponentRuntimeStyles

func ComponentRuntimeStyles() *Node

ComponentRuntimeStyles returns CSS styles for component runtime

func ErrorDisplay

func ErrorDisplay(title, message string, details []string) *Node

ErrorDisplay creates an error display div

func LoadModule

func LoadModule(componentPath, componentName string) *Node

LoadModule creates a script node that loads and renders a React component module componentPath: path to the component file (e.g., "claudemd/ClaudeDocApp.tsx") componentName: name of the component to render (e.g., "ClaudeDocApp")

func New

func New(d deps.Deps) *http.ServeMux

func ReactComponentPage

func ReactComponentPage(c config.AppConfig, componentName string, additionalHeadNodes ...*Node) *Node

ReactComponentPage creates a page that renders a React component

func ReactImportMap

func ReactImportMap(c config.AppConfig) *Node

ReactImportMap returns a script tag with React import mappings

func ServeReactApp

func ServeReactApp(w http.ResponseWriter, r *http.Request, componentPath, componentName string)

ServeReactApp serves a React application with the standard layout and dependencies This provides a reusable pattern for hosting React apps with esbuild compilation

Types

type BuildCache

type BuildCache struct {
	BuiltAt    time.Time `json:"builtAt"`
	SourcePath string    `json:"sourcePath"`
	BuildPath  string    `json:"buildPath"`
	Hash       string    `json:"hash"`
}

type FileInfo

type FileInfo struct {
	Name         string    `json:"name"`
	Path         string    `json:"path"`
	IsDir        bool      `json:"isDir"`
	Size         int64     `json:"size"`
	LastModified time.Time `json:"lastModified"`
	FileCount    int       `json:"fileCount"` // Number of files in directory (0 for regular files)
}

type SaveFileRequest

type SaveFileRequest struct {
	Path    string `json:"path"`
	Content string `json:"content"`
}

Jump to

Keyboard shortcuts

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