Skip to content

fix: remove usage of deprecated url.parse api#1

Merged
zkochan merged 1 commit intopnpm:mainfrom
SuperchupuDev:fix/no-deprecated-url-parse
Jul 23, 2025
Merged

fix: remove usage of deprecated url.parse api#1
zkochan merged 1 commit intopnpm:mainfrom
SuperchupuDev:fix/no-deprecated-url-parse

Conversation

@SuperchupuDev
Copy link

@SuperchupuDev SuperchupuDev commented Jul 23, 2025

needed to solve pnpm/pnpm#9529

version 2.0.0 of this package should be created and released after this gets merged

@SuperchupuDev
Copy link
Author

SuperchupuDev commented Jul 23, 2025

it looks like the tests use ports from URLs like git+ssh://git@notgithub.com:user/foo that aren't valid (a url's port must be numeric else it's not a valid url)

url.parse silently fails and sets port to null, URL.parse returns null instead of an URL

Co-authored-by: Gar <gar+gh@danger.computer>
@SuperchupuDev SuperchupuDev force-pushed the fix/no-deprecated-url-parse branch from 8e0bbbd to 51229b5 Compare July 23, 2025 18:28
@SuperchupuDev SuperchupuDev changed the title fix: use URL.parse instead of deprecated url.parse api fix: remove usage of deprecated url.parse api Jul 23, 2025
@SuperchupuDev
Copy link
Author

SuperchupuDev commented Jul 23, 2025

Apparently url.parse was removed upstream long ago: npm#141

I've redone this PR porting the necessary changes from there and from npm#200 in order for it to work and for the tests to pass 👍

although the proper fix would be to just pull from upstream

@zkochan
Copy link
Member

zkochan commented Jul 23, 2025

We can try to switch to the original package. Looking at the commits in this repo, the fork was created to add support for aliases. npm also added support for aliases since then.

@SuperchupuDev
Copy link
Author

sadly, latest version from upstream requires node 18.17.0 and up. no idea if they actually use node >=18.17 features but the engines field is set that way

@zkochan zkochan merged commit 5c675ac into pnpm:main Jul 23, 2025
@SuperchupuDev SuperchupuDev deleted the fix/no-deprecated-url-parse branch July 23, 2025 22:42
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

Successfully merging this pull request may close these issues.

2 participants