Add recipe prettier#6990
Conversation
|
Ah, not sure why CI failed. |
|
Force push (rerun CI) makes better result. maybe. |
|
Is my understanding correct that this is essentially a broader version of prettier-js? I mention it since there might be a collaboration opportunity with @rcoedo. The other thing I'll mention is that there is a small but significant preference in MELPA for using MELPA's regular conventions and indexing packages with their default branch specified, not a release branch. MELPA already recognizes tagged commits as (stable) releases, and the latest commit as the unstable latest. Otherwise, here's a quick first pass -- prettier.elbyte-compile (using Emacs 26.3):
checkdoc (using version 0.6.1):
package-lint (using version 20200616.2257):
Suggestions/experimental static checks:
|
I'd say it's different not just in breadth, here is a list of differences.
For background, in 2018 I had submitted a bunch of PRs to prettier-emacs but they were sitting for a month without reply. Only then did I decide to start work on this package. @rcoedo has since offered for me to take over maintenance but I'm actually quite happy with the decision to start from scratch. It left me free to choose the approach that I thought was best and meant I didn't have to worry about backward compatibility. (Also, I'd rather not recycle the
We have a build step that I would like to do without. I've considered several alternatives but after careful consideration, they all involve trade-offs I'd rather not make. That's why there is a separate branch for MELPA to pick up from, as per this comment. Is that not ok?
Thanks, fixed 🙂 |
It's fine if it's strictly necessary, but it's my duty to put downward pressure on the complexity of what goes into the recipes. :) This looks like solid work, and an interesting approach to shaving some time off tramp. |
|
Thought so, makes sense. You guys are doing a stellar job with the curation, thanks for the merge and for all your careful work! |
|
I've just had a closer look at the differences. They consist of:
- :files (:defaults "*.js" "*.base64"))
+ :files (:defaults "bootstrap-min.js" "prettier-el.js.gz.base64"))
Until I got to At least now, we have a description of what's going on. |
|
@tarsius thanks for looking into this, appreciate it. Just in case it wasn't obvious, the thread you're replying to is four years old and I've been distributing That being said, I would like to distribute an info file with the new package as well and looking for advice on best practices. I see that in magit you're using org files, checking in the generated texinfo files and then presumably Melpa picks it up from there? Is that an accurate description and can you recommend it? (I'd probably use pandoc again instead of |
I was going through the list of the three packages that Melpa and the Emacsmirror get from diverging branches. I remove the other two packages for being deprecated resp. a complete mess, and was hoping this last remaining discrepancy could be resolved.
Great, when they are not completely necessary, it is nice to see dependencies on other languages (and their respective toolchains/ecosystems) be dropped.
Once that other package exists, do you plan to deprecate this, maybe even archive it and remove it from Melpa?
If that is an option, it would probably better to distribute a texi file.
Yes, Melpa generates the info file from the texi file. (And also
Well. I would prefer if Melpa would take care of generating the texi from the org, and I even implemented support for that in So I have to continue to check the org and the texi files, and I am not particularly happy about that. I had worked for years on finally being able to stop doing that (getting changes into Org, I am considering to use a So I can totally understand, if you stick to using a dedicated branch adding the generated files -- you probably won't be the only one for that much longer. 😁 But I would recommend using the approach just outlined, and name it If you (unlike me) don't mind checking in the documentation twice on the main branch, then I would recommend doing that instead. It certainly is the simplest approach. |
|
Ah, I see now where you're coming from. All understood, and I commend you on your quest to do away with checked in generated code, in my opinion totally worth doing even if it sadly didn't lead anywhere. And, more to the point, thanks a lot for working on improving the security of the ecosystem, which I gather is what you're doing here in the wake of the xz debacle. I wasn't planning on deprecating the However what we could do is take off the base64 encoding, gzip, and minification and ship just plain JavaScript. Adding those layers was a micro-optimization aimed at slow TRAMP connections that in retrospect was a bit too fancy and we can do without really. Would that be an acceptable compromise? |
To be honest, the main motivation was to look into an unusual case, that requires special handling. But yes, I think we should avoid large binary-ish blobs, and stick to the source -- and security plays into that.
That's find, I was just wondering.
I am not sure it would be worth it. You would still require a "publish" branch (even if it weren't for the manual), right? You would still be turning many javascript files into one big file, but then stop there? Could the additional steps be performed after installation? Base64 encoding and gzipping should be possible without requiring a javascript tool chain -- minification, not so much. However, if you do that, you shouldn't do that in-place, modifying the Emacs's/ Maybe @riscy has a comment? |
Brief summary of what the package does
Format source code with a dedicated prettier process. Great support for yarn pnp.
Direct link to the package repository
https://github.com/jscheid/prettier.el
Your association with the package
Contributor
Relevant communications with the upstream package maintainer
jscheid/prettier.el#11
Checklist
Please confirm with
x:M-x checkdocis happy with my docstrings