Skip to content

Add Rust foundation template with library and CLI - #5

Merged
jabahum merged 1 commit into
mainfrom
feat/rust-foundation-template
Oct 24, 2026
Merged

jabahum merged 1 commit into
mainfrom
feat/rust-foundation-template

Conversation

@jabahum

@jabahum jabahum commented Oct 24, 2026

Copy link
Copy Markdown
Collaborator

Foundry now generates a Rust application with --template rust (also rs or rust-foundations). It ships as directly embedded source files, is available in the interactive menu and registry, records Rust project metadata, and prints Cargo startup instructions without invoking Cargo automatically.

The Rust 2024 foundation has a thin binary, reusable library, feature-owned domain/service modules, typed validation and I/O errors, an injected output writer, and an executable greeting example. It includes unit, binary integration, and documentation tests, a committed Cargo lockfile, a stable toolchain configuration with rustfmt/Clippy, and a cargo lint alias. Unsafe code is forbidden; the initial project has no third-party dependencies and builds offline after the Rust toolchain is installed. The documented minimum compiler is Rust 1.85.

Generation substitutes crate names in Rust source, Cargo manifests/lockfiles, tests, and docs. Reserved names and digit-leading names receive an app_ prefix so generated library imports and binary names remain valid. Rust/Cargo are included in doctor, and the README documents the module boundaries and extension points.

Validation:

  • make check smoke: formatting, all Foundry tests, vet, binary build, and existing generation/add smoke checks passed.
  • Fresh generated Rust project: formatting, 4 unit tests, 3 executable integration tests, 1 doctest, Clippy with warnings denied, documentation with warnings denied, offline release build, and an actual CLI invocation passed.
  • A generated project named type compiled and passed all tests as app_type.
  • ./scripts/build-release.sh ci: all six Foundry release targets passed.
  • New Rust CI generates projects and runs formatting, tests, Clippy, docs, and release builds on stable Rust across Linux/macOS/Windows and on Rust 1.85 on Linux.
  • git diff --check passed.

@jabahum
jabahum merged commit a91e0aa into main Oct 24, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant