dev-cli icon indicating copy to clipboard operation
dev-cli copied to clipboard

Allow a way to pack and publish without node_modules?

Open Aghassi opened this issue 5 years ago • 1 comments

https://github.com/oclif/dev-cli/blob/1ce4cbe637c893ddb66a4104c7217efdb001622c/src/tarballs/build.ts#L52

I'm going into a deep hole here so I figured I would reach out. I'm trying to publish a CLI internally that relies on some native node packages like node-gyp. Due to things beyond my control, building on Mac on CI is just not an option given the current infrastructure options internally. This isn't an issue if I publish via NPM, but the downside to that is (to my understanding) the auto updater plugin https://github.com/oclif/plugin-update only works with S3 publishes and installs. So, I decided to try and make a brew formula that installs locally from an S3 bucket. The problem lies here in that I'm compiling and publishing from a Linux based docker container, and consuming on a macOS based machine. This means the node-gyp compile is for the wrong platform.

This, in turn, causes failures because of missing native compilations. I can maybe try and make brew recompile node-gyp, but that alone is a headache. So the second option I'm considering is if I can publish the CLI in a tarball that has no dependencies, but allow them to get installed once the CLI is installed via brew.

I don't know if this is a valid solution to my problem, but I figured this is the best place to ask it because I'm kind of going in circles at this point trying to do this in a meaningful way. I'd like to remove extra steps needed when installing where possible, while still remaining cross-platform. Another thought would be to provide a script that could be execute on post install that I could call when doing the brew install that would allow the production installation to happen as it would on CI, just later...

Aghassi avatar Nov 03 '18 05:11 Aghassi

As a stop gap for this, I've spent a decent amount of time working on my current CLI to avoid using libraries like node-gyp that have C++ compilers under the hood.

Aghassi avatar Nov 18 '18 02:11 Aghassi