appmeta

package
v0.11.2 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package appmeta is the desktop app metadata and bundler used by `alacris-go app`. It does not import the webview; the CLI stays in the root module.

Index

Constants

View Source
const FileName = "alacris.app.json"

Variables

This section is empty.

Functions

func BundleDir

func BundleDir(c Config, binaryPath, destDir string) (string, error)

BundleDir writes the OS-specific wrapper around an already-built binary and returns the path the user should distribute.

func Init

func Init(opts InitOptions) error

Init writes a desktop-first alacris-go project into dir.

func Pack added in v0.7.0

func Pack(c Config, dest, goos string) (string, error)

Pack runs optional OS tools on a tree BundleDir already wrote: codesign, hdiutil, nfpm, go-winres. Missing tools are skipped, not errors.

func RunningVersion added in v0.7.3

func RunningVersion() string

RunningVersion is the alacris-go version this CLI was built from, or empty for a development tree. Used to pin the scaffold go.mod so `app init` does not write v0.0.0, which consumers cannot resolve.

Types

type Bundle

type Bundle struct {
	MacOS   MacOSBundle   `json:"macOS,omitempty"`
	Windows WindowsBundle `json:"windows,omitempty"`
	Linux   LinuxBundle   `json:"linux,omitempty"`
}

Bundle holds per-OS packaging options.

type Config

type Config struct {
	Name           string         `json:"name"`
	Identifier     string         `json:"identifier"`
	Version        string         `json:"version"`
	Main           string         `json:"main,omitempty"`
	Icon           string         `json:"icon,omitempty"`
	Copyright      string         `json:"copyright,omitempty"`
	Category       string         `json:"category,omitempty"`
	DeepLinkScheme string         `json:"deepLinkScheme,omitempty"`
	Bundle         Bundle         `json:"bundle,omitempty"`
	Updater        *UpdaterConfig `json:"updater,omitempty"`
}

Config is bundle metadata. Window size and live wiring stay in Go.

func Load

func Load(path string) (Config, error)

Load reads FileName from dir, or path if it is a file.

func Parse

func Parse(b []byte) (Config, error)

Parse decodes a Config, filling defaults.

func (Config) BinaryName

func (c Config) BinaryName() string

BinaryName is the executable name inside a bundle.

func (Config) WriteJSON

func (c Config) WriteJSON(path string) error

WriteJSON writes the config as indented JSON.

type InitOptions

type InitOptions struct {
	Dir        string
	Name       string
	Identifier string
	Module     string
	// AlacrisVersion is the module version to pin in the scaffold go.mod
	// (v0.7.2). Empty means this CLI is a development build: omit the
	// require and tell the user to `go get @latest`. Never write v0.0.0 —
	// that tag does not exist, and a nested-module require of it cannot
	// be resolved.
	AlacrisVersion string
}

InitOptions control what `alacris-go app init` writes.

type LinuxBundle

type LinuxBundle struct {
	Desktop    string   `json:"desktop,omitempty"`
	Categories []string `json:"categories,omitempty"`
}

LinuxBundle names the .desktop categories and package formats.

type MacOSBundle

type MacOSBundle struct {
	SigningIdentity string `json:"signingIdentity,omitempty"`
	Notarize        bool   `json:"notarize,omitempty"`
}

MacOSBundle is written into Info.plist and used by `app build` on Darwin.

type UpdaterConfig

type UpdaterConfig struct {
	Endpoint  string `json:"endpoint"`
	PublicKey string `json:"publicKey"`
}

UpdaterConfig is copied into the generated latest.json stub.

type WindowsBundle

type WindowsBundle struct {
	FileDescription string `json:"fileDescription,omitempty"`
}

WindowsBundle names how Windows resources are produced.

Jump to

Keyboard shortcuts

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