Skip to content
This repository was archived by the owner on Jul 17, 2024. It is now read-only.

Commit 1407e44

Browse files
committed
fix: Fix berry latest alias.
1 parent 53a203b commit 1407e44

File tree

6 files changed

+18
-5
lines changed

6 files changed

+18
-5
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## 0.10.3
4+
5+
#### 🐞 Fixes
6+
7+
- Fixed yarn "latest" alias pointing to the v1 latest, instead of v4 (berry) latest.
8+
39
## 0.10.2
410

511
#### 🚀 Updates

Cargo.lock

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

crates/node-depman/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "node_depman_plugin"
3-
version = "0.10.2"
3+
version = "0.10.3"
44
edition = "2021"
55
license = "MIT"
66
publish = false

crates/node-depman/src/npm_registry.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ pub struct RegistryVersion {
1111

1212
#[derive(Deserialize)]
1313
pub struct RegistryResponse {
14+
pub name: String,
1415
#[serde(rename = "dist-tags")]
1516
pub dist_tags: HashMap<String, String>,
1617
pub versions: HashMap<String, RegistryVersion>,

crates/node-depman/src/proto.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,14 @@ pub fn load_versions(Json(input): Json<LoadVersionsInput>) -> FnResult<Json<Load
112112
for (alias, version) in res.dist_tags {
113113
let version = Version::parse(&version)?;
114114

115-
if alias == "latest" && output.latest.is_none() {
115+
if alias == "latest" {
116116
output.latest = Some(version.clone());
117+
118+
// The berry alias only exists in the `yarn` package,
119+
// but not `@yarnpkg/cli-dist`, so update it here
120+
if is_yarn && res.name == "@yarnpkg/cli-dist" {
121+
output.aliases.insert("berry".into(), version.clone());
122+
}
117123
}
118124

119125
output.aliases.entry(alias).or_insert(version);

crates/node/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "node_plugin"
3-
version = "0.10.2"
3+
version = "0.10.3"
44
edition = "2021"
55
license = "MIT"
66
publish = false

0 commit comments

Comments
 (0)