frontend

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: May 31, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandsConfig

type CommandsConfig struct {
	Install string `yaml:"install"`
	Dev     string `yaml:"dev"`
	Build   string `yaml:"build"`
}

CommandsConfig defines commands for the template

type CustomGenerator

type CustomGenerator struct {
	// contains filtered or unexported fields
}

CustomGenerator generates frontend using custom commands

func NewCustomGenerator

func NewCustomGenerator(command, workDir string, frontend *config.FrontendConfig, debug bool) *CustomGenerator

NewCustomGenerator creates a new custom generator

func (*CustomGenerator) Generate

func (g *CustomGenerator) Generate(frontendPath string, projectConfig *config.ProjectConfig) error

Generate generates the frontend using the custom command

type FileConfig

type FileConfig struct {
	Source      string `yaml:"source"`
	Destination string `yaml:"destination"`
	Template    bool   `yaml:"template,omitempty"`
	Executable  bool   `yaml:"executable,omitempty"`
}

FileConfig defines file processing rules

type RemoteTemplateManager

type RemoteTemplateManager struct {
	// contains filtered or unexported fields
}

RemoteTemplateManager handles remote template operations

func NewRemoteTemplateManager

func NewRemoteTemplateManager(debug bool) *RemoteTemplateManager

NewRemoteTemplateManager creates a new remote template manager

func (*RemoteTemplateManager) Download

func (m *RemoteTemplateManager) Download(url, version string, useCache bool) (string, error)

Download downloads a remote template and returns the local path

func (*RemoteTemplateManager) Generate

func (m *RemoteTemplateManager) Generate(templatePath, frontendPath string, projectConfig *config.ProjectConfig, vars map[string]string) error

Generate generates a frontend from a remote template

type RemoteTemplateManifest

type RemoteTemplateManifest struct {
	Name        string            `yaml:"name"`
	Description string            `yaml:"description"`
	Version     string            `yaml:"version"`
	Author      string            `yaml:"author"`
	Framework   string            `yaml:"framework"`
	Commands    CommandsConfig    `yaml:"commands"`
	Variables   map[string]string `yaml:"variables,omitempty"`
	Files       []FileConfig      `yaml:"files,omitempty"`
}

RemoteTemplateManifest defines the structure of flux-template.yaml

type ScriptCategory

type ScriptCategory struct {
	Name       string            `yaml:"name"`
	Frameworks []ScriptFramework `yaml:"frameworks"`
}

ScriptCategory represents a category of frontend frameworks

type ScriptFramework

type ScriptFramework struct {
	Name        string `yaml:"name"`
	DisplayName string `yaml:"display_name"`
	Description string `yaml:"description"`
	Script      string `yaml:"script"`
	Framework   string `yaml:"framework"`
	DevCmd      string `yaml:"dev_cmd"`
	BuildCmd    string `yaml:"build_cmd"`
	TypesDir    string `yaml:"types_dir"`
	LibDir      string `yaml:"lib_dir"`
}

ScriptFramework represents a script-based frontend framework

type ScriptGenerator

type ScriptGenerator struct {
	// contains filtered or unexported fields
}

ScriptGenerator generates frontend using script commands

func NewScriptGenerator

func NewScriptGenerator(script string, frontend *config.FrontendConfig, debug bool) *ScriptGenerator

NewScriptGenerator creates a new script generator

func (*ScriptGenerator) Generate

func (g *ScriptGenerator) Generate(frontendPath string, projectConfig *config.ProjectConfig) error

Generate generates the frontend using the script

type ScriptRegistry

type ScriptRegistry struct {
	Name        string           `yaml:"name"`
	Description string           `yaml:"description"`
	Version     string           `yaml:"version"`
	Categories  []ScriptCategory `yaml:"categories"`
}

ScriptRegistry represents the structure of the script registry YAML

type ScriptRegistryManager

type ScriptRegistryManager struct {
	// contains filtered or unexported fields
}

ScriptRegistryManager manages script-based frontend templates

func NewScriptRegistryManager

func NewScriptRegistryManager() (*ScriptRegistryManager, error)

NewScriptRegistryManager creates a new script registry manager

func (*ScriptRegistryManager) GetAllFrameworks

func (m *ScriptRegistryManager) GetAllFrameworks() []ScriptFramework

GetAllFrameworks returns all available script frameworks

func (*ScriptRegistryManager) GetCategories

func (m *ScriptRegistryManager) GetCategories() []ScriptCategory

GetCategories returns all categories

func (*ScriptRegistryManager) GetFrameworkByName

func (m *ScriptRegistryManager) GetFrameworkByName(name string) (*ScriptFramework, bool)

GetFrameworkByName returns a framework by its name

func (*ScriptRegistryManager) GetFrameworkNames

func (m *ScriptRegistryManager) GetFrameworkNames() map[string]string

GetFrameworkNames returns all framework names with display names

func (*ScriptRegistryManager) GetFrameworksByCategory

func (m *ScriptRegistryManager) GetFrameworksByCategory(categoryName string) ([]ScriptFramework, bool)

GetFrameworksByCategory returns frameworks in a specific category

func (*ScriptRegistryManager) IsValidFramework

func (m *ScriptRegistryManager) IsValidFramework(name string) bool

IsValidFramework checks if a framework name is valid

type UnifiedManager

type UnifiedManager struct {
	// contains filtered or unexported fields
}

UnifiedManager handles both template-based and script-based frontend generation

func NewUnifiedManager

func NewUnifiedManager(projectConfig *config.ProjectConfig, debug bool) (*UnifiedManager, error)

NewUnifiedManager creates a new unified frontend manager

func (*UnifiedManager) GenerateFrontend

func (um *UnifiedManager) GenerateFrontend(frontendPath string) error

GenerateFrontend generates a frontend based on the configuration

func (*UnifiedManager) GetAvailableScriptFrameworks

func (um *UnifiedManager) GetAvailableScriptFrameworks() map[string]string

GetAvailableScriptFrameworks returns all available script frameworks

func (*UnifiedManager) GetAvailableTemplates

func (um *UnifiedManager) GetAvailableTemplates() map[string]string

GetAvailableTemplates returns all available backend templates

func (*UnifiedManager) GetScriptCategories

func (um *UnifiedManager) GetScriptCategories() []ScriptCategory

GetScriptCategories returns script frontends organized by category

func (*UnifiedManager) GetScriptFrontends

func (um *UnifiedManager) GetScriptFrontends() []ScriptFramework

GetScriptFrontends returns all available script-based frontends

func (*UnifiedManager) GetSupportedFrontends

func (um *UnifiedManager) GetSupportedFrontends() ([]templates.FrontendTemplateInfo, bool, error)

GetSupportedFrontends returns all supported frontend options for the current template

func (*UnifiedManager) IsScriptFramework

func (um *UnifiedManager) IsScriptFramework(name string) bool

IsScriptFramework checks if a framework name is a valid script framework

func (*UnifiedManager) ShouldRunInstallCommand

func (um *UnifiedManager) ShouldRunInstallCommand() bool

ShouldRunInstallCommand determines if we need to run an install command

func (*UnifiedManager) UpdateProjectConfig

func (um *UnifiedManager) UpdateProjectConfig(frontendName string) error

UpdateProjectConfig updates the project configuration with frontend template info

func (*UnifiedManager) UpdateProjectConfigWithScript

func (um *UnifiedManager) UpdateProjectConfigWithScript(frameworkName string) error

UpdateProjectConfigWithScript updates the project configuration for a script framework

Jump to

Keyboard shortcuts

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