fix: tinyglobby regression (#9380)

ref #9169
This commit is contained in:
Zoltan Kochan
2025-04-05 00:06:40 +02:00
committed by GitHub
parent 72cff38486
commit c85aaf87c9
2 changed files with 11 additions and 1 deletions

View File

@@ -0,0 +1,6 @@
---
"@pnpm/fs.find-packages": patch
"pnpm": patch
---
Do not hang indefinitely, when there is a glob that starts with `!/` in `pnpm-workspace.yaml`. This fixes a regression introduced by [#9169](https://github.com/pnpm/pnpm/pull/9169).

View File

@@ -69,7 +69,11 @@ export async function findPackages (root: string, opts?: Options): Promise<Proje
function normalizePatterns (patterns: readonly string[]): string[] {
const normalizedPatterns: string[] = []
for (const pattern of patterns) {
for (let pattern of patterns) {
// For some reason tinyglobby hangs indefinitely with !/
if (pattern.startsWith('!/')) {
pattern = `!${pattern.substring(2)}`
}
// We should add separate pattern for each extension
// for some reason, fast-glob is buggy with /package.{json,yaml,json5} pattern
normalizedPatterns.push(