provenant/lib.rs
1// SPDX-FileCopyrightText: Provenant contributors
2// SPDX-License-Identifier: Apache-2.0
3
4//! # Provenant
5//!
6//! `provenant` is the library crate behind the `provenant` CLI. It
7//! provides ScanCode-compatible scanning, package parsing, and output-writing
8//! building blocks for Rust applications.
9//!
10//! The main entry points are:
11//!
12//! - [`collect_paths`] to discover files in a directory tree
13//! - [`process_collected`] to scan collected files in parallel
14//! - [`OutputFormat`], [`OutputWriter`], and [`write_output_file`] to serialize scan results
15//! - [`parsers`] and [`models`] for lower-level package parsing and result inspection
16//!
17//! High-level crate organization:
18//!
19//! - [`scanner`] orchestrates traversal, filtering, and scan execution
20//! - [`license_detection`] extracts license information from files
21//! - [`parsers`] extracts package metadata from ecosystem-specific inputs
22//! - [`copyright`] and [`finder`] extract text clues such as copyrights, emails, and URLs
23//! - [`output`] renders ScanCode-compatible and SBOM-oriented output formats
24//! - [`models`] defines the core scan result data structures
25//!
26//! User-facing installation, CLI usage, supported format coverage, and broader
27//! architecture notes live in the repository documentation. The crate-level
28//! rustdoc stays intentionally concise so fast-changing project details have a
29//! single source of truth outside this file.
30
31extern crate self as provenance;
32
33pub mod assembly;
34pub mod cache;
35pub mod cli;
36pub(crate) mod compare;
37pub mod copyright;
38pub mod finder;
39pub mod golden_maintenance;
40pub mod license_detection;
41pub mod models;
42pub mod output;
43pub mod output_schema;
44pub mod parsers;
45#[cfg(feature = "golden-tests")]
46pub mod post_processing;
47#[cfg(not(feature = "golden-tests"))]
48pub(crate) mod post_processing;
49pub mod progress;
50pub(crate) mod scan_result_shaping;
51pub mod scanner;
52#[cfg(test)]
53pub(crate) mod test_support;
54pub(crate) mod time;
55pub mod utils;
56pub mod version;
57
58pub use models::{ExtraData, FileInfo, FileType, Header, Output, SystemEnvironment};
59pub use output::{
60 OutputFormat, OutputWriteConfig, OutputWriter, write_output_file, writer_for_format,
61};
62pub use parsers::{NpmParser, PackageParser};
63pub use progress::{ProgressMode, ScanProgress};
64pub use scanner::{
65 CollectedPaths, ProcessResult, TextDetectionOptions, collect_paths, process_collected,
66};