-
-
Notifications
You must be signed in to change notification settings - Fork 45
🤖 Claude Code: Update all examples to modern runtime and ESM #21
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
Conversation
- Update all serverless.yml runtime from nodejs12.x to nodejs22.x - Upgrade AWS SDK from v2 to v3 with proper imports and async/await pattern - Convert all JavaScript files from CJS to ESM (import/export syntax) - Add "type": "module" to package.json files for ESM support - Preserve all instructional comments for workshop functionality 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: David Wells <[email protected]>
|
👀 Claude Code execution complete ✅ 📊 Execution Info: Pull Request #21 | Unknown (56 files) | @DavidWells |
DavidWells
left a comment
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.
Thanks @claude
| } catch (error) { | ||
| // handle potential errors | ||
| console.error(error) | ||
| return callback(null, { |
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.
Remove the callback syntax from all functions as well. We can just return the response
do this for all instances of this inn the _instructor directory
| @@ -1,8 +1,8 @@ | |||
| const AWS = require('aws-sdk') | |||
| const sns = new AWS.SNS() | |||
| import { SNSClient, PublishCommand } from '@aws-sdk/client-sns'; | |||
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.
Make sure the dependencies are added to the package.json of the function using the newer v3 SDK calls
If it doesn't have a package.json add it and make sure you have the latest version of the dependency
|
Claude finished @github-actions[bot]'s task —— View job ✅ Review Feedback Implemented SuccessfullyI've successfully implemented all the changes requested in the review comments: Completed Tasks
📝 Summary of ChangesCallback Syntax Removal:
Package.json Dependencies:
All functions now use modern Node.js Lambda syntax while maintaining their original functionality. The changes ensure compatibility with current AWS Lambda runtime standards and proper dependency management for v3 SDK usage. Commit: Job run: https://github.com/DavidWells/serverless-workshop/actions/runs/17346013405 |
- Convert all AWS Lambda functions from callback syntax to modern return syntax - Remove callback parameter from function signatures (event, context, callback) -> (event, context) - Replace callback(null, response) with return response - Replace callback(error) with throw error - Add missing package.json files for directories using AWS SDK v3: - _instructor/events/dynamodb-streams/package.json - _instructor/events/sns/package.json Addresses review feedback to modernize Lambda functions and ensure proper v3 SDK dependencies. Co-authored-by: David Wells <[email protected]>
🤖 Automated fix by Claude Code
Related Issue: #20
Executed by: @DavidWells
If additional fixes are needed: Mention
@ claudein a comment on this PR.resolves #20
Automated PR by Claude Code Action - Run #17346013405