From 8c64921968e67b4419a01a76851871aeffd17e46 Mon Sep 17 00:00:00 2001 From: Niessen Date: Mon, 24 Aug 2026 16:40:39 +0200 Subject: [PATCH] docs(release): publish registry install instructions --- README.md | 18 ++++++++---------- docs/PORTING_PLAN.md | 2 +- docs/index.md | 8 ++++---- tests/release_workflow.rs | 19 +++++++++++++++++++ 4 files changed, 32 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 35ef175..98e07f6 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,14 @@ # ArchUnitRust +[![Crates.io](https://img.shields.io/crates/v/archunit.svg)](https://crates.io/crates/archunit) [![CI](https://github.com/LukasNiessen/ArchUnitRust/actions/workflows/ci.yml/badge.svg)](https://github.com/LukasNiessen/ArchUnitRust/actions/workflows/ci.yml) [![Documentation](https://github.com/LukasNiessen/ArchUnitRust/actions/workflows/pages.yml/badge.svg)](https://github.com/LukasNiessen/ArchUnitRust/actions/workflows/pages.yml) Architecture tests for Cargo projects, expressed as ordinary Rust tests. ArchUnitRust is part of **ArchUnitEverything** — one architecture-testing library per language. -> **Status:** usable from Git and under active development. The crate is not published on -> crates.io yet; the current package version is `0.0.1` and requires Rust 1.85 or newer. +> **Status:** `archunit` 0.0.1 is published on crates.io, requires Rust 1.85 or newer, and remains +> under active development. [User guide](https://lukasniessen.github.io/ArchUnitRust/) · [API reference](https://lukasniessen.github.io/ArchUnitRust/api/archunit/) @@ -17,19 +18,18 @@ Architecture tests for Cargo projects, expressed as ordinary Rust tests. ArchUni ArchUnit rules belong in the project that they check, so add the crate as a development dependency: ```console -cargo add --dev --git https://github.com/LukasNiessen/ArchUnitRust archunit +cargo add --dev archunit@0.0.1 ``` The equivalent `Cargo.toml` entry is: ```toml [dev-dependencies] -archunit = { git = "https://github.com/LukasNiessen/ArchUnitRust" } +archunit = "0.0.1" ``` -Cargo records the resolved Git commit in `Cargo.lock`. Commit that lockfile when the consuming -project normally tracks it. After the first crates.io release, the Git dependency can be replaced -by a versioned registry dependency. +Cargo resolves the registry version into `Cargo.lock`. Commit that lockfile when the consuming +project normally tracks it. ## File rules @@ -140,10 +140,8 @@ have a source-checked example below: All Rust snippets in this README are included in the crate documentation and compiled as doctests. The sections after this guide are the detailed reference for the implemented surface. -## What is not implemented yet +## Known limitations -- crates.io publication is tracked by [#44](https://github.com/LukasNiessen/ArchUnitRust/issues/44), - so installation currently uses the Git repository; - extraction is syntax-based: it does not expand macros or inspect build-script-generated source, evaluates `cfg` branches as a conservative union, and exposes files rather than Rust items as dependency nodes. diff --git a/docs/PORTING_PLAN.md b/docs/PORTING_PLAN.md index f012e42..42b6b0d 100644 --- a/docs/PORTING_PLAN.md +++ b/docs/PORTING_PLAN.md @@ -289,7 +289,7 @@ preserve the small conventional commits made on the branch. | Cross-cutting | #39 | Opt-in deterministic logging is covered | | Self-hosting | #40 | ArchUnitRust enforces its own module rules | | Adoption | #41-#43 | README, source-checked rustdoc/GitHub Pages, and the full CI matrix are live | -| Release | #44 | A verified package is published and install instructions are tested | +| Release | #44 | `archunit` 0.0.1 is published and its exact registry install is tested | Issue #38 stays open until every selector family has exclusion coverage, even though the matching model is designed for exclusions in the kernel. Release notes state exactly which selectors have it. diff --git a/docs/index.md b/docs/index.md index 26cb05b..2b75958 100644 --- a/docs/index.md +++ b/docs/index.md @@ -31,15 +31,15 @@ graph, and evaluates the rule. ## Install -ArchUnitRust currently installs from Git as a development dependency and requires Rust 1.85 or +ArchUnitRust 0.0.1 installs from crates.io as a development dependency and requires Rust 1.85 or newer: ```console -cargo add --dev --git https://github.com/LukasNiessen/ArchUnitRust archunit +cargo add --dev archunit@0.0.1 ``` -Cargo records the resolved commit in `Cargo.lock`. The package is not on crates.io yet, so a -versioned registry dependency is not currently an honest installation instruction. +The equivalent manifest entry is `archunit = "0.0.1"` under `[dev-dependencies]`. Cargo records the +resolved registry version in `Cargo.lock`. ## Your first rule diff --git a/tests/release_workflow.rs b/tests/release_workflow.rs index 9bc43a8..08023d9 100644 --- a/tests/release_workflow.rs +++ b/tests/release_workflow.rs @@ -90,6 +90,25 @@ fn standalone_fixture_pins_and_exercises_the_exact_registry_version() { assert!(architecture.contains("assert_passes!(rule);")); } +#[test] +fn public_installation_docs_name_the_verified_registry_version() { + let readme = read("README.md"); + let guide = read("docs/index.md"); + let plan = read("docs/PORTING_PLAN.md"); + + for public_entry_point in [&readme, &guide] { + assert!(public_entry_point.contains("cargo add --dev archunit@0.0.1")); + assert!(public_entry_point.contains("archunit = \"0.0.1\"")); + assert!(!public_entry_point.contains("cargo add --dev --git")); + assert!(!public_entry_point.contains("not on crates.io")); + assert!(!public_entry_point.contains("not published on")); + } + assert!(readme.contains("https://crates.io/crates/archunit")); + assert!( + plan.contains("`archunit` 0.0.1 is published and its exact registry install is tested") + ); +} + fn read(path: &str) -> String { fs::read_to_string(path) .unwrap_or_else(|error| panic!("failed to read {path}: {error}"))