defaults

package
v3.0.0-alpha2.111 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package defaults provides functionality for loading and saving global default settings for Wails projects. Settings are stored in ~/.config/wails/defaults.yaml

Index

Constants

This section is empty.

Variables

View Source
var (
	Frameworks = []string{
		"vanilla", "react", "vue", "svelte", "ios",
	}

	Languages = []string{"JavaScript", "TypeScript"}
)

Functions

func GetConfigDir

func GetConfigDir() (string, error)

GetConfigDir returns the path to the Wails config directory

func GetDefaultsPath

func GetDefaultsPath() (string, error)

GetDefaultsPath returns the path to the defaults.yaml file

func IsValidFramework

func IsValidFramework(f string) bool

func Save

func Save(defaults GlobalDefaults) error

Save saves the global defaults to the config file

Types

type AuthorDefaults

type AuthorDefaults struct {
	Name    string `json:"name" yaml:"name"`
	Company string `json:"company" yaml:"company"`
}

AuthorDefaults contains the author's information

type DarwinSigningDefaults

type DarwinSigningDefaults struct {
	Identity        string `json:"identity,omitempty" yaml:"identity,omitempty"`
	TeamID          string `json:"teamID,omitempty" yaml:"teamID,omitempty"`
	KeychainProfile string `json:"keychainProfile,omitempty" yaml:"keychainProfile,omitempty"`
	Entitlements    string `json:"entitlements,omitempty" yaml:"entitlements,omitempty"`
	P12Path         string `json:"p12Path,omitempty" yaml:"p12Path,omitempty"`
	APIKeyPath      string `json:"apiKeyPath,omitempty" yaml:"apiKeyPath,omitempty"`
	APIKeyID        string `json:"apiKeyID,omitempty" yaml:"apiKeyID,omitempty"`
	APIIssuerID     string `json:"apiIssuerID,omitempty" yaml:"apiIssuerID,omitempty"`
}

DarwinSigningDefaults contains macOS code signing configuration

type GlobalDefaults

type GlobalDefaults struct {
	// Author information
	Author AuthorDefaults `json:"author" yaml:"author"`

	// Default project settings
	Project ProjectDefaults `json:"project" yaml:"project"`

	// Code signing configuration (optional)
	Signing SigningDefaults `json:"signing,omitempty" yaml:"signing,omitempty"`
}

GlobalDefaults represents the user's default project settings These are stored in ~/.config/wails/defaults.yaml and used when creating new projects

func Default

func Default() GlobalDefaults

Default returns sensible defaults for first-time users

func Load

func Load() (GlobalDefaults, error)

Load loads the global defaults from the config file Returns default values if the file doesn't exist

func (*GlobalDefaults) GenerateCopyright

func (d *GlobalDefaults) GenerateCopyright() string

GenerateCopyright generates a copyright string from the template

func (*GlobalDefaults) GenerateDescription

func (d *GlobalDefaults) GenerateDescription(projectName string) string

GenerateDescription generates a description string from the template

func (*GlobalDefaults) GenerateProductIdentifier

func (d *GlobalDefaults) GenerateProductIdentifier(projectName string) string

GenerateProductIdentifier generates a product identifier from prefix and project name

func (*GlobalDefaults) GetDefaultVersion

func (d *GlobalDefaults) GetDefaultVersion() string

GetDefaultVersion returns the default version or the fallback

func (*GlobalDefaults) GetTemplateName

func (d *GlobalDefaults) GetTemplateName() string

type LinuxSigningDefaults

type LinuxSigningDefaults struct {
	GPGKeyPath string `json:"gpgKeyPath,omitempty" yaml:"gpgKeyPath,omitempty"`
	GPGKeyID   string `json:"gpgKeyID,omitempty" yaml:"gpgKeyID,omitempty"`
	SignRole   string `json:"signRole,omitempty" yaml:"signRole,omitempty"`
}

LinuxSigningDefaults contains Linux package signing configuration

type ProjectDefaults

type ProjectDefaults struct {
	ProductIdentifierPrefix string `json:"productIdentifierPrefix,omitempty" yaml:"productIdentifierPrefix,omitempty"`
	DefaultTemplate         string `json:"defaultTemplate,omitempty" yaml:"defaultTemplate,omitempty"`
	Framework               string `json:"framework,omitempty" yaml:"framework,omitempty"`
	Language                string `json:"language,omitempty" yaml:"language,omitempty"`
	CopyrightTemplate       string `json:"copyrightTemplate,omitempty" yaml:"copyrightTemplate,omitempty"`
	DescriptionTemplate     string `json:"descriptionTemplate,omitempty" yaml:"descriptionTemplate,omitempty"`
	DefaultVersion          string `json:"defaultVersion,omitempty" yaml:"defaultVersion,omitempty"`
	UseInterfaces           bool   `json:"useInterfaces" yaml:"useInterfaces"`
}

ProjectDefaults contains default project settings

type SigningDefaults

type SigningDefaults struct {
	Darwin  DarwinSigningDefaults  `json:"darwin,omitempty" yaml:"darwin,omitempty"`
	Windows WindowsSigningDefaults `json:"windows,omitempty" yaml:"windows,omitempty"`
	Linux   LinuxSigningDefaults   `json:"linux,omitempty" yaml:"linux,omitempty"`
}

SigningDefaults contains code signing configuration for all platforms

type WindowsSigningDefaults

type WindowsSigningDefaults struct {
	CertificatePath string `json:"certificatePath,omitempty" yaml:"certificatePath,omitempty"`
	Thumbprint      string `json:"thumbprint,omitempty" yaml:"thumbprint,omitempty"`
	TimestampServer string `json:"timestampServer,omitempty" yaml:"timestampServer,omitempty"`
	CloudProvider   string `json:"cloudProvider,omitempty" yaml:"cloudProvider,omitempty"`
	CloudKeyID      string `json:"cloudKeyID,omitempty" yaml:"cloudKeyID,omitempty"`
}

WindowsSigningDefaults contains Windows code signing configuration

Jump to

Keyboard shortcuts

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