scaffold

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package scaffold renders a generated Ridu application into an atomically installed target directory.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(options Options) (string, error)

Create validates, renders, and atomically installs a new project directory.

func ParsePackageManager

func ParsePackageManager(value string) (projectfile.PackageManager, error)

ParsePackageManager validates a package-manager name. Empty selects npm for new projects; legacy projects without the ridu.toml key are handled by projectfile.File.FrontendPackageManager instead.

func ValidateTarget

func ValidateTarget(value string) error

ValidateTarget checks the path rules and availability used by project creation without writing a staging directory. Interactive clients use it to report mistakes before the user confirms the scaffold.

Types

type Options

type Options struct {
	Target           string
	ModulePath       string
	NPMScope         string
	FrameworkVersion string
	Template         Template
	Agent            agentdocs.Selection
	Database         projectfile.DatabaseAdapter
	PackageManager   projectfile.PackageManager
}

Options describes one generated project.

type PackageManagerDefinition

type PackageManagerDefinition struct {
	Name        projectfile.PackageManager
	Label       string
	Description string
}

PackageManagerDefinition is stable CLI-facing metadata for one supported frontend dependency manager.

func PackageManagers

func PackageManagers() []PackageManagerDefinition

PackageManagers returns supported managers in user-facing display order.

type Template

type Template string

Template identifies one embedded project starting point. Templates share the same runtime and generated-contract boundaries; they differ only in the application-owned example content installed at time zero.

const (
	// TemplateStarter includes authenticated Users and a small Posts example.
	TemplateStarter Template = "starter"
	// TemplateBlank includes only the auth collection required to enter admin.
	TemplateBlank Template = "blank"
)

func ParseTemplate

func ParseTemplate(value string) (Template, error)

ParseTemplate validates a template name. Empty selects the backward- compatible starter so existing non-interactive invocations remain stable.

type TemplateDefinition

type TemplateDefinition struct {
	Name        Template
	Description string
}

TemplateDefinition is stable CLI-facing metadata for an embedded template.

func Templates

func Templates() []TemplateDefinition

Templates returns the embedded templates in their user-facing display order.

Jump to

Keyboard shortcuts

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