@yarnpkg/nm 4.0.0 → 4.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -123,7 +123,7 @@ const buildWorkspaceMap = (pnp) => {
123
123
  const pkg = pnp.getPackageInformation(locator);
124
124
  if (pkg) {
125
125
  const parentLocatorKey = parentLocator ? stringifyLocator(parentLocator) : ``;
126
- if (stringifyLocator(locator) !== parentLocatorKey && pkg.linkType === LinkType.SOFT && !isExternalSoftLink(pkg, locator, pnp, topPkgPortableLocation)) {
126
+ if (stringifyLocator(locator) !== parentLocatorKey && pkg.linkType === LinkType.SOFT && !locator.reference.startsWith(`link:`) && !isExternalSoftLink(pkg, locator, pnp, topPkgPortableLocation)) {
127
127
  const location = getRealPackageLocation(pkg, locator, pnp);
128
128
  const prevLocator = workspaceLikeLocators.get(location);
129
129
  // Give workspaces a priority over portals and other protocols pointing to the same location
@@ -405,7 +405,7 @@ const populateNodeModulesTree = (pnp, hoistedTree, options) => {
405
405
  for (const dep of pkg.dependencies) {
406
406
  const depReferences = Array.from(dep.references).sort().join(`#`);
407
407
  // We do not want self-references in node_modules, since they confuse existing tools
408
- if (dep.identName === pkg.identName && depReferences === pkgReferences)
408
+ if (dep.identName === pkg.identName.replace(WORKSPACE_NAME_SUFFIX, ``) && depReferences === pkgReferences)
409
409
  continue;
410
410
  const references = Array.from(dep.references).sort();
411
411
  const locator = { name: dep.identName, reference: references[0] };
@@ -423,8 +423,7 @@ const populateNodeModulesTree = (pnp, hoistedTree, options) => {
423
423
  const workspace = options.project.workspacesByCwd.get(leafNode.target.slice(0, -1));
424
424
  isAnonymousWorkspace = !!(workspace && !workspace.manifest.name);
425
425
  }
426
- const isCircularSymlink = leafNode.linkType === LinkType.SOFT && nodeModulesLocation.startsWith(leafNode.target);
427
- if (!dep.name.endsWith(WORKSPACE_NAME_SUFFIX) && !isAnonymousWorkspace && !isCircularSymlink) {
426
+ if (!dep.name.endsWith(WORKSPACE_NAME_SUFFIX) && !isAnonymousWorkspace) {
428
427
  const prevNode = tree.get(nodeModulesLocation);
429
428
  if (prevNode) {
430
429
  if (prevNode.dirList) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yarnpkg/nm",
3
- "version": "4.0.0",
3
+ "version": "4.0.2",
4
4
  "license": "BSD-2-Clause",
5
5
  "main": "./lib/index.js",
6
6
  "exports": {
@@ -9,9 +9,9 @@
9
9
  },
10
10
  "sideEffects": false,
11
11
  "dependencies": {
12
- "@yarnpkg/core": "^4.0.0",
13
- "@yarnpkg/fslib": "^3.0.0",
14
- "@yarnpkg/pnp": "^4.0.0"
12
+ "@yarnpkg/core": "^4.0.3",
13
+ "@yarnpkg/fslib": "^3.0.2",
14
+ "@yarnpkg/pnp": "^4.0.2"
15
15
  },
16
16
  "scripts": {
17
17
  "postpack": "rm -rf lib",