scaffold

package
v0.2.1 Latest Latest
Warning

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

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

Documentation

Overview

Package scaffold renders a generated Ridu application without overwriting existing project files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(options Options) (string, error)

Create validates and renders a project before installing it. New directories are installed atomically; in-place creation checks all destinations first.

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 ResolveTarget added in v0.2.1

func ResolveTarget(value string, inPlace bool) (string, string, error)

ResolveTarget returns the absolute path and package-safe project name. Existing directory names are normalized only for explicit in-place creation.

func ValidateTarget

func ValidateTarget(value string, inPlace bool) 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
	// InPlace explicitly permits installing into an existing directory.
	InPlace          bool
	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