Skip to content

refactor(cli): replace glob with tinyglobby - #3099

Merged
fengmk2 merged 4 commits into
voidzero-dev:mainfrom
liangmiQwQ:refactor/cli-tinyglobby
Oct 18, 2026
Merged

fengmk2 merged 4 commits into
voidzero-dev:mainfrom
liangmiQwQ:refactor/cli-tinyglobby

Conversation

@liangmiQwQ

@liangmiQwQ liangmiQwQ commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator

This PR replaces glob with tinyglobby in packages/cli. glob is bundled into the CLI and brings path-scurry, lru-cache and minipass with it. tinyglobby is smaller, and packages/core already uses it.

glob was used in three places: workspace package discovery (utils/workspace.ts), finding .github workflow and action files during vp migrate (migrator/setup.ts), and one test.

User-visible behavior changes:

  • Negated workspace patterns now exclude matching packages. For example, ['packages/*', '!packages/foo'] skips packages/foo. (I'll treat it as a fix, because it actually maches pnpm's behavior).
  • Recursive ** patterns now follow symlinked directories, so workspace discovery and vp migrate may find additional packages or GitHub composite actions under those directories. (Also follow pnpm10 behavior)
  • Migration messages may appear in a different order. For example, tsup migration follow-up messages now list packages/a before packages/b. (IMO, that isn't a big deal).

The glob catalog entry stays because rolldown/packages/rolldown still uses it.

Size

packages/cli/dist JS, measured with build-ts before and after:

Before After Change
Raw 2,272,005 B 2,178,596 B -93,409 B (-4.1%)
gzip -9 543,443 B 521,043 B -22,400 B (-4.1%)
Chunk Raw gzip -9
editor-*.js 406,101 → 312,408 (-93,693) 95,766 → 74,017 (-21,749)
staged/bin.js 161,231 → 104,928 (-56,303) 42,088 → 28,589 (-13,499)
picomatch-*.js (new) 0 → 56,587 (+56,587) 0 → 13,531 (+13,531)

picomatch was already bundled into staged/bin.js for lint-staged. tinyglobby uses it too, so it moved into a shared chunk instead of being bundled twice.

🤖 Generated with Claude Code

Shrinks the bundled CLI (glob pulled in path-scurry, lru-cache and minipass)
and makes negated workspace patterns like `!packages/foo` exclude packages,
matching pnpm. Paths from findPackageJsonFilesFromPatterns stay native.
@liangmiQwQ liangmiQwQ changed the title refactor(cli): replace glob with tinyglobby refactor(cli): replace glob with tinyglobby Oct 17, 2026
@liangmiQwQ liangmiQwQ changed the title refactor(cli): replace glob with tinyglobby feat(cli): replace glob with tinyglobby Oct 17, 2026
@liangmiQwQ
liangmiQwQ marked this pull request as ready for review October 17, 2026 14:48
@liangmiQwQ
liangmiQwQ requested a review from fengmk2 October 17, 2026 14:48
@fengmk2

fengmk2 commented Oct 17, 2026

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-17T17:03:20.761071Z 821ed9e Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@fengmk2 fengmk2 changed the title feat(cli): replace glob with tinyglobby refactor(cli): replace glob with tinyglobby Oct 17, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 821ed9e3ee

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/cli/src/migration/migrator/setup.ts
tinyglobby matches patterns that don't end in `*` as `<pattern>/**` too,
so a directory named like `ci.yml` pulled its contents into the setup-vp
migration. Set `expandDirectories: false` to match the previous glob behavior.
@liangmiQwQ
liangmiQwQ requested a review from fengmk2 October 17, 2026 23:50
@fengmk2
fengmk2 merged commit 2bfa93a into voidzero-dev:main Oct 18, 2026
68 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants