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

Publish the package for Pulsar Editor #159

Closed
AlexWayfer opened this issue Jul 17, 2023 · 20 comments
Closed

Publish the package for Pulsar Editor #159

AlexWayfer opened this issue Jul 17, 2023 · 20 comments

Comments

@AlexWayfer
Copy link

Hello!

Thanks for your fork.

I've faced with issues from the original package and we've found your fork.

What do you think about publishing a separate package for Pulsar Editor, a fork of Atom Editor?

pulsar-edit/pulsar#645 (comment)

@confused-Techie
Copy link
Collaborator

I'd like to add on, as one of the maintainers of Pulsar, and lead developers of the backend, I'd be more than happy to assist sorting out any troubles you have publishing, so feel free to give me a ping if needed

@alexrudd2
Copy link
Owner

Can you point me to a guide for how to package for Pulsar? I've now installed it and read some docs, but couldn't find a publishing guide.

@confused-Techie
Copy link
Collaborator

@alexrudd2 Thanks a ton for adding me to the project!

But sure, here's our most up to date docs on publishing to the PPR.

But it might be a little funkier then implied by those docs.

Essentially, there's two things to keep in mind:

  1. PPM will try to tag a release of the project, and upload it to GitHub
  2. Then it will need to publish that new version to the PPR (Pulsar Package Registry)

This does mean, that PPM needs some way to interact with Git on your system and your GitHub account. (Ideally, if you have an existing git installation, it should just use that if memory serves), then it will need your Pulsar Account API key to publish to Pulsar.

I know it's a bit weird needing both, but unfortunately Pulsar isn't a part of GitHub anymore, so we can't get away with that like Atom did.

To create your Pulsar account to get your Pulsar Account API Token, just go to the frontend's signup page.


Although if you'd like the "advanced" way to publish, which doesn't require installing Pulsar at all:

  1. Get your Pulsar API key
  2. Create the tag for your repo and upload that remotely
  3. Use something like curl to interact with the API of Pulsar directly to publish the package

If you are publishing the package for the first time (like we are here) then you're request will look something like:

curl -X POST -H "Authorization: <YOUR_PULSAR_API_KEY" https://api.pulsar-edit.dev/api/packages/?repository=alexrudd2/linter-stylelint

And from there you should be good to go. But feel free to use whatever method you're more comfortable with

@confused-Techie
Copy link
Collaborator

Or, for the reasons you've added me to the repo, I'd be more than happy to take care of this for you, if you'd like

@confused-Techie
Copy link
Collaborator

So if you'd like me to handle it just let me know (or even react to this message) and I'll take care of it

@alexrudd2
Copy link
Owner

So if you'd like me to handle it just let me know (or even react to this message) and I'll take care of it

Sure, go for it. It'll take me a while to actually learn the codebase and become a "proper" maintainer, anyways.

@confused-Techie
Copy link
Collaborator

@alexrudd2 Ah I see, well thank you.

So in that case the other big question we have, is this package still shares the name of the previously existing linter-stylelint, which of course that package still exists so we can't use the same name.

Is there a name you prefer? Could be simple like linter-stylelint-pulsar or linter-stylelint-redux so on so forth. But wanting to of course get your thoughts

@alexrudd2
Copy link
Owner

Unless there's some naming convention, linter-stylelint-pulsar seems appropriate to me.

@confused-Techie
Copy link
Collaborator

@alexrudd2 Copy that, linter-stylelint-pulsar sounds like a plan to me. I'll get on that as soon as I can

@confused-Techie
Copy link
Collaborator

Just to keep you updated, I've gone ahead and tried publishing the package to the backend, and it has lead me to discover a bug on the backend.

Where it's defaulting to using the repository name rather than the name defined by the package.json, so it thinks the package name is already in use.

So I'll go ahead and resolve that prior to continuing, sorry about that

@AlexWayfer
Copy link
Author

Do we have progress here?

I'm experiencing a weird UX after installing from CLI.

image

@confused-Techie
Copy link
Collaborator

@AlexWayfer It's funny you ping about this issue now, as I've finally gotten around to resolving this bug.

@alexrudd2 This package has now been successfully published to the Pulsar Package Registry as linter-stylelint-pulsar!

I was finally able to resolve the issue after some major refactors that took me a while, but we should now be good to go here!

Thanks for the extreme patience in this issue getting sorted, as well as allowing me the permissions to go ahead and sort it out. Thanks a ton!


As an aside, @AlexWayfer I can't confirm based on the screenshot, but I think you may be experiencing pulsar-edit/pulsar#616, but hopefully the package now being properly published can fix this.

@AlexWayfer
Copy link
Author

@confused-Techie I can't install it 😓


2
package-card.js? [sm]:579 Installing package linter-stylelint-pulsar failed Error: Installing “[email protected]” failed.
at exit (/opt/Pulsar/resources/app.asar/node_modules/settings-view/lib/package-manager.js:437:23)
at exit (/opt/Pulsar/resources/app.asar/node_modules/settings-view/lib/package-manager.js:85:26)
at triggerExitCallback (/opt/Pulsar/resources/app.asar/src/buffered-process.js:280:9)
at /opt/Pulsar/resources/app.asar/src/buffered-process.js:301:9
at Socket.<anonymous> (/opt/Pulsar/resources/app.asar/src/buffered-process.js:169:7)
at Socket.emit (events.js:327:22)
at Pipe.<anonymous> (net.js:673:12) Request for package information failed: Too Many Requests (429)

  (anonymous) @ package-card.js? [sm]:579
  onError @ /opt/Pulsar/resource…kage-manager.js:410
  exit @ /opt/Pulsar/resource…kage-manager.js:440
  exit @ /opt/Pulsar/resource…ckage-manager.js:85
  triggerExitCallback @ /opt/Pulsar/resource…ered-process.js:280
  (anonymous) @ /opt/Pulsar/resource…ered-process.js:301
  (anonymous) @ /opt/Pulsar/resource…ered-process.js:169
  emit @ events.js:327
  (anonymous) @ net.js:673

@AlexWayfer
Copy link
Author

Probably, I've understood the error:

image

It looks like linter-stylelint-pulsar has linter-stylelint name, which is broken, archived, etc.

@confused-Techie
Copy link
Collaborator

@AlexWayfer The first issue as you mentioned you figured out, but will still elaborate on, the last part of the message shows us the issue Request for package information failed: Too Many Requests (429) which is surprising to say the least. Since iirc the rate limit for unauthenticated endpoints like downloading packages is quite high at several hundred requests per IP per window (each window being 15 minutes). So I hope that isn't a common error you're seeing.

Otherwise as for issues installing it, I was just able to successfully install linter-stylelint-pulsar. Although I will say that the Install button didn't stop showing it loading, even though the package was completely installed, which I confirmed by checking the package appeared in the "Packages" tab. This may be an issue with Pulsar, or maybe the package isn't returning the activate command as expected, I'm not sure.

But it should totally be installed, and it may be a good idea to uninstall linter-stylelint, not that it's necessarily required, but if for example some keymaps haven't been updated in this fork, that'll possibly cause collisions between the two packages.

@AlexWayfer
Copy link
Author

Otherwise as for issues installing it, I was just able to successfully install linter-stylelint-pulsar. Although I will say that the Install button didn't stop showing it loading, even though the package was completely installed, which I confirmed by checking the package appeared in the "Packages" tab. This may be an issue with Pulsar, or maybe the package isn't returning the activate command as expected, I'm not sure.

But it should totally be installed, and it may be a good idea to uninstall linter-stylelint, not that it's necessarily required, but if for example some keymaps haven't been updated in this fork, that'll possibly cause collisions between the two packages.

No, you didn't understand the issue (my issue).

Nothing was installed.

I've uninstalled and reloaded the editor.

Initial state:

image

Pressing "Install" on the correct package:

image

After around 10 seconds:

image

@confused-Techie
Copy link
Collaborator

Okay wait, @AlexWayfer I take back what I previously said. You are totally correct that it's not installable.

It seems for some reason that while Pulsar is correctly attempting to install linter-stylelint-pulsar the backend for some reason is returning a tarball that's older than 4.6.0 (Which is the tarball I published that's needed in order for this package to be identified as different than it's parent fork). Since the backend provides this older tarball, Pulsar then installs an older version that still says it's linter-stylelint.

So there is a bug, not because of this package, but apparently the backend for some reason struggled with this, and seems via all the refactors recently there's been a regression the tests didn't catch. So I'll make sure to check it out as soon as I can.

I'll go ahead and track this on pulsar-edit/package-backend#236

@AlexWayfer
Copy link
Author

So there is a bug, not because of this package, but apparently the backend for some reason struggled with this, and seems via all the refactors recently there's been a regression the tests didn't catch. So I'll make sure to check it out as soon as I can.

I'll go ahead and track this on pulsar-edit/package-backend#236

Thank you very much.

@confused-Techie
Copy link
Collaborator

@AlexWayfer I've just seen you're new comment. Yeah I apologize I misunderstood it. But seem to have gotten to the root issue here.

What that means is to fix it, either we need to push an update of this package which should fix what version the backend is attempting to use, or otherwise (and what I'd prefer) I figure out what went wrong on the backend. I'm at work currently so may be some time, but I'll use that issue for tracking of this one. Thanks a ton for pointing this issue out especially since it has a pretty high impact possibility

@AlexWayfer
Copy link
Author

@confused-Techie no problem here, we'll wait, thank you for your work on all aspects of the wonderful editor.

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

No branches or pull requests

3 participants