Skip to content

bug: resolveWorkspacePackages fails for nested workspace patterns #88

@WolfieLeader

Description

@WolfieLeader

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions