From f5ba3bf1a0aaf9cb5513508b5a7453d235b751b5 Mon Sep 17 00:00:00 2001 From: Dax Raad Date: Fri, 11 Oct 2024 18:39:16 -0400 Subject: [PATCH] sst.aws.Function: fix not installing `nodejs.install` packages --- pkg/project/project.go | 4 +--- pkg/runtime/node/build.go | 6 +++++- pkg/runtime/node/node.go | 6 +++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/pkg/project/project.go b/pkg/project/project.go index 22d5863fc..c7ade2d10 100644 --- a/pkg/project/project.go +++ b/pkg/project/project.go @@ -343,9 +343,7 @@ func (p *Project) Cleanup() error { if flag.SST_NO_CLEANUP { return nil } - return os.RemoveAll( - filepath.Join(p.PathWorkingDir(), "artifacts"), - ) + return nil } func (p *Project) PathLog(name string) string { diff --git a/pkg/runtime/node/build.go b/pkg/runtime/node/build.go index 99d385194..65a4006d5 100644 --- a/pkg/runtime/node/build.go +++ b/pkg/runtime/node/build.go @@ -229,7 +229,11 @@ func (r *Runtime) Build(ctx context.Context, input *runtime.BuildInput) (*runtim if slices.Contains(installPackages, "sharp") { cmd = append(cmd, "--libc=glibc") } - err = exec.Command("npm", cmd...).Run() + proc := exec.Command("npm", cmd...) + proc.Stdout = os.Stdout + proc.Stderr = os.Stderr + proc.Dir = input.Out() + err = proc.Run() if err != nil { return nil, err } diff --git a/pkg/runtime/node/node.go b/pkg/runtime/node/node.go index c05cb52d4..b8fd3774f 100644 --- a/pkg/runtime/node/node.go +++ b/pkg/runtime/node/node.go @@ -110,9 +110,9 @@ func (w *Worker) Logs() io.ReadCloser { } type NodeProperties struct { - Loader map[string]string `json:"loader"` - Install []string - Banner string + Loader map[string]string `json:"loader"` + Install []string `json:"install"` + Banner string `json:"banner"` ESBuild esbuild.BuildOptions `json:"esbuild"` Minify bool `json:"minify"` Format string `json:"format"`