forked from Expensify/App
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreact-compiler-healthcheck+19.0.0-beta-8a03594-20241020+003+json.patch
72 lines (71 loc) · 2.28 KB
/
react-compiler-healthcheck+19.0.0-beta-8a03594-20241020+003+json.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
diff --git a/node_modules/react-compiler-healthcheck/dist/index.js b/node_modules/react-compiler-healthcheck/dist/index.js
index 17b0f96..e386e34 100755
--- a/node_modules/react-compiler-healthcheck/dist/index.js
+++ b/node_modules/react-compiler-healthcheck/dist/index.js
@@ -56972,16 +56972,28 @@ var reactCompilerCheck = {
compile(source, path);
}
},
- report(verbose) {
+ report(verbose, json) {
const totalComponents =
SucessfulCompilation.length +
countUniqueLocInEvents(OtherFailures) +
countUniqueLocInEvents(ActionableFailures);
- console.log(
- chalk.green(
- `Successfully compiled ${SucessfulCompilation.length} out of ${totalComponents} components.`
- )
- );
+ if (!json) {
+ console.log(
+ chalk.green(
+ `Successfully compiled ${SucessfulCompilation.length} out of ${totalComponents} components.`
+ )
+ );
+ }
+
+ if (json) {
+ const extractFileName = (output) => output.fnLoc.filename;
+ const successfulFiles = SucessfulCompilation.map(extractFileName);
+ const unsuccessfulFiles = [...new Set([...OtherFailures, ...ActionableFailures].map(extractFileName))];
+ console.log(JSON.stringify({
+ success: successfulFiles,
+ failure: unsuccessfulFiles,
+ }));
+ }
if (verbose) {
for (const compilation of [...SucessfulCompilation, ...ActionableFailures, ...OtherFailures]) {
@@ -57068,10 +57080,17 @@ function main() {
default: false,
alias: 'v',
})
+ .option('json', {
+ description: 'print a list of compiled/not-compiled files as JSON',
+ type: 'boolean',
+ default: false,
+ alias: 'j',
+ })
.parseSync();
const spinner = ora('Checking').start();
let src = argv.src;
let verbose = argv.verbose;
+ let json = argv.json;
const globOptions = {
onlyFiles: true,
ignore: [
@@ -57091,9 +57110,11 @@ function main() {
libraryCompatCheck.run(source, path);
}
spinner.stop();
- reactCompilerCheck.report(verbose);
- strictModeCheck.report();
- libraryCompatCheck.report();
+ reactCompilerCheck.report(verbose, json);
+ if (!json) {
+ strictModeCheck.report();
+ libraryCompatCheck.report();
+ }
});
}
main();