Skip to content
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

feat: init node application #997

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

feat: init node application #997

wants to merge 7 commits into from

Conversation

venjiang
Copy link
Contributor

@venjiang venjiang commented Jan 24, 2025

Description

The CLI adds the initializing node application as follows:

yomo init -l node app
cd app && yomo run

Copy link

vercel bot commented Jan 24, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Updated (UTC)
yomo ⬜️ Ignored (Inspect) Visit Preview Jan 29, 2025 0:15am

@venjiang venjiang requested a review from woorui January 24, 2025 07:54
@venjiang venjiang self-assigned this Jan 24, 2025
Copy link

codecov bot commented Jan 24, 2025

Codecov Report

Attention: Patch coverage is 26.70157% with 140 lines in your changes missing coverage. Please review.

Project coverage is 46.47%. Comparing base (6152a12) to head (8888536).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
cli/init.go 0.00% 30 Missing ⚠️
cli/serverless/nodejs/runtime.go 0.00% 30 Missing ⚠️
cli/serverless/nodejs/serverless.go 0.00% 20 Missing ⚠️
cli/template/template.go 71.21% 19 Missing ⚠️
serverless/mock/mock_context.go 23.52% 13 Missing ⚠️
cli/cli.go 0.00% 12 Missing ⚠️
cli/serverless/serverless.go 0.00% 10 Missing ⚠️
cli/serverless/exec/serverless.go 0.00% 2 Missing ⚠️
cli/serverless/golang/serverless.go 0.00% 2 Missing ⚠️
cli/serverless/wasm/serverless.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #997      +/-   ##
==========================================
- Coverage   46.89%   46.47%   -0.43%     
==========================================
  Files          97      100       +3     
  Lines        6721     7094     +373     
==========================================
+ Hits         3152     3297     +145     
- Misses       3370     3597     +227     
- Partials      199      200       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -16,6 +16,9 @@ var (

// Serverless defines the interface for serverless
type Serverless interface {
// Setup sets up the serverless
Setup(opts *Options) error
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the difference between Setup(opts *Options) error and Init(opts *Options) error?

Should these two function be merged ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setup is used to configure the application environment and Init is used to build

"github.com/yomorun/yomo/serverless/mock"
)

func TestHandler(t *testing.T) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The normal _test.go file works well, but the llm _test.go doesn't work. Should we merge pull request #986 first?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can merge here?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made a pr here #998

@@ -70,13 +91,13 @@ var initCmd = &cobra.Command{

log.SuccessStatusEvent(os.Stdout, "Congratulations! You have initialized the stream function successfully.")
log.InfoStatusEvent(os.Stdout, "You can enjoy the YoMo Stream Function via the command: ")
log.InfoStatusEvent(os.Stdout, "\tStep 1: cd %s && yomo build", name)
log.InfoStatusEvent(os.Stdout, "\tStep 2: yomo run sfn.yomo")
log.InfoStatusEvent(os.Stdout, "\tcd %s && yomo run", name)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the yomo build command be deprecated? Migrate the wasi flag to yomo run command..

1. Add `mock.NewArgumentsContext()` for testing llm function.
2. Add `WriteRecord.LLMResult` for retrieving llm function written data.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants