[package]
name = "cuenv-workspaces"
version.workspace = true
edition.workspace = true
authors.workspace = true
license.workspace = true
repository.workspace = true
homepage.workspace = true
readme.workspace = true
keywords.workspace = true
categories.workspace = true
description = "Workspace and dependency resolution for cuenv across multiple package managers"

[dependencies]
thiserror = { workspace = true }
miette = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
tracing = { workspace = true }
petgraph = { workspace = true }
toml = { workspace = true, optional = true }
serde_yaml = { workspace = true, optional = true }
jsonc-parser = { version = "0.28", optional = true }
yarn_lock_parser = { package = "yarn-lock-parser", version = "0.12.0", optional = true }
cargo-lock = { version = "11.0", optional = true }
cargo_toml = { version = "0.22", optional = true }
glob = { workspace = true, optional = true }
walkdir = { version = "2.5", optional = true }

[dev-dependencies]
tempfile = { workspace = true }

[features]
# Default features: package manager detection, JavaScript parsers, and JavaScript discovery
#
# These defaults are chosen to provide a complete experience for JavaScript/TypeScript projects
# (the most common use case for workspace tooling) out of the box. Users can disable default
# features with `default-features = false` to minimize dependencies for Rust-only or specialized
# use cases.
default = ["detection", "parsers-javascript", "discovery-javascript"]

# Enable package manager detection from lockfiles and commands
detection = ["toml", "serde_yaml"]

# Fine-grained discovery features
discovery-package-json = ["dep:glob", "dep:walkdir"]
discovery-pnpm = ["dep:glob", "serde_yaml", "dep:walkdir"]
discovery-cargo = ["dep:glob", "toml", "dep:walkdir"]

# Aggregate discovery features (recommended)
# Enable all JavaScript ecosystem discoveries (npm/Bun/Yarn via package.json, pnpm)
discovery-javascript = ["discovery-package-json", "discovery-pnpm"]
# Enable all Rust ecosystem discoveries (currently only Cargo)
discovery-rust = ["discovery-cargo"]

# Fine-grained parser features (prefer using aggregate features below)
parser-npm = []
parser-bun = ["jsonc-parser"]
parser-pnpm = ["serde_yaml"]
parser-yarn-classic = ["dep:yarn_lock_parser"]
parser-yarn-modern = ["serde_yaml"]
# Enable only the Cargo parser without the broader `parsers-rust` bundle
parser-cargo = ["dep:cargo-lock", "dep:cargo_toml", "toml", "dep:glob"]

# Aggregate parser features (recommended)
# Enable all JavaScript ecosystem parsers (npm, bun, pnpm, yarn classic, yarn modern)
parsers-javascript = [
	"parser-npm",
	"parser-bun",
	"parser-pnpm",
	"parser-yarn-classic",
	"parser-yarn-modern",
]
# Enable all Rust ecosystem parsers (currently only Cargo)
# Note: This implies parser-cargo but is intended to encompass additional Rust parsers in the future
parsers-rust = ["parser-cargo"]

[lints]
workspace = true
