code-coverage
code-coverage copied to clipboard
update peer dependencies
Resolves this warning when installing @cypress/code-coverage
by accurately marking these as peer dependencies (vended from other sources instead of this package's own dependencies):
➤ YN0002: │ @cypress/code-coverage@npm:3.10.0 [6241e] doesn't provide @babel/core (p8cbc9),
requested by @cypress/webpack-preprocessor
➤ YN0002: │ @cypress/code-coverage@npm:3.10.0 [6241e] doesn't provide @babel/preset-env (p3f0bc), requested by @cypress/webpack-preprocessor
➤ YN0002: │ @cypress/code-coverage@npm:3.10.0 [6241e] doesn't provide babel-loader (p93203), requested by @cypress/webpack-preprocessor
➤ YN0002: │ @cypress/code-coverage@npm:3.10.0 [6241e] doesn't provide webpack (pb20d7), requested by @cypress/webpack-preprocessor
@elylucas , sorry to ping directly, but as the last contributor to this repo, can you validate this? I'm still getting this warning on every install, and I'd like to clean it up. 😊
@admah @elylucas I know y'all are in the process of migrating to the main cypress
repository. Any chance this can get resolved for that merge?
Correct ansi-regex is <major_version>.x
(source1, source2 ):
"@babel/core": "7.x",
"@babel/preset-env": "7.x",
"babel-loader": "8.x",
"cypress": "*",
"webpack": "5.x"
Should be consider instead to add *
(accept all versions).
@CharlesStover all dependencies listed in peerDependencies should be removed from devDependencies.
@rtritto Are they not required to test locally? In my experience, having peer dependencies listed as dev dependencies allows a package to be unit tested before it is built and published, since in an e.g. Jest environment there is no "consuming package" to provide the peer dependencies.
The only way I can imagine testing a package with a peer dependency that is not a dev dependency is if the package is tested post-build with a placeholder consumer (Cypress, in this case?), but you'd lose valuable insight like coverage reports or unit testability in doing so.
In this case, if I remove @babel/core
from devDependencies
, how will the package build successfully, when no consuming package exists to provide @babel/core
for the transpilation step?
@CharlesStover nvm, you are right
Sorry to ping directly @lmiller1990 and @cacieprins but since you reviewed the last PR and this PR also has not been reviewed in >1 year, please give it a look. This error does not block installations in NPM, which will use any package present in node_modules
, but it is a FATAL
error with Yarn modern, which requires dependencies versions be specified, since it supports multiple versioning, thus blocks the use of Cypress code coverage on Yarn.
Let's ship it, I will get you one more +1 right now.
Actually I have some questions, but almost LGTM.
Thanks. I've updated the peer dependencies to match the current requirements for @cypress/webpack-preprocessor
.
Looks good, I will merge once CI is green!
:tada: This PR is included in version 3.12.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket: