@rnx-kit/cli 0.9.53 → 0.9.57
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 +38 -3
- package/coverage/clover.xml +116 -73
- 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 +112 -121
- package/coverage/lcov-report/src/typescript/index.html +111 -0
- package/coverage/lcov-report/src/typescript/project-cache.ts.html +626 -0
- package/coverage/lcov.info +208 -128
- 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 +58 -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 +42 -0
- package/lib/typescript/project-cache.d.ts.map +1 -0
- package/lib/typescript/project-cache.js +114 -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 +78 -81
- package/src/start.ts +7 -26
- package/src/types.ts +3 -5
- package/src/typescript/project-cache.ts +182 -0
- package/CHANGELOG.json +0 -3196
|
@@ -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% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
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'>
|
|
35
|
+
<span class='fraction'>14/28</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">50.94% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>27/53</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>
|
|
@@ -222,10 +222,7 @@
|
|
|
222
222
|
<a name='L163'></a><a href='#L163'>163</a>
|
|
223
223
|
<a name='L164'></a><a href='#L164'>164</a>
|
|
224
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>
|
|
225
|
+
<a name='L166'></a><a href='#L166'>166</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
229
226
|
<span class="cline-any cline-neutral"> </span>
|
|
230
227
|
<span class="cline-any cline-neutral"> </span>
|
|
231
228
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -252,84 +249,77 @@
|
|
|
252
249
|
<span class="cline-any cline-neutral"> </span>
|
|
253
250
|
<span class="cline-any cline-neutral"> </span>
|
|
254
251
|
<span class="cline-any cline-neutral"> </span>
|
|
255
|
-
<span class="cline-any cline-no"> </span>
|
|
256
252
|
<span class="cline-any cline-neutral"> </span>
|
|
257
253
|
<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
254
|
<span class="cline-any cline-neutral"> </span>
|
|
263
255
|
<span class="cline-any cline-neutral"> </span>
|
|
264
256
|
<span class="cline-any cline-neutral"> </span>
|
|
265
257
|
<span class="cline-any cline-neutral"> </span>
|
|
266
|
-
<span class="cline-any cline-
|
|
267
|
-
<span class="cline-any cline-no"> </span>
|
|
258
|
+
<span class="cline-any cline-yes">6x</span>
|
|
268
259
|
<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-
|
|
260
|
+
<span class="cline-any cline-yes">6x</span>
|
|
261
|
+
<span class="cline-any cline-yes">6x</span>
|
|
262
|
+
<span class="cline-any cline-neutral"> </span>
|
|
263
|
+
<span class="cline-any cline-yes">6x</span>
|
|
273
264
|
<span class="cline-any cline-no"> </span>
|
|
274
265
|
<span class="cline-any cline-no"> </span>
|
|
275
266
|
<span class="cline-any cline-no"> </span>
|
|
276
267
|
<span class="cline-any cline-neutral"> </span>
|
|
277
268
|
<span class="cline-any cline-neutral"> </span>
|
|
278
|
-
<span class="cline-any cline-no"> </span>
|
|
279
269
|
<span class="cline-any cline-neutral"> </span>
|
|
280
270
|
<span class="cline-any cline-no"> </span>
|
|
281
271
|
<span class="cline-any cline-neutral"> </span>
|
|
282
272
|
<span class="cline-any cline-neutral"> </span>
|
|
283
|
-
<span class="cline-any cline-
|
|
284
|
-
<span class="cline-any cline-
|
|
285
|
-
<span class="cline-any cline-no"> </span>
|
|
273
|
+
<span class="cline-any cline-neutral"> </span>
|
|
274
|
+
<span class="cline-any cline-neutral"> </span>
|
|
286
275
|
<span class="cline-any cline-no"> </span>
|
|
287
276
|
<span class="cline-any cline-neutral"> </span>
|
|
277
|
+
<span class="cline-any cline-no"> </span>
|
|
288
278
|
<span class="cline-any cline-neutral"> </span>
|
|
289
279
|
<span class="cline-any cline-neutral"> </span>
|
|
280
|
+
<span class="cline-any cline-no"> </span>
|
|
290
281
|
<span class="cline-any cline-neutral"> </span>
|
|
282
|
+
<span class="cline-any cline-no"> </span>
|
|
291
283
|
<span class="cline-any cline-neutral"> </span>
|
|
292
284
|
<span class="cline-any cline-neutral"> </span>
|
|
285
|
+
<span class="cline-any cline-no"> </span>
|
|
293
286
|
<span class="cline-any cline-neutral"> </span>
|
|
294
287
|
<span class="cline-any cline-neutral"> </span>
|
|
295
288
|
<span class="cline-any cline-neutral"> </span>
|
|
296
289
|
<span class="cline-any cline-neutral"> </span>
|
|
297
290
|
<span class="cline-any cline-no"> </span>
|
|
298
291
|
<span class="cline-any cline-no"> </span>
|
|
299
|
-
<span class="cline-any cline-neutral"> </span>
|
|
300
292
|
<span class="cline-any cline-no"> </span>
|
|
301
293
|
<span class="cline-any cline-neutral"> </span>
|
|
302
|
-
<span class="cline-any cline-no"> </span>
|
|
303
294
|
<span class="cline-any cline-neutral"> </span>
|
|
304
295
|
<span class="cline-any cline-neutral"> </span>
|
|
305
296
|
<span class="cline-any cline-no"> </span>
|
|
306
297
|
<span class="cline-any cline-no"> </span>
|
|
307
298
|
<span class="cline-any cline-no"> </span>
|
|
308
|
-
<span class="cline-any cline-no"> </span>
|
|
309
|
-
<span class="cline-any cline-no"> </span>
|
|
310
299
|
<span class="cline-any cline-neutral"> </span>
|
|
311
300
|
<span class="cline-any cline-neutral"> </span>
|
|
312
301
|
<span class="cline-any cline-no"> </span>
|
|
313
|
-
<span class="cline-any cline-
|
|
314
|
-
<span class="cline-any cline-
|
|
302
|
+
<span class="cline-any cline-no"> </span>
|
|
303
|
+
<span class="cline-any cline-no"> </span>
|
|
304
|
+
<span class="cline-any cline-no"> </span>
|
|
315
305
|
<span class="cline-any cline-neutral"> </span>
|
|
316
306
|
<span class="cline-any cline-neutral"> </span>
|
|
317
307
|
<span class="cline-any cline-neutral"> </span>
|
|
318
308
|
<span class="cline-any cline-no"> </span>
|
|
319
309
|
<span class="cline-any cline-no"> </span>
|
|
320
|
-
<span class="cline-any cline-neutral"> </span>
|
|
321
310
|
<span class="cline-any cline-no"> </span>
|
|
322
311
|
<span class="cline-any cline-no"> </span>
|
|
323
312
|
<span class="cline-any cline-neutral"> </span>
|
|
324
|
-
<span class="cline-any cline-no"> </span>
|
|
325
|
-
<span class="cline-any cline-no"> </span>
|
|
326
313
|
<span class="cline-any cline-neutral"> </span>
|
|
327
314
|
<span class="cline-any cline-neutral"> </span>
|
|
328
315
|
<span class="cline-any cline-no"> </span>
|
|
329
316
|
<span class="cline-any cline-neutral"> </span>
|
|
317
|
+
<span class="cline-any cline-no"> </span>
|
|
330
318
|
<span class="cline-any cline-neutral"> </span>
|
|
331
319
|
<span class="cline-any cline-neutral"> </span>
|
|
332
|
-
<span class="cline-any cline-
|
|
320
|
+
<span class="cline-any cline-neutral"> </span>
|
|
321
|
+
<span class="cline-any cline-neutral"> </span>
|
|
322
|
+
<span class="cline-any cline-yes">6x</span>
|
|
333
323
|
<span class="cline-any cline-neutral"> </span>
|
|
334
324
|
<span class="cline-any cline-neutral"> </span>
|
|
335
325
|
<span class="cline-any cline-yes">2x</span>
|
|
@@ -390,8 +380,12 @@
|
|
|
390
380
|
<span class="cline-any cline-neutral"> </span>
|
|
391
381
|
<span class="cline-any cline-neutral"> </span>
|
|
392
382
|
<span class="cline-any cline-yes">6x</span>
|
|
383
|
+
<span class="cline-any cline-yes">6x</span>
|
|
384
|
+
<span class="cline-any cline-no"> </span>
|
|
385
|
+
<span class="cline-any cline-yes">6x</span>
|
|
386
|
+
<span class="cline-any cline-yes">6x</span>
|
|
393
387
|
<span class="cline-any cline-neutral"> </span>
|
|
394
|
-
<span class="cline-any cline-
|
|
388
|
+
<span class="cline-any cline-yes">6x</span>
|
|
395
389
|
<span class="cline-any cline-neutral"> </span>
|
|
396
390
|
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import {
|
|
397
391
|
CyclicDependencies,
|
|
@@ -406,98 +400,91 @@ import {
|
|
|
406
400
|
esbuildTransformerConfig,
|
|
407
401
|
MetroSerializer as MetroSerializerEsbuild,
|
|
408
402
|
} from "@rnx-kit/metro-serializer-esbuild";
|
|
409
|
-
import
|
|
410
|
-
import {
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
} from "@rnx-kit/typescript-service";
|
|
403
|
+
import { AllPlatforms } from "@rnx-kit/tools-react-native/platform";
|
|
404
|
+
import { Project } from "@rnx-kit/typescript-service";
|
|
405
|
+
|
|
406
|
+
import { createProjectCache } from "./typescript/project-cache";
|
|
407
|
+
import type { TypeScriptValidationOptions } from "./types";
|
|
408
|
+
|
|
416
409
|
import type { DeltaResult, Graph } from "metro";
|
|
417
410
|
import type { InputConfigT, SerializerConfigT } from "metro-config";
|
|
418
|
-
import type { LanguageServiceHost } from "typescript";
|
|
419
411
|
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
412
|
+
/**
|
|
413
|
+
* Create a hook function to be registered with Metro during serialization.
|
|
414
|
+
* Each serialization pass runs the hook which type-checks each added/updated
|
|
415
|
+
* source file.
|
|
416
|
+
*
|
|
417
|
+
* Source file in node_modules (external packages) are ignored.
|
|
418
|
+
*
|
|
419
|
+
* @param options TypeScript validation options
|
|
420
|
+
* @returns Hook function
|
|
421
|
+
*/
|
|
422
|
+
function createSerializerHook(options: TypeScriptValidationOptions) {
|
|
423
|
+
const projectCache = createProjectCache(options.print);
|
|
424
424
|
|
|
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
|
-
}
|
|
425
|
+
const patternNodeModules = /[/\\]node_modules[/\\]/;
|
|
426
|
+
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
427
|
|
|
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>
|
|
428
|
+
const hook = <span class="fstat-no" title="function not covered" >(g</span>raph: Graph, delta: DeltaResult): void => {
|
|
429
|
+
const platform = <span class="cstat-no" title="statement not covered" >graph.transformOptions.platform as AllPlatforms;</span>
|
|
430
|
+
<span class="cstat-no" title="statement not covered" > if (platform) {</span>
|
|
431
|
+
<span class="cstat-no" title="statement not covered" > if (delta.reset) {</span>
|
|
432
|
+
// Metro is signaling that all cached data for this Graph should be
|
|
433
|
+
// thrown out. Each Graph is scoped to one platform, so discard all
|
|
434
|
+
// of that platform's projects.
|
|
435
|
+
<span class="cstat-no" title="statement not covered" > projectCache.clearPlatform(platform);</span>
|
|
444
436
|
}
|
|
445
437
|
|
|
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
|
-
};
|
|
438
|
+
// Filter adds, updates, and deletes coming from Metro. Do not look at
|
|
439
|
+
// anything in an external package (e.g. under node_modules).
|
|
440
|
+
const adds = <span class="cstat-no" title="statement not covered" >Array.from(</span>
|
|
441
|
+
delta.added.values(),
|
|
442
|
+
<span class="fstat-no" title="function not covered" > (m</span>odule) => <span class="cstat-no" title="statement not covered" >module.path</span>
|
|
443
|
+
).filter(excludeNodeModules);
|
|
464
444
|
|
|
465
|
-
<span class="cstat-no" title="statement not covered" >
|
|
466
|
-
|
|
445
|
+
const updates = <span class="cstat-no" title="statement not covered" >Array.from(</span>
|
|
446
|
+
delta.modified.values(),
|
|
447
|
+
<span class="fstat-no" title="function not covered" > (m</span>odule) => <span class="cstat-no" title="statement not covered" >module.path</span>
|
|
448
|
+
).filter(excludeNodeModules);
|
|
467
449
|
|
|
468
|
-
<span class="cstat-no" title="statement not covered" >
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
}
|
|
450
|
+
const deletes = <span class="cstat-no" title="statement not covered" >Array.from(delta.deleted.values()).filter(</span>
|
|
451
|
+
excludeNodeModules
|
|
452
|
+
);
|
|
472
453
|
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
<span class="cstat-no" title="statement not covered" >
|
|
476
|
-
<span class="cstat-no" title="statement not covered" >
|
|
477
|
-
|
|
478
|
-
|
|
454
|
+
// Map each file to a TypeScript project, and apply its delta operation.
|
|
455
|
+
const tsprojectsToValidate: Set<Project> = <span class="cstat-no" title="statement not covered" >new Set();</span>
|
|
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>
|
|
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
|
+
}
|
|
465
|
+
});
|
|
466
|
+
<span class="cstat-no" title="statement not covered" > deletes.forEach(<span class="fstat-no" title="function not covered" >(s</span>ourceFile) => {</span>
|
|
467
|
+
const { tsproject } = <span class="cstat-no" title="statement not covered" >projectCache.getProjectInfo(sourceFile, platform);</span>
|
|
468
|
+
<span class="cstat-no" title="statement not covered" > tsproject.removeFile(sourceFile);</span>
|
|
469
|
+
<span class="cstat-no" title="statement not covered" > tsprojectsToValidate.add(tsproject);</span>
|
|
470
|
+
});
|
|
479
471
|
|
|
480
|
-
|
|
472
|
+
// Validate all projects which changed, printing all type errors.
|
|
473
|
+
let isValid = <span class="cstat-no" title="statement not covered" >true;</span>
|
|
474
|
+
<span class="cstat-no" title="statement not covered" > tsprojectsToValidate.forEach(<span class="fstat-no" title="function not covered" >(p</span>) => {</span>
|
|
475
|
+
<span class="cstat-no" title="statement not covered" > if (!p.validate()) {</span>
|
|
476
|
+
<span class="cstat-no" title="statement not covered" > isValid = false;</span>
|
|
477
|
+
}
|
|
478
|
+
});
|
|
481
479
|
|
|
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>
|
|
480
|
+
<span class="cstat-no" title="statement not covered" > if (!isValid && options.throwOnError) {</span>
|
|
481
|
+
// Type-checking failed. Fail the Metro operation (bundling or serving).
|
|
482
|
+
<span class="cstat-no" title="statement not covered" > throw new Error("Type validation failed");</span>
|
|
488
483
|
}
|
|
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
484
|
}
|
|
498
485
|
};
|
|
499
486
|
|
|
500
|
-
|
|
487
|
+
return hook;
|
|
501
488
|
}
|
|
502
489
|
|
|
503
490
|
const emptySerializerHook = <span class="fstat-no" title="function not covered" >(_</span>graph: Graph, _delta: DeltaResult): void => {
|
|
@@ -510,14 +497,14 @@ const emptySerializerHook = <span class="fstat-no" title="function not covered"
|
|
|
510
497
|
* @param metroConfigReadonly Metro configuration
|
|
511
498
|
* @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
499
|
* @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
|
|
500
|
+
* @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
501
|
* @param experimental_treeShake When true, experimental tree-shaking is enabled.
|
|
515
502
|
*/
|
|
516
503
|
export function customizeMetroConfig(
|
|
517
504
|
metroConfigReadonly: InputConfigT,
|
|
518
505
|
detectCyclicDependencies: boolean | CyclicDetectorOptions,
|
|
519
506
|
detectDuplicateDependencies: boolean | DuplicateDetectorOptions,
|
|
520
|
-
|
|
507
|
+
typescriptValidation: boolean | TypeScriptValidationOptions,
|
|
521
508
|
experimental_treeShake: boolean
|
|
522
509
|
): void {
|
|
523
510
|
// We will be making changes to the Metro configuration. Coerce from a
|
|
@@ -557,9 +544,13 @@ export function customizeMetroConfig(
|
|
|
557
544
|
delete metroConfig.serializer.customSerializer;
|
|
558
545
|
}
|
|
559
546
|
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
547
|
+
let hook = emptySerializerHook;
|
|
548
|
+
<span class="missing-if-branch" title="if path not taken" >I</span>if (typeof typescriptValidation === "object") {
|
|
549
|
+
<span class="cstat-no" title="statement not covered" > hook = createSerializerHook(typescriptValidation);</span>
|
|
550
|
+
} else <span class="missing-if-branch" title="else path not taken" >E</span>if (typescriptValidation !== false) {
|
|
551
|
+
hook = createSerializerHook({});
|
|
552
|
+
}
|
|
553
|
+
metroConfig.serializer.experimentalSerializerHook = hook;
|
|
563
554
|
}
|
|
564
555
|
</pre></td></tr></table></pre>
|
|
565
556
|
|
|
@@ -568,7 +559,7 @@ export function customizeMetroConfig(
|
|
|
568
559
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
569
560
|
Code coverage generated by
|
|
570
561
|
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
|
571
|
-
at
|
|
562
|
+
at Mon Dec 13 2021 18:44:20 GMT+0000 (Coordinated Universal Time)
|
|
572
563
|
</div>
|
|
573
564
|
</div>
|
|
574
565
|
<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">8.7% </span>
|
|
27
|
+
<span class="quiet">Statements</span>
|
|
28
|
+
<span class='fraction'>4/46</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">10% </span>
|
|
41
|
+
<span class="quiet">Functions</span>
|
|
42
|
+
<span class='fraction'>1/10</span>
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
<div class='fl pad1y space-right2'>
|
|
47
|
+
<span class="strong">9.09% </span>
|
|
48
|
+
<span class="quiet">Lines</span>
|
|
49
|
+
<span class='fraction'>4/44</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="8.7" 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
|
+
</td>
|
|
80
|
+
<td data-value="8.7" class="pct low">8.7%</td>
|
|
81
|
+
<td data-value="46" class="abs low">4/46</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="10" class="pct low">10%</td>
|
|
85
|
+
<td data-value="10" class="abs low">1/10</td>
|
|
86
|
+
<td data-value="9.09" class="pct low">9.09%</td>
|
|
87
|
+
<td data-value="44" class="abs low">4/44</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 Mon Dec 13 2021 18:44:20 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
|
+
|