scaffold

package
v0.136.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package scaffold renders the starter Saga `draugr init` writes for a source tree.

It holds the part of init that decides what a descriptor says, and none of what writes it or prints a summary, so every caller that proposes a descriptor for a directory proposes the same one: the CLI writes it to a file, and the MCP server returns it for an assistant to show.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilePaths

func FilePaths(files []manifests.File) []string

FilePaths are the paths of files, in order.

func GoModules

func GoModules(t inventory.Tree) []string

GoModules names the go.mod files a tree's Go directories hold.

func PathList

func PathList(paths []string) string

PathList joins paths with a separator, the first shownPaths of them and a count of the rest.

func ProjectName

func ProjectName(dir string) string

ProjectName turns a directory name into one a descriptor accepts.

Lowercase letters, digits and dashes, starting and ending with a letter or digit, which is what `pkg/saga` enforces. Anything else becomes a dash, runs of dashes collapse, and the ends are trimmed. A name with nothing usable left in it, which a directory of punctuation or of non-Latin script produces, falls back to the same placeholder an unnamed directory gets: a scaffold somebody renames beats one that will not load.

func Saga

func Saga(t inventory.Tree, name string, perDirectory bool) string

Saga renders a starter Saga for what the tree holds.

func Scalar added in v0.135.1

func Scalar(s string) string

Scalar is s as a YAML scalar that reads back as the same string, in a block mapping or inside a flow sequence: bare where it would, double-quoted where YAML would read it as a number, a boolean or null (2024, 1e3, 0x10, true) or where it holds a character that means something in YAML. Names and paths come from directory names, which can be any of these.

The YAML 1.1 booleans are quoted too, because an editor's parser may read yes and on as true, and the schema then rejects the value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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