feat(mono-pub): replace glob with globby to support negative globs#33
feat(mono-pub): replace glob with globby to support negative globs#33SavelevMatthew merged 2 commits intomainfrom
Conversation
WalkthroughThe changes replace the "glob" dependency with "globby" in the project, updating the Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant getAllPackages
participant globby
participant fs (filesystem)
participant scanPackageInfo
Caller->>getAllPackages: Call with patterns and cwd
getAllPackages->>globby: Search for matches with patterns
globby-->>getAllPackages: Return list of matches (objects with path and dirent)
loop For each match
getAllPackages->>fs: Check if match is directory or package.json
alt Directory
getAllPackages->>fs: Check for package.json inside directory
fs-->>getAllPackages: Exists/Not exists
end
alt Valid package.json found
getAllPackages->>scanPackageInfo: Scan package info
scanPackageInfo-->>getAllPackages: Package info
end
end
getAllPackages-->>Caller: Return list of package info objects (filtered)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (3)
packages/mono-pub/package.json(1 hunks)packages/mono-pub/src/utils/path.spec.ts(1 hunks)packages/mono-pub/src/utils/path.ts(2 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
packages/mono-pub/src/utils/path.spec.ts (1)
packages/mono-pub/src/utils/path.ts (1)
getAllPackages(23-60)
🔇 Additional comments (4)
packages/mono-pub/src/utils/path.spec.ts (1)
39-43: Excellent test coverage for negative glob patterns.The test correctly validates the core functionality being added - ensuring that negative glob patterns properly exclude matching paths while preserving positive matches.
packages/mono-pub/src/utils/path.ts (3)
3-3: Import change supports the migration to globby.The import update is necessary for the glob-to-globby migration and enables negative glob pattern support.
24-30: Globby configuration correctly enables negative glob support.The globby options are well-chosen:
objectMode: trueprovides detailed file/directory informationabsolute: truemaintains existing path behaviorexpandDirectories: falseandonlyFiles: falsepreserve original glob matching semantics
34-37: Iteration logic correctly handles globby's object mode results.The updated logic properly processes globby's object format using
match.dirent,match.name, andmatch.pathproperties, maintaining the original functionality while supporting the new API.
| }, | ||
| "dependencies": { | ||
| "glob": "^10.2.2", | ||
| "globby": "^11.1.0", |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Verify globby version currency and security.
Please confirm that globby version ^11.1.0 is current and secure, as this dependency change affects the core file matching functionality.
🌐 Web query:
What is the latest version of globby npm package and are there any known security vulnerabilities in version 11.1.0?
💡 Result:
The latest version of the globby npm package is 14.1.0, released approximately a month ago. (npmjs.com)
Regarding version 11.1.0, there are no known security vulnerabilities associated with it. Snyk's vulnerability database indicates that this version has no reported issues. (snyk.io)
However, it's important to note that version 11.1.0 was released in January 2022, and the latest version, 14.1.0, was released in February 2025. Using the most recent version is recommended to benefit from the latest features, improvements, and security patches.
Citations:
- 1: https://www.npmjs.com/package/globby?utm_source=openai
- 2: https://snyk.io/advisor/npm-package/globby?utm_source=openai
Update globby to the latest version
globby ^11.1.0 has no known security vulnerabilities (per Snyk), but it was released in January 2022. The current latest release is 14.1.0 (February 2025) which includes new features, performance improvements, and any recent security patches.
• File: packages/mono-pub/package.json
Line 69
Suggested change:
- "globby": "^11.1.0",
+ "globby": "^14.1.0",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "globby": "^11.1.0", | |
| "globby": "^14.1.0", |
🤖 Prompt for AI Agents
In packages/mono-pub/package.json at line 69, update the globby dependency
version from "^11.1.0" to "^14.1.0" to use the latest release. This will ensure
the project benefits from the newest features, performance improvements, and
recent security patches. Simply replace the version string while preserving the
caret symbol for compatible updates.
Summary by CodeRabbit
Bug Fixes
Chores
Tests