Skip to content

fix(e2e): tsx の解決を root .bin 決め打ちから require.resolve('tsx/cli') に変更#191

Merged
shinyaoguri merged 1 commit into
mainfrom
fix/e2e-tsx-resolve
Jul 7, 2026
Merged

fix(e2e): tsx の解決を root .bin 決め打ちから require.resolve('tsx/cli') に変更#191
shinyaoguri merged 1 commit into
mainfrom
fix/e2e-tsx-resolve

Conversation

@shinyaoguri

Copy link
Copy Markdown
Owner

問題

Dependabot PR #189 の e2e が全滅 (spawnSync node_modules/.bin/tsx ENOENT)。

lockfile 再生成で tsx 4.23.0 が root hoist ではなく packages/e2e/node_modules/ に nest 配置され、verifyCli.ts が決め打ちしていた root の .bin/tsx が存在しなくなったため。tsx の設置場所は npm の hoisting 判断 (他パッケージとのバージョン競合等) で変わりうる。

修正

root パス決め打ちをやめ、e2e パッケージ文脈の createRequire(import.meta.url).resolve('tsx/cli') で解決した entry を process.execPath (node) で直接実行する。root hoist / nest のどちらでも動く。

検証

PR #189 の lockfile (nest 配置) を npm ci した状態で、新しい解決経路により verify-cli が exit 0 で起動することを確認済み。typecheck / lint green。

マージ後

PR #189@dependabot rebase をコメントして本修正込みで CI を回し直す。

🤖 Generated with Claude Code

Dependabot の lockfile 再生成 (PR #189) で tsx が root hoist から
packages/e2e/node_modules 配下の nest 配置に変わり、verifyCli.ts が
決め打ちしていた node_modules/.bin/tsx が消えて全 e2e が spawn ENOENT
で落ちた。設置場所は npm の hoisting 判断次第で変わりうるため、e2e
パッケージ文脈の createRequire で tsx/cli を解決し node で直接実行する。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

🚀 Preview Deployment

Name URL
Preview https://d7beb623.typedcode.pages.dev

Deployed from commit d968cbb
API: staging Workers

@shinyaoguri
shinyaoguri merged commit 05daa15 into main Jul 7, 2026
6 checks passed
@shinyaoguri
shinyaoguri deleted the fix/e2e-tsx-resolve branch July 7, 2026 23:10
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