Jarred-Sumner / git-peek

git repo to local editor instantly
MIT License
722 stars 17 forks source link

brew package #5

Closed nodesocket closed 3 years ago

nodesocket commented 3 years ago

Is it possible to get a brew package published? I've never tried to cook a formula on brew before. Not sure it's even possible with Node.js and git-peek being installed globally.

Jarred-Sumner commented 3 years ago

A brew package is a good idea. I was originally going to call this git-view but there's already a git-view on Homebrew, so I called it git-peek instead.

The most reliable way probably is to embed the node binary in a single file along with the code. That way, it doesn't have a dependency on node, and it would ideally also load from a v8 compiler cache's version, which would speed up start time somewhat. I think this is what Heroku / Vercel / others do.

The trickier question is updates – it would probably work best as a Github Action that re-runs on commit.

I wonder if there's a tool that does this automatically – turns a node.js shebang file into a single node binary

nodesocket commented 3 years ago

A quick Google found:

https://github.com/nexe/nexe

and

https://github.com/vercel/pkg

Jarred-Sumner commented 3 years ago

Almost have pkg integrated, just trying to figure out how to use release-it.

Jarred-Sumner commented 3 years ago

It will now automatically bundle as a separate binary for macOS x64 every release: https://github.com/Jarred-Sumner/git-peek/releases/tag/1.1.20

Now the question is: how to make a homebrew formula that automatically updates it

Jarred-Sumner commented 3 years ago

Added! This was way easier than I thought

nodesocket commented 3 years ago

@Jarred-Sumner thanks for doing this. I am curious what was required to get your package published to brew? Where is that brew code? Also, did generating a single binary with pkg work then?