Skip to content

Commit cb20666

Browse files
build(deps): update dependency graph-data-structure to v4 (#32320)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Michael Kriese <[email protected]>
1 parent b8d7e15 commit cb20666

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

.github/workflows/build.yml

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ env:
3737
SPARSE_CHECKOUT: |-
3838
.github/actions/
3939
data/
40+
patches/
4041
tools/
4142
package.json
4243
pnpm-lock.yaml

lib/modules/manager/nuget/package-tree.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import is from '@sindresorhus/is';
2-
import { Graph } from 'graph-data-structure';
2+
import { Graph, hasCycle } from 'graph-data-structure';
33
import upath from 'upath';
44
import { logger } from '../../../logger';
55
import { minimatchFilter } from '../../../util/minimatch';
@@ -18,7 +18,7 @@ export async function getDependentPackageFiles(
1818
isCentralManagement = false,
1919
): Promise<ProjectFile[]> {
2020
const packageFiles = await getAllPackageFiles();
21-
const graph: ReturnType<typeof Graph> = Graph();
21+
const graph = new Graph();
2222

2323
if (isCentralManagement) {
2424
graph.addNode(packageFileName);
@@ -62,7 +62,7 @@ export async function getDependentPackageFiles(
6262
graph.addEdge(ref, f);
6363
}
6464

65-
if (graph.hasCycle()) {
65+
if (hasCycle(graph)) {
6666
throw new Error('Circular reference detected in NuGet package files');
6767
}
6868
}
@@ -84,12 +84,12 @@ export async function getDependentPackageFiles(
8484
*/
8585
function recursivelyGetDependentPackageFiles(
8686
packageFileName: string,
87-
graph: ReturnType<typeof Graph>,
87+
graph: Graph,
8888
deps: Map<string, boolean>,
8989
): void {
9090
const dependents = graph.adjacent(packageFileName);
9191

92-
if (dependents.length === 0) {
92+
if (!dependents || dependents.size === 0) {
9393
deps.set(packageFileName, true);
9494
return;
9595
}

lib/modules/manager/pip-compile/utils.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Graph } from 'graph-data-structure';
1+
import { Graph, topologicalSort } from 'graph-data-structure';
22
import upath from 'upath';
33
import { logger } from '../../../logger';
44
import type { PackageFile } from '../types';
@@ -9,11 +9,11 @@ export function sortPackageFiles(
99
packageFiles: Map<string, PackageFile>,
1010
): PackageFile[] {
1111
const result: PackageFile[] = [];
12-
const graph: ReturnType<typeof Graph> = Graph();
12+
const graph = new Graph();
1313
depsBetweenFiles.forEach(({ sourceFile, outputFile }) => {
1414
graph.addEdge(sourceFile, outputFile);
1515
});
16-
const sorted = graph.topologicalSort();
16+
const sorted = topologicalSort(graph);
1717
for (const file of sorted) {
1818
if (packageFiles.has(file)) {
1919
const packageFile = packageFiles.get(file)!;

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@
205205
"good-enough-parser": "1.1.23",
206206
"google-auth-library": "9.14.2",
207207
"got": "11.8.6",
208-
"graph-data-structure": "3.5.0",
208+
"graph-data-structure": "4.2.0",
209209
"handlebars": "4.7.8",
210210
"ignore": "6.0.2",
211211
"ini": "5.0.0",

pnpm-lock.yaml

+5-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)