Skip to content

Commit f28dd5f

Browse files
authored
Merge pull request #1616 from volta-cli/use-node-semver
Switch to stable node-semver crate
2 parents bf97e8c + edd3e07 commit f28dd5f

File tree

41 files changed

+148
-230
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+148
-230
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ serde = { version = "1.0", features = ["derive"] }
2727
serde_json = "1.0.96"
2828
lazy_static = "1.3.0"
2929
log = { version = "0.4", features = ["std"] }
30-
semver = { git = "https://github.com/mikrostew/semver", branch = "new-parser" }
30+
node-semver = "2"
3131
structopt = "0.2.14"
3232
cfg-if = "1.0"
3333
mockito = { version = "0.31.1", optional = true }

crates/volta-core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ serde = { version = "1.0.174", features = ["derive"] }
2222
archive = { path = "../archive" }
2323
lazycell = "1.3.0"
2424
lazy_static = "1.3.0"
25-
semver = { git = "https://github.com/mikrostew/semver", branch = "new-parser" }
25+
node-semver = "2"
2626
cmdline_words_parser = "0.2.1"
2727
fs-utils = { path = "../fs-utils" }
2828
cfg-if = "1.0"

crates/volta-core/src/hook/tool.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use cmdline_words_parser::parse_posix;
1212
use dunce::canonicalize;
1313
use lazy_static::lazy_static;
1414
use log::debug;
15-
use semver::Version;
15+
use node_semver::Version;
1616

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

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

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

208208
// tar.gz format has extra handling, to support a multi-part extension
209209
let expected = format!(

crates/volta-core/src/inventory.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use crate::layout::volta_home;
1111
use crate::tool::PackageConfig;
1212
use crate::version::parse_version;
1313
use log::debug;
14-
use semver::Version;
14+
use node_semver::Version;
1515
use walkdir::WalkDir;
1616

1717
/// Checks if a given Node version image is available on the local machine

0 commit comments

Comments
 (0)