Closed mnapoli closed 2 years ago
Great point raising that @mnapoli - I missed that.
I'm not sure we should install it automatically for users and would prefer to throw an explicit error - if they're adopting compose for the first time, they will be aware that it needs to be installed separately and I don't think it will be a big problem for them to install compose
. They most likely will have it in local package.json
- I believe 99% users will already have a package.json
and will be running npm i
anyway because they either have a node project so they install dependencies or they use a different runtime that requires a plugin to properly bundle code (e.g. Python). So honestly I don't expect any annoyance because they're most likely running npm i
anyway.
Discussion summary.
Scenarios:
@serverless/compose
dependency@serverless/compose
dependencyIn scenarios other than 4, let's trigger an error. In scenario 4 ideally let's install NPM dependencies automatically as this should have no negative side effect.
Since
serverless deploy
needs to install Compose, there can be scenarios where compose is not installed (e.g. in CI). In non-interactive mode (i.e. CI again) the CLI is just stuck:We could imagine 2 solutions:
Since non-interactive will run in CI 90% of the time, I would go with option 2 because:
npm install
at the root of the monoreponpm i
at the root just for compose -> it should just work, we don't want to push the detail of the NPM install on users too much (to the point it's annoying)I would consider the surprise factor very low since, again, you are explicitly running Compose so there's little chance you actually don't want to install it? WDYT @pgrzesik