Skip to main content

gen_types/
lib.rs

1//! gen-types — typed IR for the universal package-manager → build-
2//! system engine.
3//!
4//! Foundation crate. Every adapter (gen-cargo, gen-npm, gen-bundler,
5//! gen-pip, gen-gomod, gen-helm, …) emits this shape; every renderer
6//! (gen-nix-incremental, gen-nix-bulk, gen-bazel, …) consumes it;
7//! every cache backend (gen-cache-attic, gen-cache-cachix, …) keys
8//! on it.
9//!
10//! See `theory/GEN.md` for the full design — why universal lifting,
11//! the 80/20 split, the trait architecture, the milestone plan.
12//!
13//! ## Shape
14//!
15//! ```text
16//! Manifest (1)
17//!   └─ packages: Vec<Package>             (one per crate / gem / wheel / etc.)
18//!         ├─ source: PackageSource        (Registry | Git | Path | Local)
19//!         ├─ dependencies: Vec<Dependency>
20//!         │     ├─ constraint: VersionConstraint
21//!         │     ├─ kind: DependencyKind   (Direct | Build | Dev | Optional | Peer)
22//!         │     ├─ features_enabled: Vec<String>
23//!         │     └─ target_predicate: Option<TargetPredicate>
24//!         ├─ features: Vec<Feature>
25//!         └─ build_steps: Vec<BuildStep>
26//!   └─ lockfile: Option<Lockfile>
27//! ```
28//!
29//! Every adapter is a thin Manifest-producer; every renderer is a
30//! thin Manifest-to-Derivation translator. The trait surface stays
31//! narrow.
32
33#![allow(clippy::module_name_repetitions)]
34
35pub mod adapter;
36pub mod dispatcher;
37pub mod ecosystem;
38pub mod lock_lifecycle;
39pub mod constraint;
40pub mod dependency;
41pub mod derivation;
42pub mod feature;
43pub mod lockfile;
44pub mod manifest;
45pub mod package;
46pub mod registry;
47pub mod source;
48pub mod target;
49pub mod version;
50pub mod workspace;
51
52pub use adapter::{
53    adapter_by_name, registered_adapter_names, registered_adapters, Adapter, AdapterCtx,
54    AdapterError, AdapterQuirkEntry, AdapterRegistration, AdapterResult,
55    BuildSpec as AdapterBuildSpec, ConfirmReport, DepChange, DepEdge, DependencyBump,
56    DispatcherVariant, DiffRef,
57    DiffReport, InvariantBreak, LockOutcome, Plan, PlanIntent, PlanWarning, PlanWarningSeverity,
58    Sbom, SbomFormat,
59};
60pub use dispatcher::TypedDispatcher;
61pub use lock_lifecycle::{LockError, LockLifecyclePrimitive};
62pub use ecosystem::{Invariants, QuirkRegistry, Spec};
63pub use constraint::{Combinator, CompoundConstraint, ConstraintSpec, VersionConstraint};
64pub use dependency::{Dependency, DependencyKind};
65pub use derivation::{BuildCommand, BuildScript, BuildStep, BuildStepKind, Derivation, DerivationRef};
66pub use feature::{Feature, FeatureRef};
67pub use lockfile::{ContentHash, Lockfile, ResolvedPackage};
68pub use manifest::Manifest;
69pub use package::{Package, PackageId};
70pub use registry::Registry;
71pub use source::PackageSource;
72pub use target::{CompoundTargetPredicate, PredicateCombinator, Target, TargetPredicate};
73pub use version::Version;
74pub use workspace::Workspace;