Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork1.3k
feat: support check more invalid workspace file#10319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Pull request overview
This PR extends the detection of invalid workspace manifest filenames by adding two dot-prefixed variants (.pnpm-workspace.yaml and.pnpm-workspace.yml) to the list of invalid filenames. When these files are found, pnpm will throw a helpful error message guiding users to use the correctpnpm-workspace.yaml filename instead.
Key changes:
- Adds
.pnpm-workspace.yamland.pnpm-workspace.ymlto the list of invalid workspace manifest filenames that trigger an error - Updates changeset documentation to reflect the new behavior
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| workspace/find-workspace-dir/src/index.ts | ExtendsINVALID_WORKSPACE_MANIFEST_FILENAME array to include dot-prefixed variants |
| .changeset/honest-radios-cut.md | Documents the new feature in the changeset |
💡Add Copilot custom instructions for smarter, more guided reviews.Learn how to get started.
| constWORKSPACE_DIR_ENV_VAR='NPM_CONFIG_WORKSPACE_DIR' | ||
| constWORKSPACE_MANIFEST_FILENAME='pnpm-workspace.yaml' | ||
| constINVALID_WORKSPACE_MANIFEST_FILENAME=['pnpm-workspaces.yaml','pnpm-workspaces.yml','pnpm-workspace.yml'] | ||
| constINVALID_WORKSPACE_MANIFEST_FILENAME=['pnpm-workspaces.yaml','pnpm-workspaces.yml','pnpm-workspace.yml','.pnpm-workspace.yaml','.pnpm-workspace.yml'] |
CopilotAIDec 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
The newly added invalid workspace filenames (.pnpm-workspace.yaml and.pnpm-workspace.yml) lack test coverage. While there is an existing test inpnpm/test/monorepo/index.ts that verifies the error is thrown forpnpm-workspace.yml, the new dot-prefixed variants should also be tested to ensure they are properly detected and produce the expected error message.
| constWORKSPACE_DIR_ENV_VAR='NPM_CONFIG_WORKSPACE_DIR' | ||
| constWORKSPACE_MANIFEST_FILENAME='pnpm-workspace.yaml' | ||
| constINVALID_WORKSPACE_MANIFEST_FILENAME=['pnpm-workspaces.yaml','pnpm-workspaces.yml','pnpm-workspace.yml'] | ||
| constINVALID_WORKSPACE_MANIFEST_FILENAME=['pnpm-workspaces.yaml','pnpm-workspaces.yml','pnpm-workspace.yml','.pnpm-workspace.yaml','.pnpm-workspace.yml'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I'd check what is the impact of adding additional file name checks. If every invalid filename check adds one more fs operation, I don't think it makes sense at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Indeed, matching only the public partpnpm-workspace should be sufficient.
close#10313