-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrating Components #6350
Integrating Components #6350
Conversation
21cfe90
to
8a40c45
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
serverless
command, 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 deploy
to deploy the newly created projectserverless.yml
file. For a minimal exampleserverless
again 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-ci
to run all validation checks on proposed changesValidate via
npm test
Validate via
npm run lint-updated
Note: Some reported issues can be automatically fixed by running
npm run lint:fix
Validate via
npm run prettier-check-updated
Note: All reported issues can be automatically fixed by running
npm run prettify-updated
Is this ready for review?: YES
Is it a breaking change?: NO