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

Commit

Permalink
fix: Fix berry latest alias.
Browse files Browse the repository at this point in the history
  • Loading branch information
milesj committed Apr 8, 2024
1 parent 53a203b commit 1407e44
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 0.10.3

#### 🐞 Fixes

- Fixed yarn "latest" alias pointing to the v1 latest, instead of v4 (berry) latest.

## 0.10.2

#### 🚀 Updates
Expand Down
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/node-depman/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "node_depman_plugin"
version = "0.10.2"
version = "0.10.3"
edition = "2021"
license = "MIT"
publish = false
Expand Down
1 change: 1 addition & 0 deletions crates/node-depman/src/npm_registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ pub struct RegistryVersion {

#[derive(Deserialize)]
pub struct RegistryResponse {
pub name: String,
#[serde(rename = "dist-tags")]
pub dist_tags: HashMap<String, String>,
pub versions: HashMap<String, RegistryVersion>,
Expand Down
8 changes: 7 additions & 1 deletion crates/node-depman/src/proto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,14 @@ pub fn load_versions(Json(input): Json<LoadVersionsInput>) -> FnResult<Json<Load
for (alias, version) in res.dist_tags {
let version = Version::parse(&version)?;

if alias == "latest" && output.latest.is_none() {
if alias == "latest" {
output.latest = Some(version.clone());

// The berry alias only exists in the `yarn` package,
// but not `@yarnpkg/cli-dist`, so update it here
if is_yarn && res.name == "@yarnpkg/cli-dist" {
output.aliases.insert("berry".into(), version.clone());
}
}

output.aliases.entry(alias).or_insert(version);
Expand Down
2 changes: 1 addition & 1 deletion crates/node/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "node_plugin"
version = "0.10.2"
version = "0.10.3"
edition = "2021"
license = "MIT"
publish = false
Expand Down

0 comments on commit 1407e44

Please sign in to comment.