blueprint

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Embedded

func Embedded() fs.FS

Embedded returns the registered embedded projects FS.

func ListEmbedded

func ListEmbedded(embedded fs.FS) ([]string, error)

ListEmbedded returns names of all built-in templates in the provided embedded FS.

func ListUserBlueprints

func ListUserBlueprints() ([]string, error)

ListUserBlueprints returns names of all blueprints in ~/.new/blueprints/.

func SetEmbedded

func SetEmbedded(fsys fs.FS)

SetEmbedded wires in the embedded templates/projects sub-filesystem so that List and Resolve can reference built-in templates.

Types

type Blueprint

type Blueprint struct {
	Name     string
	Manifest *Manifest
	// FS is the filesystem rooted at the blueprint directory.
	FS fs.FS
}

Blueprint represents a resolved blueprint — either a user blueprint from ~/.new/blueprints/<name> or an embedded built-in template.

func Resolve

func Resolve(name string, embedded fs.FS) (*Blueprint, error)

Resolve looks for a blueprint by name. User blueprints in ~/.new/blueprints/ take precedence over the provided embedded FS (pass the embedded templates/projects sub-FS as fallback).

type Manifest

type Manifest struct {
	Name        string `yaml:"name"`
	Description string `yaml:"description"`
	// Vars lists variable names the blueprint expects (used for prompting later).
	Vars []string `yaml:"vars"`
	// Defaults provides fallback values for vars.
	Defaults map[string]string `yaml:"defaults"`
}

Manifest is the optional blueprint.yaml descriptor inside a blueprint folder.

Jump to

Keyboard shortcuts

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