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

Feature request: topological sort for dependencies #398

Open
danvk opened this issue Jan 15, 2024 · 0 comments
Open

Feature request: topological sort for dependencies #398

danvk opened this issue Jan 15, 2024 · 0 comments

Comments

@danvk
Copy link

danvk commented Jan 15, 2024

If you're migrating a project from JavaScript to TypeScript, it's typically a good idea to work your way up from the leaves (modules with no dependencies). One way of codifying an order would be topological sort: print a list of modules where no module appears until all its dependencies have already appeared. This would give you the order in which to perform the migration.

This could probably be done as a post-processing step with madge --json, but it would be more convenient as part of the library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant