setupwizard

package
v3.0.0-alpha2.106 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDefaultsPath

func GetDefaultsPath() (string, error)

GetDefaultsPath returns the path to the defaults.yaml file

func SaveGlobalDefaults

func SaveGlobalDefaults(d GlobalDefaults) error

SaveGlobalDefaults saves the global defaults to the config file

Types

type AuthorDefaults

type AuthorDefaults = defaults.AuthorDefaults

type DarwinSigningDefaults

type DarwinSigningDefaults = defaults.DarwinSigningDefaults

type DependencyStatus

type DependencyStatus struct {
	Name           string `json:"name"`
	Installed      bool   `json:"installed"`
	Version        string `json:"version,omitempty"`
	Status         string `json:"status"` // "installed", "not_installed", "needs_update"
	Required       bool   `json:"required"`
	Message        string `json:"message,omitempty"`
	InstallCommand string `json:"installCommand,omitempty"`
	ConfigCommand  string `json:"configCommand,omitempty"` // shell lines to add (e.g. export JAVA_HOME=...), shown with a Copy button
	HelpURL        string `json:"helpUrl,omitempty"`
	HelpLabel      string `json:"helpLabel,omitempty"` // OS-specific link text, e.g. "Get Xcode from the App Store"
	ImageBuilt     bool   `json:"imageBuilt"`          // For Docker: whether wails-cross image exists
}

DependencyStatus represents the status of a dependency

type DockerStatus

type DockerStatus struct {
	Installed     bool   `json:"installed"`
	Running       bool   `json:"running"`
	Version       string `json:"version,omitempty"`
	ImageBuilt    bool   `json:"imageBuilt"`
	ImageName     string `json:"imageName"`
	ImageSize     string `json:"imageSize,omitempty"`
	ImageVersion  string `json:"imageVersion,omitempty"`
	SDKVersion    string `json:"sdkVersion,omitempty"`
	UpdateAvail   bool   `json:"updateAvailable"`
	LatestVersion string `json:"latestVersion,omitempty"`
	PullProgress  int    `json:"pullProgress"`
	PullMessage   string `json:"pullMessage,omitempty"`
	PullStatus    string `json:"pullStatus"`
	PullError     string `json:"pullError,omitempty"`
	BytesTotal    int64  `json:"bytesTotal,omitempty"`
	BytesDone     int64  `json:"bytesDone,omitempty"`
	LayerCount    int    `json:"layerCount,omitempty"`
	LayersDone    int    `json:"layersDone,omitempty"`
}

type GlobalDefaults

type GlobalDefaults = defaults.GlobalDefaults

func DefaultGlobalDefaults

func DefaultGlobalDefaults() GlobalDefaults

DefaultGlobalDefaults returns sensible defaults for first-time users

func LoadGlobalDefaults

func LoadGlobalDefaults() (GlobalDefaults, error)

LoadGlobalDefaults loads the global defaults from the config file

type InitData

type InitData struct {
	// Mode lets the frontend distinguish the init wizard from the setup wizard.
	Mode string `json:"mode"`

	ProjectName        string `json:"projectName"`
	TemplateName       string `json:"templateName"`
	ProductName        string `json:"productName"`
	ProductCompany     string `json:"productCompany"`
	ProductIdentifier  string `json:"productIdentifier"`
	ProductDescription string `json:"productDescription"`
	ProductVersion     string `json:"productVersion"`
	ProductCopyright   string `json:"productCopyright"`
	ProductComments    string `json:"productComments"`
	// UseInterfaces selects interface vs class bindings for TypeScript projects.
	UseInterfaces bool `json:"useInterfaces"`

	// BaseDir is the absolute directory the project folder will be created in
	// (display only). The project lands at BaseDir/<ProjectName>.
	BaseDir string `json:"baseDir"`

	// Catalogue for the picker (not modified by the user).
	Templates       []InitTemplate `json:"templates"`
	DefaultTemplate string         `json:"defaultTemplate"`
}

InitData is the payload exchanged with the init wizard frontend. The caller (commands.Init) seeds it with defaults + the available templates, and gets it back with the user's choices after Create.

type InitTemplate

type InitTemplate struct {
	Name        string `json:"name"`
	Description string `json:"description"`
}

InitTemplate is a selectable project template, sourced from the templates package by the caller (the setupwizard package must not import templates).

type InstallRequest

type InstallRequest struct {
	Command string `json:"command"`
}

InstallRequest represents a request to install a dependency

type InstallResponse

type InstallResponse struct {
	Success bool   `json:"success"`
	Output  string `json:"output"`
	Error   string `json:"error,omitempty"`
}

InstallResponse represents the result of an install attempt

type LinuxSigningDefaults

type LinuxSigningDefaults = defaults.LinuxSigningDefaults

type ProjectDefaults

type ProjectDefaults = defaults.ProjectDefaults

type PullProgress

type PullProgress struct {
	Stage    string
	Progress int
}

DockerStatus represents Docker installation and image status

type SigningDefaults

type SigningDefaults = defaults.SigningDefaults

type SystemInfo

type SystemInfo struct {
	OS           string `json:"os"`
	Arch         string `json:"arch"`
	WailsVersion string `json:"wailsVersion"`
	GoVersion    string `json:"goVersion"`
	HomeDir      string `json:"homeDir"`
	OSName       string `json:"osName,omitempty"`
	OSVersion    string `json:"osVersion,omitempty"`
	GitName      string `json:"gitName,omitempty"`
	GitEmail     string `json:"gitEmail,omitempty"`
}

SystemInfo contains detected system information

type WailsConfig

type WailsConfig struct {
	Info WailsConfigInfo `json:"info" yaml:"info"`
}

WailsConfig represents the wails.yaml configuration

type WailsConfigInfo

type WailsConfigInfo struct {
	CompanyName       string `json:"companyName" yaml:"companyName"`
	ProductName       string `json:"productName" yaml:"productName"`
	ProductIdentifier string `json:"productIdentifier" yaml:"productIdentifier"`
	Description       string `json:"description" yaml:"description"`
	Copyright         string `json:"copyright" yaml:"copyright"`
	Comments          string `json:"comments,omitempty" yaml:"comments,omitempty"`
	Version           string `json:"version" yaml:"version"`
}

WailsConfigInfo represents the info section of wails.yaml

type WindowsSigningDefaults

type WindowsSigningDefaults = defaults.WindowsSigningDefaults

type Wizard

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

Wizard is the setup wizard server

func New

func New() *Wizard

New creates a new setup wizard

func NewInitWizard

func NewInitWizard(data InitData) *Wizard

NewInitWizard creates a wizard that runs in project-init mode, pre-seeded with the given data (defaults + template list).

func (*Wizard) Run

func (w *Wizard) Run() error

Run starts the wizard and opens it in the browser

func (*Wizard) RunInit

func (w *Wizard) RunInit() (*InitData, error)

RunInit launches the init wizard and blocks until the user clicks Create (or closes the window). On Create it returns the user-edited data; on close it returns (nil, nil).

type WizardState

type WizardState struct {
	Dependencies []DependencyStatus `json:"dependencies"`
	System       SystemInfo         `json:"system"`
	StartTime    time.Time          `json:"startTime"`
}

WizardState represents the complete wizard state

Jump to

Keyboard shortcuts

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