Skip to content

update peer dependencies #574

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

Merged
merged 2 commits into from
Aug 3, 2023
Merged

update peer dependencies #574

merged 2 commits into from
Aug 3, 2023

Conversation

quisido
Copy link
Contributor

@quisido quisido commented Jun 1, 2022

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
Copy link
Contributor Author

quisido commented Jul 16, 2022

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

@CLAassistant
Copy link

CLAassistant commented Jul 22, 2022

CLA assistant check
All committers have signed the CLA.

@quisido
Copy link
Contributor Author

quisido commented Aug 21, 2022

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

@rtritto
Copy link

rtritto commented Sep 28, 2022

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
Copy link

rtritto commented Jul 29, 2023

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

@quisido
Copy link
Contributor Author

quisido commented Jul 29, 2023

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

@rtritto
Copy link

rtritto commented Jul 29, 2023

@CharlesStover nvm, you are right

@quisido
Copy link
Contributor Author

quisido commented Jul 31, 2023

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.

@lmiller1990
Copy link
Contributor

lmiller1990 commented Aug 2, 2023

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

Actually I have some questions, but almost LGTM.

package.json Outdated
"@babel/preset-env": "^7.0.0",
"babel-loader": "^8.0.0",
"cypress": "*",
"webpack": "^5.0.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be ^4.0.0 @CharlesStover? That should also be fine.

Also you should either havebabel-loader OR @babel-loader, do we need to list both of these?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually it looks like this is OUR fault, we ask for those versions of those modules. That seems wrong, but it's not really something to fix in this PR.

I think you need to set webpack to ^4 || ^5, though.

Copy link
Contributor

@lmiller1990 lmiller1990 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick question

@quisido
Copy link
Contributor Author

quisido commented Aug 2, 2023

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

@lmiller1990
Copy link
Contributor

Looks good, I will merge once CI is green!

@lmiller1990 lmiller1990 merged commit 319f7a3 into cypress-io:master Aug 3, 2023
@quisido quisido deleted the 002 branch August 3, 2023 00:45
@cypress-app-bot
Copy link

🎉 This PR is included in version 3.12.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants