Help us shape the future of Go! Take the 2026 Go Developer Survey

setupwizard

package
v3.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyWakeInit added in v3.1.0

func ApplyWakeInit(root string, config WakeSetupConfig) error

ApplyWakeInit applies validated init choices only to the newly scaffolded manifest.

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 BindingState added in v3.1.0

type BindingState struct {
	TypeScript bool `json:"typescript"`
	Interfaces bool `json:"interfaces"`
}

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"`
	WakeEnabled bool               `json:"wakeEnabled"`
	WakeSetup   *wakeSetupResponse `json:"wakeSetup,omitempty"`
	Wake        *WakeSetupConfig   `json:"wake,omitempty"`

	// BuildConfigFile is display-only; the backend always checks the environment.
	BuildConfigFile string `json:"buildConfigFile"`

	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"`
	TypeScript  bool   `json:"typescript"`
}

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 ProjectConfigState added in v3.1.0

type ProjectConfigState struct {
	Info     ProjectMetadataState `json:"info"`
	Bindings *BindingState        `json:"bindings,omitempty"`
}

ProjectConfigState is the complete project state edited by the setup wizard.

func (ProjectConfigState) ManifestState added in v3.1.0

func (config ProjectConfigState) ManifestState(existing manifest.Project) (manifest.InitialState, error)

ManifestState translates wizard-owned state into the manifest writer's scaffold interface. YAML layout and defaulting remain inside manifest.

type ProjectDefaults

type ProjectDefaults = defaults.ProjectDefaults

type ProjectMetadataState added in v3.1.0

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

ProjectMetadataState is the setup wizard's editable project metadata.

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"`
	Details      *doctor.SystemReport `json:"details,omitempty"`
}

SystemInfo contains detected system information

type WakeSetupConfig added in v3.1.0

type WakeSetupConfig struct {
	ApplicationType    string              `json:"applicationType"`
	Backend            string              `json:"backend"`
	ExperimentalPureGo bool                `json:"experimentalPureGo"`
	Prebuilt           bool                `json:"prebuilt"`
	Sign               bool                `json:"sign"`
	Targets            []WakeSetupTarget   `json:"targets"`
	Project            *ProjectConfigState `json:"project,omitempty"`
}

type WakeSetupTarget added in v3.1.0

type WakeSetupTarget struct {
	OS          string   `json:"os"`
	Arch        string   `json:"arch"`
	Formats     []string `json:"formats"`
	Destination string   `json:"destination,omitempty"`
}

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 {
	WakeEnabled  bool               `json:"wakeEnabled"`
	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