use super::{Template, TemplateFile};
const SCRIPTS_TOML: &str = r#"# Generated by `cargo script init --template workspace`
# Run cargo-run from the workspace root.
[global_env]
RUST_BACKTRACE = "1"
[workspace]
# When omitted, members are auto-discovered from Cargo.toml.
# members = ["crates/*"]
# exclude = ["crates/legacy"]
[scripts]
# Run a script across every workspace member, sequentially.
test-all = { command = "cargo test", workspace = "all", info = "Test every member" }
# Same, but in parallel (requires the `parallel` feature).
test-parallel = { command = "cargo test", workspace = "parallel", info = "Test in parallel" }
# Workspace-wide checks at the root.
fmt-check = "cargo fmt --all -- --check"
lint = "cargo clippy --workspace --all-targets -- -D warnings"
doc = "cargo doc --workspace --no-deps"
# Composite CI pipeline.
ci = { include = ["fmt-check", "lint", "test-all"], info = "Full workspace CI" }
"#;
pub const TEMPLATE: Template = Template {
name: "workspace",
description: "Multi-crate workspace setup with parallel test runs",
files: &[TemplateFile { path: "Scripts.toml", contents: SCRIPTS_TOML }],
};