Skip to content

Commit 7aaaad1

Browse files
committed
cargo-rail: refactored monolith config, unify_analyzer, and fixed error reporting for JSON.
1 parent 93904cd commit 7aaaad1

36 files changed

+2845
-2209
lines changed

.gitignore

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,11 @@ AGENTS.md
2121
*.key
2222

2323
# Documentation
24-
docs/*
25-
final_testing.md
24+
docs/design
25+
docs/src
2626
rules.md
27-
27+
cmd_cfg.md
28+
v1_precheck.md
2829

2930
# Cargo-Rail (Testing)
3031
*rail.toml

README.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -179,28 +179,29 @@ def456 fix: critical bug # Same SHA!
179179

180180
## Configuration
181181

182-
Create `.config/rail.toml`:
182+
Create `.config/rail.toml` (or use `cargo rail init`):
183183

184184
```toml
185-
# Toolchain management
186-
[toolchain]
187-
channel = "stable"
188-
components = ["clippy", "rustfmt"]
185+
# Target platforms for multi-target analysis (auto-detected by init)
186+
targets = ["x86_64-unknown-linux-gnu", "aarch64-apple-darwin"]
189187

190188
# Dependency unification
191189
[unify]
192-
consolidate_transitive_features = false # Consolidate transitive deps
193-
transitive_feature_host = "auto" # Smart auto-selection
194-
validate_targets = []
190+
pin_transitives = true # Pin transitive-only deps (workspace-hack replacement)
191+
transitive_host = "root" # Where to put pinned dev-deps: "root" or "crates/foo"
192+
include_renamed = false # Include package = "..." renamed deps
193+
exclude = ["openssl"] # Deps to exclude from unification
195194

196-
# Split/sync (optional)
197-
[[splits]]
198-
name = "my-crate"
195+
# Per-crate configuration (optional)
196+
[crates.my-crate.split]
199197
remote = "[email protected]:org/my-crate.git"
200198
mode = "single"
199+
200+
[crates.my-crate.release]
201+
publish = true
201202
```
202203

203-
See [`.config/rail.toml.example`](.config/rail.toml.example) for all options.
204+
Run `cargo rail init --check` to preview generated config.
204205

205206
---
206207

docs/book.toml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[book]
2+
title = "cargo-rail Documentation"
3+
authors = ["loadingalias"]
4+
description = "Graph-aware workspace orchestration for Rust monorepos"
5+
language = "en"
6+
multilingual = false
7+
src = "src"
8+
9+
[rust]
10+
edition = "2024"
11+
12+
[build]
13+
build-dir = "book"
14+
create-missing = false
15+
16+
[preprocessor.open-on-gh]
17+
command = "mdbook-open-on-gh"
18+
renderer = ["html"]
19+
20+
[preprocessor.alerts]
21+
# Adds GitHub Flavored Markdown alerts support
22+
# Syntax: > [!NOTE], > [!TIP], > [!IMPORTANT], > [!WARNING], > [!CAUTION]
23+
24+
[preprocessor.mermaid]
25+
command = "mdbook-mermaid"
26+
27+
[output.html]
28+
git-repository-url = "https://github.com/loadingalias/cargo-rail"
29+
edit-url-template = "https://github.com/loadingalias/cargo-rail/edit/main/docs/src/{path}"
30+
additional-js = ["mermaid.min.js", "mermaid-init.js"]
31+
32+
[output.html.fold]
33+
enable = true
34+
level = 0

src/cargo/manifest_ops.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
//! - **Bulk Operations** - transform multiple dependencies at once
1515
1616
use crate::cargo::manifest_analyzer::DepKind;
17-
use crate::cargo::unify_analyzer::UnifiedDep;
17+
use crate::cargo::unify_types::UnifiedDep;
1818
use crate::error::{RailError, RailResult, ResultExt};
1919
use std::path::Path;
2020
use toml_edit::{Array, DocumentMut, InlineTable, Item, Table, Value};

src/cargo/manifest_writer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
use crate::cargo::manifest_analyzer::DepKind;
66
use crate::cargo::manifest_ops;
7-
use crate::cargo::unify_analyzer::{TransitivePin, UnifiedDep};
7+
use crate::cargo::unify_types::{TransitivePin, UnifiedDep};
88
use crate::error::{RailResult, ResultExt};
99
use crate::toml::format::TomlFormatter;
1010
use std::path::Path;

src/cargo/mod.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,18 @@ pub mod manifest_ops;
1313
pub mod manifest_writer;
1414
pub mod multi_target_metadata;
1515
pub mod unify_analyzer;
16+
pub mod unify_report;
17+
pub mod unify_types;
1618

1719
// Re-export main types for convenience
1820
pub use cargo_transform::{CargoTransform, TransformContext};
1921
pub use feature_scanner::{FeatureScanResult, FeatureScanner};
2022
pub use manifest_analyzer::{DepKey, DepKind, DepUsage, ManifestAnalyzer};
2123
pub use manifest_writer::ManifestWriter;
2224
pub use multi_target_metadata::{ComputedMsrv, FragmentedTransitive, MultiTargetMetadata};
23-
pub use unify_analyzer::{
24-
DuplicateCleanup, IssueSeverity, MemberEdit, PrunedFeature, TransitivePin, UnificationPlan, UnifiedDep,
25-
UnifyAnalyzer, UnifyIssue, UnifyReport, ValidationResult,
25+
pub use unify_analyzer::UnifyAnalyzer;
26+
pub use unify_report::UnifyReport;
27+
pub use unify_types::{
28+
DuplicateCleanup, IssueSeverity, MemberEdit, PrunedFeature, TransitivePin, UnificationPlan, UnifiedDep, UnifyIssue,
29+
UnusedDep, UnusedReason, ValidationResult, VersionMismatch,
2630
};

0 commit comments

Comments
 (0)