@rnx-kit/cli 0.9.56 → 0.11.0
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 +44 -0
- package/README.md +14 -0
- package/coverage/clover.xml +25 -25
- package/coverage/coverage-final.json +5 -5
- package/coverage/lcov-report/block-navigation.js +8 -0
- package/coverage/lcov-report/index.html +20 -15
- package/coverage/lcov-report/sorter.js +26 -0
- package/coverage/lcov-report/src/bundle/index.html +13 -8
- package/coverage/lcov-report/src/bundle/kit-config.ts.html +10 -5
- package/coverage/lcov-report/src/bundle/metro.ts.html +9 -4
- package/coverage/lcov-report/src/bundle/overrides.ts.html +8 -3
- package/coverage/lcov-report/src/index.html +8 -3
- package/coverage/lcov-report/src/metro-config.ts.html +9 -4
- package/coverage/lcov-report/src/typescript/index.html +17 -12
- package/coverage/lcov-report/src/typescript/project-cache.ts.html +40 -23
- package/coverage/lcov.info +31 -29
- package/lib/clean.d.ts +8 -0
- package/lib/clean.d.ts.map +1 -0
- package/lib/clean.js +166 -0
- package/lib/clean.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -1
- package/lib/index.js.map +1 -1
- package/lib/start.d.ts.map +1 -1
- package/lib/start.js +35 -17
- package/lib/start.js.map +1 -1
- package/lib/typescript/project-cache.d.ts.map +1 -1
- package/lib/typescript/project-cache.js +10 -6
- package/lib/typescript/project-cache.js.map +1 -1
- package/package.json +8 -5
- package/react-native.config.js +19 -0
- package/src/clean.ts +184 -0
- package/src/index.ts +1 -0
- package/src/start.ts +39 -21
- package/src/typescript/project-cache.ts +12 -8
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">95.
|
|
26
|
+
<span class="strong">95.23% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
28
|
<span class='fraction'>20/21</span>
|
|
29
29
|
</div>
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">95.
|
|
47
|
+
<span class="strong">95.23% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
49
|
<span class='fraction'>20/21</span>
|
|
50
50
|
</div>
|
|
@@ -54,6 +54,12 @@
|
|
|
54
54
|
<p class="quiet">
|
|
55
55
|
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
|
56
56
|
</p>
|
|
57
|
+
<template id="filterTemplate">
|
|
58
|
+
<div class="quiet">
|
|
59
|
+
Filter:
|
|
60
|
+
<input oninput="onInput()" type="search" id="fileSearch">
|
|
61
|
+
</div>
|
|
62
|
+
</template>
|
|
57
63
|
</div>
|
|
58
64
|
<div class='status-line high'></div>
|
|
59
65
|
<pre><table class="coverage">
|
|
@@ -360,10 +366,9 @@ export function getKitBundleConfigs(
|
|
|
360
366
|
</div><!-- /wrapper -->
|
|
361
367
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
362
368
|
Code coverage generated by
|
|
363
|
-
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
|
364
|
-
at Wed
|
|
369
|
+
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
370
|
+
at Wed Feb 02 2022 14:52:38 GMT+0000 (Coordinated Universal Time)
|
|
365
371
|
</div>
|
|
366
|
-
</div>
|
|
367
372
|
<script src="../../prettify.js"></script>
|
|
368
373
|
<script>
|
|
369
374
|
window.onload = function () {
|
|
@@ -54,6 +54,12 @@
|
|
|
54
54
|
<p class="quiet">
|
|
55
55
|
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
|
56
56
|
</p>
|
|
57
|
+
<template id="filterTemplate">
|
|
58
|
+
<div class="quiet">
|
|
59
|
+
Filter:
|
|
60
|
+
<input oninput="onInput()" type="search" id="fileSearch">
|
|
61
|
+
</div>
|
|
62
|
+
</template>
|
|
57
63
|
</div>
|
|
58
64
|
<div class='status-line medium'></div>
|
|
59
65
|
<pre><table class="coverage">
|
|
@@ -278,7 +284,7 @@ export function createMetroBundleArgs({
|
|
|
278
284
|
}
|
|
279
285
|
|
|
280
286
|
// use an absolute path for the source map file
|
|
281
|
-
|
|
287
|
+
if (sourcemapOutput) {
|
|
282
288
|
sourcemapOutput = path.join(distPath, sourcemapOutput);
|
|
283
289
|
}
|
|
284
290
|
|
|
@@ -336,10 +342,9 @@ export async function <span class="fstat-no" title="function not covered" >metro
|
|
|
336
342
|
</div><!-- /wrapper -->
|
|
337
343
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
338
344
|
Code coverage generated by
|
|
339
|
-
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
|
340
|
-
at Wed
|
|
345
|
+
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
346
|
+
at Wed Feb 02 2022 14:52:38 GMT+0000 (Coordinated Universal Time)
|
|
341
347
|
</div>
|
|
342
|
-
</div>
|
|
343
348
|
<script src="../../prettify.js"></script>
|
|
344
349
|
<script>
|
|
345
350
|
window.onload = function () {
|
|
@@ -54,6 +54,12 @@
|
|
|
54
54
|
<p class="quiet">
|
|
55
55
|
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
|
56
56
|
</p>
|
|
57
|
+
<template id="filterTemplate">
|
|
58
|
+
<div class="quiet">
|
|
59
|
+
Filter:
|
|
60
|
+
<input oninput="onInput()" type="search" id="fileSearch">
|
|
61
|
+
</div>
|
|
62
|
+
</template>
|
|
57
63
|
</div>
|
|
58
64
|
<div class='status-line high'></div>
|
|
59
65
|
<pre><table class="coverage">
|
|
@@ -225,10 +231,9 @@ export function applyKitBundleConfigOverrides(
|
|
|
225
231
|
</div><!-- /wrapper -->
|
|
226
232
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
227
233
|
Code coverage generated by
|
|
228
|
-
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
|
229
|
-
at Wed
|
|
234
|
+
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
235
|
+
at Wed Feb 02 2022 14:52:38 GMT+0000 (Coordinated Universal Time)
|
|
230
236
|
</div>
|
|
231
|
-
</div>
|
|
232
237
|
<script src="../../prettify.js"></script>
|
|
233
238
|
<script>
|
|
234
239
|
window.onload = function () {
|
|
@@ -54,6 +54,12 @@
|
|
|
54
54
|
<p class="quiet">
|
|
55
55
|
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
|
56
56
|
</p>
|
|
57
|
+
<template id="filterTemplate">
|
|
58
|
+
<div class="quiet">
|
|
59
|
+
Filter:
|
|
60
|
+
<input oninput="onInput()" type="search" id="fileSearch">
|
|
61
|
+
</div>
|
|
62
|
+
</template>
|
|
57
63
|
</div>
|
|
58
64
|
<div class='status-line medium'></div>
|
|
59
65
|
<div class="pad1">
|
|
@@ -94,10 +100,9 @@
|
|
|
94
100
|
</div><!-- /wrapper -->
|
|
95
101
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
96
102
|
Code coverage generated by
|
|
97
|
-
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
|
98
|
-
at Wed
|
|
103
|
+
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
104
|
+
at Wed Feb 02 2022 14:52:38 GMT+0000 (Coordinated Universal Time)
|
|
99
105
|
</div>
|
|
100
|
-
</div>
|
|
101
106
|
<script src="../prettify.js"></script>
|
|
102
107
|
<script>
|
|
103
108
|
window.onload = function () {
|
|
@@ -54,6 +54,12 @@
|
|
|
54
54
|
<p class="quiet">
|
|
55
55
|
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
|
56
56
|
</p>
|
|
57
|
+
<template id="filterTemplate">
|
|
58
|
+
<div class="quiet">
|
|
59
|
+
Filter:
|
|
60
|
+
<input oninput="onInput()" type="search" id="fileSearch">
|
|
61
|
+
</div>
|
|
62
|
+
</template>
|
|
57
63
|
</div>
|
|
58
64
|
<div class='status-line medium'></div>
|
|
59
65
|
<pre><table class="coverage">
|
|
@@ -547,7 +553,7 @@ export function customizeMetroConfig(
|
|
|
547
553
|
let hook = emptySerializerHook;
|
|
548
554
|
<span class="missing-if-branch" title="if path not taken" >I</span>if (typeof typescriptValidation === "object") {
|
|
549
555
|
<span class="cstat-no" title="statement not covered" > hook = createSerializerHook(typescriptValidation);</span>
|
|
550
|
-
} else
|
|
556
|
+
} else if (typescriptValidation !== false) {
|
|
551
557
|
hook = createSerializerHook({});
|
|
552
558
|
}
|
|
553
559
|
metroConfig.serializer.experimentalSerializerHook = hook;
|
|
@@ -558,10 +564,9 @@ export function customizeMetroConfig(
|
|
|
558
564
|
</div><!-- /wrapper -->
|
|
559
565
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
560
566
|
Code coverage generated by
|
|
561
|
-
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
|
562
|
-
at Wed
|
|
567
|
+
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
568
|
+
at Wed Feb 02 2022 14:52:38 GMT+0000 (Coordinated Universal Time)
|
|
563
569
|
</div>
|
|
564
|
-
</div>
|
|
565
570
|
<script src="../prettify.js"></script>
|
|
566
571
|
<script>
|
|
567
572
|
window.onload = function () {
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">8.
|
|
26
|
+
<span class="strong">8.69% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>4/
|
|
28
|
+
<span class='fraction'>4/46</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
@@ -37,9 +37,9 @@
|
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
<div class='fl pad1y space-right2'>
|
|
40
|
-
<span class="strong">
|
|
40
|
+
<span class="strong">10% </span>
|
|
41
41
|
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>1/
|
|
42
|
+
<span class='fraction'>1/10</span>
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
45
|
|
|
@@ -54,6 +54,12 @@
|
|
|
54
54
|
<p class="quiet">
|
|
55
55
|
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
|
56
56
|
</p>
|
|
57
|
+
<template id="filterTemplate">
|
|
58
|
+
<div class="quiet">
|
|
59
|
+
Filter:
|
|
60
|
+
<input oninput="onInput()" type="search" id="fileSearch">
|
|
61
|
+
</div>
|
|
62
|
+
</template>
|
|
57
63
|
</div>
|
|
58
64
|
<div class='status-line low'></div>
|
|
59
65
|
<div class="pad1">
|
|
@@ -74,15 +80,15 @@
|
|
|
74
80
|
</thead>
|
|
75
81
|
<tbody><tr>
|
|
76
82
|
<td class="file low" data-value="project-cache.ts"><a href="project-cache.ts.html">project-cache.ts</a></td>
|
|
77
|
-
<td data-value="8.
|
|
83
|
+
<td data-value="8.69" class="pic low">
|
|
78
84
|
<div class="chart"><div class="cover-fill" style="width: 8%"></div><div class="cover-empty" style="width: 92%"></div></div>
|
|
79
85
|
</td>
|
|
80
|
-
<td data-value="8.
|
|
81
|
-
<td data-value="
|
|
86
|
+
<td data-value="8.69" class="pct low">8.69%</td>
|
|
87
|
+
<td data-value="46" class="abs low">4/46</td>
|
|
82
88
|
<td data-value="0" class="pct low">0%</td>
|
|
83
89
|
<td data-value="14" class="abs low">0/14</td>
|
|
84
|
-
<td data-value="
|
|
85
|
-
<td data-value="
|
|
90
|
+
<td data-value="10" class="pct low">10%</td>
|
|
91
|
+
<td data-value="10" class="abs low">1/10</td>
|
|
86
92
|
<td data-value="9.09" class="pct low">9.09%</td>
|
|
87
93
|
<td data-value="44" class="abs low">4/44</td>
|
|
88
94
|
</tr>
|
|
@@ -94,10 +100,9 @@
|
|
|
94
100
|
</div><!-- /wrapper -->
|
|
95
101
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
96
102
|
Code coverage generated by
|
|
97
|
-
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
|
98
|
-
at Wed
|
|
103
|
+
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
104
|
+
at Wed Feb 02 2022 14:52:38 GMT+0000 (Coordinated Universal Time)
|
|
99
105
|
</div>
|
|
100
|
-
</div>
|
|
101
106
|
<script src="../../prettify.js"></script>
|
|
102
107
|
<script>
|
|
103
108
|
window.onload = function () {
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">8.
|
|
26
|
+
<span class="strong">8.69% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>4/
|
|
28
|
+
<span class='fraction'>4/46</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
@@ -37,9 +37,9 @@
|
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
<div class='fl pad1y space-right2'>
|
|
40
|
-
<span class="strong">
|
|
40
|
+
<span class="strong">10% </span>
|
|
41
41
|
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>1/
|
|
42
|
+
<span class='fraction'>1/10</span>
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
45
|
|
|
@@ -54,6 +54,12 @@
|
|
|
54
54
|
<p class="quiet">
|
|
55
55
|
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
|
56
56
|
</p>
|
|
57
|
+
<template id="filterTemplate">
|
|
58
|
+
<div class="quiet">
|
|
59
|
+
Filter:
|
|
60
|
+
<input oninput="onInput()" type="search" id="fileSearch">
|
|
61
|
+
</div>
|
|
62
|
+
</template>
|
|
57
63
|
</div>
|
|
58
64
|
<div class='status-line low'></div>
|
|
59
65
|
<pre><table class="coverage">
|
|
@@ -235,7 +241,11 @@
|
|
|
235
241
|
<a name='L176'></a><a href='#L176'>176</a>
|
|
236
242
|
<a name='L177'></a><a href='#L177'>177</a>
|
|
237
243
|
<a name='L178'></a><a href='#L178'>178</a>
|
|
238
|
-
<a name='L179'></a><a href='#L179'>179</a
|
|
244
|
+
<a name='L179'></a><a href='#L179'>179</a>
|
|
245
|
+
<a name='L180'></a><a href='#L180'>180</a>
|
|
246
|
+
<a name='L181'></a><a href='#L181'>181</a>
|
|
247
|
+
<a name='L182'></a><a href='#L182'>182</a>
|
|
248
|
+
<a name='L183'></a><a href='#L183'>183</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
239
249
|
<span class="cline-any cline-neutral"> </span>
|
|
240
250
|
<span class="cline-any cline-neutral"> </span>
|
|
241
251
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -345,12 +355,6 @@
|
|
|
345
355
|
<span class="cline-any cline-neutral"> </span>
|
|
346
356
|
<span class="cline-any cline-neutral"> </span>
|
|
347
357
|
<span class="cline-any cline-neutral"> </span>
|
|
348
|
-
<span class="cline-any cline-no"> </span>
|
|
349
|
-
<span class="cline-any cline-no"> </span>
|
|
350
|
-
<span class="cline-any cline-no"> </span>
|
|
351
|
-
<span class="cline-any cline-no"> </span>
|
|
352
|
-
<span class="cline-any cline-no"> </span>
|
|
353
|
-
<span class="cline-any cline-no"> </span>
|
|
354
358
|
<span class="cline-any cline-neutral"> </span>
|
|
355
359
|
<span class="cline-any cline-neutral"> </span>
|
|
356
360
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -358,9 +362,17 @@
|
|
|
358
362
|
<span class="cline-any cline-neutral"> </span>
|
|
359
363
|
<span class="cline-any cline-neutral"> </span>
|
|
360
364
|
<span class="cline-any cline-neutral"> </span>
|
|
365
|
+
<span class="cline-any cline-no"> </span>
|
|
366
|
+
<span class="cline-any cline-no"> </span>
|
|
367
|
+
<span class="cline-any cline-neutral"> </span>
|
|
361
368
|
<span class="cline-any cline-neutral"> </span>
|
|
362
369
|
<span class="cline-any cline-neutral"> </span>
|
|
363
370
|
<span class="cline-any cline-no"> </span>
|
|
371
|
+
<span class="cline-any cline-no"> </span>
|
|
372
|
+
<span class="cline-any cline-no"> </span>
|
|
373
|
+
<span class="cline-any cline-no"> </span>
|
|
374
|
+
<span class="cline-any cline-no"> </span>
|
|
375
|
+
<span class="cline-any cline-no"> </span>
|
|
364
376
|
<span class="cline-any cline-neutral"> </span>
|
|
365
377
|
<span class="cline-any cline-neutral"> </span>
|
|
366
378
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -373,7 +385,9 @@
|
|
|
373
385
|
<span class="cline-any cline-no"> </span>
|
|
374
386
|
<span class="cline-any cline-neutral"> </span>
|
|
375
387
|
<span class="cline-any cline-neutral"> </span>
|
|
376
|
-
<span class="cline-any cline-
|
|
388
|
+
<span class="cline-any cline-neutral"> </span>
|
|
389
|
+
<span class="cline-any cline-neutral"> </span>
|
|
390
|
+
<span class="cline-any cline-neutral"> </span>
|
|
377
391
|
<span class="cline-any cline-neutral"> </span>
|
|
378
392
|
<span class="cline-any cline-no"> </span>
|
|
379
393
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -520,6 +534,18 @@ export function createProjectCache(
|
|
|
520
534
|
): ProjectInfo {
|
|
521
535
|
// Load the TypeScript configuration file for this project.
|
|
522
536
|
const cmdLine = <span class="cstat-no" title="statement not covered" >readTSConfig(root);</span>
|
|
537
|
+
|
|
538
|
+
// Trim down the list of source files found by TypeScript. This ensures
|
|
539
|
+
// that only explicitly added files are loaded and parsed by TypeScript.
|
|
540
|
+
// This is a perf optimization. We don't want to spend cycles on files
|
|
541
|
+
// that won't be used, such as *.android.ts when bundling for ios.
|
|
542
|
+
//
|
|
543
|
+
// The exception to this rule are .d.ts files. They hold global types,
|
|
544
|
+
// modules and namespaces, and having them in the project is the only
|
|
545
|
+
// way they can be loaded.
|
|
546
|
+
|
|
547
|
+
const tssourceFiles = <span class="cstat-no" title="statement not covered" >new Set(cmdLine.fileNames);</span>
|
|
548
|
+
<span class="cstat-no" title="statement not covered" > cmdLine.fileNames = cmdLine.fileNames.filter(<span class="fstat-no" title="function not covered" >(f</span>) => <span class="cstat-no" title="statement not covered" >f.endsWith(".d.ts"))</span>;</span>
|
|
523
549
|
|
|
524
550
|
// Create a TypeScript project using the configuration file. Enhance the
|
|
525
551
|
// underlying TS language service with our react-native module resolver.
|
|
@@ -544,14 +570,6 @@ export function createProjectCache(
|
|
|
544
570
|
cmdLine,
|
|
545
571
|
enhanceLanguageServiceHost
|
|
546
572
|
);
|
|
547
|
-
|
|
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
|
|
554
|
-
<span class="cstat-no" title="statement not covered" > tsproject.removeAllFiles();</span>
|
|
555
573
|
|
|
556
574
|
<span class="cstat-no" title="statement not covered" > return {</span>
|
|
557
575
|
tsproject,
|
|
@@ -597,10 +615,9 @@ export function createProjectCache(
|
|
|
597
615
|
</div><!-- /wrapper -->
|
|
598
616
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
599
617
|
Code coverage generated by
|
|
600
|
-
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
|
601
|
-
at Wed
|
|
618
|
+
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
619
|
+
at Wed Feb 02 2022 14:52:38 GMT+0000 (Coordinated Universal Time)
|
|
602
620
|
</div>
|
|
603
|
-
</div>
|
|
604
621
|
<script src="../../prettify.js"></script>
|
|
605
622
|
<script>
|
|
606
623
|
window.onload = function () {
|
package/coverage/lcov.info
CHANGED
|
@@ -231,11 +231,12 @@ FN:68,findProjectRoot
|
|
|
231
231
|
FN:87,readTSConfig
|
|
232
232
|
FN:95,(anonymous_3)
|
|
233
233
|
FN:102,createProjectInfo
|
|
234
|
-
FN:
|
|
235
|
-
FN:
|
|
236
|
-
FN:
|
|
237
|
-
FN:
|
|
238
|
-
|
|
234
|
+
FN:119,(anonymous_5)
|
|
235
|
+
FN:123,(anonymous_6)
|
|
236
|
+
FN:151,getProjectInfo
|
|
237
|
+
FN:166,clearPlatform
|
|
238
|
+
FN:167,(anonymous_9)
|
|
239
|
+
FNF:10
|
|
239
240
|
FNH:1
|
|
240
241
|
FNDA:6,createProjectCache
|
|
241
242
|
FNDA:0,findProjectRoot
|
|
@@ -243,9 +244,10 @@ FNDA:0,readTSConfig
|
|
|
243
244
|
FNDA:0,(anonymous_3)
|
|
244
245
|
FNDA:0,createProjectInfo
|
|
245
246
|
FNDA:0,(anonymous_5)
|
|
247
|
+
FNDA:0,(anonymous_6)
|
|
246
248
|
FNDA:0,getProjectInfo
|
|
247
249
|
FNDA:0,clearPlatform
|
|
248
|
-
FNDA:0,(
|
|
250
|
+
FNDA:0,(anonymous_9)
|
|
249
251
|
DA:59,6
|
|
250
252
|
DA:60,6
|
|
251
253
|
DA:66,6
|
|
@@ -266,30 +268,30 @@ DA:95,0
|
|
|
266
268
|
DA:96,0
|
|
267
269
|
DA:99,0
|
|
268
270
|
DA:107,0
|
|
269
|
-
DA:
|
|
270
|
-
DA:
|
|
271
|
-
DA:
|
|
272
|
-
DA:
|
|
273
|
-
DA:
|
|
274
|
-
DA:116,0
|
|
271
|
+
DA:118,0
|
|
272
|
+
DA:119,0
|
|
273
|
+
DA:123,0
|
|
274
|
+
DA:124,0
|
|
275
|
+
DA:125,0
|
|
275
276
|
DA:126,0
|
|
276
|
-
DA:
|
|
277
|
-
DA:
|
|
278
|
-
DA:
|
|
279
|
-
DA:
|
|
280
|
-
DA:152,0
|
|
281
|
-
DA:154,0
|
|
277
|
+
DA:127,0
|
|
278
|
+
DA:128,0
|
|
279
|
+
DA:138,0
|
|
280
|
+
DA:145,0
|
|
282
281
|
DA:155,0
|
|
283
282
|
DA:156,0
|
|
284
|
-
DA:
|
|
283
|
+
DA:158,0
|
|
285
284
|
DA:159,0
|
|
285
|
+
DA:160,0
|
|
286
|
+
DA:161,0
|
|
286
287
|
DA:163,0
|
|
287
|
-
DA:164,0
|
|
288
|
-
DA:165,0
|
|
289
|
-
DA:166,0
|
|
290
288
|
DA:167,0
|
|
289
|
+
DA:168,0
|
|
291
290
|
DA:169,0
|
|
292
|
-
DA:
|
|
291
|
+
DA:170,0
|
|
292
|
+
DA:171,0
|
|
293
|
+
DA:173,0
|
|
294
|
+
DA:178,6
|
|
293
295
|
LF:44
|
|
294
296
|
LH:4
|
|
295
297
|
BRDA:71,0,0,0
|
|
@@ -300,12 +302,12 @@ BRDA:91,2,0,0
|
|
|
300
302
|
BRDA:91,2,1,0
|
|
301
303
|
BRDA:93,3,0,0
|
|
302
304
|
BRDA:93,3,1,0
|
|
303
|
-
BRDA:
|
|
304
|
-
BRDA:
|
|
305
|
-
BRDA:
|
|
306
|
-
BRDA:
|
|
307
|
-
BRDA:
|
|
308
|
-
BRDA:
|
|
305
|
+
BRDA:159,4,0,0
|
|
306
|
+
BRDA:159,4,1,0
|
|
307
|
+
BRDA:169,5,0,0
|
|
308
|
+
BRDA:169,5,1,0
|
|
309
|
+
BRDA:170,6,0,0
|
|
310
|
+
BRDA:170,6,1,0
|
|
309
311
|
BRF:14
|
|
310
312
|
BRH:0
|
|
311
313
|
end_of_record
|
package/lib/clean.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Config as CLIConfig } from "@react-native-community/cli-types";
|
|
2
|
+
declare type Args = {
|
|
3
|
+
include?: string;
|
|
4
|
+
projectRoot?: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function rnxClean(_argv: string[], _config: CLIConfig, cliOptions: Args): Promise<void>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=clean.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clean.d.ts","sourceRoot":"","sources":["../src/clean.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAQ7E,aAAK,IAAI,GAAG;IACV,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAWF,wBAAsB,QAAQ,CAC5B,KAAK,EAAE,MAAM,EAAE,EACf,OAAO,EAAE,SAAS,EAClB,UAAU,EAAE,IAAI,GACf,OAAO,CAAC,IAAI,CAAC,CA+Gf"}
|
package/lib/clean.js
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.rnxClean = void 0;
|
|
16
|
+
const child_process_1 = require("child_process");
|
|
17
|
+
const fs_1 = require("fs");
|
|
18
|
+
const promises_1 = __importDefault(require("fs/promises"));
|
|
19
|
+
const ora_1 = __importDefault(require("ora"));
|
|
20
|
+
const os_1 = __importDefault(require("os"));
|
|
21
|
+
const path_1 = __importDefault(require("path"));
|
|
22
|
+
function rnxClean(_argv, _config, cliOptions) {
|
|
23
|
+
var _a, _b, _c;
|
|
24
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
+
const projectRoot = (_a = cliOptions.projectRoot) !== null && _a !== void 0 ? _a : process.cwd();
|
|
26
|
+
if (!(0, fs_1.existsSync)(projectRoot)) {
|
|
27
|
+
throw new Error(`Invalid path provided! ${projectRoot}`);
|
|
28
|
+
}
|
|
29
|
+
const npm = os_1.default.platform() === "win32" ? "npm.cmd" : "npm";
|
|
30
|
+
const yarn = os_1.default.platform() === "win32" ? "yarn.cmd" : "yarn";
|
|
31
|
+
const COMMANDS = {
|
|
32
|
+
android: [
|
|
33
|
+
{
|
|
34
|
+
label: "Clean Gradle cache",
|
|
35
|
+
action: () => {
|
|
36
|
+
const candidates = os_1.default.platform() === "win32"
|
|
37
|
+
? ["android/gradlew.bat", "gradlew.bat"]
|
|
38
|
+
: ["android/gradlew", "gradlew"];
|
|
39
|
+
const gradlew = findPath(projectRoot, candidates);
|
|
40
|
+
if (gradlew) {
|
|
41
|
+
const script = path_1.default.basename(gradlew);
|
|
42
|
+
return execute(os_1.default.platform() === "win32" ? script : `./${script}`, ["clean"], path_1.default.dirname(gradlew));
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
return Promise.resolve();
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
cocoapods: [
|
|
51
|
+
{
|
|
52
|
+
label: "Clean CocoaPods cache",
|
|
53
|
+
action: () => execute("pod", ["cache", "clean", "--all"], projectRoot),
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
npm: [
|
|
57
|
+
{
|
|
58
|
+
label: "Remove node_modules",
|
|
59
|
+
action: () => cleanDir(`${projectRoot}/node_modules`),
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
label: "Verify npm cache",
|
|
63
|
+
action: () => execute(npm, ["cache", "verify"], projectRoot),
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
metro: [
|
|
67
|
+
{
|
|
68
|
+
label: "Clean Metro cache",
|
|
69
|
+
action: () => cleanDir(`${os_1.default.tmpdir()}/metro-*`),
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
label: "Clean Haste cache",
|
|
73
|
+
action: () => cleanDir(`${os_1.default.tmpdir()}/haste-map-*`),
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
label: "Clean React Native cache",
|
|
77
|
+
action: () => cleanDir(`${os_1.default.tmpdir()}/react-*`),
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
watchman: [
|
|
81
|
+
{
|
|
82
|
+
label: "Stop Watchman",
|
|
83
|
+
action: () => execute(os_1.default.platform() === "win32" ? "tskill" : "killall", ["watchman"], projectRoot),
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
label: "Delete Watchman cache",
|
|
87
|
+
action: () => execute("watchman", ["watch-del-all"], projectRoot),
|
|
88
|
+
},
|
|
89
|
+
],
|
|
90
|
+
yarn: [
|
|
91
|
+
{
|
|
92
|
+
label: "Clean Yarn cache",
|
|
93
|
+
action: () => execute(yarn, ["cache", "clean"], projectRoot),
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
};
|
|
97
|
+
const categories = (_c = (_b = cliOptions.include) === null || _b === void 0 ? void 0 : _b.split(",")) !== null && _c !== void 0 ? _c : [
|
|
98
|
+
"metro",
|
|
99
|
+
"npm",
|
|
100
|
+
"watchman",
|
|
101
|
+
"yarn",
|
|
102
|
+
];
|
|
103
|
+
const spinner = (0, ora_1.default)();
|
|
104
|
+
for (const category of categories) {
|
|
105
|
+
const commands = COMMANDS[category];
|
|
106
|
+
if (!commands) {
|
|
107
|
+
spinner.warn(`Unknown category: ${category}`);
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
for (const { action, label } of commands) {
|
|
111
|
+
spinner.start(label);
|
|
112
|
+
yield action()
|
|
113
|
+
.then(() => {
|
|
114
|
+
spinner.succeed();
|
|
115
|
+
})
|
|
116
|
+
.catch((e) => {
|
|
117
|
+
spinner.fail(`${label} » ${e}`);
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
exports.rnxClean = rnxClean;
|
|
124
|
+
function cleanDir(path) {
|
|
125
|
+
if (!(0, fs_1.existsSync)(path)) {
|
|
126
|
+
return Promise.resolve();
|
|
127
|
+
}
|
|
128
|
+
return promises_1.default.rmdir(path, { maxRetries: 3, recursive: true });
|
|
129
|
+
}
|
|
130
|
+
function findPath(startPath, files) {
|
|
131
|
+
// TODO: Find project files via `@react-native-community/cli`
|
|
132
|
+
for (const file of files) {
|
|
133
|
+
const filename = path_1.default.resolve(startPath, file);
|
|
134
|
+
if ((0, fs_1.existsSync)(filename)) {
|
|
135
|
+
return filename;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return undefined;
|
|
139
|
+
}
|
|
140
|
+
function execute(command, args, cwd) {
|
|
141
|
+
return new Promise((resolve, reject) => {
|
|
142
|
+
const process = (0, child_process_1.spawn)(command, args, {
|
|
143
|
+
cwd,
|
|
144
|
+
stdio: ["inherit", null, null],
|
|
145
|
+
});
|
|
146
|
+
const stderr = [];
|
|
147
|
+
process.stderr.on("data", (data) => {
|
|
148
|
+
stderr.push(data);
|
|
149
|
+
});
|
|
150
|
+
process.on("close", (code, signal) => {
|
|
151
|
+
if (code === 0) {
|
|
152
|
+
resolve();
|
|
153
|
+
}
|
|
154
|
+
else if (stderr) {
|
|
155
|
+
reject(Buffer.concat(stderr).toString().trimEnd());
|
|
156
|
+
}
|
|
157
|
+
else if (signal) {
|
|
158
|
+
reject(`Failed with signal ${signal}`);
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
reject(`Failed with exit code ${code}`);
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
//# sourceMappingURL=clean.js.map
|