@rnx-kit/cli 0.9.51 → 0.9.55
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 +56 -3
- package/coverage/clover.xml +110 -71
- package/coverage/coverage-final.json +3 -2
- package/coverage/lcov-report/index.html +43 -28
- package/coverage/lcov-report/src/bundle/index.html +15 -15
- package/coverage/lcov-report/src/bundle/kit-config.ts.html +1 -1
- package/coverage/lcov-report/src/bundle/metro.ts.html +15 -78
- package/coverage/lcov-report/src/bundle/overrides.ts.html +1 -1
- package/coverage/lcov-report/src/index.html +21 -21
- package/coverage/lcov-report/src/metro-config.ts.html +105 -129
- package/coverage/lcov-report/src/typescript/index.html +111 -0
- package/coverage/lcov-report/src/typescript/project-cache.ts.html +539 -0
- package/coverage/lcov.info +198 -126
- package/lib/bundle/metro.d.ts +1 -2
- package/lib/bundle/metro.d.ts.map +1 -1
- package/lib/bundle/metro.js +5 -17
- package/lib/bundle/metro.js.map +1 -1
- package/lib/bundle.d.ts.map +1 -1
- package/lib/bundle.js +1 -3
- package/lib/bundle.js.map +1 -1
- package/lib/metro-config.d.ts +3 -3
- package/lib/metro-config.d.ts.map +1 -1
- package/lib/metro-config.js +56 -67
- package/lib/metro-config.js.map +1 -1
- package/lib/start.d.ts.map +1 -1
- package/lib/start.js +6 -17
- package/lib/start.js.map +1 -1
- package/lib/types.d.ts +3 -4
- package/lib/types.d.ts.map +1 -1
- package/lib/typescript/project-cache.d.ts +38 -0
- package/lib/typescript/project-cache.d.ts.map +1 -0
- package/lib/typescript/project-cache.js +101 -0
- package/lib/typescript/project-cache.js.map +1 -0
- package/package.json +15 -15
- package/src/bundle/metro.ts +6 -27
- package/src/bundle.ts +1 -4
- package/src/metro-config.ts +73 -81
- package/src/start.ts +7 -26
- package/src/types.ts +3 -5
- package/src/typescript/project-cache.ts +153 -0
- package/CHANGELOG.json +0 -3074
- package/just.config.js +0 -2
|
@@ -23,30 +23,30 @@
|
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">
|
|
26
|
+
<span class="strong">50.94% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>27/53</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">53.85% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>
|
|
35
|
+
<span class='fraction'>14/26</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
<div class='fl pad1y space-right2'>
|
|
40
|
-
<span class="strong">
|
|
40
|
+
<span class="strong">20% </span>
|
|
41
41
|
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>
|
|
42
|
+
<span class='fraction'>2/10</span>
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">
|
|
47
|
+
<span class="strong">51.92% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>27/52</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -55,7 +55,7 @@
|
|
|
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
57
|
</div>
|
|
58
|
-
<div class='status-line
|
|
58
|
+
<div class='status-line medium'></div>
|
|
59
59
|
<pre><table class="coverage">
|
|
60
60
|
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
|
61
61
|
<a name='L2'></a><a href='#L2'>2</a>
|
|
@@ -217,15 +217,7 @@
|
|
|
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>
|
|
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></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
220
|
+
<a name='L161'></a><a href='#L161'>161</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
229
221
|
<span class="cline-any cline-neutral"> </span>
|
|
230
222
|
<span class="cline-any cline-neutral"> </span>
|
|
231
223
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -252,54 +244,42 @@
|
|
|
252
244
|
<span class="cline-any cline-neutral"> </span>
|
|
253
245
|
<span class="cline-any cline-neutral"> </span>
|
|
254
246
|
<span class="cline-any cline-neutral"> </span>
|
|
255
|
-
<span class="cline-any cline-no"> </span>
|
|
256
247
|
<span class="cline-any cline-neutral"> </span>
|
|
257
248
|
<span class="cline-any cline-neutral"> </span>
|
|
258
|
-
<span class="cline-any cline-no"> </span>
|
|
259
|
-
<span class="cline-any cline-no"> </span>
|
|
260
|
-
<span class="cline-any cline-no"> </span>
|
|
261
|
-
<span class="cline-any cline-no"> </span>
|
|
262
249
|
<span class="cline-any cline-neutral"> </span>
|
|
263
250
|
<span class="cline-any cline-neutral"> </span>
|
|
264
251
|
<span class="cline-any cline-neutral"> </span>
|
|
265
252
|
<span class="cline-any cline-neutral"> </span>
|
|
266
|
-
<span class="cline-any cline-
|
|
267
|
-
<span class="cline-any cline-no"> </span>
|
|
253
|
+
<span class="cline-any cline-yes">6x</span>
|
|
268
254
|
<span class="cline-any cline-neutral"> </span>
|
|
269
|
-
<span class="cline-any cline-
|
|
270
|
-
<span class="cline-any cline-
|
|
271
|
-
<span class="cline-any cline-
|
|
272
|
-
<span class="cline-any cline-
|
|
255
|
+
<span class="cline-any cline-yes">6x</span>
|
|
256
|
+
<span class="cline-any cline-yes">6x</span>
|
|
257
|
+
<span class="cline-any cline-neutral"> </span>
|
|
258
|
+
<span class="cline-any cline-yes">6x</span>
|
|
273
259
|
<span class="cline-any cline-no"> </span>
|
|
274
260
|
<span class="cline-any cline-no"> </span>
|
|
275
261
|
<span class="cline-any cline-no"> </span>
|
|
276
262
|
<span class="cline-any cline-neutral"> </span>
|
|
277
263
|
<span class="cline-any cline-neutral"> </span>
|
|
278
|
-
<span class="cline-any cline-no"> </span>
|
|
279
264
|
<span class="cline-any cline-neutral"> </span>
|
|
280
265
|
<span class="cline-any cline-no"> </span>
|
|
281
266
|
<span class="cline-any cline-neutral"> </span>
|
|
282
267
|
<span class="cline-any cline-neutral"> </span>
|
|
283
|
-
<span class="cline-any cline-no"> </span>
|
|
284
|
-
<span class="cline-any cline-no"> </span>
|
|
285
|
-
<span class="cline-any cline-no"> </span>
|
|
286
|
-
<span class="cline-any cline-no"> </span>
|
|
287
|
-
<span class="cline-any cline-neutral"> </span>
|
|
288
|
-
<span class="cline-any cline-neutral"> </span>
|
|
289
268
|
<span class="cline-any cline-neutral"> </span>
|
|
290
269
|
<span class="cline-any cline-neutral"> </span>
|
|
270
|
+
<span class="cline-any cline-no"> </span>
|
|
291
271
|
<span class="cline-any cline-neutral"> </span>
|
|
272
|
+
<span class="cline-any cline-no"> </span>
|
|
292
273
|
<span class="cline-any cline-neutral"> </span>
|
|
293
274
|
<span class="cline-any cline-neutral"> </span>
|
|
275
|
+
<span class="cline-any cline-no"> </span>
|
|
294
276
|
<span class="cline-any cline-neutral"> </span>
|
|
277
|
+
<span class="cline-any cline-no"> </span>
|
|
295
278
|
<span class="cline-any cline-neutral"> </span>
|
|
296
279
|
<span class="cline-any cline-neutral"> </span>
|
|
297
280
|
<span class="cline-any cline-no"> </span>
|
|
298
|
-
<span class="cline-any cline-no"> </span>
|
|
299
281
|
<span class="cline-any cline-neutral"> </span>
|
|
300
|
-
<span class="cline-any cline-no"> </span>
|
|
301
282
|
<span class="cline-any cline-neutral"> </span>
|
|
302
|
-
<span class="cline-any cline-no"> </span>
|
|
303
283
|
<span class="cline-any cline-neutral"> </span>
|
|
304
284
|
<span class="cline-any cline-neutral"> </span>
|
|
305
285
|
<span class="cline-any cline-no"> </span>
|
|
@@ -308,28 +288,28 @@
|
|
|
308
288
|
<span class="cline-any cline-no"> </span>
|
|
309
289
|
<span class="cline-any cline-no"> </span>
|
|
310
290
|
<span class="cline-any cline-neutral"> </span>
|
|
311
|
-
<span class="cline-any cline-neutral"> </span>
|
|
312
291
|
<span class="cline-any cline-no"> </span>
|
|
313
|
-
<span class="cline-any cline-
|
|
314
|
-
<span class="cline-any cline-
|
|
292
|
+
<span class="cline-any cline-no"> </span>
|
|
293
|
+
<span class="cline-any cline-no"> </span>
|
|
294
|
+
<span class="cline-any cline-no"> </span>
|
|
315
295
|
<span class="cline-any cline-neutral"> </span>
|
|
316
296
|
<span class="cline-any cline-neutral"> </span>
|
|
317
297
|
<span class="cline-any cline-neutral"> </span>
|
|
318
298
|
<span class="cline-any cline-no"> </span>
|
|
319
299
|
<span class="cline-any cline-no"> </span>
|
|
320
|
-
<span class="cline-any cline-neutral"> </span>
|
|
321
300
|
<span class="cline-any cline-no"> </span>
|
|
322
301
|
<span class="cline-any cline-no"> </span>
|
|
323
302
|
<span class="cline-any cline-neutral"> </span>
|
|
324
|
-
<span class="cline-any cline-no"> </span>
|
|
325
|
-
<span class="cline-any cline-no"> </span>
|
|
326
303
|
<span class="cline-any cline-neutral"> </span>
|
|
327
304
|
<span class="cline-any cline-neutral"> </span>
|
|
328
305
|
<span class="cline-any cline-no"> </span>
|
|
329
306
|
<span class="cline-any cline-neutral"> </span>
|
|
307
|
+
<span class="cline-any cline-no"> </span>
|
|
308
|
+
<span class="cline-any cline-neutral"> </span>
|
|
330
309
|
<span class="cline-any cline-neutral"> </span>
|
|
331
310
|
<span class="cline-any cline-neutral"> </span>
|
|
332
|
-
<span class="cline-any cline-
|
|
311
|
+
<span class="cline-any cline-neutral"> </span>
|
|
312
|
+
<span class="cline-any cline-yes">6x</span>
|
|
333
313
|
<span class="cline-any cline-neutral"> </span>
|
|
334
314
|
<span class="cline-any cline-neutral"> </span>
|
|
335
315
|
<span class="cline-any cline-yes">2x</span>
|
|
@@ -390,8 +370,12 @@
|
|
|
390
370
|
<span class="cline-any cline-neutral"> </span>
|
|
391
371
|
<span class="cline-any cline-neutral"> </span>
|
|
392
372
|
<span class="cline-any cline-yes">6x</span>
|
|
373
|
+
<span class="cline-any cline-yes">6x</span>
|
|
374
|
+
<span class="cline-any cline-no"> </span>
|
|
375
|
+
<span class="cline-any cline-yes">6x</span>
|
|
376
|
+
<span class="cline-any cline-yes">6x</span>
|
|
393
377
|
<span class="cline-any cline-neutral"> </span>
|
|
394
|
-
<span class="cline-any cline-
|
|
378
|
+
<span class="cline-any cline-yes">6x</span>
|
|
395
379
|
<span class="cline-any cline-neutral"> </span>
|
|
396
380
|
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import {
|
|
397
381
|
CyclicDependencies,
|
|
@@ -406,98 +390,86 @@ import {
|
|
|
406
390
|
esbuildTransformerConfig,
|
|
407
391
|
MetroSerializer as MetroSerializerEsbuild,
|
|
408
392
|
} from "@rnx-kit/metro-serializer-esbuild";
|
|
409
|
-
import
|
|
410
|
-
import {
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
} from "@rnx-kit/typescript-service";
|
|
393
|
+
import { AllPlatforms } from "@rnx-kit/tools-react-native/platform";
|
|
394
|
+
import { Project } from "@rnx-kit/typescript-service";
|
|
395
|
+
|
|
396
|
+
import { createProjectCache } from "./typescript/project-cache";
|
|
397
|
+
import type { TypeScriptValidationOptions } from "./types";
|
|
398
|
+
|
|
416
399
|
import type { DeltaResult, Graph } from "metro";
|
|
417
400
|
import type { InputConfigT, SerializerConfigT } from "metro-config";
|
|
418
|
-
import type { LanguageServiceHost } from "typescript";
|
|
419
|
-
|
|
420
|
-
import type { TSProjectInfo } from "./types";
|
|
421
401
|
|
|
422
|
-
|
|
423
|
-
|
|
402
|
+
/**
|
|
403
|
+
* Create a hook function to be registered with Metro during serialization.
|
|
404
|
+
* Each serialization pass runs the hook which type-checks each added/updated
|
|
405
|
+
* source file.
|
|
406
|
+
*
|
|
407
|
+
* Source file in node_modules (external packages) are ignored.
|
|
408
|
+
*
|
|
409
|
+
* @param options TypeScript validation options
|
|
410
|
+
* @returns Hook function
|
|
411
|
+
*/
|
|
412
|
+
function createSerializerHook(options: TypeScriptValidationOptions) {
|
|
413
|
+
const projectCache = createProjectCache(options.print);
|
|
424
414
|
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
<span class="cstat-no" title="statement not covered" > if (tsproject) {</span>
|
|
428
|
-
<span class="cstat-no" title="statement not covered" > tsproject.dispose();</span>
|
|
429
|
-
<span class="cstat-no" title="statement not covered" > tsprojectByPlatform.delete(platform);</span>
|
|
430
|
-
}
|
|
431
|
-
}
|
|
415
|
+
const patternNodeModules = /[/\\]node_modules[/\\]/;
|
|
416
|
+
const excludeNodeModules = <span class="fstat-no" title="function not covered" >(p</span>: string) => <span class="cstat-no" title="statement not covered" >!patternNodeModules.test(p);</span>
|
|
432
417
|
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
<span class="cstat-no" title="statement not covered" > if (
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
const writer = <span class="cstat-no" title="statement not covered" >createDiagnosticWriter();</span>
|
|
442
|
-
<span class="cstat-no" title="statement not covered" > cmdLine.errors.forEach(<span class="fstat-no" title="function not covered" >(e</span>) => <span class="cstat-no" title="statement not covered" >writer.print(e))</span>;</span>
|
|
443
|
-
<span class="cstat-no" title="statement not covered" > throw new Error(`Failed to load '${configFileName}'`);</span>
|
|
418
|
+
const hook = <span class="fstat-no" title="function not covered" >(g</span>raph: Graph, delta: DeltaResult): void => {
|
|
419
|
+
const platform = <span class="cstat-no" title="statement not covered" >graph.transformOptions.platform as AllPlatforms;</span>
|
|
420
|
+
<span class="cstat-no" title="statement not covered" > if (platform) {</span>
|
|
421
|
+
<span class="cstat-no" title="statement not covered" > if (delta.reset) {</span>
|
|
422
|
+
// Metro is signaling that all cached data for this Graph should be
|
|
423
|
+
// thrown out. Each Graph is scoped to one platform, so discard all
|
|
424
|
+
// of that platform's projects.
|
|
425
|
+
<span class="cstat-no" title="statement not covered" > projectCache.clearPlatform(platform);</span>
|
|
444
426
|
}
|
|
445
427
|
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
<span class="cstat-no" title="statement not covered" >
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
const traceReactNativeModuleResolutionErrors = <span class="cstat-no" title="statement not covered" >false;</span>
|
|
453
|
-
const traceResolutionLog = <span class="cstat-no" title="statement not covered" >undefined;</span>
|
|
454
|
-
<span class="cstat-no" title="statement not covered" > changeHostToUseReactNativeResolver({</span>
|
|
455
|
-
host,
|
|
456
|
-
options: cmdLine.options,
|
|
457
|
-
platform,
|
|
458
|
-
platformExtensionNames,
|
|
459
|
-
disableReactNativePackageSubstitution,
|
|
460
|
-
traceReactNativeModuleResolutionErrors,
|
|
461
|
-
traceResolutionLog,
|
|
462
|
-
});
|
|
463
|
-
};
|
|
428
|
+
// Filter adds, updates, and deletes coming from Metro. Do not look at
|
|
429
|
+
// anything in an external package (e.g. under node_modules).
|
|
430
|
+
const adds = <span class="cstat-no" title="statement not covered" >Array.from(</span>
|
|
431
|
+
delta.added.values(),
|
|
432
|
+
<span class="fstat-no" title="function not covered" > (m</span>odule) => <span class="cstat-no" title="statement not covered" >module.path</span>
|
|
433
|
+
).filter(excludeNodeModules);
|
|
464
434
|
|
|
465
|
-
<span class="cstat-no" title="statement not covered" >
|
|
466
|
-
|
|
435
|
+
const updates = <span class="cstat-no" title="statement not covered" >Array.from(</span>
|
|
436
|
+
delta.modified.values(),
|
|
437
|
+
<span class="fstat-no" title="function not covered" > (m</span>odule) => <span class="cstat-no" title="statement not covered" >module.path</span>
|
|
438
|
+
).filter(excludeNodeModules);
|
|
467
439
|
|
|
468
|
-
<span class="cstat-no" title="statement not covered" >
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
}
|
|
440
|
+
const deletes = <span class="cstat-no" title="statement not covered" >Array.from(delta.deleted.values()).filter(</span>
|
|
441
|
+
excludeNodeModules
|
|
442
|
+
);
|
|
472
443
|
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
<span class="cstat-no" title="statement not covered" >
|
|
476
|
-
<span class="cstat-no" title="statement not covered" >
|
|
477
|
-
<span class="cstat-no" title="statement not covered" >
|
|
478
|
-
|
|
444
|
+
// Map each file to a TypeScript project, and apply its delta operation.
|
|
445
|
+
const tsprojectsToValidate: Set<Project> = <span class="cstat-no" title="statement not covered" >new Set();</span>
|
|
446
|
+
<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.getProject(sourceFile, platform);</span>
|
|
448
|
+
<span class="cstat-no" title="statement not covered" > tsproject.setFile(sourceFile);</span>
|
|
449
|
+
<span class="cstat-no" title="statement not covered" > tsprojectsToValidate.add(tsproject);</span>
|
|
450
|
+
});
|
|
451
|
+
<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.getProject(sourceFile, platform);</span>
|
|
453
|
+
<span class="cstat-no" title="statement not covered" > tsproject.removeFile(sourceFile);</span>
|
|
454
|
+
<span class="cstat-no" title="statement not covered" > tsprojectsToValidate.add(tsproject);</span>
|
|
455
|
+
});
|
|
479
456
|
|
|
480
|
-
|
|
457
|
+
// Validate all projects which changed, printing all type errors.
|
|
458
|
+
let isValid = <span class="cstat-no" title="statement not covered" >true;</span>
|
|
459
|
+
<span class="cstat-no" title="statement not covered" > tsprojectsToValidate.forEach(<span class="fstat-no" title="function not covered" >(p</span>) => {</span>
|
|
460
|
+
<span class="cstat-no" title="statement not covered" > if (!p.validate()) {</span>
|
|
461
|
+
<span class="cstat-no" title="statement not covered" > isValid = false;</span>
|
|
462
|
+
}
|
|
463
|
+
});
|
|
481
464
|
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
// are removed from the project file list.
|
|
486
|
-
<span class="cstat-no" title="statement not covered" > for (const module of delta.added.values()) {</span>
|
|
487
|
-
<span class="cstat-no" title="statement not covered" > tsproject.setFile(module.path);</span>
|
|
465
|
+
<span class="cstat-no" title="statement not covered" > if (!isValid && options.throwOnError) {</span>
|
|
466
|
+
// Type-checking failed. Fail the Metro operation (bundling or serving).
|
|
467
|
+
<span class="cstat-no" title="statement not covered" > throw new Error("Type validation failed");</span>
|
|
488
468
|
}
|
|
489
|
-
<span class="cstat-no" title="statement not covered" > for (const module of delta.modified.values()) {</span>
|
|
490
|
-
<span class="cstat-no" title="statement not covered" > tsproject.setFile(module.path);</span>
|
|
491
|
-
}
|
|
492
|
-
<span class="cstat-no" title="statement not covered" > for (const module of delta.deleted.values()) {</span>
|
|
493
|
-
<span class="cstat-no" title="statement not covered" > tsproject.removeFile(module);</span>
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
<span class="cstat-no" title="statement not covered" > tsproject.validate();</span>
|
|
497
469
|
}
|
|
498
470
|
};
|
|
499
471
|
|
|
500
|
-
|
|
472
|
+
return hook;
|
|
501
473
|
}
|
|
502
474
|
|
|
503
475
|
const emptySerializerHook = <span class="fstat-no" title="function not covered" >(_</span>graph: Graph, _delta: DeltaResult): void => {
|
|
@@ -510,14 +482,14 @@ const emptySerializerHook = <span class="fstat-no" title="function not covered"
|
|
|
510
482
|
* @param metroConfigReadonly Metro configuration
|
|
511
483
|
* @param detectCyclicDependencies When true, cyclic dependency checking is enabled with a default set of options. Otherwise the object allows for fine-grained control over the detection process.
|
|
512
484
|
* @param detectDuplicateDependencies When true, duplicate dependency checking is enabled with a default set of options. Otherwise, the object allows for fine-grained control over the detection process.
|
|
513
|
-
* @param
|
|
485
|
+
* @param typescriptValidation When true, TypeScript type-checking is enabled with a default set of options. Otherwise, the object allows for fine-grained control over the type-checking process.
|
|
514
486
|
* @param experimental_treeShake When true, experimental tree-shaking is enabled.
|
|
515
487
|
*/
|
|
516
488
|
export function customizeMetroConfig(
|
|
517
489
|
metroConfigReadonly: InputConfigT,
|
|
518
490
|
detectCyclicDependencies: boolean | CyclicDetectorOptions,
|
|
519
491
|
detectDuplicateDependencies: boolean | DuplicateDetectorOptions,
|
|
520
|
-
|
|
492
|
+
typescriptValidation: boolean | TypeScriptValidationOptions,
|
|
521
493
|
experimental_treeShake: boolean
|
|
522
494
|
): void {
|
|
523
495
|
// We will be making changes to the Metro configuration. Coerce from a
|
|
@@ -557,9 +529,13 @@ export function customizeMetroConfig(
|
|
|
557
529
|
delete metroConfig.serializer.customSerializer;
|
|
558
530
|
}
|
|
559
531
|
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
532
|
+
let hook = emptySerializerHook;
|
|
533
|
+
<span class="missing-if-branch" title="if path not taken" >I</span>if (typeof typescriptValidation === "object") {
|
|
534
|
+
<span class="cstat-no" title="statement not covered" > hook = createSerializerHook(typescriptValidation);</span>
|
|
535
|
+
} else <span class="missing-if-branch" title="else path not taken" >E</span>if (typescriptValidation !== false) {
|
|
536
|
+
hook = createSerializerHook({});
|
|
537
|
+
}
|
|
538
|
+
metroConfig.serializer.experimentalSerializerHook = hook;
|
|
563
539
|
}
|
|
564
540
|
</pre></td></tr></table></pre>
|
|
565
541
|
|
|
@@ -568,7 +544,7 @@ export function customizeMetroConfig(
|
|
|
568
544
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
569
545
|
Code coverage generated by
|
|
570
546
|
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
|
571
|
-
at Tue
|
|
547
|
+
at Tue Dec 07 2021 17:01:30 GMT+0000 (Coordinated Universal Time)
|
|
572
548
|
</div>
|
|
573
549
|
</div>
|
|
574
550
|
<script src="../prettify.js"></script>
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
|
|
2
|
+
<!doctype html>
|
|
3
|
+
<html lang="en">
|
|
4
|
+
|
|
5
|
+
<head>
|
|
6
|
+
<title>Code coverage report for src/typescript</title>
|
|
7
|
+
<meta charset="utf-8" />
|
|
8
|
+
<link rel="stylesheet" href="../../prettify.css" />
|
|
9
|
+
<link rel="stylesheet" href="../../base.css" />
|
|
10
|
+
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
|
|
11
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
12
|
+
<style type='text/css'>
|
|
13
|
+
.coverage-summary .sorter {
|
|
14
|
+
background-image: url(../../sort-arrow-sprite.png);
|
|
15
|
+
}
|
|
16
|
+
</style>
|
|
17
|
+
</head>
|
|
18
|
+
|
|
19
|
+
<body>
|
|
20
|
+
<div class='wrapper'>
|
|
21
|
+
<div class='pad1'>
|
|
22
|
+
<h1><a href="../../index.html">All files</a> src/typescript</h1>
|
|
23
|
+
<div class='clearfix'>
|
|
24
|
+
|
|
25
|
+
<div class='fl pad1y space-right2'>
|
|
26
|
+
<span class="strong">9.52% </span>
|
|
27
|
+
<span class="quiet">Statements</span>
|
|
28
|
+
<span class='fraction'>4/42</span>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
<div class='fl pad1y space-right2'>
|
|
33
|
+
<span class="strong">0% </span>
|
|
34
|
+
<span class="quiet">Branches</span>
|
|
35
|
+
<span class='fraction'>0/14</span>
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
<div class='fl pad1y space-right2'>
|
|
40
|
+
<span class="strong">11.11% </span>
|
|
41
|
+
<span class="quiet">Functions</span>
|
|
42
|
+
<span class='fraction'>1/9</span>
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
<div class='fl pad1y space-right2'>
|
|
47
|
+
<span class="strong">9.76% </span>
|
|
48
|
+
<span class="quiet">Lines</span>
|
|
49
|
+
<span class='fraction'>4/41</span>
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
</div>
|
|
54
|
+
<p class="quiet">
|
|
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
|
+
</p>
|
|
57
|
+
</div>
|
|
58
|
+
<div class='status-line low'></div>
|
|
59
|
+
<div class="pad1">
|
|
60
|
+
<table class="coverage-summary">
|
|
61
|
+
<thead>
|
|
62
|
+
<tr>
|
|
63
|
+
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
|
|
64
|
+
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
|
|
65
|
+
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
|
|
66
|
+
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
|
|
67
|
+
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
|
|
68
|
+
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
|
|
69
|
+
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
|
|
70
|
+
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
|
|
71
|
+
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
|
|
72
|
+
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
|
|
73
|
+
</tr>
|
|
74
|
+
</thead>
|
|
75
|
+
<tbody><tr>
|
|
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="9.52" class="pic low">
|
|
78
|
+
<div class="chart"><div class="cover-fill" style="width: 9%"></div><div class="cover-empty" style="width: 91%"></div></div>
|
|
79
|
+
</td>
|
|
80
|
+
<td data-value="9.52" class="pct low">9.52%</td>
|
|
81
|
+
<td data-value="42" class="abs low">4/42</td>
|
|
82
|
+
<td data-value="0" class="pct low">0%</td>
|
|
83
|
+
<td data-value="14" class="abs low">0/14</td>
|
|
84
|
+
<td data-value="11.11" class="pct low">11.11%</td>
|
|
85
|
+
<td data-value="9" class="abs low">1/9</td>
|
|
86
|
+
<td data-value="9.76" class="pct low">9.76%</td>
|
|
87
|
+
<td data-value="41" class="abs low">4/41</td>
|
|
88
|
+
</tr>
|
|
89
|
+
|
|
90
|
+
</tbody>
|
|
91
|
+
</table>
|
|
92
|
+
</div>
|
|
93
|
+
<div class='push'></div><!-- for sticky footer -->
|
|
94
|
+
</div><!-- /wrapper -->
|
|
95
|
+
<div class='footer quiet pad2 space-top1 center small'>
|
|
96
|
+
Code coverage generated by
|
|
97
|
+
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
|
98
|
+
at Tue Dec 07 2021 17:01:30 GMT+0000 (Coordinated Universal Time)
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
<script src="../../prettify.js"></script>
|
|
102
|
+
<script>
|
|
103
|
+
window.onload = function () {
|
|
104
|
+
prettyPrint();
|
|
105
|
+
};
|
|
106
|
+
</script>
|
|
107
|
+
<script src="../../sorter.js"></script>
|
|
108
|
+
<script src="../../block-navigation.js"></script>
|
|
109
|
+
</body>
|
|
110
|
+
</html>
|
|
111
|
+
|