Commit 974db43
fix(dep-versions): 直接读取 node_modules/<dep>/package.json,不再依赖 require.resolve
CI(bun 1.4.0)上 detectHermesEnabled 的 RN 版本用例失败:带 paths 的
require.resolve 结果被按 specifier 缓存,第二个临时项目解析到了第一个项目
的 react-native。改为从 cwd 向上查找 node_modules/<dep>/package.json 直接读取,
不受解析器缓存影响;同时对 exports 映射未导出 package.json 的依赖也能取到版本
(require.resolve 在这种包上会抛错而被静默跳过)。
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Tusm6iL2itjJZDiemujAeL1 parent b848104 commit 974db43
1 file changed
Lines changed: 24 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
39 | 44 | | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
47 | 63 | | |
48 | 64 | | |
49 | 65 | | |
| |||
0 commit comments