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 constraint;
37pub mod dependency;
38pub mod derivation;
39pub mod dispatcher;
40pub mod ecosystem;
41pub mod feature;
42pub mod lock_lifecycle;
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, AdapterCtx, AdapterError, AdapterQuirkEntry, AdapterRegistration, AdapterResult,
54    BuildSpec as AdapterBuildSpec, ConfirmReport, DepChange, DepEdge, DependencyBump, DiffRef,
55    DiffReport, DispatcherVariant, InvariantBreak, LockOutcome, Plan, PlanIntent, PlanWarning,
56    PlanWarningSeverity, Sbom, SbomFormat, adapter_by_name, registered_adapter_names,
57    registered_adapters,
58};
59pub use constraint::{Combinator, CompoundConstraint, ConstraintSpec, VersionConstraint};
60pub use dependency::{Dependency, DependencyKind};
61pub use derivation::{
62    BuildCommand, BuildScript, BuildStep, BuildStepKind, Derivation, DerivationRef,
63};
64pub use dispatcher::TypedDispatcher;
65pub use ecosystem::{Invariants, QuirkRegistry, Spec};
66pub use feature::{Feature, FeatureRef};
67pub use lock_lifecycle::{LockError, LockLifecyclePrimitive};
68pub use lockfile::{ContentHash, Lockfile, ResolvedPackage};
69pub use manifest::Manifest;
70pub use package::{Package, PackageId};
71pub use registry::Registry;
72pub use source::PackageSource;
73pub use target::{CompoundTargetPredicate, PredicateCombinator, Target, TargetPredicate};
74pub use version::Version;
75pub use workspace::Workspace;