Skip to content

Commit 9c0abc3

Browse files
authored
Warg update 0.7 (#116)
updated warg version to 0.7.0
1 parent 7a58bdb commit 9c0abc3

File tree

9 files changed

+111
-135
lines changed

9 files changed

+111
-135
lines changed

Cargo.lock

Lines changed: 86 additions & 115 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@ wat = "1.202.0"
8080
logos = "0.14.0"
8181
miette = "7.2.0"
8282
thiserror = "1.0.58"
83-
warg-client = "0.6.0"
84-
warg-protocol = "0.6.0"
85-
warg-crypto = "0.6.0"
86-
warg-server = "0.6.0"
83+
warg-client = "0.7.0"
84+
warg-protocol = "0.7.0"
85+
warg-crypto = "0.7.0"
86+
warg-server = "0.7.0"
8787
futures = "0.3.30"
8888
indicatif = "0.17.8"
8989
pretty_assertions = "1.4.0"

crates/wac-resolver/src/registry.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,23 +40,23 @@ impl RegistryPackageResolver {
4040
/// client configuration file.
4141
///
4242
/// If `url` is `None`, the default URL will be used.
43-
pub fn new(url: Option<&str>, bar: Option<Box<dyn ProgressBar>>) -> Result<Self> {
43+
pub async fn new(url: Option<&str>, bar: Option<Box<dyn ProgressBar>>) -> Result<Self> {
4444
Ok(Self {
45-
client: Arc::new(Client::new_with_default_config(url)?),
45+
client: Arc::new(Client::new_with_default_config(url).await?),
4646
bar,
4747
})
4848
}
4949

5050
/// Creates a new registry package resolver with the given configuration.
5151
///
5252
/// If `url` is `None`, the default URL will be used.
53-
pub fn new_with_config(
53+
pub async fn new_with_config(
5454
url: Option<&str>,
5555
config: &Config,
5656
bar: Option<Box<dyn ProgressBar>>,
5757
) -> Result<Self> {
5858
Ok(Self {
59-
client: Arc::new(Client::new_with_config(url, config, None)?),
59+
client: Arc::new(Client::new_with_config(url, config, None).await?),
6060
bar,
6161
})
6262
}

crates/wac-resolver/tests/registry.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export i2.foo as "bar";
6161
"#,
6262
)?;
6363

64-
let resolver = RegistryPackageResolver::new_with_config(None, &config, None)?;
64+
let resolver = RegistryPackageResolver::new_with_config(None, &config, None).await?;
6565
let packages = resolver.resolve(&packages(&document)?).await?;
6666

6767
let resolution = document.resolve(packages)?;

crates/wac-resolver/tests/support/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ pub async fn publish(
6464
content: Vec<u8>,
6565
init: bool,
6666
) -> Result<()> {
67-
let client = FileSystemClient::new_with_config(None, config, None)?;
67+
let client = FileSystemClient::new_with_config(None, config, None).await?;
6868

6969
let digest = client
7070
.content()
@@ -148,6 +148,7 @@ pub async fn spawn_server(root: &Path) -> Result<(ServerInstance, warg_client::C
148148
content_dir: Some(root.join("content")),
149149
namespace_map_path: Some(root.join("namespaces")),
150150
keyring_auth: false,
151+
keyring_backend: None,
151152
keys: Default::default(),
152153
ignore_federation_hints: false,
153154
auto_accept_federation_hints: false,

src/commands/encode.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ impl EncodeCommand {
8484
self.deps.into_iter().collect(),
8585
#[cfg(feature = "registry")]
8686
self.registry.as_deref(),
87-
)?;
87+
)
88+
.await?;
8889

8990
let packages = resolver
9091
.resolve(&document)

src/commands/plug.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ impl PlugCommand {
105105
#[cfg(feature = "registry")]
106106
PackageRef::RegistryPackage((name, version)) => {
107107
if client.is_none() {
108-
client = Some(FileSystemClient::new_with_default_config(
109-
self.registry.as_deref(),
110-
));
108+
client = Some(
109+
FileSystemClient::new_with_default_config(self.registry.as_deref()).await,
110+
);
111111
}
112112
let client = client.as_ref().unwrap().as_ref().map_err(|_| {
113113
anyhow::anyhow!(
@@ -176,9 +176,10 @@ impl PlugCommand {
176176
#[cfg(feature = "registry")]
177177
PackageRef::RegistryPackage((name, version)) => {
178178
if client.is_none() {
179-
client = Some(FileSystemClient::new_with_default_config(
180-
self.registry.as_deref(),
181-
));
179+
client = Some(
180+
FileSystemClient::new_with_default_config(self.registry.as_deref())
181+
.await,
182+
);
182183
}
183184
let client = client.as_ref().unwrap().as_ref().map_err(|_| {
184185
anyhow::anyhow!(

src/commands/resolve.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ impl ResolveCommand {
5656
self.deps.into_iter().collect(),
5757
#[cfg(feature = "registry")]
5858
self.registry.as_deref(),
59-
)?;
59+
)
60+
.await?;
6061

6162
let packages = resolver
6263
.resolve(&document)

src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ pub struct PackageResolver {
5252

5353
impl PackageResolver {
5454
/// Creates a new package resolver.
55-
pub fn new(
55+
pub async fn new(
5656
dir: impl Into<PathBuf>,
5757
overrides: HashMap<String, PathBuf>,
5858
#[cfg(feature = "registry")] registry: Option<&str>,
@@ -63,7 +63,8 @@ impl PackageResolver {
6363
registry: wac_resolver::RegistryPackageResolver::new(
6464
registry,
6565
Some(Box::new(progress::ProgressBar::new())),
66-
)?,
66+
)
67+
.await?,
6768
})
6869
}
6970

0 commit comments

Comments
 (0)