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

When to publish #2

Open
lassik opened this issue Jul 18, 2018 · 12 comments
Open

When to publish #2

lassik opened this issue Jul 18, 2018 · 12 comments
Assignees
Labels
help wanted Extra attention is needed question Further information is requested

Comments

@lassik
Copy link
Collaborator

lassik commented Jul 18, 2018

Today I just successfully formatted an Emacs buffer for the first time using this extension and the latest version of the @unibeautify/cli from npm 😄 In fact, it's working surprisingly well for basic usage, doing M-x unibeautify to manually beautify a source file (M-x is Emacs-speak for the key combinationMeta-x, i.e. Alt-x). I made it match up Emacs modes with the corresponding Unibeautify language names so Emacs can automatically pick the right language for Unibeautify.

@Glavin001 @szeck87 Since it's already usable, I'd like to publish this package in the main third-party Emacs package archive, MELPA. They usually approve new packages within 1-2 weeks. But waiting longer is fine with me if you'd like to polish some of the NPM packages first. Emacs users expect MELPA packages to mostly work well, but are understanding it there is an occasional hitch, especially with new packages. I'll write some explanatory comments saying that this is work in progress and if they want it done sooner please contribute on GitHub :P

@Glavin001
Copy link
Member

They usually approve new packages within 1-2 weeks.

Wowee, makes me thankful for npm!

... if you'd like to polish some of the NPM packages first.

The Emacs package will be separate from the npm package itself though, right? The user must install the Unibeautify CLI themselves and the Emacs package will wrap their currently installed version?

Overall, I am in favour of getting this process started. @lassik are you OK taking this on? I would appreciate it, as I have no background with Emacs or MELPA. Thank you!!! 🎉

@Glavin001 Glavin001 added help wanted Extra attention is needed question Further information is requested labels Jul 18, 2018
@lassik
Copy link
Collaborator Author

lassik commented Jul 18, 2018

They usually approve new packages within 1-2 weeks.

Wowee, makes me thankful for npm!

The initial submissions take so long because they are hand-vetted for quality by the maintainers (they actually read your code and offer constructive criticism), and the project is badly understaffed right now. After that it's smooth sailing, their CI server picks up any commits from our GitHub master branch and creates a new package in hours. In my experience the system is an extremely good compromise between quality and convenience, apart from the current staff shortage.

... if you'd like to polish some of the NPM packages first.

The Emacs package will be separate from the npm package itself though, right? The user must install the Unibeautify CLI themselves and the Emacs package will wrap their currently installed version?

Exactly right on both counts :) I think it's also best to keep them separate, as there is no clean way to have the Emacs package manager call npm. Emacs users are also very used to this arrangement: other external programs, such as grep and git, are also managed entirely separately from Emacs, usually via the OS package manager. I can write a short introduction for the Emacs package that points to the Unibeautify installation instructions (what would be the best URL, by the way?)

@lassik are you OK taking this on?

Sure, no problem :) I've published several MELPA packages so I'm familiar with the process.

@Glavin001
Copy link
Member

Glavin001 commented Sep 15, 2018

Hey @lassik . Just checking in. I hope you are doing well 😃.

Did they approve the package? Any updates, such as installation instructions, you would like to make to the README.md or https://unibeautify.com/docs/editor-emacs ? Thanks again for your contribution to Unibeautify!

@lassik
Copy link
Collaborator Author

lassik commented Sep 17, 2018

Hi. Thanks, you are very courteous.

I put off publishing it due to perfectionism basically - I wanted to add a framework for migrating settings between Emacs and .unibeautifyrc. But since that's still work in progress on the CLI side (unibeautify --dump-config-json option, etc.) we could just publish the current version. It doesn't have anything besides a manual unibeautify command but that already works fine. And packages don't need to be extremely polished to be submitted to MELPA. I could do it this week.

@Glavin001
Copy link
Member

Sounds good. Thank you!

For those following this issue, here is the related issue for unibeautify --dump-config-json: Unibeautify/cli#19

@lassik
Copy link
Collaborator Author

lassik commented Sep 20, 2018

@Glavin001 I'm ready to submit this to MELPA. Please check the newest commit in the proposed-commentary branch, are these introductory blurbs (README.md and the ;; comments at the top of the .el file) OK with you? The ;; comments are also used by MELPA as the introductory text on the webpage that it generates for the package.

@Glavin001
Copy link
Member

Looks great! Feel free to edit https://github.com/Unibeautify/website/blob/master/docs/editor-emacs.md with any Emacs related instructions. Awesome work, @lassik !

@lassik
Copy link
Collaborator Author

lassik commented Sep 21, 2018

No problem, the work was mostly copy-pasting from existing code :)

Just realized that we should really resolve Unibeautify/cli#81 (How to specify which beautifiers to use with the CLI) before publishing this. Right now the Emacs package doesn't give any config options to the CLI (it only gives it the programming language) so it relies entirely on the CLI to pick which beautifier to use.

@Glavin001
Copy link
Member

Does it use the .unibeautifyrc.yml config files? I think this should be sufficient. Ideally I do not want to encourage alternatives for configuration and really focus on utilizing the configuration file.

@lassik
Copy link
Collaborator Author

lassik commented Sep 21, 2018

The Emacs package doesn't read any configuration files at the moment. I would like to keep it so that it doesn't even have to know that .unibeautifyrc* files exist. The unibeautify CLI program would be the one that checks for the existence of such config files, reads them and applies the settings. This would be the clearest policy IMO, for multiple reasons (also for other plugins besides Emacs).

Whether the .unibeautifyrc* parsing is done in the CLI or in Unibeautify core doesn't matter to Emacs. I suppose it would be good to have it in core (perhaps as an option so callers can opt to read those files or not) since some editor plugins are skipping the CLI and using the core directly. In any case, I think the best policy is to only have one piece of code parse those files. The process is actually very complex when you put together all the little details involved :)

@Glavin001
Copy link
Member

Agreed. Emacs should not have to deal with the configuration file, only Unibeautify CLI itself 👍 .

In your tests, is this working already? Or is Unibeautify CLI not there yet? Unfortunately, it's been a while since I've taken a closer look at the CLI status.

@lassik
Copy link
Collaborator Author

lassik commented Sep 21, 2018

No problem, we are all volunteers here :) It's working fine, but Emacs relies entirely on the CLI to use whatever default options the CLI has. Emacs tells the CLI what programming language it should expect, and the CLI somehow selects a default beautifier with default options for that language.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants