Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to stable node-semver crate #1616

Merged
merged 1 commit into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
205 changes: 58 additions & 147 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 Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0.96"
lazy_static = "1.3.0"
log = { version = "0.4", features = ["std"] }
semver = { git = "https://github.com/mikrostew/semver", branch = "new-parser" }
node-semver = "2"
structopt = "0.2.14"
cfg-if = "1.0"
mockito = { version = "0.31.1", optional = true }
Expand Down
2 changes: 1 addition & 1 deletion crates/volta-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ serde = { version = "1.0.174", features = ["derive"] }
archive = { path = "../archive" }
lazycell = "1.3.0"
lazy_static = "1.3.0"
semver = { git = "https://github.com/mikrostew/semver", branch = "new-parser" }
node-semver = "2"
cmdline_words_parser = "0.2.1"
fs-utils = { path = "../fs-utils" }
cfg-if = "1.0"
Expand Down
8 changes: 4 additions & 4 deletions crates/volta-core/src/hook/tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use cmdline_words_parser::parse_posix;
use dunce::canonicalize;
use lazy_static::lazy_static;
use log::debug;
use semver::Version;
use node_semver::Version;

const ARCH_TEMPLATE: &str = "{{arch}}";
const OS_TEMPLATE: &str = "{{os}}";
Expand Down Expand Up @@ -182,14 +182,14 @@ fn execute_binary(bin: &str, base_path: &Path, extra_arg: Option<String>) -> Fal
pub mod tests {
use super::{calculate_extension, DistroHook, MetadataHook};
use crate::tool::{NODE_DISTRO_ARCH, NODE_DISTRO_OS};
use semver::Version;
use node_semver::Version;

#[test]
fn test_distro_prefix_resolve() {
let prefix = "http://localhost/node/distro/";
let filename = "node.tar.gz";
let hook = DistroHook::Prefix(prefix.to_string());
let version = Version::new(1, 0, 0);
let version = Version::parse("1.0.0").unwrap();

assert_eq!(
hook.resolve(&version, filename)
Expand All @@ -203,7 +203,7 @@ pub mod tests {
let hook = DistroHook::Template(
"http://localhost/node/{{os}}/{{arch}}/{{version}}/{{ext}}/{{filename}}".to_string(),
);
let version = Version::new(1, 0, 0);
let version = Version::parse("1.0.0").unwrap();

// tar.gz format has extra handling, to support a multi-part extension
let expected = format!(
Expand Down
2 changes: 1 addition & 1 deletion crates/volta-core/src/inventory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::layout::volta_home;
use crate::tool::PackageConfig;
use crate::version::parse_version;
use log::debug;
use semver::Version;
use node_semver::Version;
use walkdir::WalkDir;

/// Checks if a given Node version image is available on the local machine
Expand Down
Loading
Loading