Description
The CLI becomes unresponsive when running commands in projects with a large number of files inside the resources directory, this is caused by a recursive file scan in makeClientLibUrl which searches the entire directory tree to locate neutralino.js.
Steps to reproduce the delay
- Initialize a new project:
neu create test-app
cd test-app
- Simulate a large project structure:
mkdir resources/test-package
# On Windows (PowerShell):
for ($i=1; $i -le 10000; $i++) { New-Item -Path "resources/test-package/file_$i.txt" -ItemType "file" -Value "test" }
- Run the application:
- Observe the delay: You will notice a significant hang before the Neutralino window appears. This is because the CLI is recursively scanning all 10,000+ files to find neutralino.js, even though it is typically located in the root of the resources folder.
Expected Behavior:
- CLI should start almost instantly
- No noticeable delay regardless of file count
Actual Behavior:
- CLI freezes for several seconds before starting
- No output during the delay
- Time increases with number of files
I reproduced this issue on my system by generating ~10,000 files inside the resources directory using CMD and observed a 3-5 sec delay which can grow to minutes for larger projects
Description
The CLI becomes unresponsive when running commands in projects with a large number of files inside the
resourcesdirectory, this is caused by a recursive file scan inmakeClientLibUrlwhich searches the entire directory tree to locate neutralino.js.Steps to reproduce the delay
Expected Behavior:
Actual Behavior:
I reproduced this issue on my system by generating ~10,000 files inside the resources directory using CMD and observed a 3-5 sec delay which can grow to minutes for larger projects