Description
resolveWorkspacePackages() uses pattern.replace(/\/\*\*?(\/\*)?$/, '') to strip glob suffixes, then checks direct children or recurses. This approach fails for nested workspace patterns like apps/*/packages/*.
The regex strips /* from the end, leaving apps/*/packages, which is then treated as a literal directory path rather than a glob.
Expected Behavior
A recursive segment-by-segment glob resolver (matching * for single level, ** for recursive, and literal segments) would handle arbitrary nesting correctly.
Additional Improvements
- Workspace patterns should be normalized before resolution (strip
./ prefix, trailing /, normalize backslashes to forward slashes)
- Patterns should be deduplicated and sorted for consistent behavior
Description
resolveWorkspacePackages()usespattern.replace(/\/\*\*?(\/\*)?$/, '')to strip glob suffixes, then checks direct children or recurses. This approach fails for nested workspace patterns likeapps/*/packages/*.The regex strips
/*from the end, leavingapps/*/packages, which is then treated as a literal directory path rather than a glob.Expected Behavior
A recursive segment-by-segment glob resolver (matching
*for single level,**for recursive, and literal segments) would handle arbitrary nesting correctly.Additional Improvements
./prefix, trailing/, normalize backslashes to forward slashes)