Skip to content

Conversation

@0x80
Copy link
Owner

@0x80 0x80 commented Jul 13, 2025

Throw a specific error when pnpm-workspace.yaml is empty to prevent a TypeError. Fixes #83

Co-authored-by: thijskoerselman <thijskoerselman@gmail.com>
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Bug: PNPM Validation Fails for Empty Workspace YAML

The pnpm case in findPackagesGlobs has insufficient validation for pnpm-workspace.yaml. The current check only verifies if the file content is falsy, but does not ensure the presence of the required packages property when the content is a truthy object (e.g., {}). This leads to globs being undefined after destructuring, causing the function to return undefined instead of an array or throwing an error, inconsistent with other package manager validations.

src/lib/registry/helpers/find-packages-globs.ts#L26-L36

if (!workspaceConfig) {
throw new Error(
"pnpm-workspace.yaml file is empty. Please specify packages configuration."
);
}
const { packages: globs } = workspaceConfig;
log.debug("Detected pnpm packages globs:", inspectValue(globs));
return globs;

Fix in CursorFix in Web


BugBot free trial expires on July 22, 2025
Learn more in the Cursor dashboard.

Was this report helpful? Give feedback by reacting with 👍 or 👎

@0x80 0x80 merged commit e771c34 into main Jul 13, 2025
2 checks passed
0x80 added a commit that referenced this pull request Jul 13, 2025
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.

Will fail if pnpm-workspace.yaml is empty

3 participants