feat(fermata): add cargo publish/install metadata

Adds license (MIT OR Apache-2.0), repository (placeholder TODO URL),
readme, keywords, categories, rust-version, dual LICENSE files, and a
README install section. Adds a regression test asserting these fields
remain present so future edits cannot silently break cargo publish.

`cargo install --path crates/dirigent_fermata --features cli` produces
a working `fermata` binary; `cargo publish --dry-run` is clean.
This commit is contained in:
2026-04-30 22:08:39 +02:00
parent 97001e1544
commit 478bf1927b
5 changed files with 292 additions and 0 deletions
+47
View File
@@ -0,0 +1,47 @@
//! Guards that fermata's Cargo.toml carries the metadata required for
//! `cargo publish` and a useful `cargo install`. Reads the manifest as
//! plain text to avoid pulling cargo internals.
use std::fs;
fn manifest() -> String {
fs::read_to_string(concat!(env!("CARGO_MANIFEST_DIR"), "/Cargo.toml"))
.expect("read Cargo.toml")
}
#[test]
fn has_license() {
let m = manifest();
assert!(m.contains("license ="), "Cargo.toml missing `license` field");
}
#[test]
fn has_repository() {
let m = manifest();
assert!(m.contains("repository ="), "Cargo.toml missing `repository` field");
}
#[test]
fn has_description() {
let m = manifest();
assert!(m.contains("description ="), "Cargo.toml missing `description`");
}
#[test]
fn has_readme() {
let m = manifest();
assert!(m.contains("readme ="), "Cargo.toml missing `readme` field");
}
#[test]
fn has_keywords_and_categories() {
let m = manifest();
assert!(m.contains("keywords ="), "Cargo.toml missing `keywords`");
assert!(m.contains("categories ="), "Cargo.toml missing `categories`");
}
#[test]
fn has_rust_version() {
let m = manifest();
assert!(m.contains("rust-version ="), "Cargo.toml missing `rust-version` (MSRV)");
}