You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ideally our CLI is available as a single binary and we can download it from brew. Most DevOps people are not in the JavaScript world so we can't expect them to have NodeJs installed.
The text was updated successfully, but these errors were encountered:
So the most commonly used way to do this is through vercel/pkg. Unfortunately this does not have ESM support. I've tried creating a CJS bundle with Rollup but there are things that keep going wrong.
As an alternative, I've started exploring Caxa which does have support for ESM. Initial test seems to work. The author mentions some limitations and imo his solution is a bit dirty and hacky - however it works and maybe for now we should be happy with that.
I'd suggest rolling with this until pkg version 6.0 is released which will support ESM.
Why is it hacky? It basically copies your Node to node_modules/.bin/node and zips it afterwards. Then the 'executable' simply unwraps it to a temporary directory and executes it as if it as if it was just Node natively. It's dirty because it does not clean up this tmp directory for "caching" which basically pollutes a users file system.
You might start messing with the version of NodeJs that the user has installed and that will give very awkward behaviour. I think Brew should have a cleanup call when you uninstall or update and I found the directory of the temporary file. For now it's fine but I might look into writing a small cleanup script. Not for now in any case!
Ideally our CLI is available as a single binary and we can download it from
brew
. Most DevOps people are not in the JavaScript world so we can't expect them to have NodeJs installed.The text was updated successfully, but these errors were encountered: