mswjs / data

Data modeling and relation library for testing JavaScript applications.
https://npm.im/@mswjs/data
MIT License
823 stars 52 forks source link

pnpm resolves msw optional dependency as v2 instead of v1 #289

Closed LavaToaster closed 1 year ago

LavaToaster commented 1 year ago

Given the following package.json file:

{
    "dependencies": {
        "msw": "^1.2.3"
    },
    "devDependencies": {
        "@mswjs/data": "^0.13.0",
        "@mswjs/http-middleware": "^0.8.0",
        "@mswjs/interceptors": "^0.25.1"
    }
}

NPM, Yarn and PNPM are resolving the msw for @mswjs/data as either v1 or v2. In our case with PNPM it's resolving v2. Which then results in @mswjs/data being incompatible.

Should this be a peerDependency?

VororRich commented 1 year ago

Should package.json have the devDependencies and optionalDependencies for MSW set to "^1.0.0" (instead of "latest") until a v2 fix/implementation is in place?

pim commented 1 year ago

In the meantime adding this to package.json fixed it for me.

{
  "pnpm": {
    "overrides": {
      "@mswjs/data": "^1.0.0"
    }
}
kettanaito commented 1 year ago

Using latest was completely incorrect. Will publish a fix.

kettanaito commented 1 year ago

Released: v0.15.0 🎉

This has been released in v0.15.0!

Make sure to always update to the latest version (npm i @mswjs/data@latest) to get the newest features and bug fixes.


Predictable release automation by @ossjs/release.