diff --git a/Cargo.lock b/Cargo.lock index 5666a654..73f49eb9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -238,7 +238,7 @@ dependencies = [ [[package]] name = "buffrs" -version = "0.13.2" +version = "0.14.0" dependencies = [ "anyhow", "assert_cmd", @@ -255,6 +255,7 @@ dependencies = [ "hex", "home", "human-panic", + "ignore", "miette", "pretty_assertions", "protobuf", @@ -625,9 +626,9 @@ checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280" [[package]] name = "globset" -version = "0.4.16" +version = "0.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54a1028dfc5f5df5da8a56a73e6c153c9a9708ec57232470703592a3f18e49f5" +checksum = "52dfc19153a48bde0cbd630453615c8151bce3a5adfac7a0aebfbf0a1e1f57e3" dependencies = [ "aho-corasick", "bstr", @@ -906,9 +907,9 @@ dependencies = [ [[package]] name = "ignore" -version = "0.4.23" +version = "0.4.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d89fd380afde86567dfba715db065673989d6253f42b88179abd3eae47bda4b" +checksum = "d3d782a365a015e0f5c04902246139249abf769125006fbe7649e2ee88169b4a" dependencies = [ "crossbeam-deque", "globset", @@ -1586,7 +1587,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys 0.11.0", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -1627,9 +1628,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.103.12" +version = "0.103.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8279bb85272c9f10811ae6a6c547ff594d6a7f3c6c6b02ee9726d1d0dcfcdd06" +checksum = "61c429a8649f110dddef65e2a5ad240f747e85f7758a6bccc7e5777bd33f756e" dependencies = [ "ring", "rustls-pki-types", @@ -1960,7 +1961,7 @@ dependencies = [ "getrandom 0.3.3", "once_cell", "rustix 1.1.3", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index aa642c9e..d013dc20 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "buffrs" -version = "0.13.2" +version = "0.14.0" edition = "2024" description = "Modern protobuf package management" authors = [ @@ -55,6 +55,7 @@ glob = "0.3" hex = "0.4.3" home = "0.5.5" human-panic = "2" +ignore = "0.4.25" miette = { version = "7", features = ["fancy"] } protobuf = { version = "3.7.2", optional = true } protobuf-parse = { version = "3.7.2", optional = true } diff --git a/src/command.rs b/src/command.rs index ec85dc6f..2872541c 100644 --- a/src/command.rs +++ b/src/command.rs @@ -69,6 +69,8 @@ pub async fn init(kind: Option, name: Option) -> miett name, version: INITIAL_VERSION, description: None, + include: Default::default(), + exclude: Default::default(), }) }) .transpose()?; @@ -106,6 +108,8 @@ pub async fn new(kind: Option, name: PackageName) -> miette::Result name, version: INITIAL_VERSION, description: None, + include: Default::default(), + exclude: Default::default(), }) }) .transpose()?; @@ -371,7 +375,9 @@ pub async fn list() -> miette::Result<()> { store.populate(pkg).await?; } - let protos = store.collect(&store.proto_vendor_path(), true).await; + let protos = store + .collect(&store.proto_vendor_path(), true, None, None) + .await?; let cwd = { let cwd = std::env::current_dir() diff --git a/src/manifest/mod.rs b/src/manifest/mod.rs index b9a84d98..16240e75 100644 --- a/src/manifest/mod.rs +++ b/src/manifest/mod.rs @@ -50,6 +50,8 @@ pub enum Edition { /// at any time. Users are responsible for consulting documentation and /// help channels if errors occur. Canary, + /// The canary edition used by buffrs 0.13.x + Canary13, /// The canary edition used by buffrs 0.12.x Canary12, /// The canary edition used by buffrs 0.11.x @@ -80,6 +82,7 @@ impl From<&str> for Edition { fn from(value: &str) -> Self { match value { CANARY_EDITION => Self::Canary, + "0.13" => Self::Canary13, "0.12" => Self::Canary12, "0.11" => Self::Canary11, "0.10" => Self::Canary10, @@ -95,6 +98,7 @@ impl From for &'static str { fn from(value: Edition) -> Self { match value { Edition::Canary => CANARY_EDITION, + Edition::Canary13 => "0.13", Edition::Canary12 => "0.12", Edition::Canary11 => "0.11", Edition::Canary10 => "0.10", @@ -367,6 +371,7 @@ mod tests { #[test] fn edition_from_str_legacy_versions() { + assert_eq!(Edition::from("0.13"), Edition::Canary13); assert_eq!(Edition::from("0.12"), Edition::Canary12); assert_eq!(Edition::from("0.11"), Edition::Canary11); assert_eq!(Edition::from("0.10"), Edition::Canary10); @@ -385,6 +390,7 @@ mod tests { #[test] fn edition_to_str() { assert_eq!(<&str>::from(Edition::Canary), CANARY_EDITION); + assert_eq!(<&str>::from(Edition::Canary13), "0.13"); assert_eq!(<&str>::from(Edition::Canary12), "0.12"); assert_eq!(<&str>::from(Edition::Canary11), "0.11"); assert_eq!(<&str>::from(Edition::Canary10), "0.10"); @@ -536,6 +542,8 @@ mod tests { name: PackageName::from_str("test").unwrap(), version: Version::new(1, 0, 0), description: Some("Test description".to_string()), + include: Default::default(), + exclude: Default::default(), }) .dependencies(vec![]) .build(); @@ -544,6 +552,166 @@ mod tests { assert!(serialized.contains("Test description")); } + #[test] + fn serialize_package_manifest_with_include() { + let manifest = PackagesManifest::builder() + .package(PackageManifest { + kind: PackageType::Api, + name: PackageName::from_str("test").unwrap(), + version: Version::new(1, 0, 0), + description: None, + include: Some(vec!["foo".to_string()]), + exclude: Default::default(), + }) + .build(); + + let serialized: String = manifest.try_into().expect("should serialize"); + assert!(serialized.contains("include")); + assert!(!serialized.contains("exclude")); + } + + #[test] + fn serialize_package_manifest_with_exclude() { + let manifest = PackagesManifest::builder() + .package(PackageManifest { + kind: PackageType::Api, + name: PackageName::from_str("test").unwrap(), + version: Version::new(1, 0, 0), + description: None, + include: None, + exclude: Some(vec!["bar".to_string()]), + }) + .build(); + + let serialized: String = manifest.try_into().expect("should serialize"); + assert!(!serialized.contains("include")); + assert!(serialized.contains("exclude")); + } + + #[test] + fn serialize_package_manifest_omits_empty_include_and_exclude() { + let manifest = PackagesManifest::builder() + .package(PackageManifest { + kind: PackageType::Api, + name: PackageName::from_str("test").unwrap(), + version: Version::new(1, 0, 0), + description: None, + include: None, + exclude: Default::default(), + }) + .build(); + + let serialized: String = manifest.try_into().expect("should serialize"); + assert!(!serialized.contains("include")); + assert!(!serialized.contains("exclude")); + } + + #[test] + fn deserialize_manifest_with_include() { + let toml = r#" + edition = "0.14" + + [package] + type = "lib" + name = "test" + version = "1.0.0" + include = ["src/**/*.proto", "api/*.proto"] + + [dependencies] + "#; + + let manifest = PackagesManifest::from_str(toml).expect("should parse"); + let pkg = manifest.package.expect("package should be present"); + assert_eq!( + pkg.include, + Some(vec![ + "src/**/*.proto".to_string(), + "api/*.proto".to_string() + ]) + ); + assert!(pkg.exclude.is_none()); + } + + #[test] + fn deserialize_manifest_with_exclude() { + let toml = r#" + edition = "0.14" + + [package] + type = "lib" + name = "test" + version = "1.0.0" + exclude = ["internal.proto"] + + [dependencies] + "#; + + let manifest = PackagesManifest::from_str(toml).expect("should parse"); + let pkg = manifest.package.expect("package should be present"); + assert!(pkg.include.is_none()); + assert_eq!(pkg.exclude, Some(vec!["internal.proto".to_string()])); + } + + #[test] + fn deserialize_manifest_with_empty_exclude_preserves_distinction() { + let toml = r#" + edition = "0.14" + + [package] + type = "lib" + name = "test" + version = "1.0.0" + exclude = [] + + [dependencies] + "#; + + let manifest = PackagesManifest::from_str(toml).expect("should parse"); + let pkg = manifest.package.expect("package should be present"); + assert_eq!(pkg.exclude, Some(vec![])); + } + + #[test] + fn deserialize_manifest_with_both_include_and_exclude_fails() { + let toml = r#" + edition = "0.14" + + [package] + type = "lib" + name = "test" + version = "1.0.0" + include = ["src/**/*.proto"] + exclude = ["internal.proto"] + + [dependencies] + "#; + + let result = PackagesManifest::from_str(toml); + assert!( + result.is_err(), + "manifest with both include and exclude should fail" + ); + } + + #[test] + fn deserialize_manifest_with_empty_include_preserves_distinction() { + let toml = r#" + edition = "0.14" + + [package] + type = "lib" + name = "test" + version = "1.0.0" + include = [] + + [dependencies] + "#; + + let manifest = PackagesManifest::from_str(toml).expect("should parse"); + let pkg = manifest.package.expect("package should be present"); + assert_eq!(pkg.include, Some(vec![])); + } + #[test] fn deserialize_manifest_with_local_dependency() { let toml = r#" @@ -647,6 +815,8 @@ mod tests { name: PackageName::from_str("complex-package").unwrap(), version: Version::new(2, 1, 0), description: Some("A complex test package".to_string()), + include: Some(vec!["foo".to_string()]), + exclude: Default::default(), }; let deps = vec![ diff --git a/src/manifest/package.rs b/src/manifest/package.rs index 8c01ceda..39c16cd2 100644 --- a/src/manifest/package.rs +++ b/src/manifest/package.rs @@ -237,6 +237,36 @@ pub struct PackageManifest { pub version: Version, /// Description of the api package pub description: Option, + /// List of paths that should be **included** in the package. + /// + /// Gitignore syntax is supported. Starts from an empty set: only + /// files matching one of the globs are included (any file type, + /// not limited to `.proto`). + /// + /// If neither `include` nor `exclude` is set, the default is + /// every `.proto` file under the package root. + /// + /// The manifest file (`Proto.toml`) is always included in the + /// package regardless of this setting. + /// + /// Mutually exclusive with `exclude`. + #[serde(skip_serializing_if = "Option::is_none")] + pub include: Option>, + /// List of paths that should be **excluded** from the package. + /// + /// Gitignore syntax is supported. When set, starts from the set of + /// all files under the package root (any file type, not limited to + /// `.proto`) and removes files matching any of the globs. An empty + /// list (`exclude = []`) means "include every file with no + /// exclusions" — distinct from omitting the field, which falls back + /// to the default of every `.proto` file under the package root. + /// + /// The manifest file (`Proto.toml`) is always included in the + /// package regardless of this setting. + /// + /// Mutually exclusive with `include`. + #[serde(skip_serializing_if = "Option::is_none")] + pub exclude: Option>, } /// Represents a single project dependency @@ -371,6 +401,8 @@ mod tests { name: PackageName::from_str("test-pkg").unwrap(), version: Version::new(1, 2, 3), description: Some("A test package".to_string()), + include: Default::default(), + exclude: Default::default(), }; let deps = vec![Dependency::new( @@ -440,6 +472,8 @@ mod tests { name: PackageName::from_str("test").unwrap(), version: Version::new(1, 0, 0), description: None, + include: Default::default(), + exclude: Default::default(), }) .dependencies(vec![]) .build(); @@ -562,6 +596,8 @@ mod tests { name: PackageName::from_str("test").unwrap(), version: Version::new(1, 0, 0), description: None, + include: Default::default(), + exclude: Default::default(), }) .dependencies(vec![]) .build(); @@ -589,6 +625,8 @@ mod tests { name: PackageName::from_str("test-pkg").unwrap(), version: Version::new(1, 0, 0), description: None, + include: Default::default(), + exclude: Default::default(), }) .dependencies(Default::default()) .build(); diff --git a/src/manifest/raw.rs b/src/manifest/raw.rs index cc8e25b5..d9c76864 100644 --- a/src/manifest/raw.rs +++ b/src/manifest/raw.rs @@ -194,6 +194,7 @@ mod deserializer { match Edition::from(edition.as_str()) { Edition::Canary + | Edition::Canary13 | Edition::Canary12 | Edition::Canary11 | Edition::Canary10 @@ -333,9 +334,18 @@ impl TryFrom for PackagesManifest { type Error = miette::Report; fn try_from(raw: RawManifest) -> Result { + let package = raw.package().cloned(); + + if let Some(pkg) = &package + && pkg.include.is_some() + && pkg.exclude.is_some() + { + bail!("manifest cannot have both `include` and `exclude`; use one or the other"); + } + Ok(PackagesManifest { edition: raw.edition(), - package: raw.package().cloned(), + package, dependencies: raw.dependencies_as_vec(), }) } @@ -387,6 +397,8 @@ mod tests { name: PackageName::from_str("test").unwrap(), version: Version::new(1, 0, 0), description: None, + include: Some(vec!["*.proto".into()]), + exclude: None, }; let raw = RawManifest::Canary { @@ -408,6 +420,8 @@ mod tests { name: PackageName::from_str("test").unwrap(), version: Version::new(1, 0, 0), description: None, + include: None, + exclude: Some(vec!["internal.proto".into()]), }; let raw = RawManifest::Unknown { @@ -552,6 +566,8 @@ mod tests { name: PackageName::new("test").unwrap(), version: Version::new(1, 0, 0), description: None, + include: Default::default(), + exclude: Default::default(), }), dependencies: None, workspace: None, diff --git a/src/package/store.rs b/src/package/store.rs index cccd2077..1dc99b11 100644 --- a/src/package/store.rs +++ b/src/package/store.rs @@ -21,12 +21,12 @@ use std::{ use bytes::Bytes; use miette::{Context, IntoDiagnostic, miette}; use tokio::fs; -use walkdir::WalkDir; use crate::{ manifest::{MANIFEST_FILE, Manifest, PackageManifest, PackagesManifest}, package::{Package, PackageName}, }; +use ignore::{Match, WalkBuilder, overrides::OverrideBuilder, types::TypesBuilder}; /// IO abstraction layer over local `buffrs` package store #[derive(Debug, Clone, PartialEq, Eq)] @@ -212,7 +212,7 @@ impl PackageStore { manifest: &PackageManifest, ) -> miette::Result { let root_path = self.proto_vendor_path(); - let source_files = self.populated_files(manifest).await; + let source_files = self.populated_files(manifest).await?; let mut parser = crate::validation::Validator::new(&root_path, manifest); @@ -254,12 +254,23 @@ impl PackageStore { manifest: &PackagesManifest, preserve_mtime: bool, ) -> miette::Result { + if manifest.package.is_none() { + return Err(miette!( + "cannot release a package without a [package] declaration in the manifest" + )); + } + let pkg_path = self.proto_path(); let mut entries = BTreeMap::new(); - for entry in self.collect(&pkg_path, false).await { + let include = manifest.package.as_ref().and_then(|p| p.include.as_deref()); + let exclude = manifest.package.as_ref().and_then(|p| p.exclude.as_deref()); + for entry in self.collect(&pkg_path, false, include, exclude).await? { let path = entry.strip_prefix(&pkg_path).into_diagnostic()?; - let contents = tokio::fs::read(&entry).await.unwrap(); + let contents = tokio::fs::read(&entry) + .await + .into_diagnostic() + .wrap_err_with(|| format!("failed to read {}", entry.display()))?; entries.insert( path.into(), @@ -298,29 +309,116 @@ impl PackageStore { /// /// * `path` - The root directory to search /// * `vendored` - If `false`, excludes files from `proto/vendor/` (for collecting source files only), if `true`, includes all `.proto` files regardless of location - pub async fn collect(&self, path: &Path, vendored: bool) -> Vec { - let mut paths: Vec<_> = WalkDir::new(path) - .into_iter() - .filter_map(Result::ok) - .map(|entry| entry.into_path()) - .filter(|path| { + pub async fn collect( + &self, + path: &Path, + vendored: bool, + include: Option<&[String]>, + exclude: Option<&[String]>, + ) -> miette::Result> { + debug_assert!( + include.is_none() || exclude.is_none(), + "include and exclude are mutually exclusive" + ); + + let mut builder = WalkBuilder::new(path); + builder.standard_filters(false); + + let vendor_path = self.proto_vendor_path(); + + if let Some(include) = include { + // An empty include list means "include nothing" — but an empty + // `OverrideBuilder` is a no-op filter that lets every file + // through, so short-circuit here instead of walking the tree. + if include.is_empty() { + return Ok(Vec::new()); + } + // Use the inclusions list to select files via overrides + let mut overrides_builder = OverrideBuilder::new(path); + for glob in include { + overrides_builder + .add(glob) + .into_diagnostic() + .wrap_err_with(|| format!("invalid include entry: {glob}"))?; + } + builder.overrides( + overrides_builder + .build() + .into_diagnostic() + .wrap_err("failed to build include filter")?, + ); + builder.filter_entry(move |e| { if vendored { true } else { - !path.starts_with(self.proto_vendor_path()) + !e.path().starts_with(&vendor_path) + } + }); + } else if let Some(exclude) = exclude { + // Start from all files (no type filter) and exclude matches + let mut overrides_builder = OverrideBuilder::new(path); + for glob in exclude { + overrides_builder + .add(glob) + .into_diagnostic() + .wrap_err_with(|| format!("invalid exclude entry: {glob}"))?; + } + let overrides = overrides_builder + .build() + .into_diagnostic() + .wrap_err("failed to build exclude filter")?; + builder.filter_entry(move |e| { + let Some(ftype) = e.file_type() else { + // file_type() returns None for stdin or broken symlinks; + // exclude the entry in either case + return false; + }; + let path = e.path(); + match overrides.matched(path, ftype.is_dir()) { + Match::None | Match::Ignore(_) => { + if vendored { + true + } else { + !path.starts_with(&vendor_path) + } + } + Match::Whitelist(_) => false, } - }) - .filter(|path| { - let ext = path.extension().map(|s| s.to_str()); + }); + } else { + // Default: include only .proto files + let proto_types = { + let mut types = TypesBuilder::new(); + types + .add("proto", "*.proto") + .into_diagnostic() + .wrap_err("internal error: failed to register `proto` file type")?; + types.select("proto"); + types + .build() + .into_diagnostic() + .wrap_err("internal error: failed to build `proto` file type matcher")? + }; + builder.types(proto_types).filter_entry(move |e| { + if vendored { + true + } else { + !e.path().starts_with(&vendor_path) + } + }); + } - matches!(ext, Some(Some("proto"))) - }) + let mut paths: Vec<_> = builder + .build() + .filter_map(Result::ok) + .filter(|entry| entry.file_type().map(|ft| ft.is_file()).unwrap_or(false)) + .map(|entry| entry.into_path()) .collect(); // to ensure determinism paths.sort(); - paths + Ok(paths) } /// Copies the package's source `.proto` files to the vendor directory @@ -348,31 +446,42 @@ impl PackageStore { if tokio::fs::try_exists(&target_dir) .await .into_diagnostic() - .wrap_err(format!( - "failed to check whether directory {} still exists", - target_dir.to_str().unwrap() - ))? + .wrap_err_with(|| { + format!( + "failed to check whether directory {} still exists", + target_dir.display() + ) + })? { tokio::fs::remove_dir_all(&target_dir) .await .into_diagnostic() - .wrap_err(format!( - "failed to remove directory {} and its contents.", - target_dir.to_str().unwrap() - ))?; + .wrap_err_with(|| { + format!( + "failed to remove directory {} and its contents", + target_dir.display() + ) + })?; } - for entry in self.collect(&source_path, false).await { + let include = manifest.include.as_deref(); + let exclude = manifest.exclude.as_deref(); + for entry in self.collect(&source_path, false, include, exclude).await? { let file_name = entry.strip_prefix(&source_path).into_diagnostic()?; let target_path = target_dir.join(file_name); - tokio::fs::create_dir_all(target_path.parent().unwrap()) + let parent = target_path.parent().ok_or_else(|| { + miette!("unexpected root path in target: {}", target_path.display()) + })?; + tokio::fs::create_dir_all(parent) .await .into_diagnostic() - .wrap_err(format!( - "Failed to create directory {} and its parents.", - target_path.parent().unwrap().to_str().unwrap() - ))?; + .wrap_err_with(|| { + format!( + "failed to create directory {} and its parents", + parent.display() + ) + })?; tokio::fs::copy(entry, target_path) .await @@ -391,8 +500,14 @@ impl PackageStore { /// # Returns /// /// A sorted vector of paths to all `.proto` files in the package's vendor directory. - pub async fn populated_files(&self, manifest: &PackageManifest) -> Vec { - self.collect(&self.populated_path(manifest), true).await + pub async fn populated_files( + &self, + manifest: &PackageManifest, + ) -> miette::Result> { + // Don't re-apply include/exclude here: files were already filtered + // by populate() when they were copied into the vendor directory. + self.collect(&self.populated_path(manifest), true, None, None) + .await } } @@ -403,14 +518,323 @@ pub struct Entry { pub metadata: Option, } -#[test] -fn can_get_proto_path() { - assert_eq!( - PackageStore::new("/tmp".into()).proto_path(), - PathBuf::from("/tmp/proto") - ); - assert_eq!( - PackageStore::new("/tmp".into()).proto_vendor_path(), - PathBuf::from("/tmp/proto/vendor") - ); +#[cfg(test)] +mod tests { + use super::*; + use crate::package::PackageType; + + #[test] + fn can_get_proto_path() { + assert_eq!( + PackageStore::new("/tmp".into()).proto_path(), + PathBuf::from("/tmp/proto") + ); + assert_eq!( + PackageStore::new("/tmp".into()).proto_vendor_path(), + PathBuf::from("/tmp/proto/vendor") + ); + } + + /// Helper to create a test directory structure for collect() tests: + /// + /// ```text + /// proto/ + /// hello.proto + /// subdir/ + /// nested.proto + /// excluded.proto + /// vendor/ + /// dep/ + /// dep.proto + /// ``` + fn setup_test_dir(tmp: &Path) -> PackageStore { + let proto = tmp.join("proto"); + let subdir = proto.join("subdir"); + let vendor = proto.join("vendor"); + let dep = vendor.join("dep"); + + std::fs::create_dir_all(&subdir).unwrap(); + std::fs::create_dir_all(&dep).unwrap(); + + std::fs::write(proto.join("hello.proto"), "syntax = \"proto3\";").unwrap(); + std::fs::write(subdir.join("nested.proto"), "syntax = \"proto3\";").unwrap(); + std::fs::write(proto.join("excluded.proto"), "syntax = \"proto3\";").unwrap(); + std::fs::write(dep.join("dep.proto"), "syntax = \"proto3\";").unwrap(); + + PackageStore::new(tmp.to_path_buf()) + } + + /// Strip the prefix and collect file names for easier assertion + fn relative_paths(paths: &[PathBuf], base: &Path) -> Vec { + let mut result: Vec = paths + .iter() + .map(|p| p.strip_prefix(base).unwrap().to_string_lossy().to_string()) + .collect(); + result.sort(); + result + } + + #[tokio::test] + async fn collect_default_only_proto_files() { + let tmp = tempfile::tempdir().unwrap(); + let store = setup_test_dir(tmp.path()); + + // Also create a non-proto file to verify it's excluded + std::fs::write(store.proto_path().join("readme.txt"), "not a proto").unwrap(); + + let paths = store + .collect(&store.proto_path(), false, None, None) + .await + .unwrap(); + + let names = relative_paths(&paths, &store.proto_path()); + assert_eq!( + names, + vec!["excluded.proto", "hello.proto", "subdir/nested.proto"] + ); + } + + #[tokio::test] + async fn collect_with_include_pattern() { + let tmp = tempfile::tempdir().unwrap(); + let store = setup_test_dir(tmp.path()); + + let include = vec!["subdir/*.proto".to_string()]; + let paths = store + .collect(&store.proto_path(), false, Some(&include), None) + .await + .unwrap(); + + let names = relative_paths(&paths, &store.proto_path()); + assert_eq!(names, vec!["subdir/nested.proto"]); + } + + #[tokio::test] + async fn collect_with_exclude_pattern() { + let tmp = tempfile::tempdir().unwrap(); + let store = setup_test_dir(tmp.path()); + + let exclude = vec!["excluded.proto".to_string()]; + let paths = store + .collect(&store.proto_path(), false, None, Some(&exclude)) + .await + .unwrap(); + + let names = relative_paths(&paths, &store.proto_path()); + assert_eq!(names, vec!["hello.proto", "subdir/nested.proto"]); + } + + #[tokio::test] + async fn collect_with_exclude_starts_from_all_files() { + let tmp = tempfile::tempdir().unwrap(); + let store = setup_test_dir(tmp.path()); + + // A non-.proto file should be picked up when exclude is set, + // since exclude starts from the set of all files. + std::fs::write(store.proto_path().join("readme.txt"), "hello").unwrap(); + + let exclude = vec!["excluded.proto".to_string()]; + let paths = store + .collect(&store.proto_path(), false, None, Some(&exclude)) + .await + .unwrap(); + + let names = relative_paths(&paths, &store.proto_path()); + assert_eq!( + names, + vec!["hello.proto", "readme.txt", "subdir/nested.proto"] + ); + } + + #[tokio::test] + async fn collect_with_empty_include_yields_no_files() { + let tmp = tempfile::tempdir().unwrap(); + let store = setup_test_dir(tmp.path()); + + // `include = []` means "include nothing matching": no files + // should be collected, even though the manifest and lockfile + // are added separately by the packaging layer. + let paths = store + .collect(&store.proto_path(), false, Some(&[]), None) + .await + .unwrap(); + + assert!(paths.is_empty(), "expected no files, got {paths:?}"); + } + + #[tokio::test] + async fn collect_with_empty_exclude_includes_all_files() { + let tmp = tempfile::tempdir().unwrap(); + let store = setup_test_dir(tmp.path()); + + // `exclude = []` must be distinct from omitting exclude: it + // means "start from all files, exclude nothing", so even + // non-.proto files are bundled. + std::fs::write(store.proto_path().join("readme.txt"), "hello").unwrap(); + + let paths = store + .collect(&store.proto_path(), false, None, Some(&[])) + .await + .unwrap(); + + let names = relative_paths(&paths, &store.proto_path()); + assert_eq!( + names, + vec![ + "excluded.proto", + "hello.proto", + "readme.txt", + "subdir/nested.proto" + ] + ); + } + + #[tokio::test] + async fn collect_excludes_vendor_when_not_vendored() { + let tmp = tempfile::tempdir().unwrap(); + let store = setup_test_dir(tmp.path()); + + let paths = store + .collect(&store.proto_path(), false, None, None) + .await + .unwrap(); + + let names = relative_paths(&paths, &store.proto_path()); + assert!( + !names.iter().any(|n| n.starts_with("vendor/")), + "vendor files should not be included when vendored=false" + ); + } + + #[tokio::test] + async fn collect_includes_vendor_when_vendored() { + let tmp = tempfile::tempdir().unwrap(); + let store = setup_test_dir(tmp.path()); + + let paths = store + .collect(&store.proto_path(), true, None, None) + .await + .unwrap(); + + let names = relative_paths(&paths, &store.proto_path()); + assert!( + names.iter().any(|n| n.starts_with("vendor/")), + "vendor files should be included when vendored=true" + ); + } + + #[tokio::test] + async fn collect_returns_only_files() { + let tmp = tempfile::tempdir().unwrap(); + let store = setup_test_dir(tmp.path()); + + let paths = store + .collect(&store.proto_path(), true, None, None) + .await + .unwrap(); + + for path in &paths { + assert!( + path.is_file(), + "{} should be a file, not a directory", + path.display() + ); + } + } + + #[tokio::test] + async fn collect_returns_only_files_with_include() { + let tmp = tempfile::tempdir().unwrap(); + let store = setup_test_dir(tmp.path()); + + let include = vec!["**/*.proto".to_string()]; + let paths = store + .collect(&store.proto_path(), true, Some(&include), None) + .await + .unwrap(); + + for path in &paths { + assert!( + path.is_file(), + "{} should be a file, not a directory", + path.display() + ); + } + } + + #[tokio::test] + async fn collect_invalid_include_glob_returns_error() { + let tmp = tempfile::tempdir().unwrap(); + let store = setup_test_dir(tmp.path()); + + let include = vec!["[invalid".to_string()]; + let result = store + .collect(&store.proto_path(), false, Some(&include), None) + .await; + + assert!( + result.is_err(), + "invalid include glob should produce an error" + ); + } + + #[tokio::test] + async fn collect_invalid_exclude_glob_returns_error() { + let tmp = tempfile::tempdir().unwrap(); + let store = setup_test_dir(tmp.path()); + + let exclude = vec!["[invalid".to_string()]; + let result = store + .collect(&store.proto_path(), false, None, Some(&exclude)) + .await; + + assert!( + result.is_err(), + "invalid exclude glob should produce an error" + ); + } + + #[tokio::test] + async fn populate_with_include_filters_files() { + let tmp = tempfile::tempdir().unwrap(); + let store = setup_test_dir(tmp.path()); + + let manifest = PackageManifest { + kind: PackageType::Lib, + name: PackageName::new("test-pkg").unwrap(), + version: semver::Version::new(0, 1, 0), + description: None, + include: Some(vec!["hello.proto".to_string()]), + exclude: Default::default(), + }; + + store.populate(&manifest).await.unwrap(); + + let target_dir = store.proto_vendor_path().join("test-pkg"); + assert!(target_dir.join("hello.proto").exists()); + assert!(!target_dir.join("excluded.proto").exists()); + assert!(!target_dir.join("subdir/nested.proto").exists()); + } + + #[tokio::test] + async fn populate_with_exclude_filters_files() { + let tmp = tempfile::tempdir().unwrap(); + let store = setup_test_dir(tmp.path()); + + let manifest = PackageManifest { + kind: PackageType::Lib, + name: PackageName::new("test-pkg").unwrap(), + version: semver::Version::new(0, 1, 0), + description: None, + include: None, + exclude: Some(vec!["excluded.proto".to_string()]), + }; + + store.populate(&manifest).await.unwrap(); + + let target_dir = store.proto_vendor_path().join("test-pkg"); + assert!(target_dir.join("hello.proto").exists()); + assert!(target_dir.join("subdir/nested.proto").exists()); + assert!(!target_dir.join("excluded.proto").exists()); + } } diff --git a/src/registry/cache.rs b/src/registry/cache.rs index fbdc18e4..6ffc7d74 100644 --- a/src/registry/cache.rs +++ b/src/registry/cache.rs @@ -121,6 +121,8 @@ mod tests { name: "test-api".parse().unwrap(), version: "0.1.0".parse().unwrap(), description: None, + include: Default::default(), + exclude: Default::default(), }) .dependencies(Default::default()) .build(); diff --git a/src/validation/rules.rs b/src/validation/rules.rs index aff0ab58..41542a8e 100644 --- a/src/validation/rules.rs +++ b/src/validation/rules.rs @@ -136,6 +136,8 @@ mod tests { name: crate::package::PackageName::new("package")?, version: Version::new(0, 1, 0), description: Default::default(), + include: Default::default(), + exclude: Default::default(), }; let all = all(&manifest) @@ -162,6 +164,8 @@ mod tests { name: crate::package::PackageName::new("package")?, version: Version::new(0, 1, 0), description: Default::default(), + include: Default::default(), + exclude: Default::default(), }; let all = all(&manifest) diff --git a/tests/cmd/add/out/Proto.toml b/tests/cmd/add/out/Proto.toml index 52538d5b..c46d87e4 100644 --- a/tests/cmd/add/out/Proto.toml +++ b/tests/cmd/add/out/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "lib" diff --git a/tests/cmd/init/api/out/Proto.toml b/tests/cmd/init/api/out/Proto.toml index bd1bdea0..dc7e58da 100644 --- a/tests/cmd/init/api/out/Proto.toml +++ b/tests/cmd/init/api/out/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "api" diff --git a/tests/cmd/init/default/out/Proto.toml b/tests/cmd/init/default/out/Proto.toml index 08b037af..333e6235 100644 --- a/tests/cmd/init/default/out/Proto.toml +++ b/tests/cmd/init/default/out/Proto.toml @@ -1,3 +1,3 @@ -edition = "0.13" +edition = "0.14" [dependencies] diff --git a/tests/cmd/init/lib/out/Proto.toml b/tests/cmd/init/lib/out/Proto.toml index f0a7d703..9796221c 100644 --- a/tests/cmd/init/lib/out/Proto.toml +++ b/tests/cmd/init/lib/out/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "lib" diff --git a/tests/cmd/install/package/local/out/proto/vendor/some-local-api/Proto.toml b/tests/cmd/install/package/local/out/proto/vendor/some-local-api/Proto.toml index b7b115fb..ef60c5e8 100644 --- a/tests/cmd/install/package/local/out/proto/vendor/some-local-api/Proto.toml +++ b/tests/cmd/install/package/local/out/proto/vendor/some-local-api/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "api" diff --git a/tests/cmd/install/package/lockfile/stale/in/Proto.toml b/tests/cmd/install/package/lockfile/stale/in/Proto.toml index f2479688..1ca4f453 100644 --- a/tests/cmd/install/package/lockfile/stale/in/Proto.toml +++ b/tests/cmd/install/package/lockfile/stale/in/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "api" diff --git a/tests/cmd/install/package/offline/in/Proto.toml b/tests/cmd/install/package/offline/in/Proto.toml index 9925e253..59bf32d8 100644 --- a/tests/cmd/install/package/offline/in/Proto.toml +++ b/tests/cmd/install/package/offline/in/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "lib" diff --git a/tests/cmd/install/package/online/in/Proto.toml b/tests/cmd/install/package/online/in/Proto.toml index 9925e253..59bf32d8 100644 --- a/tests/cmd/install/package/online/in/Proto.toml +++ b/tests/cmd/install/package/online/in/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "lib" diff --git a/tests/cmd/install/workspace/creates_lockfile/in/Proto.toml b/tests/cmd/install/workspace/creates_lockfile/in/Proto.toml index 0e8669f9..e1773c12 100644 --- a/tests/cmd/install/workspace/creates_lockfile/in/Proto.toml +++ b/tests/cmd/install/workspace/creates_lockfile/in/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [workspace] members = ["pkg1", "pkg2"] diff --git a/tests/cmd/install/workspace/creates_lockfile/in/pkg1/Proto.toml b/tests/cmd/install/workspace/creates_lockfile/in/pkg1/Proto.toml index ced8ab36..4754388e 100644 --- a/tests/cmd/install/workspace/creates_lockfile/in/pkg1/Proto.toml +++ b/tests/cmd/install/workspace/creates_lockfile/in/pkg1/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "lib" diff --git a/tests/cmd/install/workspace/creates_lockfile/in/pkg2/Proto.toml b/tests/cmd/install/workspace/creates_lockfile/in/pkg2/Proto.toml index e5c7ff2c..c6ba2b3d 100644 --- a/tests/cmd/install/workspace/creates_lockfile/in/pkg2/Proto.toml +++ b/tests/cmd/install/workspace/creates_lockfile/in/pkg2/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "lib" diff --git a/tests/cmd/install/workspace/creates_lockfile/out/Proto.toml b/tests/cmd/install/workspace/creates_lockfile/out/Proto.toml index 0e8669f9..e1773c12 100644 --- a/tests/cmd/install/workspace/creates_lockfile/out/Proto.toml +++ b/tests/cmd/install/workspace/creates_lockfile/out/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [workspace] members = ["pkg1", "pkg2"] diff --git a/tests/cmd/install/workspace/creates_lockfile/out/pkg1/Proto.toml b/tests/cmd/install/workspace/creates_lockfile/out/pkg1/Proto.toml index 44cef28b..8d981cd9 100644 --- a/tests/cmd/install/workspace/creates_lockfile/out/pkg1/Proto.toml +++ b/tests/cmd/install/workspace/creates_lockfile/out/pkg1/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "lib" diff --git a/tests/cmd/install/workspace/creates_lockfile/out/pkg1/proto/vendor/remote-lib/Proto.toml b/tests/cmd/install/workspace/creates_lockfile/out/pkg1/proto/vendor/remote-lib/Proto.toml index ced697e1..6bfeaf90 100644 --- a/tests/cmd/install/workspace/creates_lockfile/out/pkg1/proto/vendor/remote-lib/Proto.toml +++ b/tests/cmd/install/workspace/creates_lockfile/out/pkg1/proto/vendor/remote-lib/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "lib" diff --git a/tests/cmd/install/workspace/creates_lockfile/out/pkg2/Proto.toml b/tests/cmd/install/workspace/creates_lockfile/out/pkg2/Proto.toml index e5c7ff2c..c6ba2b3d 100644 --- a/tests/cmd/install/workspace/creates_lockfile/out/pkg2/Proto.toml +++ b/tests/cmd/install/workspace/creates_lockfile/out/pkg2/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "lib" diff --git a/tests/cmd/install/workspace/creates_lockfile/out/pkg2/proto/vendor/remote-lib/Proto.toml b/tests/cmd/install/workspace/creates_lockfile/out/pkg2/proto/vendor/remote-lib/Proto.toml index ced697e1..6bfeaf90 100644 --- a/tests/cmd/install/workspace/creates_lockfile/out/pkg2/proto/vendor/remote-lib/Proto.toml +++ b/tests/cmd/install/workspace/creates_lockfile/out/pkg2/proto/vendor/remote-lib/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "lib" diff --git a/tests/cmd/install/workspace/creates_lockfile/out/pkg2/proto/vendor/workspace-pkg1/Proto.toml b/tests/cmd/install/workspace/creates_lockfile/out/pkg2/proto/vendor/workspace-pkg1/Proto.toml index 44cef28b..8d981cd9 100644 --- a/tests/cmd/install/workspace/creates_lockfile/out/pkg2/proto/vendor/workspace-pkg1/Proto.toml +++ b/tests/cmd/install/workspace/creates_lockfile/out/pkg2/proto/vendor/workspace-pkg1/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "lib" diff --git a/tests/cmd/install/workspace/creates_lockfile/out/remote-lib/Proto.toml b/tests/cmd/install/workspace/creates_lockfile/out/remote-lib/Proto.toml index ced697e1..6bfeaf90 100644 --- a/tests/cmd/install/workspace/creates_lockfile/out/remote-lib/Proto.toml +++ b/tests/cmd/install/workspace/creates_lockfile/out/remote-lib/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "lib" diff --git a/tests/cmd/install/workspace/lockfile/stale/in/Proto.toml b/tests/cmd/install/workspace/lockfile/stale/in/Proto.toml index 0e8669f9..e1773c12 100644 --- a/tests/cmd/install/workspace/lockfile/stale/in/Proto.toml +++ b/tests/cmd/install/workspace/lockfile/stale/in/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [workspace] members = ["pkg1", "pkg2"] diff --git a/tests/cmd/install/workspace/lockfile/stale/in/pkg1/Proto.toml b/tests/cmd/install/workspace/lockfile/stale/in/pkg1/Proto.toml index ced8ab36..4754388e 100644 --- a/tests/cmd/install/workspace/lockfile/stale/in/pkg1/Proto.toml +++ b/tests/cmd/install/workspace/lockfile/stale/in/pkg1/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "lib" diff --git a/tests/cmd/install/workspace/lockfile/stale/in/pkg2/Proto.toml b/tests/cmd/install/workspace/lockfile/stale/in/pkg2/Proto.toml index 5504fb01..93fe0370 100644 --- a/tests/cmd/install/workspace/lockfile/stale/in/pkg2/Proto.toml +++ b/tests/cmd/install/workspace/lockfile/stale/in/pkg2/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "lib" diff --git a/tests/cmd/install/workspace/lockfile_diamond_dependencies/in/Proto.toml b/tests/cmd/install/workspace/lockfile_diamond_dependencies/in/Proto.toml index 0e8669f9..e1773c12 100644 --- a/tests/cmd/install/workspace/lockfile_diamond_dependencies/in/Proto.toml +++ b/tests/cmd/install/workspace/lockfile_diamond_dependencies/in/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [workspace] members = ["pkg1", "pkg2"] diff --git a/tests/cmd/install/workspace/lockfile_diamond_dependencies/in/pkg1/Proto.toml b/tests/cmd/install/workspace/lockfile_diamond_dependencies/in/pkg1/Proto.toml index ced8ab36..4754388e 100644 --- a/tests/cmd/install/workspace/lockfile_diamond_dependencies/in/pkg1/Proto.toml +++ b/tests/cmd/install/workspace/lockfile_diamond_dependencies/in/pkg1/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "lib" diff --git a/tests/cmd/install/workspace/lockfile_diamond_dependencies/in/pkg2/Proto.toml b/tests/cmd/install/workspace/lockfile_diamond_dependencies/in/pkg2/Proto.toml index 5504fb01..93fe0370 100644 --- a/tests/cmd/install/workspace/lockfile_diamond_dependencies/in/pkg2/Proto.toml +++ b/tests/cmd/install/workspace/lockfile_diamond_dependencies/in/pkg2/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "lib" diff --git a/tests/cmd/install/workspace/lockfile_diamond_dependencies/out/Proto.toml b/tests/cmd/install/workspace/lockfile_diamond_dependencies/out/Proto.toml index 0e8669f9..e1773c12 100644 --- a/tests/cmd/install/workspace/lockfile_diamond_dependencies/out/Proto.toml +++ b/tests/cmd/install/workspace/lockfile_diamond_dependencies/out/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [workspace] members = ["pkg1", "pkg2"] diff --git a/tests/cmd/install/workspace/lockfile_diamond_dependencies/out/pkg1/Proto.toml b/tests/cmd/install/workspace/lockfile_diamond_dependencies/out/pkg1/Proto.toml index de3d7825..7e3bb215 100644 --- a/tests/cmd/install/workspace/lockfile_diamond_dependencies/out/pkg1/Proto.toml +++ b/tests/cmd/install/workspace/lockfile_diamond_dependencies/out/pkg1/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "lib" diff --git a/tests/cmd/install/workspace/lockfile_diamond_dependencies/out/pkg1/proto/vendor/lib-a/Proto.toml b/tests/cmd/install/workspace/lockfile_diamond_dependencies/out/pkg1/proto/vendor/lib-a/Proto.toml index 3d59ade8..23ef390a 100644 --- a/tests/cmd/install/workspace/lockfile_diamond_dependencies/out/pkg1/proto/vendor/lib-a/Proto.toml +++ b/tests/cmd/install/workspace/lockfile_diamond_dependencies/out/pkg1/proto/vendor/lib-a/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "lib" diff --git a/tests/cmd/install/workspace/lockfile_diamond_dependencies/out/pkg1/proto/vendor/lib-b/Proto.toml b/tests/cmd/install/workspace/lockfile_diamond_dependencies/out/pkg1/proto/vendor/lib-b/Proto.toml index 2cc61e5d..7c7059ba 100644 --- a/tests/cmd/install/workspace/lockfile_diamond_dependencies/out/pkg1/proto/vendor/lib-b/Proto.toml +++ b/tests/cmd/install/workspace/lockfile_diamond_dependencies/out/pkg1/proto/vendor/lib-b/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "lib" diff --git a/tests/cmd/install/workspace/lockfile_diamond_dependencies/out/pkg2/Proto.toml b/tests/cmd/install/workspace/lockfile_diamond_dependencies/out/pkg2/Proto.toml index 5b2aa30d..4f86f1b5 100644 --- a/tests/cmd/install/workspace/lockfile_diamond_dependencies/out/pkg2/Proto.toml +++ b/tests/cmd/install/workspace/lockfile_diamond_dependencies/out/pkg2/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "lib" diff --git a/tests/cmd/install/workspace/lockfile_diamond_dependencies/out/pkg2/proto/vendor/lib-a/Proto.toml b/tests/cmd/install/workspace/lockfile_diamond_dependencies/out/pkg2/proto/vendor/lib-a/Proto.toml index 3d59ade8..23ef390a 100644 --- a/tests/cmd/install/workspace/lockfile_diamond_dependencies/out/pkg2/proto/vendor/lib-a/Proto.toml +++ b/tests/cmd/install/workspace/lockfile_diamond_dependencies/out/pkg2/proto/vendor/lib-a/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "lib" diff --git a/tests/cmd/install/workspace/lockfile_diamond_dependencies/out/pkg2/proto/vendor/lib-b/Proto.toml b/tests/cmd/install/workspace/lockfile_diamond_dependencies/out/pkg2/proto/vendor/lib-b/Proto.toml index 2cc61e5d..7c7059ba 100644 --- a/tests/cmd/install/workspace/lockfile_diamond_dependencies/out/pkg2/proto/vendor/lib-b/Proto.toml +++ b/tests/cmd/install/workspace/lockfile_diamond_dependencies/out/pkg2/proto/vendor/lib-b/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "lib" diff --git a/tests/cmd/install/workspace/lockfile_multiple_versions/in/Proto.toml b/tests/cmd/install/workspace/lockfile_multiple_versions/in/Proto.toml index 0e8669f9..e1773c12 100644 --- a/tests/cmd/install/workspace/lockfile_multiple_versions/in/Proto.toml +++ b/tests/cmd/install/workspace/lockfile_multiple_versions/in/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [workspace] members = ["pkg1", "pkg2"] diff --git a/tests/cmd/install/workspace/lockfile_multiple_versions/in/pkg1/Proto.toml b/tests/cmd/install/workspace/lockfile_multiple_versions/in/pkg1/Proto.toml index ced8ab36..4754388e 100644 --- a/tests/cmd/install/workspace/lockfile_multiple_versions/in/pkg1/Proto.toml +++ b/tests/cmd/install/workspace/lockfile_multiple_versions/in/pkg1/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "lib" diff --git a/tests/cmd/install/workspace/lockfile_multiple_versions/in/pkg2/Proto.toml b/tests/cmd/install/workspace/lockfile_multiple_versions/in/pkg2/Proto.toml index 5504fb01..93fe0370 100644 --- a/tests/cmd/install/workspace/lockfile_multiple_versions/in/pkg2/Proto.toml +++ b/tests/cmd/install/workspace/lockfile_multiple_versions/in/pkg2/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "lib" diff --git a/tests/cmd/install/workspace/lockfile_multiple_versions/out/Proto.toml b/tests/cmd/install/workspace/lockfile_multiple_versions/out/Proto.toml index 0e8669f9..e1773c12 100644 --- a/tests/cmd/install/workspace/lockfile_multiple_versions/out/Proto.toml +++ b/tests/cmd/install/workspace/lockfile_multiple_versions/out/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [workspace] members = ["pkg1", "pkg2"] diff --git a/tests/cmd/install/workspace/lockfile_multiple_versions/out/pkg1/Proto.toml b/tests/cmd/install/workspace/lockfile_multiple_versions/out/pkg1/Proto.toml index 2ca2f9e3..f48bd09d 100644 --- a/tests/cmd/install/workspace/lockfile_multiple_versions/out/pkg1/Proto.toml +++ b/tests/cmd/install/workspace/lockfile_multiple_versions/out/pkg1/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "lib" diff --git a/tests/cmd/install/workspace/lockfile_multiple_versions/out/pkg1/proto/vendor/remote-lib/Proto.toml b/tests/cmd/install/workspace/lockfile_multiple_versions/out/pkg1/proto/vendor/remote-lib/Proto.toml index dc2a4a53..344a3527 100644 --- a/tests/cmd/install/workspace/lockfile_multiple_versions/out/pkg1/proto/vendor/remote-lib/Proto.toml +++ b/tests/cmd/install/workspace/lockfile_multiple_versions/out/pkg1/proto/vendor/remote-lib/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "lib" diff --git a/tests/cmd/install/workspace/lockfile_multiple_versions/out/pkg2/Proto.toml b/tests/cmd/install/workspace/lockfile_multiple_versions/out/pkg2/Proto.toml index 7a3ca802..b35c26da 100644 --- a/tests/cmd/install/workspace/lockfile_multiple_versions/out/pkg2/Proto.toml +++ b/tests/cmd/install/workspace/lockfile_multiple_versions/out/pkg2/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "lib" diff --git a/tests/cmd/install/workspace/lockfile_multiple_versions/out/pkg2/proto/vendor/remote-lib/Proto.toml b/tests/cmd/install/workspace/lockfile_multiple_versions/out/pkg2/proto/vendor/remote-lib/Proto.toml index 1834926c..630df55b 100644 --- a/tests/cmd/install/workspace/lockfile_multiple_versions/out/pkg2/proto/vendor/remote-lib/Proto.toml +++ b/tests/cmd/install/workspace/lockfile_multiple_versions/out/pkg2/proto/vendor/remote-lib/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "lib" diff --git a/tests/cmd/install/workspace/lockfile_transitive/in/Proto.toml b/tests/cmd/install/workspace/lockfile_transitive/in/Proto.toml index 0e8669f9..e1773c12 100644 --- a/tests/cmd/install/workspace/lockfile_transitive/in/Proto.toml +++ b/tests/cmd/install/workspace/lockfile_transitive/in/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [workspace] members = ["pkg1", "pkg2"] diff --git a/tests/cmd/install/workspace/lockfile_transitive/in/pkg1/Proto.toml b/tests/cmd/install/workspace/lockfile_transitive/in/pkg1/Proto.toml index ced8ab36..4754388e 100644 --- a/tests/cmd/install/workspace/lockfile_transitive/in/pkg1/Proto.toml +++ b/tests/cmd/install/workspace/lockfile_transitive/in/pkg1/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "lib" diff --git a/tests/cmd/install/workspace/lockfile_transitive/in/pkg2/Proto.toml b/tests/cmd/install/workspace/lockfile_transitive/in/pkg2/Proto.toml index 5baea8ac..d917eb1e 100644 --- a/tests/cmd/install/workspace/lockfile_transitive/in/pkg2/Proto.toml +++ b/tests/cmd/install/workspace/lockfile_transitive/in/pkg2/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "lib" diff --git a/tests/cmd/install/workspace/lockfile_transitive/out/Proto.toml b/tests/cmd/install/workspace/lockfile_transitive/out/Proto.toml index 0e8669f9..e1773c12 100644 --- a/tests/cmd/install/workspace/lockfile_transitive/out/Proto.toml +++ b/tests/cmd/install/workspace/lockfile_transitive/out/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [workspace] members = ["pkg1", "pkg2"] diff --git a/tests/cmd/install/workspace/lockfile_transitive/out/pkg1/Proto.toml b/tests/cmd/install/workspace/lockfile_transitive/out/pkg1/Proto.toml index 2ca2f9e3..f48bd09d 100644 --- a/tests/cmd/install/workspace/lockfile_transitive/out/pkg1/Proto.toml +++ b/tests/cmd/install/workspace/lockfile_transitive/out/pkg1/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "lib" diff --git a/tests/cmd/install/workspace/lockfile_transitive/out/pkg1/proto/vendor/remote-lib/Proto.toml b/tests/cmd/install/workspace/lockfile_transitive/out/pkg1/proto/vendor/remote-lib/Proto.toml index dc2a4a53..344a3527 100644 --- a/tests/cmd/install/workspace/lockfile_transitive/out/pkg1/proto/vendor/remote-lib/Proto.toml +++ b/tests/cmd/install/workspace/lockfile_transitive/out/pkg1/proto/vendor/remote-lib/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "lib" diff --git a/tests/cmd/install/workspace/lockfile_transitive/out/pkg2/Proto.toml b/tests/cmd/install/workspace/lockfile_transitive/out/pkg2/Proto.toml index 5baea8ac..d917eb1e 100644 --- a/tests/cmd/install/workspace/lockfile_transitive/out/pkg2/Proto.toml +++ b/tests/cmd/install/workspace/lockfile_transitive/out/pkg2/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "lib" diff --git a/tests/cmd/install/workspace/lockfile_transitive/out/pkg2/proto/vendor/remote-lib/Proto.toml b/tests/cmd/install/workspace/lockfile_transitive/out/pkg2/proto/vendor/remote-lib/Proto.toml index dc2a4a53..344a3527 100644 --- a/tests/cmd/install/workspace/lockfile_transitive/out/pkg2/proto/vendor/remote-lib/Proto.toml +++ b/tests/cmd/install/workspace/lockfile_transitive/out/pkg2/proto/vendor/remote-lib/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "lib" diff --git a/tests/cmd/install/workspace/lockfile_transitive/out/pkg2/proto/vendor/workspace-pkg1/Proto.toml b/tests/cmd/install/workspace/lockfile_transitive/out/pkg2/proto/vendor/workspace-pkg1/Proto.toml index 2ca2f9e3..f48bd09d 100644 --- a/tests/cmd/install/workspace/lockfile_transitive/out/pkg2/proto/vendor/workspace-pkg1/Proto.toml +++ b/tests/cmd/install/workspace/lockfile_transitive/out/pkg2/proto/vendor/workspace-pkg1/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "lib" diff --git a/tests/cmd/lock/print_files/package/in/Proto.toml b/tests/cmd/lock/print_files/package/in/Proto.toml index 0e8669f9..e1773c12 100644 --- a/tests/cmd/lock/print_files/package/in/Proto.toml +++ b/tests/cmd/lock/print_files/package/in/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [workspace] members = ["pkg1", "pkg2"] diff --git a/tests/cmd/lock/print_files/workspace/in/Proto.toml b/tests/cmd/lock/print_files/workspace/in/Proto.toml index 0e8669f9..e1773c12 100644 --- a/tests/cmd/lock/print_files/workspace/in/Proto.toml +++ b/tests/cmd/lock/print_files/workspace/in/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [workspace] members = ["pkg1", "pkg2"] diff --git a/tests/cmd/package/out/lib-0.0.1.tgz b/tests/cmd/package/out/lib-0.0.1.tgz index 7611d128..5a4a83e2 100644 Binary files a/tests/cmd/package/out/lib-0.0.1.tgz and b/tests/cmd/package/out/lib-0.0.1.tgz differ diff --git a/tests/cmd/publish/local/in/proto/vendor/some-local-lib/Proto.toml b/tests/cmd/publish/local/in/proto/vendor/some-local-lib/Proto.toml index 378f5654..d5f4a565 100644 --- a/tests/cmd/publish/local/in/proto/vendor/some-local-lib/Proto.toml +++ b/tests/cmd/publish/local/in/proto/vendor/some-local-lib/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "lib" diff --git a/tests/cmd/publish/local/out/proto/vendor/some-local-lib/Proto.toml b/tests/cmd/publish/local/out/proto/vendor/some-local-lib/Proto.toml index 378f5654..d5f4a565 100644 --- a/tests/cmd/publish/local/out/proto/vendor/some-local-lib/Proto.toml +++ b/tests/cmd/publish/local/out/proto/vendor/some-local-lib/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "lib" diff --git a/tests/cmd/publish/workspace/set_version/in/Proto.toml b/tests/cmd/publish/workspace/set_version/in/Proto.toml index ddebdf98..dd7e02be 100644 --- a/tests/cmd/publish/workspace/set_version/in/Proto.toml +++ b/tests/cmd/publish/workspace/set_version/in/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [workspace] members = ["pkg-a", "pkg-b"] diff --git a/tests/cmd/publish/workspace/set_version/in/pkg-a/Proto.toml b/tests/cmd/publish/workspace/set_version/in/pkg-a/Proto.toml index 32859dce..d67698e8 100644 --- a/tests/cmd/publish/workspace/set_version/in/pkg-a/Proto.toml +++ b/tests/cmd/publish/workspace/set_version/in/pkg-a/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "lib" diff --git a/tests/cmd/publish/workspace/set_version/in/pkg-b/Proto.toml b/tests/cmd/publish/workspace/set_version/in/pkg-b/Proto.toml index 4299bff1..d8147ae8 100644 --- a/tests/cmd/publish/workspace/set_version/in/pkg-b/Proto.toml +++ b/tests/cmd/publish/workspace/set_version/in/pkg-b/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "lib" diff --git a/tests/cmd/publish/workspace/set_version/out/Proto.toml b/tests/cmd/publish/workspace/set_version/out/Proto.toml index ddebdf98..dd7e02be 100644 --- a/tests/cmd/publish/workspace/set_version/out/Proto.toml +++ b/tests/cmd/publish/workspace/set_version/out/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [workspace] members = ["pkg-a", "pkg-b"] diff --git a/tests/cmd/publish/workspace/set_version/out/pkg-a/Proto.toml b/tests/cmd/publish/workspace/set_version/out/pkg-a/Proto.toml index 32859dce..d67698e8 100644 --- a/tests/cmd/publish/workspace/set_version/out/pkg-a/Proto.toml +++ b/tests/cmd/publish/workspace/set_version/out/pkg-a/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "lib" diff --git a/tests/cmd/publish/workspace/set_version/out/pkg-b/Proto.toml b/tests/cmd/publish/workspace/set_version/out/pkg-b/Proto.toml index 4299bff1..d8147ae8 100644 --- a/tests/cmd/publish/workspace/set_version/out/pkg-b/Proto.toml +++ b/tests/cmd/publish/workspace/set_version/out/pkg-b/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "lib" diff --git a/tests/cmd/publish/workspace/set_version_with_local_deps/in/Proto.toml b/tests/cmd/publish/workspace/set_version_with_local_deps/in/Proto.toml index c1d05bcb..71c7c550 100644 --- a/tests/cmd/publish/workspace/set_version_with_local_deps/in/Proto.toml +++ b/tests/cmd/publish/workspace/set_version_with_local_deps/in/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [workspace] members = ["lib-a", "api-b"] diff --git a/tests/cmd/publish/workspace/set_version_with_local_deps/in/api-b/Proto.toml b/tests/cmd/publish/workspace/set_version_with_local_deps/in/api-b/Proto.toml index ab90723d..e4fe63eb 100644 --- a/tests/cmd/publish/workspace/set_version_with_local_deps/in/api-b/Proto.toml +++ b/tests/cmd/publish/workspace/set_version_with_local_deps/in/api-b/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "api" diff --git a/tests/cmd/publish/workspace/set_version_with_local_deps/in/lib-a/Proto.toml b/tests/cmd/publish/workspace/set_version_with_local_deps/in/lib-a/Proto.toml index 53569b03..c2f1adf6 100644 --- a/tests/cmd/publish/workspace/set_version_with_local_deps/in/lib-a/Proto.toml +++ b/tests/cmd/publish/workspace/set_version_with_local_deps/in/lib-a/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "lib" diff --git a/tests/cmd/publish/workspace/set_version_with_local_deps/out/Proto.toml b/tests/cmd/publish/workspace/set_version_with_local_deps/out/Proto.toml index c1d05bcb..71c7c550 100644 --- a/tests/cmd/publish/workspace/set_version_with_local_deps/out/Proto.toml +++ b/tests/cmd/publish/workspace/set_version_with_local_deps/out/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [workspace] members = ["lib-a", "api-b"] diff --git a/tests/cmd/publish/workspace/set_version_with_local_deps/out/api-b/Proto.toml b/tests/cmd/publish/workspace/set_version_with_local_deps/out/api-b/Proto.toml index ab90723d..e4fe63eb 100644 --- a/tests/cmd/publish/workspace/set_version_with_local_deps/out/api-b/Proto.toml +++ b/tests/cmd/publish/workspace/set_version_with_local_deps/out/api-b/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "api" diff --git a/tests/cmd/publish/workspace/set_version_with_local_deps/out/lib-a/Proto.toml b/tests/cmd/publish/workspace/set_version_with_local_deps/out/lib-a/Proto.toml index 53569b03..c2f1adf6 100644 --- a/tests/cmd/publish/workspace/set_version_with_local_deps/out/lib-a/Proto.toml +++ b/tests/cmd/publish/workspace/set_version_with_local_deps/out/lib-a/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "lib" diff --git a/tests/cmd/publish/workspace/shared_dep_via_different_paths/in/Proto.toml b/tests/cmd/publish/workspace/shared_dep_via_different_paths/in/Proto.toml index 2120adeb..5fbc985a 100644 --- a/tests/cmd/publish/workspace/shared_dep_via_different_paths/in/Proto.toml +++ b/tests/cmd/publish/workspace/shared_dep_via_different_paths/in/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [workspace] members = ["consumer"] diff --git a/tests/cmd/publish/workspace/shared_dep_via_different_paths/in/api-a/Proto.toml b/tests/cmd/publish/workspace/shared_dep_via_different_paths/in/api-a/Proto.toml index 044af5ce..1b438e18 100644 --- a/tests/cmd/publish/workspace/shared_dep_via_different_paths/in/api-a/Proto.toml +++ b/tests/cmd/publish/workspace/shared_dep_via_different_paths/in/api-a/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "api" diff --git a/tests/cmd/publish/workspace/shared_dep_via_different_paths/in/api-b/Proto.toml b/tests/cmd/publish/workspace/shared_dep_via_different_paths/in/api-b/Proto.toml index c973e0be..6baa6aeb 100644 --- a/tests/cmd/publish/workspace/shared_dep_via_different_paths/in/api-b/Proto.toml +++ b/tests/cmd/publish/workspace/shared_dep_via_different_paths/in/api-b/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "api" diff --git a/tests/cmd/publish/workspace/shared_dep_via_different_paths/in/consumer/Proto.toml b/tests/cmd/publish/workspace/shared_dep_via_different_paths/in/consumer/Proto.toml index f3de41df..1bd46d43 100644 --- a/tests/cmd/publish/workspace/shared_dep_via_different_paths/in/consumer/Proto.toml +++ b/tests/cmd/publish/workspace/shared_dep_via_different_paths/in/consumer/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "api" diff --git a/tests/cmd/publish/workspace/shared_dep_via_different_paths/in/shared-lib/Proto.toml b/tests/cmd/publish/workspace/shared_dep_via_different_paths/in/shared-lib/Proto.toml index 4d778871..204e041a 100644 --- a/tests/cmd/publish/workspace/shared_dep_via_different_paths/in/shared-lib/Proto.toml +++ b/tests/cmd/publish/workspace/shared_dep_via_different_paths/in/shared-lib/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "lib" diff --git a/tests/cmd/tuto/in/build.rs b/tests/cmd/tuto/in/build.rs index 37fc4b1f..f64c4650 100644 --- a/tests/cmd/tuto/in/build.rs +++ b/tests/cmd/tuto/in/build.rs @@ -9,8 +9,9 @@ async fn main() { let protos = PackageStore::current() .await .unwrap() - .collect(store, true) - .await; + .collect(store, true, None, None) + .await + .unwrap(); let includes = &[store]; diff --git a/tests/data/projects/lib/Proto.toml b/tests/data/projects/lib/Proto.toml index b708d3cb..1ddfbcac 100644 --- a/tests/data/projects/lib/Proto.toml +++ b/tests/data/projects/lib/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "lib" diff --git a/tests/nix/package/in/Proto.toml b/tests/nix/package/in/Proto.toml index 2f8aaefc..a7e2162a 100644 --- a/tests/nix/package/in/Proto.toml +++ b/tests/nix/package/in/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "lib" diff --git a/tests/nix/workspace/in/Proto.toml b/tests/nix/workspace/in/Proto.toml index ddebdf98..dd7e02be 100644 --- a/tests/nix/workspace/in/Proto.toml +++ b/tests/nix/workspace/in/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [workspace] members = ["pkg-a", "pkg-b"] diff --git a/tests/nix/workspace/in/pkg-a/Proto.toml b/tests/nix/workspace/in/pkg-a/Proto.toml index 323fa063..ce5f1585 100644 --- a/tests/nix/workspace/in/pkg-a/Proto.toml +++ b/tests/nix/workspace/in/pkg-a/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "lib" diff --git a/tests/nix/workspace/in/pkg-b/Proto.toml b/tests/nix/workspace/in/pkg-b/Proto.toml index bf86b308..5b287af4 100644 --- a/tests/nix/workspace/in/pkg-b/Proto.toml +++ b/tests/nix/workspace/in/pkg-b/Proto.toml @@ -1,4 +1,4 @@ -edition = "0.13" +edition = "0.14" [package] type = "lib" diff --git a/tests/resolver/mod.rs b/tests/resolver/mod.rs index 96819f89..7fb72ffb 100644 --- a/tests/resolver/mod.rs +++ b/tests/resolver/mod.rs @@ -36,6 +36,8 @@ fn create_test_manifest( name: name.parse().expect("valid package name"), version: Version::new(0, 1, 0), description: None, + include: Default::default(), + exclude: Default::default(), }) .dependencies(dependencies) .build() @@ -82,6 +84,8 @@ async fn test_single_local_dependency() { name: "api-package".parse().expect("valid package name"), version: Version::new(0, 1, 0), description: None, + include: Default::default(), + exclude: Default::default(), }) .dependencies(vec![Dependency { package: "lib-package".parse().expect("valid package name"), @@ -136,6 +140,8 @@ async fn test_transitive_dependencies() { name: "lib1".parse().expect("valid package name"), version: Version::new(0, 1, 0), description: None, + include: Default::default(), + exclude: Default::default(), }) .dependencies(vec![Dependency { package: "lib2".parse().expect("valid package name"), @@ -157,6 +163,8 @@ async fn test_transitive_dependencies() { name: "api".parse().expect("valid package name"), version: Version::new(0, 1, 0), description: None, + include: Default::default(), + exclude: Default::default(), }) .dependencies(vec![Dependency { package: "lib1".parse().expect("valid package name"), @@ -220,6 +228,8 @@ async fn test_lib_cannot_depend_on_api() { name: "lib-package".parse().expect("valid package name"), version: Version::new(0, 1, 0), description: None, + include: Default::default(), + exclude: Default::default(), }) .dependencies(vec![Dependency { package: "api-package".parse().expect("valid package name"), @@ -269,6 +279,8 @@ async fn test_api_can_depend_on_lib() { name: "api-package".parse().expect("valid package name"), version: Version::new(0, 1, 0), description: None, + include: Default::default(), + exclude: Default::default(), }) .dependencies(vec![Dependency { package: "lib-package".parse().expect("valid package name"), @@ -312,6 +324,8 @@ async fn test_circular_dependency_direct() { name: "pkg2".parse().expect("valid package name"), version: Version::new(0, 1, 0), description: None, + include: Default::default(), + exclude: Default::default(), }) .dependencies(vec![Dependency { package: "pkg1".parse().expect("valid package name"), @@ -333,6 +347,8 @@ async fn test_circular_dependency_direct() { name: "pkg1".parse().expect("valid package name"), version: Version::new(0, 1, 0), description: None, + include: Default::default(), + exclude: Default::default(), }) .dependencies(vec![Dependency { package: "pkg2".parse().expect("valid package name"), @@ -394,6 +410,8 @@ async fn test_circular_dependency_indirect() { name: "pkg3".parse().expect("valid package name"), version: Version::new(0, 1, 0), description: None, + include: Default::default(), + exclude: Default::default(), }) .dependencies(vec![Dependency { package: "pkg1".parse().expect("valid package name"), @@ -414,6 +432,8 @@ async fn test_circular_dependency_indirect() { name: "pkg2".parse().expect("valid package name"), version: Version::new(0, 1, 0), description: None, + include: Default::default(), + exclude: Default::default(), }) .dependencies(vec![Dependency { package: "pkg3".parse().expect("valid package name"), @@ -434,6 +454,8 @@ async fn test_circular_dependency_indirect() { name: "pkg1".parse().expect("valid package name"), version: Version::new(0, 1, 0), description: None, + include: Default::default(), + exclude: Default::default(), }) .dependencies(vec![Dependency { package: "pkg2".parse().expect("valid package name"), @@ -493,6 +515,8 @@ async fn test_diamond_dependency() { name: "lib1".parse().expect("valid package name"), version: Version::new(0, 1, 0), description: None, + include: Default::default(), + exclude: Default::default(), }) .dependencies(vec![Dependency { package: "common".parse().expect("valid package name"), @@ -517,6 +541,8 @@ async fn test_diamond_dependency() { name: "lib2".parse().expect("valid package name"), version: Version::new(0, 1, 0), description: None, + include: Default::default(), + exclude: Default::default(), }) .dependencies(vec![Dependency { package: "common".parse().expect("valid package name"), @@ -538,6 +564,8 @@ async fn test_diamond_dependency() { name: "api".parse().expect("valid package name"), version: Version::new(0, 1, 0), description: None, + include: Default::default(), + exclude: Default::default(), }) .dependencies(vec![ Dependency { @@ -628,6 +656,8 @@ async fn test_multiple_dependencies_from_single_package() { name: "api".parse().expect("valid package name"), version: Version::new(0, 1, 0), description: None, + include: Default::default(), + exclude: Default::default(), }) .dependencies(vec![ Dependency { @@ -704,6 +734,8 @@ async fn test_local_remote_conflict() { name: "api-package".parse().expect("valid package name"), version: Version::new(0, 1, 0), description: None, + include: Default::default(), + exclude: Default::default(), }) .dependencies(vec![ Dependency { @@ -773,6 +805,8 @@ async fn test_relative_path_resolution() { name: "api".parse().expect("valid package name"), version: Version::new(0, 1, 0), description: None, + include: Default::default(), + exclude: Default::default(), }) .dependencies(vec![Dependency { package: "lib1".parse().expect("valid package name"),