Automattic / vip-cli

The VIP CLI
https://docs.wpvip.com/vip-cli/
MIT License
58 stars 16 forks source link

chore(deps): make `node-fetch` 2.x depend on `whatwg-url` 14.x to address deprecations #1965

Closed sjinks closed 3 weeks ago

sjinks commented 1 month ago

Description

Node.js 21 and 22 deprecate the native punycode module in favor of the userland implementation.

However, whatwg-url 5.x still uses the native module, and this causes deprecation warnings (see #1942):

(node:59820) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
$ npm why whatwg-url
whatwg-url@5.0.0
node_modules/whatwg-url
  whatwg-url@"^5.0.0" from node-fetch@2.7.0
  node_modules/node-fetch
    node-fetch@"^2.6.1" from the root project
    node-fetch@"^2.6.7" from @automattic/vip-go-preflight-checks@2.0.17
    node_modules/@automattic/vip-go-preflight-checks
      @automattic/vip-go-preflight-checks@"^2.0.16" from the root project

Because updating node-fetch to 3.x is not something we can do right now (node-fetch 3.x is an ESM-only module), we override the version of whatwg-url at the package manager level.

This is not the cleanest solution, but it works.

Pull request checklist

New release checklist

Steps to Test

CI must pass.

github-actions[bot] commented 1 month ago

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Manifest Files

sonarcloud[bot] commented 1 month ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud