diff --git a/sdkbuild/typescript.go b/sdkbuild/typescript.go index fab8417f..1cff7494 100644 --- a/sdkbuild/typescript.go +++ b/sdkbuild/typescript.go @@ -89,7 +89,7 @@ func BuildTypeScriptProgram(ctx context.Context, options BuildTypeScriptProgramO // Have to build the local repo if st, err := os.Stat(filepath.Join(options.Version, "node_modules")); err != nil || !st.IsDir() { // Only install dependencies, avoid triggerring any post install build scripts - cmd := exec.CommandContext(ctx, "npm", "ci", "--ignore-scripts") + cmd := exec.CommandContext(ctx, "corepack", "pnpm", "install", "--frozen-lockfile", "--ignore-scripts") cmd.Dir = options.Version cmd.Stdin, cmd.Stdout, cmd.Stderr = os.Stdin, os.Stdout, os.Stderr if err := cmd.Run(); err != nil { @@ -97,7 +97,7 @@ func BuildTypeScriptProgram(ctx context.Context, options BuildTypeScriptProgramO } // Build the SDK, ignore the unused `create` package as a mostly insignificant micro optimisation. - cmd = exec.CommandContext(ctx, "npm", "run", "build", "--", "--ignore", "@temporalio/create") + cmd = exec.CommandContext(ctx, "corepack", "pnpm", "run", "build", "--", "--ignore", "@temporalio/create") cmd.Dir = options.Version cmd.Stdin, cmd.Stdout, cmd.Stderr = os.Stdin, os.Stdout, os.Stderr if err := cmd.Run(); err != nil { @@ -118,7 +118,7 @@ func BuildTypeScriptProgram(ctx context.Context, options BuildTypeScriptProgramO } } else { version := strings.TrimPrefix(options.Version, "v") - pkgs := []string{"activity", "client", "common", "worker", "workflow"} + pkgs := []string{"activity", "client", "common", "proto", "worker", "workflow"} for _, pkg := range pkgs { packageJSONDepStr += fmt.Sprintf(` "@temporalio/%v": %q,`, pkg, version) + "\n" } @@ -217,7 +217,7 @@ func BuildTypeScriptProgram(ctx context.Context, options BuildTypeScriptProgramO } // Install - cmd := exec.CommandContext(ctx, "npm", "install") + cmd := exec.CommandContext(ctx, "corepack", "pnpm", "install") cmd.Dir = dir cmd.Stdin, cmd.Stdout, cmd.Stderr = os.Stdin, os.Stdout, os.Stderr if options.ApplyToCommand != nil { @@ -230,7 +230,7 @@ func BuildTypeScriptProgram(ctx context.Context, options BuildTypeScriptProgramO } // Compile - cmd = exec.CommandContext(ctx, "npm", "run", "build") + cmd = exec.CommandContext(ctx, "corepack", "pnpm", "run", "build") cmd.Dir = dir cmd.Stdin, cmd.Stdout, cmd.Stderr = os.Stdin, os.Stdout, os.Stderr if options.ApplyToCommand != nil {