Skip to content
Closed
Show file tree
Hide file tree
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
7 changes: 7 additions & 0 deletions .changeset/fix-update-typescript-go-workflow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@effect/tsgo": patch
---

Fix automatic `typescript-go` update workflow compatibility with the latest upstream `tsgo` entrypoint changes.

The workflow now updates to the newer upstream submodule revision, keeps the `cmd/tsgo/main.go` hook patch applying cleanly, and refreshes generated shims and flake metadata accordingly.
5 changes: 3 additions & 2 deletions _patches/001-cmd-tsgo-main.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/cmd/tsgo/main.go b/cmd/tsgo/main.go
index 5eabc96df..82b7bf932 100644
index aebcf70fd..6d43d0fe4 100644
--- a/cmd/tsgo/main.go
+++ b/cmd/tsgo/main.go
@@ -3,6 +3,11 @@ package main
@@ -3,7 +3,12 @@ package main
import (
"os"

Expand All @@ -11,6 +11,7 @@ index 5eabc96df..82b7bf932 100644
+ _ "github.com/effect-ts/tsgo/etscheckerhooks" // checker diagnostics hooks
+ _ "github.com/effect-ts/tsgo/etslshooks" // LS codefix hooks
+
"github.com/microsoft/typescript-go/internal/core"
"github.com/microsoft/typescript-go/internal/execute"
)

9 changes: 6 additions & 3 deletions _tools/update-flake-vendor-hash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ if [[ -n "${NIX_BUILD_ARGS:-}" ]]; then
fi

# --- Step 1: Sync flake inputs with submodule commits ---

tsgo_commit="$(git ls-tree HEAD typescript-go | awk '{print $3}')"
#
# Prefer the staged gitlink so local refreshes can be run before committing an
# updated submodule pointer. In CI this matches HEAD once the update commit
# exists.
tsgo_commit="$(git ls-files --stage -- typescript-go | awk 'NR==1 {print $2}')"
if [[ -z "$tsgo_commit" ]]; then
echo "error: cannot determine typescript-go submodule commit" >&2
exit 1
Expand Down Expand Up @@ -70,7 +73,7 @@ update_input_commit "typescript-src" "$ts_commit" "microsoft/TypeScript"
# --- Step 2: Refresh vendor hash ---

run_build() {
nix build "$flake_attr" --no-write-lock-file -L "${extra_args[@]}" >"$build_log" 2>&1
nix build "$flake_attr" --no-write-lock-file -L "${extra_args[@]+"${extra_args[@]}"}" >"$build_log" 2>&1
}

extract_new_hash() {
Expand Down
8 changes: 4 additions & 4 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/* Source of truth: git submodule `typescript-go` commit.
Keep in sync via `_tools/update-flake-vendor-hash.sh`. */
typescript-go-src = {
url = "github:microsoft/typescript-go/56ab4af421576f5326e0c08be5ac67149c053618?submodules=1";
url = "github:microsoft/typescript-go/ee4225a856389fc94c8ce4a5fd9af771dbbc2c0b?submodules=1";
flake = false;
};
/* Source of truth: typescript-go's `_submodules/TypeScript` commit.
Expand Down
2 changes: 1 addition & 1 deletion shim/ast/shim.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions shim/core/shim.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion typescript-go
Submodule typescript-go updated 158 files