Skip to content

Commit 9ee7775

Browse files
committed
fix(graph): Not able to generate graph on large projects
fix #283
1 parent 99a3e24 commit 9ee7775

File tree

3 files changed

+39
-46
lines changed

3 files changed

+39
-46
lines changed

dist/index-cli.js

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

dist/index.js

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

src/app/application.ts

+13-14
Original file line numberDiff line numberDiff line change
@@ -1447,22 +1447,21 @@ export class Application {
14471447
}
14481448
finalMainGraphPath += 'graph';
14491449
$ngdengine.init(path.resolve(finalMainGraphPath));
1450-
if ($dependenciesEngine.rawModulesForOverview.length > 150) {
1451-
logger.warn(`Too many modules (${$dependenciesEngine.rawModulesForOverview.length}), main graph generation disabled`);
1452-
this.configuration.mainData.disableMainGraph = true;
1453-
loop();
1454-
} else {
1455-
$ngdengine.renderGraph(this.configuration.mainData.tsconfig, path.resolve(finalMainGraphPath), 'p').then(() => {
1456-
$ngdengine.readGraph(path.resolve(finalMainGraphPath + path.sep + 'dependencies.svg'), 'Main graph').then((data) => {
1457-
this.configuration.mainData.mainGraph = <string>data;
1458-
loop();
1459-
}, (err) => {
1460-
logger.error('Error during graph read: ', err);
1461-
});
1450+
1451+
$ngdengine.renderGraph(this.configuration.mainData.tsconfig, path.resolve(finalMainGraphPath), 'p').then(() => {
1452+
$ngdengine.readGraph(path.resolve(finalMainGraphPath + path.sep + 'dependencies.svg'), 'Main graph').then((data) => {
1453+
this.configuration.mainData.mainGraph = <string>data;
1454+
loop();
14621455
}, (err) => {
1463-
logger.error('Error during graph generation: ', err);
1456+
logger.error('Error during main graph reading : ', err);
1457+
this.configuration.mainData.disableMainGraph = true;
1458+
loop();
14641459
});
1465-
}
1460+
}, (err) => {
1461+
logger.error('Ooops error during main graph generation, moving on next part with main graph disabled : ', err);
1462+
this.configuration.mainData.disableMainGraph = true;
1463+
loop();
1464+
});
14661465
}
14671466
}
14681467

0 commit comments

Comments
 (0)