poststep

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package poststep defines post-generation steps run after a scaffold is written.

Package poststep defines post-generation steps run after a scaffold is written.

Package poststep defines post-generation steps run after a scaffold is written.

Package poststep defines post-generation steps run after a scaffold is written.

Package poststep defines post-generation steps run after a scaffold is written.

Package poststep defines post-generation steps run after a scaffold is written.

Package poststep defines post-generation steps run after a scaffold is written.

Package poststep defines post-generation steps run after a scaffold is written.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GitCommitPostStep

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

GitCommitPostStep stages the generated scaffold and creates the initial commit.

func (GitCommitPostStep) Name

func (GitCommitPostStep) Name() string

Name returns the human-readable name of the post step.

func (GitCommitPostStep) Run

Run stages all generated files and creates the initial commit.

type GitInitPostStep

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

GitInitPostStep initializes a Git repository in the generated project.

func (GitInitPostStep) Name

func (GitInitPostStep) Name() string

Name returns the human-readable name of the post step.

func (GitInitPostStep) Run

Run initializes Git in the generated project.

type GoGetUpdatePostStep

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

GoGetUpdatePostStep updates module dependencies in the generated project.

func (GoGetUpdatePostStep) Name

func (GoGetUpdatePostStep) Name() string

Name returns the human-readable name of the post step.

func (GoGetUpdatePostStep) Run

Run executes `go get -u ./...` in the generated project.

type GoModTidyPostStep

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

GoModTidyPostStep tidies the generated project's module metadata.

func (GoModTidyPostStep) Name

func (GoModTidyPostStep) Name() string

Name returns the human-readable name of the post step.

func (GoModTidyPostStep) Run

Run executes `go mod tidy` in the generated project.

type Planner

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

Planner builds the ordered post-step plan for a generator run.

func NewPlanner

func NewPlanner(log zerolog.Logger, cfg *bcliconfig.PostStepsConfig) *Planner

NewPlanner constructs a Planner with subsystem-specific loggers.

func (*Planner) Planned

func (p *Planner) Planned() []PostStep

Planned returns the enabled post steps in execution order after applying dependencies.

type PostStep

type PostStep interface {
	Name() string
	Run(ctx context.Context, input PostStepInput) error
}

PostStep represents a single post-generation action.

func DefaultPostSteps

func DefaultPostSteps() []PostStep

DefaultPostSteps returns the default ordered post steps for a generated project.

type PostStepInput

type PostStepInput struct {
	ProjectPath string
	Name        string
	ModulePath  string
}

PostStepInput describes the generated project passed to a post step.

type StepID

type StepID string

StepID identifies a configurable post-generation step.

const (
	// StepGoGetUpdate updates generated project dependencies.
	StepGoGetUpdate StepID = "go_get_update"
	// StepGoModTidy tidies the generated project's module metadata.
	StepGoModTidy StepID = "go_mod_tidy"
	// StepGitInit initializes Git in the generated project.
	StepGitInit StepID = "git_init"
	// StepGitCommit stages and commits the generated project.
	StepGitCommit StepID = "git_commit"
)

Jump to

Keyboard shortcuts

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