Commit fca1ad5
authored
[rush] Add an option to make the Rush operation hash depend on the NodeJS version. (#5630)
* feat(rush-lib): add dependsOnNodeVersion to operation settings in rush-project.json
Add a new boolean `dependsOnNodeVersion` property to operation settings
in rush-project.json. When set to true, the Node.js version (process.version)
is included in the build cache hash, ensuring cached outputs are invalidated
when the Node.js version changes.
This is useful for projects that produce Node.js-version-specific outputs,
such as native module builds.
* feat(rush-lib): support granular Node.js version matching in dependsOnNodeVersion
Extend dependsOnNodeVersion from a simple boolean to also accept 'major',
'minor', or 'patch' string values (with true as an alias for 'patch').
- 'major': hash includes only major version (e.g. 18)
- 'minor': hash includes major.minor (e.g. 18.17)
- 'patch'/true: hash includes full version (e.g. 18.17.1)
Extract NodeVersionGranularity type alias for reuse. Pre-compute version
strings at all granularity levels once per InputsSnapshot construction.1 parent f83c6ad commit fca1ad5
8 files changed
Lines changed: 340 additions & 2 deletions
File tree
- common
- changes/@microsoft/rush-lib
- reviews/api
- libraries/rush-lib/src
- api
- logic/incremental
- test
- __snapshots__
- schemas
Lines 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
669 | 669 | | |
670 | 670 | | |
671 | 671 | | |
| 672 | + | |
672 | 673 | | |
673 | 674 | | |
674 | 675 | | |
| |||
961 | 962 | | |
962 | 963 | | |
963 | 964 | | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
964 | 968 | | |
965 | 969 | | |
966 | 970 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
75 | 86 | | |
76 | 87 | | |
77 | 88 | | |
| |||
112 | 123 | | |
113 | 124 | | |
114 | 125 | | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
115 | 140 | | |
116 | 141 | | |
117 | 142 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
82 | 83 | | |
83 | 84 | | |
84 | 85 | | |
| |||
Lines changed: 42 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
14 | 18 | | |
15 | 19 | | |
16 | 20 | | |
| |||
90 | 94 | | |
91 | 95 | | |
92 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
93 | 102 | | |
94 | 103 | | |
95 | 104 | | |
| |||
205 | 214 | | |
206 | 215 | | |
207 | 216 | | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
208 | 221 | | |
209 | 222 | | |
210 | 223 | | |
| |||
219 | 232 | | |
220 | 233 | | |
221 | 234 | | |
| 235 | + | |
222 | 236 | | |
223 | 237 | | |
224 | 238 | | |
| |||
274 | 288 | | |
275 | 289 | | |
276 | 290 | | |
| 291 | + | |
| 292 | + | |
277 | 293 | | |
278 | 294 | | |
279 | 295 | | |
| |||
380 | 396 | | |
381 | 397 | | |
382 | 398 | | |
383 | | - | |
| 399 | + | |
384 | 400 | | |
385 | 401 | | |
386 | 402 | | |
| |||
389 | 405 | | |
390 | 406 | | |
391 | 407 | | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
392 | 414 | | |
393 | 415 | | |
394 | 416 | | |
| |||
421 | 443 | | |
422 | 444 | | |
423 | 445 | | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
424 | 464 | | |
425 | 465 | | |
426 | 466 | | |
| |||
0 commit comments