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

Make maxDepth configurable #92

Open
tiagodj opened this issue Jun 6, 2022 · 5 comments
Open

Make maxDepth configurable #92

tiagodj opened this issue Jun 6, 2022 · 5 comments
Labels
enhancement New feature or request ready This issue is ready for us to code on it

Comments

@tiagodj
Copy link

tiagodj commented Jun 6, 2022

Hi,

My project folders in the monorepo sometimes are under 4 levels of directories, and because of that Mookme doesn't find them.

Would it be possible to make maxDepth parameter configurable?

extractPackagesPaths(depth = 0, maxDepth = 3, source?: string): string[] {

Thank you!

@LMaxence
Copy link
Member

LMaxence commented Jun 8, 2022

Sure ! It can be configurable, I would leave it as a configuration option (stored in the .mookme.json), and make it default to the current value :)

The recursive search is computationally expensive so I've set a hard limit on this, but I knew the time when I would be asked this would come 😅

@LMaxence
Copy link
Member

LMaxence commented Jun 8, 2022

If you're willing to contribute, this can be a good first issue, I'll provide a technical strategy asap !

@tiagodj
Copy link
Author

tiagodj commented Jun 8, 2022 via email

@LMaxence
Copy link
Member

LMaxence commented Jun 9, 2022

Mookme v1.* worked like this, so it had the advantage you mention (it knows where to look packages for), but it had a few drawbacks:

The initialization was a lot worse than it is right now (there was a very looooooooong prompter-based form to let you enter relatively easily the folders that are supposed to hold the packages). You can try to install and init a project using mookme@1.something to see the difference between 1 & 2 ;)

Also, the behaviour was "configuration" based and not "reality" based which was a bit hard to debug sometimes.

These two are the major reasons that lead me to automatize this part of the execution

@LMaxence
Copy link
Member

LMaxence commented Jan 29, 2023

Hello @tiagodj !

I will leave this issue stalling, for the reason that I will implement the matching using glob-pattern matching. It will have the benefits that I don't have an algorithm to maintain for this, will work exponentially faster, and will be very unsensitive to the search depth.

I expect this change to solve your issue.

@LMaxence LMaxence added enhancement New feature or request ready This issue is ready for us to code on it labels Jan 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ready This issue is ready for us to code on it
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants