clone

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: May 17, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package clone provides embedded app-clone templates for nself init --template. Each template bundles a Postgres schema, Hasura metadata, seed data, and a Flutter UI starter. Templates are embedded in the binary via go:embed so no network access is required at scaffold time.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func All

func All() []string

All returns the list of all bundled clone template names.

func IsCloneTemplate

func IsCloneTemplate(name string) bool

IsCloneTemplate reports whether name is one of the six bundled clone templates.

func Scaffold

func Scaffold(name string, opts ScaffoldOptions) ([]string, error)

Scaffold writes all template files for name into opts.TargetDir. Returns the list of files written (or that would be written on dry run).

Types

type Manifest

type Manifest struct {
	Name            string   `json:"name"`
	Version         string   `json:"version"`
	Description     string   `json:"description"`
	RequiredPlugins []string `json:"required_plugins"`
}

Manifest describes a clone template.

func GetManifest

func GetManifest(name string) (Manifest, error)

GetManifest reads the manifest.json for the named template.

type ScaffoldOptions

type ScaffoldOptions struct {
	// TargetDir is the directory to write files into. It must exist.
	TargetDir string
	// NoSeed skips 002_seed.sql.
	NoSeed bool
	// DryRun prints files without writing.
	DryRun bool
}

ScaffoldOptions controls how a template is written to disk.

Jump to

Keyboard shortcuts

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