Closed skorfmann closed 5 years ago
Splitting cli from core logic seems first quite reasonable. But how our stack's package.json
will look like with this splitted logic?
Currently we are adding terrastack
as a dependency for the stack (see: example).
With this change we also need to install terrastack-cli
to be able to execute the stack. So it makes working with Terrastack 'more' complex... Or I'm missing something?
With this change we also need to install terrastack-cli to be able to execute the stack. So it makes working with Terrastack 'more' complex... Or I'm missing something?
Yes, the general idea was to have the CLI separate, so it can be installed globally.
For the example folder, we could use npx for a quick start. For the development workflow of the CLI, it can be symlinked.
Anyway, as always, there are pros and cons. Perhaps we should talk about the strategy offline.
Drawbacks:
- oclif is a bit slower than commander (~ 300ms vs 100ms printing the main help)
When it's actually installed and not linked, the difference becomes smaller (oclif: ~ 170ms)
Let's merge it and see how it works out (so far quite good for me, working like this for a few days already)
btw: One really good argument to exract the CLI is less dependencies. The complex example has now ~ 40 npm packages in production mode. That's practically nothing for Node ;)
This extracts the CLI in a dedicated repo: https://github.com/TerraStackIO/terrastack-cli
Benefits:
Drawbacks: