Skip to content

Forked relay-compiler breaks .bin script #4726

@f8k8

Description

@f8k8

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

The forked version of relay-compiler overwrites the script installed to .bin by the regular version of relay-compiler. This can cause builds to use an incorrect version of the relay compiler.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new, empty package with npm init.
  2. Install relay-compiler: npm install --save relay-compiler.
  3. The relay-compiler script in .bin points to the correct place.
  4. Install @graphql-codegen/typescript: npm install --save @graphql-codegen/typescript@2.7.3.
  5. The relay-compiler script in .bin is updated to point to the v12 fork used in @graphql-tools/relay-operation-optimizer

Expected behavior

The forked version of relay-compiler (@ardatan/relay-compiler@12.0.0) should not include the bin entry in its package.json:

"bin": {
    "relay-compiler": "bin/relay-compiler"
  },

and so wouldn't overwrite the relay-compiler script in the .bin folder.

Environment:

  • OS: Windows 10
  • @graphql-tools/relay-operation-optimizer@6.5.6:
  • NodeJS: v16.13.2
  • NPM: 8.17.0

Additional context

There doesn't seem to be a repo for the forked relay-compiler (@ardatan/relay-compiler) that I could see to add this issue to.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions