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

repo link from package.json is automatically converted to a github link in package page, breaking link for non-github hosted packages #135

Open
2 tasks done
wesinator opened this issue Feb 17, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@wesinator
Copy link

Thanks in advance for your bug report!

  • Have you reproduced this issue in incognito/private browsing?
  • Have you made sure you issue doesn't already exist?

Where is the URL that this occurs?

https://web.pulsar-edit.dev/packages/chlorine

What's your issue?

This package is the one with the repo specified at https://gitlab.com/clj-editors/atom-chlorine/-/blob/master/package.json?ref_type=heads#L21, a gitlab link.

The package frontend displays the repo link as "GitHub", and converts the hostname in the link to github.com, which leads to a nonexistent page.
Expected: the "GitHub" link (really the repo link) should use whatever exact repo url is specified in the package.json, as long as the url is valid https or git. alternatively, an allowlist of additional hosts like gitlab.com and gitea.com could be used, but that seems more hacky.

I believe this is happening in https://github.com/pulsar-edit/package-frontend/blob/95ce50674bf4698521019bf67ea24498ba6a144e/src/reg.js
https://github.com/pulsar-edit/package-frontend/blob/95ce50674bf4698521019bf67ea24498ba6a144e/src/utils.js but I couldn't find the exact generator.

I'm guessing this is a holdover from early atom, and it would probably make sense for the entire "GitHub" specific code to be overhauled.

The one on the packages page is clearly not the github package https://github.com/mauricioszabo/atom-chlorine because 1. the repo path is different. 2. the version in the packages is 0.12.1 which matches the gitlab version.

Which OS/Browser/Version does this happen on?

All browsers

Steps to Reproduce/Additional Details:

https://web.pulsar-edit.dev/packages/chlorine -> click the "GitHub" link

Expected: opens the repo link that is specified in the packages package.json, which in this case is a gitlab link.

@wesinator wesinator added the bug Something isn't working label Feb 17, 2024
@confused-Techie
Copy link
Member

Thanks a ton for reporting this issue!

I'll quickly mention in this case this is not a holdover from Atom. The Atom code that rendered packages was closed source, so this is all custom to Pulsar.

While you do make a great point, I'll say that currently the Pulsar Package Registry only supports publishing packages from GitHub, so this will work in 99.99% of cases. With ones like this package being one of the few were it doesn't work.

Not disagreeing with you about the suggested solution, since we do eventually want to support more than just GitHub, just pointing out that this being an issue should be very few and far between

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants