Skip to content
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

Peer dependency warnings from @graphql-tools/graphql-tag-pluck on @babel/core #5066

Open
4 tasks
shawnmcknight opened this issue Feb 16, 2023 · 4 comments
Open
4 tasks

Comments

@shawnmcknight
Copy link

Issue workflow progress

Progress of the issue based on the Contributor Workflow

  • 1. The issue provides a reproduction available on Github, Stackblitz or CodeSandbox

    Make sure to fork this template and run yarn generate in the terminal.

    Please make sure the GraphQL Tools package versions under package.json matches yours.

  • 2. A failing test has been provided
  • 3. A local solution has been provided
  • 4. A pull request is pending review

Describe the bug

@graphql-tools/graphql-tag-pluck has a dependency on @babel/plugin-syntax-import-assertions. That package has a peer dependency on @babel/core^7.0.0-0. As a result, pnpm is emitting peer dependency warnings due to @babel/core not being present:

└─┬ @graphql-codegen/cli 3.0.0
  └─┬ @graphql-tools/code-file-loader 7.3.21
    └─┬ @graphql-tools/graphql-tag-pluck 7.5.0
      └─┬ @babel/plugin-syntax-import-assertions 7.20.0
        └── ✕ missing peer @babel/core@^7.0.0-0
Peer dependencies that should be installed:
  @babel/core@^7.0.0-0

The dependency for @babel/plugin-syntax-import-assertions was added in #4863. Since that package has a peer dependency on @babel/core, that should be added as well so that consumers without @babel/core do not get peer dependency warnings or an alternative approach devised which makes the syntax transformation opt-in.

To Reproduce
Steps to reproduce the behavior:

Add @graphql-tools/graphql-tag-pluck as a dependency without installing @babel/core. pnpm will emit a peer dependency warning. It's been a while since I've used npm or yarn, but I suspect they would exhibit similar warnings.

Expected behavior

No peer dependency warnings.

Environment:

  • OS: Windows
  • @graphql-tools/...: See dependency tree in description
  • NodeJS: 18.14.0

Additional context

@lensbart
Copy link

lensbart commented Jun 3, 2023

Yarn warning:

➤ YN0002: │ @graphql-tools/graphql-tag-pluck@npm:8.0.1 [cc2f2] doesn't provide @babel/core (p424e0), requested by @babel/plugin-syntax-import-assertions

Yarn workaround:

# .yarnrc.yml
packageExtensions:
  # awaiting fix: https://github.com/ardatan/graphql-tools/issues/5066
  '@graphql-tools/graphql-tag-pluck@*':
    dependencies:
      '@babel/core': '*'

@ardatan
Copy link
Owner

ardatan commented Jun 3, 2023

I don't use PNPM or newer versions of Yarn. PRs are welcome to fix it.

@Semigradsky
Copy link

https://next.babeljs.io/docs/v8-migration/#babelplugin-syntax-import-assertions

Please migrate to @babel/plugin-syntax-import-attributes (#15536). After you replace the plugin, you should search and replace the following patterns in your codebase:

- import value from "module" assert { type: "json" };
+ import value from "module" with { type: "json" };

@ardatan
Copy link
Owner

ardatan commented Jul 25, 2023

Closing this issue since peer dependency has bene added in the latest version.

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

No branches or pull requests

4 participants