Expand description
Project + plugin scaffolding.
Two functions:
scaffold_projectwrites a complete new project directory. Maps toumbral startproject <name>.scaffold_appwrites a new plugin crate atplugins/<name>/. Maps toumbral startapp <name>.
Both are pure: take a target path and the new name, write files,
return what was written. The binary’s main.rs wraps them with
CLI parsing + a stdout report.
Structs§
- Scaffold
Report - Report returned by both scaffolding functions: the paths written, so the binary can print them to the user.
Enums§
- Command
Target - Where a scaffolded management command lives: the project’s own binary
(registered on the App builder via
.commands(commands::all())) or a plugin underplugins/<name>/(returned from itsPlugin::commands(), so it travels with the plugin). - Scaffold
Error - Error type for scaffolding operations. Wraps I/O and validation failures with enough context for a user-facing message.
Constants§
- RESERVED_
PLUGIN_ COMMAND_ NAMES - Commands shipped by a built-in plugin. Unlike the framework’s own
subcommands, these can’t be read off a clap parser — they only exist
once the plugin is registered on an App, and
startcommandruns outside any App. So they’re listed. - RESERVED_
PLUGIN_ NAMES - Built-in plugin names that
umbral startapprefuses to scaffold over. Adding a new built-in plugin? Add its name here so futurestartapp <name>calls fail fast with a clear message.
Functions§
- discover_
plugins - List the plugins available in this project: every
plugins/<name>/directory that holds aCargo.toml. - register_
dep_ in_ cargo_ toml - Attempt to register
<name> = { path = "plugins/<name>" }under[dependencies]in the project’sCargo.toml. - reserved_
command_ names - Every command name a new command may not take: the framework’s own
subcommands plus
RESERVED_PLUGIN_COMMAND_NAMES. - scaffold_
app - Deprecated alias for
scaffold_plugin. Everything the framework generates underplugins/is a plugin — there is no separate “app” contract — so the old minimalstartappwriter folds intostartplugin/scaffold_plugin, leaving one generator to maintain. Kept as a forwarding shim so existing API callers keep working; the CLIstartappcommand forwards here and prints a deprecation note. (Not#[deprecated]at the Rust level — that would warn on every internal test call site; the user-facing deprecation lives on the CLI command.) - scaffold_
command - Write a management command and register it.
- scaffold_
plugin - Write a richer plugin scaffold at
<project_root>/plugins/<name>/targeted at distributable / reusable plugins (third-party crates you’d publish or share across projects). Layout: - scaffold_
project