Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix circularity in dependency tree + add CI check for circularity #1173

Closed
2 tasks done
Gerrit0 opened this issue Jan 15, 2020 · 2 comments
Closed
2 tasks done

Fix circularity in dependency tree + add CI check for circularity #1173

Gerrit0 opened this issue Jan 15, 2020 · 2 comments
Labels
help wanted Contributions are especially encouraged

Comments

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Jan 15, 2020

According to madge, TypeDoc currently has 7 circular dependencies.

1) lib/converter/context.js > lib/converter/converter.js
2) lib/models/types/index.js > lib/models/types/array.js
3) lib/models/types/index.js > lib/models/types/indexed-access.js
4) lib/converter/index.js > lib/converter/nodes/index.js > lib/converter/nodes/enum.js
5) lib/converter/index.js > lib/converter/nodes/index.js > lib/converter/nodes/variable.js
6) lib/output/renderer.js > lib/output/plugins/index.js > lib/output/plugins/AssetsPlugin.js
7) lib/output/renderer.js > lib/output/themes/DefaultTheme.js > lib/output/theme.js > lib/output/utils/resources.js

#1172 was caused by adding another circular dependency that (unlike the existing 7) was not deferable, and thus caused an application crash when using the CLI. (I still don't really understand why it didn't crash the tests too)

This could have been prevented by a CI check that runs a check for circular dependencies and fails the build if any are detected.

  • Fix existing circular dependencies in TypeDoc
  • Add a check to CI so that introducing a circular dependency fails the build
@Gerrit0 Gerrit0 added help wanted Contributions are especially encouraged code health labels Jan 15, 2020
@Gerrit0
Copy link
Collaborator Author

Gerrit0 commented Jan 15, 2020

While doing this, it would be great to simplify the existing dependency tree. This is crazy large, it shouldn't need to be this big... seriously, it reminds me of the time I generated a dependency tree of literally everything installed on a linux box.

deps

@Gerrit0
Copy link
Collaborator Author

Gerrit0 commented Jan 15, 2020

TypeScript 3.8's type only imports / exports should also help with this - https://devblogs.microsoft.com/typescript/announcing-typescript-3-8-beta/#type-only-imports-exports

@Gerrit0 Gerrit0 added this to To do in Version 0.20 via automation Nov 2, 2020
@Gerrit0 Gerrit0 moved this from To do to In progress in Version 0.20 Nov 2, 2020
@Gerrit0 Gerrit0 moved this from In progress to Done in Version 0.20 Nov 6, 2020
@Gerrit0 Gerrit0 closed this as completed Dec 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Contributions are especially encouraged
Projects
No open projects
Development

No branches or pull requests

1 participant