Skip to main content

fallow_extract/cache/
mod.rs

1//! Incremental parse cache with bitcode serialization.
2//!
3//! Stores parsed module information (exports, imports, re-exports) on disk so
4//! unchanged files can skip AST parsing on subsequent runs. Uses xxh3 content
5//! hashing to detect changes.
6
7mod conversion;
8mod store;
9mod types;
10
11#[cfg(all(test, not(miri)))]
12mod tests;
13
14/// A test cache directory that is its own write base.
15#[cfg(all(test, not(miri)))]
16fn at(dir: &std::path::Path) -> fallow_types::path_guard::CacheTarget<'_> {
17    fallow_types::path_guard::CacheTarget::inside(dir)
18}
19
20#[cfg(test)]
21pub(crate) use conversion::module_to_cached_from_parts;
22pub use conversion::{
23    cached_hit_to_module, cached_to_module, cached_to_module_opts, current_unix_seconds,
24    module_to_cached,
25};
26pub use store::CacheStore;
27pub use types::{
28    CachedDynamicImport, CachedDynamicImportPattern, CachedExport, CachedImport, CachedMember,
29    CachedModule, CachedReExport, CachedRequireCall, CachedSuppression, DEFAULT_CACHE_MAX_SIZE,
30    DUPES_CACHE_VERSION,
31};