This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
import { readCachedProjectGraph } from '@nx/devkit'; | |
import chalk from 'chalk'; | |
const graph = readCachedProjectGraph(); | |
const adjList = buildAdjList(graph); | |
const circularChains = findCircularChains(adjList); | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (let i = 0; i < nodes.length; i++) { | |
const node = nodes[i]; | |
adjList[node] = []; | |
matrix[node] = {}; | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (let i = 0; i < nodes.length; i++) { | |
const node = nodes[i]; | |
adjList[node] = []; | |
const initMatrixValues = {}; | |
for (let j = 0; j < nodes.length; j++) { | |
initMatrixValues[nodes[j]] = false; | |
}); | |
matrix[node] = { ...initMatrixValues }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function buildMatrix(graph) { | |
const dependencies = graph.dependencies; | |
const nodes = Object.keys(graph.nodes); | |
const adjList = {}; | |
const matrix = {}; | |
const initMatrixValues = nodes.reduce((acc, value) => { | |
return { ...acc, [value]: false }; | |
}, {}); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function buildMatrix(graph) { | |
const dependencies = graph.dependencies; | |
const nodes = Object.keys(graph.nodes); | |
const adjList = {}; | |
const matrix = {}; | |
const initMatrixValues = nodes.reduce((acc, value) => { | |
return { ...acc, [value]: false }; | |
}, {}); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function buildMatrix(graph) { | |
const dependencies = graph.dependencies; | |
const nodes = Object.keys(graph.nodes); | |
const adjList = {}; | |
const matrix = {}; | |
const initMatrixValues = nodes.reduce((acc, value) => { | |
return { ...acc, [value]: false }; | |
}, {}); | |
for (let i = 0; i < nodes.length; i++) { | |
const v = nodes[i]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"nodes": { | |
"project-a": { | |
// ... other fields | |
"data": { | |
// ... other fields | |
"files": [ | |
{ "file": "packages/project-a/a.ts", "hash": "...", "ext": "ts" }, | |
// ... | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"nodes": { | |
"project-a": { | |
// ... other fields | |
"data": { | |
// ... other fields | |
"files": [ | |
{ "file": "packages/project-a/a.ts", "hash": "...", "ext": "ts" }, | |
// ... | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"nodes": { | |
"project-a": { | |
// ... other fields | |
"data": { | |
// ... other fields | |
"files": { | |
"packages/project-a/a": { "file": "packages/project-a/a.ts", "hash": "...", "ext": "ts" }, | |
// ... | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"nodes": { | |
"project-a": { | |
// ... other fields | |
"data": { | |
// ... other fields | |
"files": [ | |
{ "file": "packages/project-a/a.ts", "hash": "...", "ext": "ts" }, | |
// ... | |
] |
NewerOlder