Anifacted / lerna-update-wizard

A command line tool for bulk-updating lerna package dependencies
269 stars 20 forks source link

Hangs when there are too many directories? #50

Open ChristianKienle opened 5 years ago

ChristianKienle commented 5 years ago

I just tried to run lerna-update-wizzard a couple of times in a project with about 60 packages. It always got stuck before showing the 'Select a dependency to upgrade'-prompt. Then I deleted all node_module-directories (recursively) and ran it again. This time the prompt was shown immediately. Is this a known thing?

Anifacted commented 5 years ago

Hmm, I haven't seen this issue myself, no, but I can imagine that 60 packages would build up quite a huge object for representing your project's "dependency map", and therefore expect "Collecting packages..." step to take a little while.

I am unsure of why the presence of node_modules/ folders would make any difference, though, since it works exclusively on the information found in your package.json files.

Anifacted commented 5 years ago

It just occurred to me that this line might be the issue: https://github.com/Anifacted/lerna-update-wizard/blob/master/src/index.js#L83

It is scanning for package.json files and it might be recursively hitting all those node_modules/ sub directories. I need to look into that. Are you still seeing the issue?

ChristianKienle commented 5 years ago

globby.stream should do the trick. Right? Need a helping hand?

Anifacted commented 5 years ago

You are more than welcome to add a PR, yes! I suppose functionality should stay unchanged with that change, so we should be able to rely on the automated tests for this one 👍

Anifacted commented 5 years ago

I believe these tests should cover that part: https://github.com/Anifacted/lerna-update-wizard/blob/master/test/lerna.json.packages.spec.js