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

Add "why" command #525

Open
wants to merge 7 commits into
base: development
Choose a base branch
from

Conversation

TheDrawingCoder-Gamer
Copy link

Adds "why" command, which finds the reason a library must be included. Basic documentation:
haxelib why [library]
Looks through the haxelib.json dependecies, and returns the dependency path if it's found, or states it couldn't find the library.
haxelib why [library] [hxml]
Looks through the hxml file and finds why a library is required, returning the dependency path if it's found, or states it couldn't find the library. Follows --library tags and hxml references.

Similar to yarn's why command

Optimization: This probably needs optimization, as it traverses the tree of dependencies of a tree. Threading would be helpful

Further Improvements: Right now, it only returns 1 path, when it may be required in multiple places.

@skial skial mentioned this pull request Oct 6, 2021
1 task

if (haxelibResults != Failure)
return haxelibResults;
} else if (line.endsWith('.hxml')) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check could fail if the file extension is uppercased.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, it can be uppercased??

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Some file systems are case-insensitive.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The line is now forced to lowercase it latest version. However in other parts of the code (which I haven't written) it doesn't take case into consideration

@RealyUniqueName
Copy link
Member

Add a test please.
See test/tests/integration/ for references

@TheDrawingCoder-Gamer
Copy link
Author

Some tests break and my tests don't seem to run : ( I don't think it's related to my test.

@RealyUniqueName
Copy link
Member

I don't see a button to run CI for PRs. @Simn , do you have it?

@Simn
Copy link
Member

Simn commented Nov 2, 2021

No

@TheDrawingCoder-Gamer
Copy link
Author

Will you guys handle the run.n? it seems like a recompile will be required anyway

@RealyUniqueName
Copy link
Member

You need to merge development and avoid committing run.n after that.

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

Successfully merging this pull request may close these issues.

3 participants