neutralinojs / neutralinojs-cli

neu cli for Neutralinojs
https://neutralino.js.org/docs/cli/neu-cli
MIT License
91 stars 56 forks source link

Feat: ignore files support added #253

Closed viralgupta closed 3 months ago

viralgupta commented 4 months ago

closes #218

docs for this pr #309

viralgupta commented 3 months ago

Hi @shalithasuranga, thank you for highlighting best practices. I've removed glob as a dependency and replaced it with anymatch, which is the same library utilized by chokidar in autoReloadExclude. By including anymatch in package.json, we avoid increasing the size of node_modules and instead rely on an existing subdependency.

However, the format for excluding files in cli.autoReloadExclude (".*\\.scss$|.*\\.less$") differs from the format we use for cli.resourceIgnore files (["*.ts", "*.tsx"]). In cli.resourceIgnore, we use an array of patterns rather than a single string with patterns separated by |. Should we maintain a consistent format for ignoring files throughout the configuration file?

shalithasuranga commented 3 months ago

Thanks so much for your update. Could you please implement this the same as the autoReloadExclude option without linking another dependency? Thank you :tada: I think all developers who use Neutralinojs know about Regex, so we don't need to worry about using an array :tada:

Edit: Also, please use Exclude term instead of Ignore to match the existing features.

viralgupta commented 3 months ago

Hi @shalithasuranga, I have implemented regex pattern matching and dropped glob pattern matching. I just wanted to confirm: should we drop glob pattern matching even though this was what was requested in the original issue?

"resourcesIgnore": [".ts", "*.scss", "sandbox.js"]

If we are okay with regex matching, then I think we can merge this PR.

shalithasuranga commented 3 months ago

This is now merged, Thanks :) Please note that I've done some changes in: https://github.com/neutralinojs/neutralinojs-cli/commit/2a6d21c6466a31c20eb41fde67684f2bca63305b