fix(linter): fix broken circular deps output (#7810)
This commit is contained in:
parent
4a3686c501
commit
2af9d4b4b1
@ -183,10 +183,10 @@ export function extractCachedFileData(
|
|||||||
cachedFileData: { [project: string]: { [file: string]: FileData } };
|
cachedFileData: { [project: string]: { [file: string]: FileData } };
|
||||||
} {
|
} {
|
||||||
const filesToProcess: ProjectFileMap = {};
|
const filesToProcess: ProjectFileMap = {};
|
||||||
|
const cachedFileData: Record<string, Record<string, FileData>> = {};
|
||||||
const currentProjects = Object.keys(fileMap).filter(
|
const currentProjects = Object.keys(fileMap).filter(
|
||||||
(name) => fileMap[name].length > 0
|
(name) => fileMap[name].length > 0
|
||||||
);
|
);
|
||||||
const cachedFileData = {};
|
|
||||||
currentProjects.forEach((p) => {
|
currentProjects.forEach((p) => {
|
||||||
processProjectNode(p, c.nodes[p], cachedFileData, filesToProcess, fileMap);
|
processProjectNode(p, c.nodes[p], cachedFileData, filesToProcess, fileMap);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import type { ProjectGraph, ProjectGraphNode } from '@nrwl/devkit';
|
import type { FileData, ProjectGraph, ProjectGraphNode } from '@nrwl/devkit';
|
||||||
import { isWorkspaceProject } from '../core/project-graph/operators';
|
import { isWorkspaceProject } from '../core/project-graph/operators';
|
||||||
|
|
||||||
interface Reach {
|
interface Reach {
|
||||||
@ -120,10 +120,12 @@ export function findFilesInCircularPath(
|
|||||||
|
|
||||||
for (let i = 0; i < circularPath.length - 1; i++) {
|
for (let i = 0; i < circularPath.length - 1; i++) {
|
||||||
const next = circularPath[i + 1].name;
|
const next = circularPath[i + 1].name;
|
||||||
const files = circularPath[i].data.files;
|
const files: FileData[] = circularPath[i].data.files;
|
||||||
filePathChain.push(
|
filePathChain.push(
|
||||||
Object.keys(files)
|
Object.keys(files)
|
||||||
.filter((key) => files[key].deps?.indexOf(next) !== -1)
|
.filter(
|
||||||
|
(key) => files[key].deps && files[key].deps.indexOf(next) !== -1
|
||||||
|
)
|
||||||
.map((key) => files[key].file)
|
.map((key) => files[key].file)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -227,8 +227,8 @@ export function mapProjectGraphFiles<T>(
|
|||||||
projectGraph.nodes as Record<string, ProjectGraphProjectNode>
|
projectGraph.nodes as Record<string, ProjectGraphProjectNode>
|
||||||
).forEach(([name, node]) => {
|
).forEach(([name, node]) => {
|
||||||
const files: Record<string, FileData> = {};
|
const files: Record<string, FileData> = {};
|
||||||
node.data.files.forEach(({ file, hash }) => {
|
node.data.files.forEach(({ file, hash, deps }) => {
|
||||||
files[removeExt(file)] = { file, hash };
|
files[removeExt(file)] = { file, hash, ...(deps && { deps }) };
|
||||||
});
|
});
|
||||||
const data = { ...node.data, files };
|
const data = { ...node.data, files };
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user