Fix: strip inline YAML comments when reading pnpm workspace globs (#570)

An inline comment on a pnpm-workspace.yaml packages line defeated the
end-anchored flow-list regex and the block-list state switch, so
workspaces outside apps/ or packages/ went unrecognized. Reuses the
engine's existing stripInlineYamlComment, matching context.mjs.

Written with AI assistance (Cursor); reviewed by maintainer.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Abdul Wahab
2026-08-14 23:47:59 +05:00
co-authored by Cursor
parent dca8f1ca6f
commit 91f2c7b47e
2 changed files with 18 additions and 1 deletions
+1 -1
View File
@@ -603,7 +603,7 @@ function readWorkspacePatterns(dir) {
try {
let inPackages = false;
for (const line of fs.readFileSync(path.join(dir, 'pnpm-workspace.yaml'), 'utf-8').split(/\r?\n/)) {
const trimmed = line.trim();
const trimmed = stripInlineYamlComment(line).trim();
if (!trimmed || trimmed.startsWith('#')) continue;
const flow = trimmed.match(/^packages:\s*\[(.*)\]\s*$/);
if (flow) {