Documentation
¶
Overview ¶
Package cli provides command-line interface tools for GoSPA.
Package cli provides the state pruning functionality for GoSPA.
Index ¶
- func Build(config *BuildConfig)
- func BuildAll()
- func Clean()
- func CreateProject(name string)
- func CreateProjectWithConfig(config *ProjectConfig) error
- func Dev(config *DevConfig)
- func DevWithConfig(config *DevConfig) error
- func Doctor(config *DoctorConfig)
- func Generate(config *GenerateConfig)
- func GenerateWithConfig(config *GenerateConfig) error
- func PrintBanner()
- func Prune(config *PruneConfig)
- func StateAnalyze(config *PruneConfig)
- func StateTree(stateFile string, usedPaths []string, jsonOut bool)
- func ValidateProjectName(name string) error
- func Watch()
- type BuildConfig
- type BuildSummary
- type ColorPrinter
- func (p *ColorPrinter) Bold(text string) string
- func (p *ColorPrinter) Cyan(text string) string
- func (p *ColorPrinter) Dim(text string) string
- func (p *ColorPrinter) Error(format string, args ...interface{})
- func (p *ColorPrinter) Green(text string) string
- func (p *ColorPrinter) Info(format string, args ...interface{})
- func (p *ColorPrinter) ProgressBar(current, total int, label string)
- func (p *ColorPrinter) Red(text string) string
- func (p *ColorPrinter) Step(step int, total int, format string, args ...interface{})
- func (p *ColorPrinter) Subtitle(format string, args ...interface{})
- func (p *ColorPrinter) Success(format string, args ...interface{})
- func (p *ColorPrinter) Title(format string, args ...interface{})
- func (p *ColorPrinter) Warning(format string, args ...interface{})
- func (p *ColorPrinter) Yellow(text string) string
- type DevConfig
- type DevWatcher
- type DoctorConfig
- type FileEvent
- type FileOp
- type GenerateConfig
- type ProjectConfig
- type PruneConfig
- type RouteDefinition
- type Spinner
- type TypeScriptField
- type TypeScriptType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateProject ¶
func CreateProject(name string)
CreateProject creates a new GoSPA project with the given name.
func CreateProjectWithConfig ¶
func CreateProjectWithConfig(config *ProjectConfig) error
CreateProjectWithConfig creates a new GoSPA project with custom configuration.
func DevWithConfig ¶
DevWithConfig starts the development server with custom configuration.
func Doctor ¶ added in v0.1.30
func Doctor(config *DoctorConfig)
Doctor inspects the current project for common setup issues.
func Generate ¶
func Generate(config *GenerateConfig)
Generate generates TypeScript types and routes from Go templates.
func GenerateWithConfig ¶
func GenerateWithConfig(config *GenerateConfig) error
GenerateWithConfig generates code with custom configuration.
func StateAnalyze ¶
func StateAnalyze(config *PruneConfig)
StateAnalyze executes the state analysis command.
func ValidateProjectName ¶
ValidateProjectName checks if a project name is valid.
Types ¶
type BuildConfig ¶
type BuildConfig struct {
OutputDir string
Platform string
Arch string
StaticAssets bool
Minify bool
Compress bool
Env string
}
BuildConfig holds configuration for the production build.
type BuildSummary ¶ added in v0.1.30
type BuildSummary struct {
BunPath string
ClientRuntimeBuilt bool
ClientRuntimePath string
GoBinaryPath string
StaticFilesCopied int
CompressedFiles int
}
BuildSummary captures the important outputs from a production build.
func BuildWithConfig ¶
func BuildWithConfig(config *BuildConfig) (*BuildSummary, error)
BuildWithConfig builds the application with custom configuration.
type ColorPrinter ¶
type ColorPrinter struct {
// contains filtered or unexported fields
}
ColorPrinter provides colored output utilities
func NewColorPrinter ¶
func NewColorPrinter() *ColorPrinter
NewColorPrinter creates a new color printer
func (*ColorPrinter) Error ¶
func (p *ColorPrinter) Error(format string, args ...interface{})
Error prints a red error message with X mark
func (*ColorPrinter) Green ¶
func (p *ColorPrinter) Green(text string) string
Green returns green text
func (*ColorPrinter) Info ¶
func (p *ColorPrinter) Info(format string, args ...interface{})
Info prints a blue info message
func (*ColorPrinter) ProgressBar ¶
func (p *ColorPrinter) ProgressBar(current, total int, label string)
ProgressBar displays a simple progress bar
func (*ColorPrinter) Step ¶
func (p *ColorPrinter) Step(step int, total int, format string, args ...interface{})
Step prints a step in a process
func (*ColorPrinter) Subtitle ¶
func (p *ColorPrinter) Subtitle(format string, args ...interface{})
Subtitle prints a dimmed subtitle
func (*ColorPrinter) Success ¶
func (p *ColorPrinter) Success(format string, args ...interface{})
Success prints a green success message with checkmark
func (*ColorPrinter) Title ¶
func (p *ColorPrinter) Title(format string, args ...interface{})
Title prints a bold title
func (*ColorPrinter) Warning ¶
func (p *ColorPrinter) Warning(format string, args ...interface{})
Warning prints a yellow warning message
func (*ColorPrinter) Yellow ¶
func (p *ColorPrinter) Yellow(text string) string
Yellow returns yellow text
type DevConfig ¶
type DevConfig struct {
Port int
Host string
RoutesDir string
WatchPaths []string // extra directories to watch in addition to RoutesDir
}
DevConfig holds configuration for the development server.
type DevWatcher ¶
type DevWatcher struct {
Events chan FileEvent
Errors chan error
// contains filtered or unexported fields
}
DevWatcher watches files for changes.
func NewDevWatcher ¶
func NewDevWatcher(dirs ...string) *DevWatcher
NewDevWatcher creates a new file watcher.
type DoctorConfig ¶ added in v0.1.30
type DoctorConfig struct {
RoutesDir string
}
DoctorConfig controls CLI doctor checks.
type GenerateConfig ¶
type GenerateConfig struct {
InputDir string
OutputDir string
StateFiles []string
RouteFiles []string
ComponentType string
}
GenerateConfig holds configuration for code generation.
type ProjectConfig ¶
type ProjectConfig struct {
Name string
Module string
OutputDir string
WithGit bool
WithDocker bool
}
ProjectConfig holds configuration for a new GoSPA project.
type PruneConfig ¶
type PruneConfig struct {
RootDir string
OutputDir string
ReportFile string
KeepUnused bool
Aggressive bool
Exclude []string
Include []string
DryRun bool
Verbose bool
JSONOutput bool
}
PruneConfig holds configuration for the prune command.
type RouteDefinition ¶
type RouteDefinition struct {
Path string
File string
Params []string
IsDynamic bool
IsCatchAll bool
}
RouteDefinition represents a route definition.
type Spinner ¶
type Spinner struct {
// contains filtered or unexported fields
}
Spinner shows a spinning animation
func NewSpinner ¶
func NewSpinner(printer *ColorPrinter, message string) *Spinner
NewSpinner creates a new spinner
type TypeScriptField ¶
TypeScriptField represents a field in a TypeScript type.
type TypeScriptType ¶
type TypeScriptType struct {
Name string
Fields []TypeScriptField
}
TypeScriptType represents a TypeScript type definition.