add_website

package
v1.61.0 Latest Latest
Warning

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

Go to latest
Published: May 1, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StepName step = iota
	StepPath
	StepTool
	StepPackageManager
	StepPort
	StepRunningToolCommand
	StepDone
)

Variables

View Source
var (

	// WebsiteNameRegex matches valid characters for a website name
	WebsiteNameRegex = regexp.MustCompile(`^[a-zA-Z0-9_-]+$`)
	// WebsiteNameStartRegex ensures the name starts with a letter or number
	WebsiteNameStartRegex = regexp.MustCompile(`^[a-zA-Z0-9]`)
	// WebsiteNameEndRegex ensures the name doesn't end with a hyphen
	WebsiteNameEndRegex = regexp.MustCompile(`[a-zA-Z0-9]$`)
)

Functions

func DisallowedPathsValidator

func DisallowedPathsValidator(disallowedPaths []string) validation.StringValidator

func PortInFlightValidators

func PortInFlightValidators() []validation.StringValidator

PortInFlightValidators returns a list of in-flight validators for the port field

func PortValidators

func PortValidators() []validation.StringValidator

PortValidators returns a list of validators for the port field

func WebsiteNameInFlightValidators

func WebsiteNameInFlightValidators() []validation.StringValidator

func WebsiteNameValidators

func WebsiteNameValidators(existingNames []string) []validation.StringValidator

func WebsiteURLPathInFlightValidators

func WebsiteURLPathInFlightValidators(disallowedPaths []string) []validation.StringValidator

func WebsiteURLPathValidators

func WebsiteURLPathValidators(disallowedPaths []string) []validation.StringValidator

Types

type Args

type Args struct {
	WebsiteName string
	WebsitePath string
	ToolName    string
}

type CommandTemplate

type CommandTemplate string

func (CommandTemplate) Format

func (t CommandTemplate) Format(vars CommandVars) string

type CommandVars

type CommandVars struct {
	PackageManager string
	Path           string
	Port           string
	BaseURL        string
}

type Model

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

func New

func New(fs afero.Fs, args Args) (Model, error)

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Update

func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (Model) View

func (m Model) View() string

type Tool

type Tool struct {
	Name        string
	Value       string
	Description string

	OutputDir string

	InstallLink              string
	SkipPackageManagerPrompt bool
	// contains filtered or unexported fields
}

func (Tool) GetBuildCommand

func (f Tool) GetBuildCommand(packageManager string, path string) string

func (Tool) GetCreateCommand

func (f Tool) GetCreateCommand(packageManager string, path string) string

func (Tool) GetDevCommand

func (f Tool) GetDevCommand(packageManager string, port string) string

func (Tool) GetDevURL

func (f Tool) GetDevURL(port string) string

func (Tool) GetItemDescription

func (f Tool) GetItemDescription() string

func (Tool) GetItemValue

func (f Tool) GetItemValue() string

Jump to

Keyboard shortcuts

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