config

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package config handles builder.json configuration file management. It provides loading, saving, and validation of project configuration.

Index

Constants

View Source
const ConfigFileName = "builder.json"

ConfigFileName is the default configuration file name.

Variables

View Source
var ErrConfigNotFound = errors.New("builder.json not found")

ErrConfigNotFound indicates builder.json was not found.

Functions

This section is empty.

Types

type Config

type Config struct {
	Project     string            `json:"project"`
	Platform    string            `json:"platform"`
	GitHub      GitHubConfig      `json:"github"`
	IOS         IOSConfig         `json:"ios,omitempty"`
	Flutter     FlutterConfig     `json:"flutter,omitempty"`
	ReactNative ReactNativeConfig `json:"reactNative,omitempty"`
	MobAI       MobAIConfig       `json:"mobai,omitempty"`
}

Config represents the builder.json configuration file

func (*Config) Validate

func (c *Config) Validate() error

Validate checks if the configuration is valid

type FlutterConfig

type FlutterConfig struct {
	Version string `json:"version,omitempty"` // Pinned Flutter version (e.g., "3.24.0")
}

FlutterConfig holds Flutter-specific settings

type GitHubConfig

type GitHubConfig struct {
	Owner string `json:"owner"`
	Repo  string `json:"repo"`
}

GitHubConfig holds GitHub repository settings

type IOSConfig

type IOSConfig struct {
	// Path to iOS project relative to repo root (e.g., "ios" for React Native, "platforms/ios" for Cordova)
	// Empty means root directory contains the Xcode project
	Path          string `json:"path,omitempty"`
	Scheme        string `json:"scheme,omitempty"`        // Xcode scheme to build (auto-detected if empty)
	Signing       bool   `json:"signing,omitempty"`       // Whether code signing is configured
	Configuration string `json:"configuration,omitempty"` // Build configuration: Debug (faster) or Release (production)
}

IOSConfig holds iOS build settings

type Manager

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

Manager handles configuration loading and persistence

func NewManager

func NewManager() *Manager

NewManager creates a new configuration manager

func (*Manager) Load

func (m *Manager) Load() (*Config, error)

Load reads builder.json from the configured path

func (*Manager) Save

func (m *Manager) Save(cfg *Config) error

Save writes configuration to builder.json

type MobAIConfig

type MobAIConfig struct {
	URL      string `json:"url,omitempty"`       // MobAI API URL (default: http://localhost:8686)
	DeviceID string `json:"device_id,omitempty"` // Preferred device ID (default: first available)
}

MobAIConfig holds MobAI settings for local development

type ReactNativeConfig added in v0.2.0

type ReactNativeConfig struct {
	MetroPort int  `json:"metroPort,omitempty"` // Metro bundler port (default: 8081)
	Expo      bool `json:"expo,omitempty"`      // Whether this is an Expo project
}

ReactNativeConfig holds React Native-specific settings

type ValidationError

type ValidationError struct {
	Field   string
	Message string
}

ValidationError represents a configuration validation error

func (*ValidationError) Error

func (e *ValidationError) Error() string

Jump to

Keyboard shortcuts

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