@rnx-kit/cli 0.9.55 → 0.9.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/coverage/clover.xml +74 -70
- package/coverage/coverage-final.json +2 -2
- package/coverage/lcov-report/index.html +20 -20
- package/coverage/lcov-report/src/bundle/index.html +1 -1
- package/coverage/lcov-report/src/bundle/kit-config.ts.html +1 -1
- package/coverage/lcov-report/src/bundle/metro.ts.html +1 -1
- package/coverage/lcov-report/src/bundle/overrides.ts.html +1 -1
- package/coverage/lcov-report/src/index.html +14 -14
- package/coverage/lcov-report/src/metro-config.ts.html +27 -12
- package/coverage/lcov-report/src/typescript/index.html +11 -11
- package/coverage/lcov-report/src/typescript/project-cache.ts.html +99 -24
- package/coverage/lcov.info +115 -109
- package/lib/metro-config.d.ts.map +1 -1
- package/lib/metro-config.js +6 -4
- package/lib/metro-config.js.map +1 -1
- package/lib/typescript/project-cache.d.ts +6 -2
- package/lib/typescript/project-cache.d.ts.map +1 -1
- package/lib/typescript/project-cache.js +23 -14
- package/lib/typescript/project-cache.js.map +1 -1
- package/package.json +1 -1
- package/src/metro-config.ts +9 -4
- package/src/typescript/project-cache.ts +42 -17
|
@@ -23,16 +23,16 @@
|
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">50
|
|
26
|
+
<span class="strong">50% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>27/
|
|
28
|
+
<span class='fraction'>27/54</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">50% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>14/
|
|
35
|
+
<span class='fraction'>14/28</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">
|
|
47
|
+
<span class="strong">50.94% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>27/
|
|
49
|
+
<span class='fraction'>27/53</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -74,17 +74,17 @@
|
|
|
74
74
|
</thead>
|
|
75
75
|
<tbody><tr>
|
|
76
76
|
<td class="file medium" data-value="metro-config.ts"><a href="metro-config.ts.html">metro-config.ts</a></td>
|
|
77
|
-
<td data-value="50
|
|
77
|
+
<td data-value="50" class="pic medium">
|
|
78
78
|
<div class="chart"><div class="cover-fill" style="width: 50%"></div><div class="cover-empty" style="width: 50%"></div></div>
|
|
79
79
|
</td>
|
|
80
|
-
<td data-value="50
|
|
81
|
-
<td data-value="
|
|
82
|
-
<td data-value="
|
|
83
|
-
<td data-value="
|
|
80
|
+
<td data-value="50" class="pct medium">50%</td>
|
|
81
|
+
<td data-value="54" class="abs medium">27/54</td>
|
|
82
|
+
<td data-value="50" class="pct medium">50%</td>
|
|
83
|
+
<td data-value="28" class="abs medium">14/28</td>
|
|
84
84
|
<td data-value="20" class="pct low">20%</td>
|
|
85
85
|
<td data-value="10" class="abs low">2/10</td>
|
|
86
|
-
<td data-value="
|
|
87
|
-
<td data-value="
|
|
86
|
+
<td data-value="50.94" class="pct medium">50.94%</td>
|
|
87
|
+
<td data-value="53" class="abs medium">27/53</td>
|
|
88
88
|
</tr>
|
|
89
89
|
|
|
90
90
|
</tbody>
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
96
96
|
Code coverage generated by
|
|
97
97
|
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
|
98
|
-
at
|
|
98
|
+
at Wed Dec 08 2021 23:26:22 GMT+0000 (Coordinated Universal Time)
|
|
99
99
|
</div>
|
|
100
100
|
</div>
|
|
101
101
|
<script src="../prettify.js"></script>
|
|
@@ -23,16 +23,16 @@
|
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">50
|
|
26
|
+
<span class="strong">50% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>27/
|
|
28
|
+
<span class='fraction'>27/54</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">50% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>14/
|
|
35
|
+
<span class='fraction'>14/28</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">
|
|
47
|
+
<span class="strong">50.94% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>27/
|
|
49
|
+
<span class='fraction'>27/53</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -217,7 +217,12 @@
|
|
|
217
217
|
<a name='L158'></a><a href='#L158'>158</a>
|
|
218
218
|
<a name='L159'></a><a href='#L159'>159</a>
|
|
219
219
|
<a name='L160'></a><a href='#L160'>160</a>
|
|
220
|
-
<a name='L161'></a><a href='#L161'>161</a
|
|
220
|
+
<a name='L161'></a><a href='#L161'>161</a>
|
|
221
|
+
<a name='L162'></a><a href='#L162'>162</a>
|
|
222
|
+
<a name='L163'></a><a href='#L163'>163</a>
|
|
223
|
+
<a name='L164'></a><a href='#L164'>164</a>
|
|
224
|
+
<a name='L165'></a><a href='#L165'>165</a>
|
|
225
|
+
<a name='L166'></a><a href='#L166'>166</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
221
226
|
<span class="cline-any cline-neutral"> </span>
|
|
222
227
|
<span class="cline-any cline-neutral"> </span>
|
|
223
228
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -285,9 +290,14 @@
|
|
|
285
290
|
<span class="cline-any cline-no"> </span>
|
|
286
291
|
<span class="cline-any cline-no"> </span>
|
|
287
292
|
<span class="cline-any cline-no"> </span>
|
|
293
|
+
<span class="cline-any cline-neutral"> </span>
|
|
294
|
+
<span class="cline-any cline-neutral"> </span>
|
|
295
|
+
<span class="cline-any cline-neutral"> </span>
|
|
296
|
+
<span class="cline-any cline-no"> </span>
|
|
288
297
|
<span class="cline-any cline-no"> </span>
|
|
289
298
|
<span class="cline-any cline-no"> </span>
|
|
290
299
|
<span class="cline-any cline-neutral"> </span>
|
|
300
|
+
<span class="cline-any cline-neutral"> </span>
|
|
291
301
|
<span class="cline-any cline-no"> </span>
|
|
292
302
|
<span class="cline-any cline-no"> </span>
|
|
293
303
|
<span class="cline-any cline-no"> </span>
|
|
@@ -444,12 +454,17 @@ function createSerializerHook(options: TypeScriptValidationOptions) {
|
|
|
444
454
|
// Map each file to a TypeScript project, and apply its delta operation.
|
|
445
455
|
const tsprojectsToValidate: Set<Project> = <span class="cstat-no" title="statement not covered" >new Set();</span>
|
|
446
456
|
<span class="cstat-no" title="statement not covered" > adds.concat(updates).forEach(<span class="fstat-no" title="function not covered" >(s</span>ourceFile) => {</span>
|
|
447
|
-
const tsproject = <span class="cstat-no" title="statement not covered" >projectCache.
|
|
448
|
-
|
|
449
|
-
|
|
457
|
+
const { tsproject, tssourceFiles } = <span class="cstat-no" title="statement not covered" >projectCache.getProjectInfo(</span>
|
|
458
|
+
sourceFile,
|
|
459
|
+
platform
|
|
460
|
+
);
|
|
461
|
+
<span class="cstat-no" title="statement not covered" > if (tssourceFiles.has(sourceFile)) {</span>
|
|
462
|
+
<span class="cstat-no" title="statement not covered" > tsproject.setFile(sourceFile);</span>
|
|
463
|
+
<span class="cstat-no" title="statement not covered" > tsprojectsToValidate.add(tsproject);</span>
|
|
464
|
+
}
|
|
450
465
|
});
|
|
451
466
|
<span class="cstat-no" title="statement not covered" > deletes.forEach(<span class="fstat-no" title="function not covered" >(s</span>ourceFile) => {</span>
|
|
452
|
-
const tsproject = <span class="cstat-no" title="statement not covered" >projectCache.
|
|
467
|
+
const { tsproject } = <span class="cstat-no" title="statement not covered" >projectCache.getProjectInfo(sourceFile, platform);</span>
|
|
453
468
|
<span class="cstat-no" title="statement not covered" > tsproject.removeFile(sourceFile);</span>
|
|
454
469
|
<span class="cstat-no" title="statement not covered" > tsprojectsToValidate.add(tsproject);</span>
|
|
455
470
|
});
|
|
@@ -544,7 +559,7 @@ export function customizeMetroConfig(
|
|
|
544
559
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
545
560
|
Code coverage generated by
|
|
546
561
|
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
|
547
|
-
at
|
|
562
|
+
at Wed Dec 08 2021 23:26:22 GMT+0000 (Coordinated Universal Time)
|
|
548
563
|
</div>
|
|
549
564
|
</div>
|
|
550
565
|
<script src="../prettify.js"></script>
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">
|
|
26
|
+
<span class="strong">8.89% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>4/
|
|
28
|
+
<span class='fraction'>4/45</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">9.
|
|
47
|
+
<span class="strong">9.09% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>4/
|
|
49
|
+
<span class='fraction'>4/44</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -74,17 +74,17 @@
|
|
|
74
74
|
</thead>
|
|
75
75
|
<tbody><tr>
|
|
76
76
|
<td class="file low" data-value="project-cache.ts"><a href="project-cache.ts.html">project-cache.ts</a></td>
|
|
77
|
-
<td data-value="
|
|
78
|
-
<div class="chart"><div class="cover-fill" style="width:
|
|
77
|
+
<td data-value="8.89" class="pic low">
|
|
78
|
+
<div class="chart"><div class="cover-fill" style="width: 8%"></div><div class="cover-empty" style="width: 92%"></div></div>
|
|
79
79
|
</td>
|
|
80
|
-
<td data-value="
|
|
81
|
-
<td data-value="
|
|
80
|
+
<td data-value="8.89" class="pct low">8.89%</td>
|
|
81
|
+
<td data-value="45" class="abs low">4/45</td>
|
|
82
82
|
<td data-value="0" class="pct low">0%</td>
|
|
83
83
|
<td data-value="14" class="abs low">0/14</td>
|
|
84
84
|
<td data-value="11.11" class="pct low">11.11%</td>
|
|
85
85
|
<td data-value="9" class="abs low">1/9</td>
|
|
86
|
-
<td data-value="9.
|
|
87
|
-
<td data-value="
|
|
86
|
+
<td data-value="9.09" class="pct low">9.09%</td>
|
|
87
|
+
<td data-value="44" class="abs low">4/44</td>
|
|
88
88
|
</tr>
|
|
89
89
|
|
|
90
90
|
</tbody>
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
96
96
|
Code coverage generated by
|
|
97
97
|
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
|
98
|
-
at
|
|
98
|
+
at Wed Dec 08 2021 23:26:22 GMT+0000 (Coordinated Universal Time)
|
|
99
99
|
</div>
|
|
100
100
|
</div>
|
|
101
101
|
<script src="../../prettify.js"></script>
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">
|
|
26
|
+
<span class="strong">8.89% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>4/
|
|
28
|
+
<span class='fraction'>4/45</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">9.
|
|
47
|
+
<span class="strong">9.09% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>4/
|
|
49
|
+
<span class='fraction'>4/44</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -210,7 +210,37 @@
|
|
|
210
210
|
<a name='L151'></a><a href='#L151'>151</a>
|
|
211
211
|
<a name='L152'></a><a href='#L152'>152</a>
|
|
212
212
|
<a name='L153'></a><a href='#L153'>153</a>
|
|
213
|
-
<a name='L154'></a><a href='#L154'>154</a
|
|
213
|
+
<a name='L154'></a><a href='#L154'>154</a>
|
|
214
|
+
<a name='L155'></a><a href='#L155'>155</a>
|
|
215
|
+
<a name='L156'></a><a href='#L156'>156</a>
|
|
216
|
+
<a name='L157'></a><a href='#L157'>157</a>
|
|
217
|
+
<a name='L158'></a><a href='#L158'>158</a>
|
|
218
|
+
<a name='L159'></a><a href='#L159'>159</a>
|
|
219
|
+
<a name='L160'></a><a href='#L160'>160</a>
|
|
220
|
+
<a name='L161'></a><a href='#L161'>161</a>
|
|
221
|
+
<a name='L162'></a><a href='#L162'>162</a>
|
|
222
|
+
<a name='L163'></a><a href='#L163'>163</a>
|
|
223
|
+
<a name='L164'></a><a href='#L164'>164</a>
|
|
224
|
+
<a name='L165'></a><a href='#L165'>165</a>
|
|
225
|
+
<a name='L166'></a><a href='#L166'>166</a>
|
|
226
|
+
<a name='L167'></a><a href='#L167'>167</a>
|
|
227
|
+
<a name='L168'></a><a href='#L168'>168</a>
|
|
228
|
+
<a name='L169'></a><a href='#L169'>169</a>
|
|
229
|
+
<a name='L170'></a><a href='#L170'>170</a>
|
|
230
|
+
<a name='L171'></a><a href='#L171'>171</a>
|
|
231
|
+
<a name='L172'></a><a href='#L172'>172</a>
|
|
232
|
+
<a name='L173'></a><a href='#L173'>173</a>
|
|
233
|
+
<a name='L174'></a><a href='#L174'>174</a>
|
|
234
|
+
<a name='L175'></a><a href='#L175'>175</a>
|
|
235
|
+
<a name='L176'></a><a href='#L176'>176</a>
|
|
236
|
+
<a name='L177'></a><a href='#L177'>177</a>
|
|
237
|
+
<a name='L178'></a><a href='#L178'>178</a>
|
|
238
|
+
<a name='L179'></a><a href='#L179'>179</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
239
|
+
<span class="cline-any cline-neutral"> </span>
|
|
240
|
+
<span class="cline-any cline-neutral"> </span>
|
|
241
|
+
<span class="cline-any cline-neutral"> </span>
|
|
242
|
+
<span class="cline-any cline-neutral"> </span>
|
|
243
|
+
<span class="cline-any cline-neutral"> </span>
|
|
214
244
|
<span class="cline-any cline-neutral"> </span>
|
|
215
245
|
<span class="cline-any cline-neutral"> </span>
|
|
216
246
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -267,6 +297,9 @@
|
|
|
267
297
|
<span class="cline-any cline-yes">6x</span>
|
|
268
298
|
<span class="cline-any cline-neutral"> </span>
|
|
269
299
|
<span class="cline-any cline-neutral"> </span>
|
|
300
|
+
<span class="cline-any cline-neutral"> </span>
|
|
301
|
+
<span class="cline-any cline-neutral"> </span>
|
|
302
|
+
<span class="cline-any cline-neutral"> </span>
|
|
270
303
|
<span class="cline-any cline-yes">6x</span>
|
|
271
304
|
<span class="cline-any cline-neutral"> </span>
|
|
272
305
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -305,6 +338,9 @@
|
|
|
305
338
|
<span class="cline-any cline-neutral"> </span>
|
|
306
339
|
<span class="cline-any cline-neutral"> </span>
|
|
307
340
|
<span class="cline-any cline-neutral"> </span>
|
|
341
|
+
<span class="cline-any cline-neutral"> </span>
|
|
342
|
+
<span class="cline-any cline-neutral"> </span>
|
|
343
|
+
<span class="cline-any cline-neutral"> </span>
|
|
308
344
|
<span class="cline-any cline-no"> </span>
|
|
309
345
|
<span class="cline-any cline-neutral"> </span>
|
|
310
346
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -332,18 +368,30 @@
|
|
|
332
368
|
<span class="cline-any cline-neutral"> </span>
|
|
333
369
|
<span class="cline-any cline-neutral"> </span>
|
|
334
370
|
<span class="cline-any cline-neutral"> </span>
|
|
335
|
-
<span class="cline-any cline-
|
|
371
|
+
<span class="cline-any cline-neutral"> </span>
|
|
336
372
|
<span class="cline-any cline-neutral"> </span>
|
|
337
373
|
<span class="cline-any cline-no"> </span>
|
|
338
374
|
<span class="cline-any cline-neutral"> </span>
|
|
339
375
|
<span class="cline-any cline-neutral"> </span>
|
|
376
|
+
<span class="cline-any cline-no"> </span>
|
|
340
377
|
<span class="cline-any cline-neutral"> </span>
|
|
341
378
|
<span class="cline-any cline-no"> </span>
|
|
379
|
+
<span class="cline-any cline-neutral"> </span>
|
|
380
|
+
<span class="cline-any cline-neutral"> </span>
|
|
381
|
+
<span class="cline-any cline-neutral"> </span>
|
|
382
|
+
<span class="cline-any cline-neutral"> </span>
|
|
383
|
+
<span class="cline-any cline-neutral"> </span>
|
|
384
|
+
<span class="cline-any cline-neutral"> </span>
|
|
385
|
+
<span class="cline-any cline-neutral"> </span>
|
|
386
|
+
<span class="cline-any cline-neutral"> </span>
|
|
387
|
+
<span class="cline-any cline-neutral"> </span>
|
|
342
388
|
<span class="cline-any cline-no"> </span>
|
|
343
389
|
<span class="cline-any cline-no"> </span>
|
|
344
390
|
<span class="cline-any cline-neutral"> </span>
|
|
345
391
|
<span class="cline-any cline-no"> </span>
|
|
346
392
|
<span class="cline-any cline-no"> </span>
|
|
393
|
+
<span class="cline-any cline-no"> </span>
|
|
394
|
+
<span class="cline-any cline-no"> </span>
|
|
347
395
|
<span class="cline-any cline-neutral"> </span>
|
|
348
396
|
<span class="cline-any cline-no"> </span>
|
|
349
397
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -355,6 +403,8 @@
|
|
|
355
403
|
<span class="cline-any cline-no"> </span>
|
|
356
404
|
<span class="cline-any cline-no"> </span>
|
|
357
405
|
<span class="cline-any cline-neutral"> </span>
|
|
406
|
+
<span class="cline-any cline-no"> </span>
|
|
407
|
+
<span class="cline-any cline-neutral"> </span>
|
|
358
408
|
<span class="cline-any cline-neutral"> </span>
|
|
359
409
|
<span class="cline-any cline-neutral"> </span>
|
|
360
410
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -377,6 +427,11 @@ import {
|
|
|
377
427
|
import path from "path";
|
|
378
428
|
import ts from "typescript";
|
|
379
429
|
|
|
430
|
+
export type ProjectInfo = {
|
|
431
|
+
tsproject: Project;
|
|
432
|
+
tssourceFiles: Set<string>;
|
|
433
|
+
};
|
|
434
|
+
|
|
380
435
|
/**
|
|
381
436
|
* Collection of TypeScript projects, separated by their target platform.
|
|
382
437
|
*
|
|
@@ -397,14 +452,14 @@ export interface ProjectCache {
|
|
|
397
452
|
clearPlatform(platform: AllPlatforms): void;
|
|
398
453
|
|
|
399
454
|
/**
|
|
400
|
-
* Get the project which targets a specific platform and contains a specific
|
|
455
|
+
* Get info on the project which targets a specific platform and contains a specific
|
|
401
456
|
* source file. If the project is not cached, load it and add it to the cache.
|
|
402
457
|
*
|
|
403
458
|
* @param platform Target platform
|
|
404
459
|
* @param sourceFile Source file
|
|
405
460
|
* @returns Project targeting the given platform and containing the given source file
|
|
406
461
|
*/
|
|
407
|
-
|
|
462
|
+
getProjectInfo(sourceFile: string, platform: AllPlatforms): ProjectInfo;
|
|
408
463
|
}
|
|
409
464
|
|
|
410
465
|
/**
|
|
@@ -420,7 +475,10 @@ export function createProjectCache(
|
|
|
420
475
|
const diagnosticWriter = createDiagnosticWriter(print);
|
|
421
476
|
|
|
422
477
|
// Collection of projects organized by root directory, then by platform.
|
|
423
|
-
const projects: Record<
|
|
478
|
+
const projects: Record<
|
|
479
|
+
string,
|
|
480
|
+
Partial<Record<AllPlatforms, ProjectInfo>>
|
|
481
|
+
> = {};
|
|
424
482
|
|
|
425
483
|
function <span class="fstat-no" title="function not covered" >findProjectRoot(</span>sourceFile: string): string {
|
|
426
484
|
// Search known root directories to see if the source file is in one of them.
|
|
@@ -456,7 +514,10 @@ export function createProjectCache(
|
|
|
456
514
|
<span class="cstat-no" title="statement not covered" > return cmdLine;</span>
|
|
457
515
|
}
|
|
458
516
|
|
|
459
|
-
function <span class="fstat-no" title="function not covered" >
|
|
517
|
+
function <span class="fstat-no" title="function not covered" >createProjectInfo(</span>
|
|
518
|
+
root: string,
|
|
519
|
+
platform: AllPlatforms
|
|
520
|
+
): ProjectInfo {
|
|
460
521
|
// Load the TypeScript configuration file for this project.
|
|
461
522
|
const cmdLine = <span class="cstat-no" title="statement not covered" >readTSConfig(root);</span>
|
|
462
523
|
|
|
@@ -484,28 +545,42 @@ export function createProjectCache(
|
|
|
484
545
|
enhanceLanguageServiceHost
|
|
485
546
|
);
|
|
486
547
|
|
|
487
|
-
//
|
|
548
|
+
// Store TypeScript's source file list for this project. We'll use it later
|
|
549
|
+
// to filter files from Metro's file graph. We only want to check files that
|
|
550
|
+
// TypeScript considers to be source code, and not transpiled output.
|
|
551
|
+
const tssourceFiles = <span class="cstat-no" title="statement not covered" >new Set(cmdLine.fileNames);</span>
|
|
552
|
+
|
|
553
|
+
// Start with an empty project
|
|
488
554
|
<span class="cstat-no" title="statement not covered" > tsproject.removeAllFiles();</span>
|
|
489
555
|
|
|
490
|
-
<span class="cstat-no" title="statement not covered" > return
|
|
556
|
+
<span class="cstat-no" title="statement not covered" > return {</span>
|
|
557
|
+
tsproject,
|
|
558
|
+
tssourceFiles,
|
|
559
|
+
};
|
|
491
560
|
}
|
|
492
561
|
|
|
493
|
-
function <span class="fstat-no" title="function not covered" >
|
|
562
|
+
function <span class="fstat-no" title="function not covered" >getProjectInfo(</span>
|
|
563
|
+
sourceFile: string,
|
|
564
|
+
platform: AllPlatforms
|
|
565
|
+
): ProjectInfo {
|
|
494
566
|
const root = <span class="cstat-no" title="statement not covered" >findProjectRoot(sourceFile);</span>
|
|
495
|
-
<span class="cstat-no" title="statement not covered" >
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
<span class="cstat-no" title="statement not covered" > if (!
|
|
499
|
-
<span class="cstat-no" title="statement not covered" >
|
|
567
|
+
<span class="cstat-no" title="statement not covered" > projects[root] ||= {};</span>
|
|
568
|
+
|
|
569
|
+
let info = <span class="cstat-no" title="statement not covered" >projects[root][platform];</span>
|
|
570
|
+
<span class="cstat-no" title="statement not covered" > if (!info) {</span>
|
|
571
|
+
<span class="cstat-no" title="statement not covered" > info = createProjectInfo(root, platform);</span>
|
|
572
|
+
<span class="cstat-no" title="statement not covered" > projects[root][platform] = info;</span>
|
|
500
573
|
}
|
|
501
|
-
<span class="cstat-no" title="statement not covered" > return
|
|
574
|
+
<span class="cstat-no" title="statement not covered" > return info;</span>
|
|
502
575
|
}
|
|
503
576
|
|
|
504
577
|
function <span class="fstat-no" title="function not covered" >clearPlatform(</span>platform: AllPlatforms): void {
|
|
505
578
|
<span class="cstat-no" title="statement not covered" > Object.values(projects).forEach(<span class="fstat-no" title="function not covered" >(p</span>rojectsByPlatform) => {</span>
|
|
506
|
-
const
|
|
507
|
-
<span class="cstat-no" title="statement not covered" > if (
|
|
508
|
-
<span class="cstat-no" title="statement not covered" >
|
|
579
|
+
const info = <span class="cstat-no" title="statement not covered" >projectsByPlatform[platform];</span>
|
|
580
|
+
<span class="cstat-no" title="statement not covered" > if (info) {</span>
|
|
581
|
+
<span class="cstat-no" title="statement not covered" > if (info.tsproject) {</span>
|
|
582
|
+
<span class="cstat-no" title="statement not covered" > info.tsproject.dispose();</span>
|
|
583
|
+
}
|
|
509
584
|
<span class="cstat-no" title="statement not covered" > delete projectsByPlatform[platform];</span>
|
|
510
585
|
}
|
|
511
586
|
});
|
|
@@ -513,7 +588,7 @@ export function createProjectCache(
|
|
|
513
588
|
|
|
514
589
|
return {
|
|
515
590
|
clearPlatform,
|
|
516
|
-
|
|
591
|
+
getProjectInfo,
|
|
517
592
|
};
|
|
518
593
|
}
|
|
519
594
|
</pre></td></tr></table></pre>
|
|
@@ -523,7 +598,7 @@ export function createProjectCache(
|
|
|
523
598
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
524
599
|
Code coverage generated by
|
|
525
600
|
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
|
526
|
-
at
|
|
601
|
+
at Wed Dec 08 2021 23:26:22 GMT+0000 (Coordinated Universal Time)
|
|
527
602
|
</div>
|
|
528
603
|
</div>
|
|
529
604
|
<script src="../../prettify.js"></script>
|