project

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultBlueprintFile = "project.blueprint.yaml"

DefaultBlueprintFile is the blueprint file name used when no existing project blueprint file can be detected in the working directory.

Variables

This section is empty.

Functions

func DetectBlueprintFile added in v0.5.0

func DetectBlueprintFile(directory string) string

DetectBlueprintFile returns the name of the first existing project blueprint file in the given directory, probing the supported formats in priority order. It falls back to DefaultBlueprintFile when none are present.

Types

type Preparer

type Preparer interface {
	// RemoveGitHistory removes the .git directory from the project.
	RemoveGitHistory(directory string) error
	// RemoveMaintainerFiles removes files that are meant for template maintainers
	// (e.g., README.md, LICENSE) before template processing.
	RemoveMaintainerFiles(directory string) error
	// SelectBlueprintFormat removes the unused blueprint file.
	// The selected format's .tmpl file will be processed by SubstitutePlaceholders.
	SelectBlueprintFormat(directory string, format string) error
	// SubstitutePlaceholders finds all .tmpl files, processes them as Go templates,
	// writes the output without the .tmpl extension, and removes the original .tmpl files.
	SubstitutePlaceholders(directory string, values TemplateValues) error
}

Preparer is an interface that provides methods for preparing a project after it has been cloned from a template repository.

func NewDefaultPreparer

func NewDefaultPreparer() Preparer

NewDefaultPreparer creates a new instance of the default Preparer implementation.

type TemplateValues

type TemplateValues struct {
	ProjectName           string
	NormalisedProjectName string
	BlueprintFormat       string
}

TemplateValues holds the values to substitute in template files.

func NewTemplateValues

func NewTemplateValues(projectName, blueprintFormat string) TemplateValues

NewTemplateValues creates a TemplateValues struct with computed fields.

Jump to

Keyboard shortcuts

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