Closed vonagam closed 3 years ago
Mocha is a peer dependency. Does it mean yarn PnP doesn’t support peerdeps?
If it was declared as peer dependency it would have worked. Currently there are no peer dependencies in package.json. I assume that i was done to support both jasmine and mocha.
But now there is peerDependenciesMeta
field in package.json (npm, yarn).
So you can add mocha
into peerDependencies
and then mark it as optional in peerDependenciesMeta
.
You are right. For some reason I thought they are all optional peerdeps. Need to change this.
If you have time PR is very welcome!
This requires only small changes to package.json
but i don't know current supported version range for mocha
(and jasmine
or jest
which can be added too), unless you want to use wildcard.
this ones works for sure + up:
"optionalDependencies": {
"mocha": "^4.0.0 || ^3.0.0 || ^2.3.0 || ^5.0.0 || ^6.0.0",
"jasmine-core": "^2.0.0 || ^3.0.0",
"jest": "^20.0.0 || ^22.0.0 || ^23.0.0 || ^24.0.0"
},
just need to use peerDeps
+ peerDepsMeta
:tada: This issue has been resolved in version 2.6.1 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Yarn 2 introduced new alternative stricter resolution system for modules - Plug'n'Play.
The problem:
bdd-lazy-var
does not havemocha
as a dependency but still relies on it being resolvable during framework detection. PnP system does not allow that.There is "loose" mode that makes it work, but it still generates warnings about ambiguity and unsoundness of such require call.