code-coverage icon indicating copy to clipboard operation
code-coverage copied to clipboard

update peer dependencies

Open quisido opened this issue 2 years ago • 4 comments

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

quisido avatar Jun 01 '22 21:06 quisido

@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. 😊

quisido avatar Jul 16 '22 23:07 quisido

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Jul 22 '22 19:07 CLAassistant

@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?

quisido avatar Aug 21 '22 22:08 quisido

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).

rtritto avatar Sep 28 '22 23:09 rtritto

@CharlesStover all dependencies listed in peerDependencies should be removed from devDependencies.

rtritto avatar Jul 29 '23 12:07 rtritto

@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?

quisido avatar Jul 29 '23 17:07 quisido

@CharlesStover nvm, you are right

rtritto avatar Jul 29 '23 19:07 rtritto

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.

quisido avatar Jul 31 '23 20:07 quisido

Let's ship it, I will get you one more +1 right now.

Actually I have some questions, but almost LGTM.

lmiller1990 avatar Aug 02 '23 22:08 lmiller1990

Thanks. I've updated the peer dependencies to match the current requirements for @cypress/webpack-preprocessor.

quisido avatar Aug 02 '23 23:08 quisido

Looks good, I will merge once CI is green!

lmiller1990 avatar Aug 02 '23 23:08 lmiller1990

:tada: This PR is included in version 3.12.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

cypress-app-bot avatar Sep 06 '23 17:09 cypress-app-bot