@yarnpkg/nm
Advanced tools
Comparing version 3.0.0-rc.12 to 3.0.0-rc.13
@@ -110,3 +110,3 @@ "use strict"; | ||
const seen = new Set(); | ||
const visit = (locator) => { | ||
const visit = (locator, parentLocator) => { | ||
const locatorKey = stringifyLocator(locator); | ||
@@ -118,8 +118,16 @@ if (seen.has(locatorKey)) | ||
if (pkg) { | ||
if (pkg.linkType === LinkType.SOFT && !isExternalSoftLink(pkg, locator, pnp, topPkgPortableLocation)) | ||
workspaceLikeLocators.set(getRealPackageLocation(pkg, locator, pnp), locator); | ||
const parentLocatorKey = parentLocator ? stringifyLocator(parentLocator) : ``; | ||
if (stringifyLocator(locator) !== parentLocatorKey && pkg.linkType === LinkType.SOFT && !isExternalSoftLink(pkg, locator, pnp, topPkgPortableLocation)) { | ||
const location = getRealPackageLocation(pkg, locator, pnp); | ||
const prevLocator = workspaceLikeLocators.get(location); | ||
// Give workspaces a priority over portals and other protocols pointing to the same location | ||
// The devDependencies are not installed for portals, but installed for workspaces | ||
if (!prevLocator || locator.reference.startsWith(`workspace:`)) { | ||
workspaceLikeLocators.set(location, locator); | ||
} | ||
} | ||
for (const [name, referencish] of pkg.packageDependencies) { | ||
if (referencish !== null) { | ||
if (!pkg.packagePeers.has(name)) { | ||
visit(pnp.getLocator(name, referencish)); | ||
visit(pnp.getLocator(name, referencish), locator); | ||
} | ||
@@ -131,3 +139,3 @@ } | ||
for (const locator of pnpRoots) | ||
visit(locator); | ||
visit(locator, null); | ||
const cwdSegments = topPkgPortableLocation.split(fslib_1.ppath.sep); | ||
@@ -134,0 +142,0 @@ for (const locator of workspaceLikeLocators.values()) { |
{ | ||
"name": "@yarnpkg/nm", | ||
"version": "3.0.0-rc.12", | ||
"version": "3.0.0-rc.13", | ||
"license": "BSD-2-Clause", | ||
@@ -9,7 +9,7 @@ "main": "./lib/index.js", | ||
"dependencies": { | ||
"@yarnpkg/core": "^3.1.0-rc.12", | ||
"@yarnpkg/fslib": "^2.6.0-rc.11" | ||
"@yarnpkg/core": "^3.1.0-rc.13", | ||
"@yarnpkg/fslib": "^2.6.0-rc.12" | ||
}, | ||
"devDependencies": { | ||
"@yarnpkg/pnp": "^3.1.0-rc.8" | ||
"@yarnpkg/pnp": "^3.1.0-rc.9" | ||
}, | ||
@@ -16,0 +16,0 @@ "scripts": { |
77840
1604
Updated@yarnpkg/core@^3.1.0-rc.13
Updated@yarnpkg/fslib@^2.6.0-rc.12