scaffold

package
v0.1.45 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2026 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Overview

Package scaffold holds the `forge scaffold` command — the one verb that writes new code into a forge project, at two granularities picked by ARITY:

forge scaffold                    everything the protos imply (the sweep;
                                  see sweep.go)
forge scaffold <noun> [args...]   one thing, explicitly (service / worker /
                                  operator / binary / frontend / webhook /
                                  package / adapter / library /
                                  handler-file / rpc / entity / crd /
                                  scenario)

Both modes run the same primitives: `forge scaffold entity product --from-proto tasks` is the explicit spelling of one birth the sweep would perform from a `// forge:entity` marker. The nouns beyond entity (service, worker, …) have no marker to sweep from, so they are only reachable explicitly.

It is a dir-nested command group (the devspace idiom forge ships in generated apps). The subcommands that trigger codegen — `scaffold service`, `scaffold worker`, `scaffold operator` — reach the generate pipeline and the pkg/app/services.go registration view through factory.GenAPI (function values internal/cli registers via SetGenAPI). The group never imports internal/cli, so the registry indirection in the factory package is what keeps the dependency one-directional (group → factory) and the import cycle broken. init() (in sweep.go) self-registers the command with the factory.

Jump to

Keyboard shortcuts

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