@yarnpkg/nm 3.0.1-rc.2 → 3.0.1-rc.6
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.
- package/lib/buildNodeModulesTree.js +9 -1
- package/lib/hoist.js +8 -1
- package/package.json +4 -4
|
@@ -73,7 +73,15 @@ const buildLocatorMap = (nodeModulesTree) => {
|
|
|
73
73
|
val.locations = val.locations.sort((loc1, loc2) => {
|
|
74
74
|
const len1 = loc1.split(fslib_1.ppath.delimiter).length;
|
|
75
75
|
const len2 = loc2.split(fslib_1.ppath.delimiter).length;
|
|
76
|
-
|
|
76
|
+
if (loc2 === loc1) {
|
|
77
|
+
return 0;
|
|
78
|
+
}
|
|
79
|
+
else if (len1 !== len2) {
|
|
80
|
+
return len2 - len1;
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
return loc2 > loc1 ? 1 : -1;
|
|
84
|
+
}
|
|
77
85
|
});
|
|
78
86
|
}
|
|
79
87
|
return map;
|
package/lib/hoist.js
CHANGED
|
@@ -801,7 +801,14 @@ const dumpDepTree = (tree) => {
|
|
|
801
801
|
if (nodeCount > MAX_NODES_TO_DUMP || parents.has(pkg))
|
|
802
802
|
return ``;
|
|
803
803
|
nodeCount++;
|
|
804
|
-
const dependencies = Array.from(pkg.dependencies.values()).sort((n1, n2) =>
|
|
804
|
+
const dependencies = Array.from(pkg.dependencies.values()).sort((n1, n2) => {
|
|
805
|
+
if (n1.name === n2.name) {
|
|
806
|
+
return 0;
|
|
807
|
+
}
|
|
808
|
+
else {
|
|
809
|
+
return n1.name > n2.name ? 1 : -1;
|
|
810
|
+
}
|
|
811
|
+
});
|
|
805
812
|
let str = ``;
|
|
806
813
|
parents.add(pkg);
|
|
807
814
|
for (let idx = 0; idx < dependencies.length; idx++) {
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yarnpkg/nm",
|
|
3
|
-
"version": "3.0.1-rc.
|
|
3
|
+
"version": "3.0.1-rc.6",
|
|
4
4
|
"license": "BSD-2-Clause",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
7
7
|
"sideEffects": false,
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@yarnpkg/core": "^3.2.0-rc.
|
|
10
|
-
"@yarnpkg/fslib": "^2.6.
|
|
9
|
+
"@yarnpkg/core": "^3.2.0-rc.6",
|
|
10
|
+
"@yarnpkg/fslib": "^2.6.1-rc.1"
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
|
-
"@yarnpkg/pnp": "^3.1.1-rc.
|
|
13
|
+
"@yarnpkg/pnp": "^3.1.1-rc.6"
|
|
14
14
|
},
|
|
15
15
|
"scripts": {
|
|
16
16
|
"postpack": "rm -rf lib",
|