fix(e2e): tsx の解決を root .bin 決め打ちから require.resolve('tsx/cli') に変更#191
Merged
Conversation
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>
🚀 Preview Deployment
Deployed from commit d968cbb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
問題
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