From 7e461f2fb20a45e7a42bb729fa3d24d1a8fdd7a2 Mon Sep 17 00:00:00 2001 From: Thomas Hardy Date: Thu, 18 Dec 2025 02:34:24 -0500 Subject: [PATCH 1/4] fix: use `pnpm` when installing from source with a frozen lockfile (update `npm` -> `pnpm` for ts build scripts) --- sdkbuild/typescript.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sdkbuild/typescript.go b/sdkbuild/typescript.go index fab8417f..8811544a 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, "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, "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 { @@ -217,7 +217,7 @@ func BuildTypeScriptProgram(ctx context.Context, options BuildTypeScriptProgramO } // Install - cmd := exec.CommandContext(ctx, "npm", "install") + cmd := exec.CommandContext(ctx, "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, "pnpm", "run", "build") cmd.Dir = dir cmd.Stdin, cmd.Stdout, cmd.Stderr = os.Stdin, os.Stdout, os.Stderr if options.ApplyToCommand != nil { From 686b46419438a954441b12f10cd169190aff9fca Mon Sep 17 00:00:00 2001 From: Thomas Hardy Date: Thu, 18 Dec 2025 02:42:33 -0500 Subject: [PATCH 2/4] pnpm not installed, use npx (avoid installation) --- sdkbuild/typescript.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sdkbuild/typescript.go b/sdkbuild/typescript.go index 8811544a..c608aaec 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, "pnpm", "install", "--frozen-lockfile", "--ignore-scripts") + cmd := exec.CommandContext(ctx, "npx", "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, "pnpm", "run", "build", "--", "--ignore", "@temporalio/create") + cmd = exec.CommandContext(ctx, "npx", "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 { @@ -217,7 +217,7 @@ func BuildTypeScriptProgram(ctx context.Context, options BuildTypeScriptProgramO } // Install - cmd := exec.CommandContext(ctx, "pnpm", "install") + cmd := exec.CommandContext(ctx, "npx", "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, "pnpm", "run", "build") + cmd = exec.CommandContext(ctx, "npx", "pnpm", "run", "build") cmd.Dir = dir cmd.Stdin, cmd.Stdout, cmd.Stderr = os.Stdin, os.Stdout, os.Stderr if options.ApplyToCommand != nil { From 61b54c75ceaa39dde6c2678c8819e5d2d48f7fb3 Mon Sep 17 00:00:00 2001 From: Thomas Hardy Date: Thu, 18 Dec 2025 02:48:46 -0500 Subject: [PATCH 3/4] use corepack instead of npx --- sdkbuild/typescript.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sdkbuild/typescript.go b/sdkbuild/typescript.go index c608aaec..6453c1d9 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, "npx", "pnpm", "install", "--frozen-lockfile", "--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, "npx", "pnpm", "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 { @@ -217,7 +217,7 @@ func BuildTypeScriptProgram(ctx context.Context, options BuildTypeScriptProgramO } // Install - cmd := exec.CommandContext(ctx, "npx", "pnpm", "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, "npx", "pnpm", "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 { From 7ca419c0f4daf988b6f523410124d1578a0218b8 Mon Sep 17 00:00:00 2001 From: Thomas Hardy Date: Thu, 18 Dec 2025 03:09:54 -0500 Subject: [PATCH 4/4] add proto dep (now necessary because pnpm uses strict dep isolation, so @temporalio/proto is not longer hoisted to the project root, as it was with npm's flat hoisting) --- sdkbuild/typescript.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdkbuild/typescript.go b/sdkbuild/typescript.go index 6453c1d9..1cff7494 100644 --- a/sdkbuild/typescript.go +++ b/sdkbuild/typescript.go @@ -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" }