fix: prevent scanner from traversing node_modules and enable config l… #4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fixes the issue where the icon scanner recursively scans all directories from the project root, including
node_modules, causing build failures when dependencies contain unsupported syntax (e.g., TypeScript decorators).Problem
The scanner had two main issues:
zero-ui.config.jswas completely commented out indist/config.jsROOT_DIRwas""(empty string), causing the scanner to traverse the entire project includingnode_modulesThis caused build failures with packages like
@hookform/resolversthat contain decorator syntax:SyntaxError: Support for the experimental syntax 'decorators' isn't currently enabledSolution
✅ Enabled config loading from
zero-ui.config.js✅ Changed default
ROOT_DIRfrom""to"src"✅ Added
EXCLUDE_DIRSconfiguration with sensible defaults:["node_modules", ".git", "dist", "build", ".next", "out"]✅ Updated scanner to respect
EXCLUDE_DIRSwhen traversing✅ Added comprehensive test suite (8 new tests)
✅ Created unified test runner for better DX
Breaking Changes
None - this is fully backward compatible:
zero-ui.config.jsTesting
All tests pass (including new tests):
npm testTest coverage includes:
Configuration Example
Users can now create zero-ui.config.js:
Related Issues
Fixes #3