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

Make vitest a peer dependency or expose vitest bin #538

Closed
tobiasdiez opened this issue May 21, 2023 · 3 comments
Closed

Make vitest a peer dependency or expose vitest bin #538

tobiasdiez opened this issue May 21, 2023 · 3 comments

Comments

@tobiasdiez
Copy link
Contributor

Currently, nuxt-vitest declares vitest as a dependency. However, it is not possible to invoke binaries exposed by transitive dependencies (at least for yarn, see yarnpkg/berry#1875). Thus users are forced to install vitest as well, so that you end up with two versions of vitest which might lead to version mismatches and issues such as https://github.com/danielroe/nuxt-vitest/issues/132.

Proposal:

  • Either make vitest a peer dependency
  • Re-expose the vitest binary in nuxt-vitest
@danielroe
Copy link
Member

I think it would make sense for vitest to be a peerDep.

@danielroe
Copy link
Member

resolved in danielroe/nuxt-vitest@616b721.

@marr
Copy link

marr commented May 22, 2023

Thanks for this @danielroe - I just realized that the dep is a bit restrictive due to vitest still being prerelease (<1). Should the version be something like ~0 to support all pre-release versions of vitest? Currently if you $ ni -D @nuxt/test-utils nuxt-vitest on a fresh nuxt install, this will fail.

@danielroe danielroe transferred this issue from danielroe/nuxt-vitest Dec 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants