Skip to content

fix(node-fetch): restore form-data dependency to ^3.0.0#58804

Merged
typescript-bot merged 4 commits intoDefinitelyTyped:masterfrom
peterblazejewicz:fix/node-fetch
Feb 15, 2022
Merged

fix(node-fetch): restore form-data dependency to ^3.0.0#58804
typescript-bot merged 4 commits intoDefinitelyTyped:masterfrom
peterblazejewicz:fix/node-fetch

Conversation

@peterblazejewicz
Copy link
Member

@peterblazejewicz peterblazejewicz commented Feb 15, 2022

We recently restored the deleted node-fetch types. We lowered
the dependency on form-data from ^3.0.0 to ^2.3.3 since that's
what the dev dependency in node-fetch@2 itself had but that older
version didn't ship its own types.

This PR restores the dependency to the same constraint it had when
we previously published @types/node-fetch. While it seems a bit
suspect to depend on a newer major version than node-fetch does,
the only change in form-data v3 is dropping node@4 support, and
it's just a dev dependency upstream.

#58693 (comment)

/cc @glasser @distracteddev

Thanks!

  • Use a meaningful title for the pull request. Include the name of the package modified.
  • Test the change in your own code. (Compile and run.)

@typescript-bot
Copy link
Contributor

typescript-bot commented Feb 15, 2022

@peterblazejewicz Thank you for submitting this PR!

This is a live comment which I will keep updated.

1 package in this PR

Code Reviews

Because this is a widely-used package, a DT maintainer will need to review it before it can be merged.

You can test the changes of this PR in the Playground.

Status

  • ✅ No merge conflicts
  • ✅ Continuous integration tests have passed
  • ✅ Most recent commit is approved by a DT maintainer

All of the items on the list are green. To merge, you need to post a comment including the string "Ready to merge" to bring in your changes.


Diagnostic Information: What the bot saw about this PR
{
  "type": "info",
  "now": "-",
  "pr_number": 58804,
  "author": "peterblazejewicz",
  "headCommitOid": "bb42125bbb73dc49194ac59927e77f6a47433ac3",
  "mergeBaseOid": "24308482dd19406877bb52bfed03d84c8168d457",
  "lastPushDate": "2022-02-15T19:10:06.000Z",
  "lastActivityDate": "2022-02-15T19:45:43.000Z",
  "mergeOfferDate": "2022-02-15T19:44:38.000Z",
  "mergeRequestDate": "2022-02-15T19:45:43.000Z",
  "mergeRequestUser": "peterblazejewicz",
  "hasMergeConflict": false,
  "isFirstContribution": false,
  "tooManyFiles": false,
  "hugeChange": false,
  "popularityLevel": "Critical",
  "pkgInfo": [
    {
      "name": "node-fetch",
      "kind": "edit",
      "files": [
        {
          "path": "types/node-fetch/package.json",
          "kind": "package-meta-ok"
        }
      ],
      "owners": [
        "torstenwerner",
        "nikcorg",
        "vinaybedre",
        "kyranet",
        "AndrewLeedham",
        "JasonLi914",
        "southpolesteve",
        "ExE-Boss",
        "alexandrusavin",
        "OmgImAlexis",
        "kbkk",
        "glasser"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Critical"
    }
  ],
  "reviews": [
    {
      "type": "approved",
      "reviewer": "andrewbranch",
      "date": "2022-02-15T19:44:00.000Z",
      "isMaintainer": true
    },
    {
      "type": "approved",
      "reviewer": "glasser",
      "date": "2022-02-15T19:18:14.000Z",
      "isMaintainer": false
    }
  ],
  "mainBotCommentID": 1040620786,
  "ciResult": "pass"
}

@typescript-bot
Copy link
Contributor

🔔 @torstenwerner @nikcorg @vinaybedre @kyranet @AndrewLeedham @JasonLi914 @southpolesteve @ExE-Boss @alexandrusavin @OmgImAlexis @kbkk @glasser — please review this PR in the next few days. Be sure to explicitly select Approve or Request Changes in the GitHub UI so I know what's going on.

@typescript-bot typescript-bot added the The CI failed When GH Actions fails label Feb 15, 2022
@typescript-bot
Copy link
Contributor

@peterblazejewicz The CI build failed! Please review the logs for more information.

Once you've pushed the fixes, the build will automatically re-run. Thanks!

Note: builds which are failing do not end up on the list of PRs for the DT maintainers to review.

Copy link
Contributor

@glasser glasser left a comment

Choose a reason for hiding this comment

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

I trust you know better than me here. I don't know why this worked in the past before it was deleted? But it does look like the native typings were added in v2.5.0. form-data/form-data@a3c0142

@typescript-bot typescript-bot added the Owner Approved A listed owner of this package signed off on the pull request. label Feb 15, 2022
@glasser
Copy link
Contributor

glasser commented Feb 15, 2022

Well it does appear that this PR isn't quite correct for the reasons that CI is saying, though I suspect you know better than me how to fix it!

@glasser
Copy link
Contributor

glasser commented Feb 15, 2022

Worth noting that node-fetch 2.x only has a dev dep on form-data, so maybe we don't need to take its constraint so seriously and we can change our constraint to be form-data@2.5?

@glasser
Copy link
Contributor

glasser commented Feb 15, 2022

Ah, there is no @types/form-data 2.3 :)

@glasser
Copy link
Contributor

glasser commented Feb 15, 2022

So you can change this to @types/form-data@2.2 or to form-data@2.5.0. Comparing the .d.ts file, the only difference is that form-data@2.5.0 does add a getBuffer() method to FormData, so I guess that is a bit backwards-incompatible. That said, 2.5.0 came out 3 years ago, so it does seem likely that most people are on it in practice?

@peterblazejewicz
Copy link
Member Author

what a mess, there is 2.2.1:
https://unpkg.com/@types/form-data@2.2.1/index.d.ts

@typescript-bot typescript-bot removed Owner Approved A listed owner of this package signed off on the pull request. The CI failed When GH Actions fails labels Feb 15, 2022
@peterblazejewicz
Copy link
Member Author

@glasser amended to 2.2.1 (@types/form-data).
btw. This is what I meant when mentioning 3rd party deps problems

@typescript-bot typescript-bot added the The CI failed When GH Actions fails label Feb 15, 2022
@typescript-bot
Copy link
Contributor

@peterblazejewicz The CI build failed! Please review the logs for more information.

Once you've pushed the fixes, the build will automatically re-run. Thanks!

Note: builds which are failing do not end up on the list of PRs for the DT maintainers to review.

@peterblazejewicz
Copy link
Member Author

OK, so it was never added to white listed types (a bummer), the only option for now is either to wait and whitelist @types/form-data or use form-data@2.5.0 @glasser mentioned. Thoughts?

@typescript-bot typescript-bot removed the The CI failed When GH Actions fails label Feb 15, 2022
@typescript-bot
Copy link
Contributor

@glasser Thank you for reviewing this PR! The author has pushed new commits since your last review. Could you take another look and submit a fresh review?

@peterblazejewicz peterblazejewicz changed the title fix(node-fetch): swap dependency to @types/form-data fix(node-fetch): downgrade dependency of the form-data Feb 15, 2022
Co-authored-by: David Glasser <glasser@apollographql.com>
@peterblazejewicz peterblazejewicz changed the title fix(node-fetch): downgrade dependency of the form-data fix(node-fetch): restore form-data dependency to ^3.0.0 Feb 15, 2022
@typescript-bot
Copy link
Contributor

@glasser Thank you for reviewing this PR! The author has pushed new commits since your last review. Could you take another look and submit a fresh review?

@typescript-bot typescript-bot added the Owner Approved A listed owner of this package signed off on the pull request. label Feb 15, 2022
@peterblazejewicz
Copy link
Member Author

@andrewbranch, at your discretion, please!

@typescript-bot typescript-bot added Maintainer Approved Self Merge This PR can now be self-merged by the PR author or an owner labels Feb 15, 2022
@typescript-bot
Copy link
Contributor

@peterblazejewicz: Everything looks good here. I am ready to merge this PR (at bb42125) on your behalf whenever you think it's ready.

If you'd like that to happen, please post a comment saying:

Ready to merge

and I'll merge this PR almost instantly. Thanks for helping out! ❤️

(@torstenwerner, @nikcorg, @vinaybedre, @kyranet, @AndrewLeedham, @JasonLi914, @southpolesteve, @ExE-Boss, @alexandrusavin, @OmgImAlexis, @kbkk, @glasser: you can do this too.)

@peterblazejewicz
Copy link
Member Author

Ready to merge 💘

@typescript-bot typescript-bot merged commit 08514ca into DefinitelyTyped:master Feb 15, 2022
@peterblazejewicz peterblazejewicz deleted the fix/node-fetch branch February 15, 2022 19:46
martin-badin pushed a commit to martin-badin/DefinitelyTyped that referenced this pull request Feb 23, 2022
…ependency to ^3.0.0 by @peterblazejewicz

* fix(node-fetch): swap dependency to @types/form-data

v2.6 depends on v2.3 of `form-data`. That verison of `form-data` is not
TS native, requires different dependency

DefinitelyTyped#58693 (comment)

/cc @glasser @distracteddev

Thanks!

* Update types/node-fetch/package.json

* Update types/node-fetch/package.json

* Update types/node-fetch/package.json

Co-authored-by: David Glasser <glasser@apollographql.com>

Co-authored-by: David Glasser <glasser@apollographql.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Critical package Maintainer Approved Owner Approved A listed owner of this package signed off on the pull request. Self Merge This PR can now be self-merged by the PR author or an owner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants