Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions sdkbuild/typescript.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,15 @@ 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 {
return nil, fmt.Errorf("failed installing SDK deps: %w", err)
}

// 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 {
Expand All @@ -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"
}
Expand Down Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down
Loading