extensions

package
v1.2.15 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package extensions provides the framework for registering and applying extensions to the scaffold generation process.

Index

Constants

This section is empty.

Variables

View Source
var Files embed.FS

Files contains the templates provided by scaffold extensions.

Functions

func Names

func Names() []string

Names returns all registered extension names in sorted order.

func Register

func Register(ext Extension) error

Register adds an extension to the global registry.

Types

type AwsSes

type AwsSes struct{}

AwsSes adds AWS SES email client support to a scaffolded project.

func (AwsSes) Apply

func (e AwsSes) Apply(ctx *Context) error

Apply adds AWS SES configuration, providers, and client files.

func (AwsSes) Dependencies

func (e AwsSes) Dependencies() []string

Dependencies returns extension names that must be applied first.

func (AwsSes) Name

func (e AwsSes) Name() string

Name returns the extension name used in lock files and CLI flags.

type Context

type Context struct {
	TargetDir         string
	Data              TemplateData
	ProcessTemplate   ProcessTemplateFunc
	AddPostStep       func(func(targetDir string) error)
	NextMigrationTime *time.Time
	Inertia           string // inertia adapter, e.g. "vue", "react"
}

Context carries state and callbacks for applying an extension.

func (*Context) Builder

func (ctx *Context) Builder() *blueprint.Builder

Builder returns the blueprint builder for structured contributions.

type CssComponents added in v1.0.0

type CssComponents struct{}

CssComponents adds optional CSS component examples to a scaffolded project.

func (CssComponents) Apply added in v1.0.0

func (c CssComponents) Apply(ctx *Context) error

Apply renders component CSS and example templates.

func (CssComponents) Dependencies added in v1.0.0

func (c CssComponents) Dependencies() []string

Dependencies returns extension names that must be applied first.

func (CssComponents) Name added in v1.0.0

func (c CssComponents) Name() string

Name returns the extension name used in lock files and CLI flags.

type Docker

type Docker struct{}

Docker adds Docker build files to a scaffolded project.

func (Docker) Apply

func (d Docker) Apply(ctx *Context) error

Apply renders Docker templates into the target project.

func (Docker) Dependencies

func (d Docker) Dependencies() []string

Dependencies returns extension names that must be applied first.

func (Docker) Name

func (d Docker) Name() string

Name returns the extension name used in lock files and CLI flags.

type Extension

type Extension interface {
	Name() string
	Apply(ctx *Context) error
	Dependencies() []string
}

Extension adds files, blueprint entries, or post-processing steps to a scaffold.

func Get

func Get(name string) (Extension, bool)

Get returns a registered extension by name.

type ProcessTemplateFunc

type ProcessTemplateFunc func(templateFile, targetPath string, data TemplateData) error

ProcessTemplateFunc renders an extension template into a target file.

type TemplateData

type TemplateData interface {
	DatabaseDialect() string
	GetModuleName() string
	GetInertia() string
	Builder() *blueprint.Builder
	SetBlueprint(bp *blueprint.Blueprint)
}

TemplateData exposes scaffold data to extension templates and blueprints.

Jump to

Keyboard shortcuts

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