@ssen/collect-dependencies
Advanced tools
Comparing version 1.3.4 to 2.0.0
@@ -47,3 +47,6 @@ "use strict"; | ||
if (childPackageJson && childPackageJson.dependencies) { | ||
searchNestedDependencies(ownerName, childPackageJson.dependencies, dependenciesSet, [...parents, dependencyName]); | ||
searchNestedDependencies(ownerName, childPackageJson.dependencies, dependenciesSet, [ | ||
...parents, | ||
dependencyName, | ||
]); | ||
} | ||
@@ -60,3 +63,5 @@ } | ||
name: packageJson.name, | ||
dependencies: searchNestedDependencies(packageJson.name, packageJson.dependencies, new Set(), [packageJson.name]), | ||
dependencies: searchNestedDependencies(packageJson.name, packageJson.dependencies, new Set(), [ | ||
packageJson.name, | ||
]), | ||
}; | ||
@@ -63,0 +68,0 @@ }); |
@@ -16,3 +16,3 @@ { | ||
"name": "@ssen/collect-dependencies", | ||
"version": "1.3.4", | ||
"version": "2.0.0", | ||
"dependencies": { | ||
@@ -19,0 +19,0 @@ "type-fest": "^0.16.0", |
@@ -513,2 +513,38 @@ # `@ssen/collect-dependencies` | ||
test('should guide detailed circular references error', () => { | ||
// Arrange | ||
const packageJsonContents: PackageJson[] = [ | ||
{ | ||
name: '@ssen/test-module1', | ||
dependencies: { | ||
'@ssen/test-module2': '0', | ||
}, | ||
}, | ||
{ | ||
name: '@ssen/test-module2', | ||
dependencies: { | ||
'@ssen/test-module3': '0', | ||
}, | ||
}, | ||
{ | ||
name: '@ssen/test-module3', | ||
dependencies: { | ||
'@ssen/test-module4': '0', | ||
}, | ||
}, | ||
{ | ||
name: '@ssen/test-module4', | ||
dependencies: { | ||
'@ssen/test-module1': '0', | ||
}, | ||
}, | ||
]; | ||
// Act | ||
// throwed message should has detailed paths | ||
expect(() => getPackagesOrder({ packageJsonContents })).toThrow( | ||
'package.json files have circularly referenced dependencies : "@ssen/test-module1" in "@ssen/test-module1 < @ssen/test-module2 < @ssen/test-module3 < @ssen/test-module4 < @ssen/test-module1"', | ||
); | ||
}); | ||
test('should sort by names if they have not some dependencies each other', () => { | ||
@@ -515,0 +551,0 @@ // Arrange |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
53207
263
1021