Integrating Components#6350
Conversation
21cfe90 to
8a40c45
Compare
There was a problem hiding this comment.
I just tested it and it works fine.
I got an error when running the bucket example (NoSuchBucket) but I guess that this is intentional.
Then only thing that confused me was that the componentsCli has the logic which determines whether the serverless.yml is a Framework file or a Components file. As far as I understood it, the cli project is Components related (at least that what the project description on GitHub says).
I'd propose to add the check for whether it's a Framework or Componets project in the bin/serverless.js file and then call the relevant Components CLI commands if a components project is detected.
Another way would be to remove the emphasis on Components from the CLI project and build it in a consumer-agnostic way. In that case we should rename the variables in the bin/serverless.js file as suggested below.
pmuens
left a comment
There was a problem hiding this comment.
Just tested it again and it works fine 👍 (couldn't reproduce the Bucket error).
Thanks for updating the code 👍
LGTM ![]()
What did you implement:
Integrates Serverless Components with the Serverless Framework.
How did you implement it:
Integrated with Serverless Components by simply depending on the components cli as a dependency and using its methods (I've kept all the required logic over there to keep things separate). Since components require at least Node 8, we are only integrating components for Node 8+ users.
One conflicting issue I've found is: what happens when there's an empty directory? I know @medikoo is working on an interactive
serverlesscommand, but the components project also ships with such a functionality. I think what we'll need to do is add support for components templates in @medikoo implementation, although I wish we could separate concerns. For now, the components check just moves on if it's an empty directory so that @medikoo updates kick in.How can we verify it:
serverless create -t aws-nodejs- this should create a framework projectserverless deployto deploy the newly created projectserverless.ymlfile. For a minimal exampleserverlessagain in the same cwd. This should run components instead of the framework as it detected that it's a components projectTodos:
Note: Run
npm run test-cito run all validation checks on proposed changesValidate via
npm testValidate via
npm run lint-updatedNote: Some reported issues can be automatically fixed by running
npm run lint:fixValidate via
npm run prettier-check-updatedNote: All reported issues can be automatically fixed by running
npm run prettify-updatedIs this ready for review?: YES
Is it a breaking change?: NO