1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
//! Detect the kind of a project (Rust, Node, Bun, Deno, Python, Lua, C, C++,
//! or any custom kind you register) from on-disk signals (`Cargo.toml`,
//! `package.json`, …) and scan a polyglot monorepo workspace recursively.
//!
//! # Two ways in
//!
//! For the common case where the built-in kinds are enough:
//!
//! ```no_run
//! use std::path::Path;
//! use standarbuild_detect::{detect_in_dir, discover, DiscoverOptions, KindId};
//!
//! if let Some(m) = detect_in_dir(Path::new("./my-app")) {
//! println!("{} matched on {:?}", m.kind, m.signals);
//! }
//!
//! for p in discover(Path::new("./my-monorepo"), &DiscoverOptions::default()) {
//! println!("{} -> {} at {}", p.label, p.kind, p.rel_path);
//! }
//! ```
//!
//! To extend the detection space (custom kinds, custom precedence, or
//! disabling a built-in), build your own registry:
//!
//! ```no_run
//! use std::path::Path;
//! use standarbuild_detect::{
//! builtin, DetectMatch, Detector, DetectorRegistry, KindId,
//! };
//!
//! struct WgslDetector;
//! impl Detector for WgslDetector {
//! fn kind(&self) -> KindId { KindId::custom("wgsl") }
//! fn priority(&self) -> i32 { 60 }
//! fn detect(&self, dir: &Path) -> Option<DetectMatch> {
//! dir.join("shaders").is_dir().then(|| DetectMatch {
//! kind: KindId::custom("wgsl"),
//! signals: vec!["shaders/".into()],
//! })
//! }
//! }
//!
//! let mut registry = DetectorRegistry::with_builtins();
//! registry.remove(&KindId::C); // we don't care about plain C
//! registry.add(WgslDetector);
//! ```
//!
//! # Features
//!
//! - `serde` *(default)* — derives `Serialize`/`Deserialize` on the public
//! types and exposes POSIX-path serializers in [`path_norm`]. Disable with
//! `default-features = false` for the leanest dep tree.
pub use detect_in_dir;
pub use ;
pub use ;
pub use KindId;
pub use to_posix;
pub use ;