mirror of
https://github.com/pesde-pkg/pesde.git
synced 2025-04-05 11:20:55 +01:00
fix(resolver): ensure version is root
This commit is contained in:
parent
344416da3d
commit
8dfdc6dfa8
1 changed files with 6 additions and 2 deletions
|
@ -237,7 +237,11 @@ impl Project {
|
||||||
&self,
|
&self,
|
||||||
lockfile: &RootLockfileNode,
|
lockfile: &RootLockfileNode,
|
||||||
) -> Result<(), LinkingDependenciesError> {
|
) -> Result<(), LinkingDependenciesError> {
|
||||||
let root_deps = lockfile.specifiers.keys().collect::<HashSet<_>>();
|
let root_deps = lockfile
|
||||||
|
.specifiers
|
||||||
|
.iter()
|
||||||
|
.flat_map(|(name, versions)| versions.keys().map(|version| (name.clone(), version)))
|
||||||
|
.collect::<HashSet<_>>();
|
||||||
|
|
||||||
for (name, versions) in &lockfile.children {
|
for (name, versions) in &lockfile.children {
|
||||||
for (version, resolved_pkg) in versions {
|
for (version, resolved_pkg) in versions {
|
||||||
|
@ -275,7 +279,7 @@ impl Project {
|
||||||
})?;
|
})?;
|
||||||
}
|
}
|
||||||
|
|
||||||
if root_deps.contains(&name) {
|
if root_deps.contains(&(name.clone(), version)) {
|
||||||
let (specifier, desired_name) = lockfile.root_specifier(resolved_pkg).unwrap();
|
let (specifier, desired_name) = lockfile.root_specifier(resolved_pkg).unwrap();
|
||||||
let linking_dir = &self.path().join(packages_folder(
|
let linking_dir = &self.path().join(packages_folder(
|
||||||
specifier.realm().copied().unwrap_or_default(),
|
specifier.realm().copied().unwrap_or_default(),
|
||||||
|
|
Loading…
Add table
Reference in a new issue