Skip to content

fix(hooks): wipe TS project emit on branch checkout - #849

Merged
patroza merged 1 commit into
mainfrom
t3code/tsgo-checkout-emit-wipe
Aug 4, 2026
Merged

fix(hooks): wipe TS project emit on branch checkout#849
patroza merged 1 commit into
mainfrom
t3code/tsgo-checkout-emit-wipe

Conversation

@patroza

@patroza patroza commented Aug 4, 2026

Copy link
Copy Markdown
Member

Why

pnpm check is tsgo --build. Package dist/ + .tsbuildinfo are gitignored and can outlive a branch switch, causing phantom type errors that vanish on pnpm rbuild. Same class as scanner#2166.

What

  • Add .githooks/post-checkout: wipe packages/*/dist (and stray *.tsbuildinfo) on every branch/worktree checkout, then reconcile pnpm when lockfile changed
  • Document in .githooks/README.md
  • chmod hooks in install-git-hooks.mjs
  • Hook unit test under scripts/hooks/

How

Checkout flag 1 only; file-only checkouts leave dist alone. Incremental same-branch tsgo -b remains the fast path for pre-push.

Remarks

  • Workaround until upstream invalidation is solid (typescript-go #2666, #4664, #4262)
  • Do not re-enable cross-tree dist reuse without exact source-identity keys

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

tsgo --build reuses packages/*/dist (.tsbuildinfo + declarations) across
branch switches, which causes phantom type errors that vanish on rbuild.
Clear package emit on every post-checkout branch/worktree switch as a
temporary workaround (same approach as macs-holding/scanner#2166).
@pkg-pr-new

pkg-pr-new Bot commented Aug 4, 2026

Copy link
Copy Markdown

Open in StackBlitz

@effect-app/cli

npm i https://pkg.pr.new/effect-app/libs/@effect-app/cli@849

effect-app

npm i https://pkg.pr.new/effect-app/libs/effect-app@849

@effect-app/eslint-codegen-model

npm i https://pkg.pr.new/effect-app/libs/@effect-app/eslint-codegen-model@849

@effect-app/eslint-shared-config

npm i https://pkg.pr.new/effect-app/libs/@effect-app/eslint-shared-config@849

@effect-app/infra

npm i https://pkg.pr.new/effect-app/libs/@effect-app/infra@849

@effect-app/vue

npm i https://pkg.pr.new/effect-app/libs/@effect-app/vue@849

@effect-app/vue-components

npm i https://pkg.pr.new/effect-app/libs/@effect-app/vue-components@849

commit: d38e4b0

@patroza
patroza marked this pull request as ready for review August 4, 2026 11:16
@patroza
patroza merged commit 9c50a0a into main Aug 4, 2026
6 checks passed
@patroza
patroza deleted the t3code/tsgo-checkout-emit-wipe branch August 4, 2026 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant