Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use unique package names for workspaces #5607

Closed
4 tasks done
fdc-viktor-luft opened this issue Apr 24, 2024 · 2 comments · Fixed by #5608
Closed
4 tasks done

Use unique package names for workspaces #5607

fdc-viktor-luft opened this issue Apr 24, 2024 · 2 comments · Fixed by #5608

Comments

@fdc-viktor-luft
Copy link

fdc-viktor-luft commented Apr 24, 2024

Clear and concise description of the problem

I set up a workspace with roughly 50 workspace packages, but I could not run all tests of the workspace because I ran into the following issue:

Error: Project name "client" is not unique. All projects in a workspace should have unique names.

A big project benefits from having similar structures in different parts of a big monorepo. So it is not surprising that packages with similar purpose end up having the same directory names.

Suggested solution

Why not following rather the same uniqueness restrictions that already exist for package managers and hence will guarantee unique names?

The vitest workspace should identify workspace packages by the "name" property of the package.json.

Additionally: This will also reduce e.g. the nesting level seen in vitest VSCode plugin in the "Testing" panel.

Alternative

No response

Additional context

No response

Validations

@sheremet-va
Copy link
Member

You can add a name property to the config. I don't know if we can use package.json to get the name since workspace file supports any folder, not just packages.

@fdc-viktor-luft
Copy link
Author

Ohh. Thank you. Didn't know that. I would have liked this to be the default, but with that info I can work around my issue.

Feel free to close the issue, if there are good reasons to prefer the dir names instead of the package names.

@github-actions github-actions bot locked and limited conversation to collaborators May 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants