Skip to content

Conversation

@github-actions
Copy link
Contributor

🤖 Automated fix by Claude Code

Related Issue: #20
Executed by: @DavidWells


If additional fixes are needed: Mention @ claude in a comment on this PR.

resolves #20


Automated PR by Claude Code Action - Run #17346013405

- 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]>
@github-actions
Copy link
Contributor Author

github-actions bot commented Aug 30, 2025

👀 Claude Code execution complete

📊 Execution Info: Pull Request #21 | Unknown (56 files) | @DavidWells
🌿 Branch: claude/issue-20-20250830-1624master
ℹ️ Action Run: https://github.com/DavidWells/serverless-workshop/actions/runs/17346216684

Copy link
Owner

@DavidWells DavidWells left a 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, {
Copy link
Owner

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';
Copy link
Owner

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

@github-actions
Copy link
Contributor Author

github-actions bot commented Aug 30, 2025

Claude finished @github-actions[bot]'s task —— View job


✅ Review Feedback Implemented Successfully

I've successfully implemented all the changes requested in the review comments:

Completed Tasks

  • Remove callback syntax from all functions in _instructor directory (18 files modified)
  • Add missing package.json files with v3 SDK dependencies (2 files created)
  • Commit and push changes

📝 Summary of Changes

Callback Syntax Removal:

  • Updated 18 handler files across the _instructor directory
  • Converted all AWS Lambda functions from legacy callback syntax to modern return syntax
  • Changed function signatures from (event, context, callback) to (event, context)
  • Replaced callback(null, response) with return response
  • Replaced callback(error) with throw error

Package.json Dependencies:

  • Created /events/dynamodb-streams/package.json with AWS SDK v3 dependencies:
    • @aws-sdk/client-dynamodb: ^3.668.0
    • @aws-sdk/lib-dynamodb: ^3.668.0
  • Created /events/sns/package.json with AWS SDK v3 dependencies:
    • @aws-sdk/client-sns: ^3.668.0

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: c6122d4 - Remove callback syntax from all functions in _instructor directory

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]>
@github-actions github-actions bot added auto-generated Automatically generated content claude-code Items created or modified by Claude Code labels Aug 30, 2025
@DavidWells DavidWells merged commit bf35265 into master Sep 1, 2025
2 checks passed
@DavidWells DavidWells deleted the claude/issue-20-20250830-1624 branch September 1, 2025 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-generated Automatically generated content claude-code Items created or modified by Claude Code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update all examples to modern runtime and ESM

2 participants