-
Notifications
You must be signed in to change notification settings - Fork 77
[Feature] Make function command #125
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
base: main
Are you sure you want to change the base?
[Feature] Make function command #125
Conversation
|
Hey there again @aarondfrancis, I've just marked this as Ready for Review! Note: Just a reminder that this PR depends on #123. |
|
I have updated this PR to reflect changes from #123 @aarondfrancis |
|
This PR has just been updated with all the changes from latest release 🚀 |
WalkthroughAdds a new Artisan command Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Artisan as Laravel Artisan
participant Command as MakeLambdaFunction
participant Stub as lambda-function.stub
participant FS as File System
User->>Artisan: php artisan make:lambda-function MyFunc --runtime python3.10
Artisan->>Command: invoke command
Command->>Stub: load stub template
Stub-->>Command: return template with placeholders
Command->>Command: replace {{ namespace }}, {{ class }}, {{ runtime }}
Command->>FS: write generated class file to app/Sidecar/...
FS-->>Command: write success
Command-->>Artisan: command completes
Artisan-->>User: "Lambda function class created"
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 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.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/Commands/stubs/lambda-function.stub (1)
15-18: Consider documenting the placeholder handler path.The handler returns a hardcoded placeholder path
'sidecar/function.handler'. Users will need to manually update this to match their actual handler location. Consider adding a comment in the stub to make this more explicit, or include an example that aligns with common project structures.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
README.md(1 hunks)docs/commands.md(1 hunks)src/Commands/MakeLambdaFunction.php(1 hunks)src/Commands/Warm.php(0 hunks)src/Commands/stubs/lambda-function.stub(1 hunks)src/Providers/SidecarServiceProvider.php(2 hunks)
💤 Files with no reviewable changes (1)
- src/Commands/Warm.php
🧰 Additional context used
🧬 Code graph analysis (1)
src/Commands/MakeLambdaFunction.php (1)
src/LambdaFunction.php (2)
name(100-103)runtime(236-239)
🪛 LanguageTool
README.md
[style] ~51-~51: To sound more natural, try using the present tense here instead of the progressive.
Context: ... deployed to Lambda For example, if we were wanting to use Node on Lambda to generate an `o...
(IS_WANTING_TO)
[style] ~52-~52: Consider a more expressive alternative.
Context: ...imple class in PHP called OgImage. To do this we can run the command: ```bash p...
(DO_ACHIEVE)
🔇 Additional comments (4)
README.md (1)
51-56: Excellent addition to the documentation!The new command example is clear and well-placed. It helps users discover the make command early in the workflow.
src/Providers/SidecarServiceProvider.php (1)
17-17: LGTM!The command is properly imported and registered in the service provider.
Also applies to: 60-60
docs/commands.md (1)
22-35: Comprehensive documentation!The Make section clearly explains both basic usage and runtime customization. The link to the Runtime section is helpful for users wanting more details.
src/Commands/MakeLambdaFunction.php (1)
78-85: Clarify why both replacement patterns are needed.The
str_replaceon line 84 replaces both'nodejs20.x'and'{{ runtime }}'. Since the stub template uses'{{ runtime }}'as the placeholder, why is'nodejs20.x'also being replaced? This appears redundant and could cause confusion.If the stub only contains
'{{ runtime }}', consider simplifying to:- return str_replace(['nodejs20.x', '{{ runtime }}'], $runtime, $stub); + return str_replace('{{ runtime }}', $runtime, $stub);
…ption Co-authored-by: wilsenhc <[email protected]>
Co-authored-by: wilsenhc <[email protected]>
Fix MakeLambdaFunction: rename getArguments() to getOptions() with correct option definition
This PR adds a new
make:lambda-functioncommand to easily create a new function class!Still need to start documenting this, but feel free to add any comments now @aarondfrancis !
Much better so I can start doing changes/fixes to this before marking as ready.
Note: This PR depends on #123, so we better finish that first too
Summary by CodeRabbit
New Features
Documentation
Style