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

bootstrap

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const ManifestPath = "bootstrap/manifest.yml"

Variables

This section is empty.

Functions

func PlanPaths added in v0.2.3

func PlanPaths(opts BootstrapOptions) ([]string, error)

PlanPaths returns the source-relative file paths (forward-slash, sorted) that BootstrapProject would write for the given options. It is used to detect conflicts against an existing directory before any file is written.

Types

type BootstrapOptions

type BootstrapOptions struct {
	Manifest       Manifest
	SourceDir      string
	DestinationDir string
	Site           string
	Theme          string
	BundleIDs      []string
	RepeatableIDs  []string

	// AllowExisting permits scaffolding into a directory that already exists
	// (in-place init). When set, the destination-exists guard is relaxed and
	// git is left untouched so an existing repository is preserved.
	AllowExisting bool
	// SkipPaths holds source-relative file paths (forward-slash) the caller
	// chose not to overwrite. Planned files in this set are left as-is.
	SkipPaths map[string]struct{}
}

type Bundle

type Bundle struct {
	ID          string      `yaml:"id"`
	Label       string      `yaml:"label"`
	Description string      `yaml:"description,omitempty"`
	Paths       []string    `yaml:"paths"`
	Recipes     []string    `yaml:"recipes,omitempty"`
	Transforms  []Transform `yaml:"transforms,omitempty"`
}

type Manifest

type Manifest struct {
	Name          string       `yaml:"name,omitempty"`
	BasePaths     []string     `yaml:"base_paths,omitempty"`
	Exclude       []string     `yaml:"exclude,omitempty"`
	GeneratedDirs []string     `yaml:"generated_dirs,omitempty"`
	Bundles       []Bundle     `yaml:"bundles"`
	Recipes       []Recipe     `yaml:"recipes"`
	Repeatables   []Repeatable `yaml:"repeatables"`
}

func LoadManifest

func LoadManifest(root string) (Manifest, error)

type Recipe

type Recipe struct {
	ID                string `yaml:"id"`
	RuntimeIdentifier string `yaml:"runtime_identifier,omitempty"`
	RuntimeImport     string `yaml:"runtime_import,omitempty"`
	RuntimeRegisterAs string `yaml:"runtime_register_as,omitempty"`
	CSSImport         string `yaml:"css_import,omitempty"`
	BuildIdentifier   string `yaml:"build_identifier,omitempty"`
	BuildImport       string `yaml:"build_import,omitempty"`
}

type Repeatable

type Repeatable struct {
	ID          string      `yaml:"id"`
	Label       string      `yaml:"label"`
	Description string      `yaml:"description,omitempty"`
	Paths       []string    `yaml:"paths"`
	Recipes     []string    `yaml:"recipes,omitempty"`
	Transforms  []Transform `yaml:"transforms,omitempty"`
}

type Result

type Result struct {
	Path        string   `json:"path"`
	Site        string   `json:"site"`
	Theme       string   `json:"theme"`
	Bundles     []string `json:"bundles,omitempty"`
	Repeatables []string `json:"repeatables,omitempty"`
}

func BootstrapProject

func BootstrapProject(opts BootstrapOptions) (Result, error)

type Transform

type Transform struct {
	Type  string `yaml:"type"`
	Path  string `yaml:"path"`
	Name  string `yaml:"name,omitempty"`
	Match string `yaml:"match,omitempty"`
}

Jump to

Keyboard shortcuts

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