Skip to main content

Module scaffold

Module scaffold 

Source
Expand description

Project + plugin scaffolding.

Two functions:

  • scaffold_project writes a complete new project directory. Maps to umbral startproject <name>.
  • scaffold_app writes a new plugin crate at plugins/<name>/. Maps to umbral 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§

ScaffoldReport
Report returned by both scaffolding functions: the paths written, so the binary can print them to the user.

Enums§

ScaffoldError
Error type for scaffolding operations. Wraps I/O and validation failures with enough context for a user-facing message.

Constants§

RESERVED_PLUGIN_NAMES
Built-in plugin names that umbral startapp refuses to scaffold over. Adding a new built-in plugin? Add its name here so future startapp <name> calls fail fast with a clear message.

Functions§

register_dep_in_cargo_toml
Attempt to register <name> = { path = "plugins/<name>" } under [dependencies] in the project’s Cargo.toml.
scaffold_app
Write a new plugin crate at <project_root>/plugins/<name>/, using the per-concern layout (gaps2 #8):
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