Commit 4c8fd4d
rush-resolver-cache-plugin: add pnpm 10 / lockfile v9 compatibility (#5749)
* rush-resolver-cache-plugin: add pnpm 9/10 compatibility
- Add IPnpmVersionHelpers interface with version-specific implementations
for dep-path hashing, lockfile key format, and store index paths
- Vendor pnpm depPathToFilename from exact source commits for v8, v9, v10
- Organize helpers into pnpm/ subdirectory with shared modules for
keys (v6/v9), store (v3/v10), depPath (v8/v9/v10), and hash functions
- Detect pnpm major version from rush.json config or lockfile format
- Add v9 lockfile test fixture and integration tests for pnpm 9 and 10
- Add unit tests for detectPnpmMajorVersion, getPnpmVersionHelpersAsync,
resolveDependencyKey (33 tests total, up from 7)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Remove detectPnpmMajorVersion; require pnpmVersion from caller
The pnpm major version is always available from rush.json's
packageManagerToolVersion, so there is no need to guess it from
the lockfile format. Make pnpmVersion required in
IComputeResolverCacheFromLockfileOptions and delete the
detectPnpmMajorVersion helper and its tests.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Address code review feedback
- afterInstallAsync: switch/case with throw on unsupported pnpm versions
- computeResolverCacheFromLockfileAsync: hoist backslash regex, use
name ||= parsed.name, destructure lockfile.packages
- helpers: flatten resolveDependencyKey link: branches into ternary,
simplify package key resolution to single getDescriptionFileRootFromKey call
- pnpm/index.ts: move types and factory to pnpmVersionHelpers.ts,
index.ts now only re-exports
- pnpm/v8,v9,v10: import from ./pnpmVersionHelpers instead of .
- pnpm/store/v10: add Dirent to import, hoist scope separator regex
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 1815739 commit 4c8fd4d
File tree
23 files changed
+1227
-121
lines changed- common/changes/@microsoft/rush
- rush-plugins/rush-resolver-cache-plugin
- src
- pnpm
- depPath
- keys
- store
- test
- __snapshots__
- test-collateral
23 files changed
+1227
-121
lines changedLines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
Lines changed: 25 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
19 | 24 | | |
20 | 25 | | |
21 | 26 | | |
| |||
79 | 84 | | |
80 | 85 | | |
81 | 86 | | |
82 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
83 | 104 | | |
84 | 105 | | |
85 | | - | |
| 106 | + | |
86 | 107 | | |
87 | 108 | | |
88 | 109 | | |
| |||
166 | 187 | | |
167 | 188 | | |
168 | 189 | | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
| 190 | + | |
173 | 191 | | |
174 | 192 | | |
175 | 193 | | |
| |||
254 | 272 | | |
255 | 273 | | |
256 | 274 | | |
| 275 | + | |
257 | 276 | | |
258 | 277 | | |
259 | 278 | | |
| |||
Lines changed: 43 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
13 | 23 | | |
14 | 24 | | |
15 | 25 | | |
| |||
105 | 115 | | |
106 | 116 | | |
107 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
108 | 121 | | |
109 | 122 | | |
110 | 123 | | |
| |||
129 | 142 | | |
130 | 143 | | |
131 | 144 | | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
132 | 150 | | |
133 | 151 | | |
134 | 152 | | |
| |||
143 | 161 | | |
144 | 162 | | |
145 | 163 | | |
| 164 | + | |
| 165 | + | |
146 | 166 | | |
147 | 167 | | |
148 | 168 | | |
149 | 169 | | |
150 | 170 | | |
151 | 171 | | |
152 | | - | |
| 172 | + | |
153 | 173 | | |
154 | 174 | | |
155 | 175 | | |
| |||
169 | 189 | | |
170 | 190 | | |
171 | 191 | | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
172 | 196 | | |
173 | | - | |
| 197 | + | |
174 | 198 | | |
175 | | - | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
176 | 205 | | |
177 | 206 | | |
178 | 207 | | |
| |||
182 | 211 | | |
183 | 212 | | |
184 | 213 | | |
185 | | - | |
186 | | - | |
187 | | - | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
188 | 218 | | |
189 | 219 | | |
190 | 220 | | |
| |||
196 | 226 | | |
197 | 227 | | |
198 | 228 | | |
| 229 | + | |
199 | 230 | | |
200 | 231 | | |
201 | 232 | | |
| |||
204 | 235 | | |
205 | 236 | | |
206 | 237 | | |
207 | | - | |
| 238 | + | |
208 | 239 | | |
209 | 240 | | |
210 | | - | |
| 241 | + | |
211 | 242 | | |
212 | 243 | | |
213 | 244 | | |
| |||
248 | 279 | | |
249 | 280 | | |
250 | 281 | | |
251 | | - | |
| 282 | + | |
252 | 283 | | |
253 | 284 | | |
254 | | - | |
| 285 | + | |
255 | 286 | | |
256 | 287 | | |
257 | | - | |
| 288 | + | |
258 | 289 | | |
259 | 290 | | |
260 | 291 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | 4 | | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
| 9 | + | |
56 | 10 | | |
57 | 11 | | |
58 | 12 | | |
59 | 13 | | |
60 | 14 | | |
61 | 15 | | |
62 | 16 | | |
| 17 | + | |
63 | 18 | | |
64 | 19 | | |
65 | 20 | | |
66 | 21 | | |
67 | 22 | | |
68 | 23 | | |
69 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
70 | 27 | | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
79 | 33 | | |
80 | | - | |
| 34 | + | |
81 | 35 | | |
82 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
83 | 40 | | |
84 | 41 | | |
85 | 42 | | |
86 | 43 | | |
87 | 44 | | |
88 | 45 | | |
89 | 46 | | |
| 47 | + | |
90 | 48 | | |
91 | 49 | | |
92 | 50 | | |
93 | | - | |
94 | | - | |
95 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
96 | 60 | | |
97 | 61 | | |
98 | 62 | | |
| |||
106 | 70 | | |
107 | 71 | | |
108 | 72 | | |
109 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
110 | 76 | | |
111 | 77 | | |
112 | 78 | | |
113 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
114 | 87 | | |
115 | 88 | | |
116 | 89 | | |
117 | 90 | | |
118 | 91 | | |
119 | 92 | | |
120 | | - | |
121 | | - | |
122 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
123 | 96 | | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
130 | 105 | | |
131 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
132 | 111 | | |
133 | 112 | | |
134 | 113 | | |
| |||
0 commit comments