Remove WARNINGS file from FB (#27820)
The test was migrated to the generated JS file that allows Jest to track the dependencies, we can now remove this file generation.
Jan Kassens committed
Dec 8, 2023 at 16:21 UTC
40f653d13c363c6f81b13de67ce391991fb1f870
3 files changed
+7
-17
.circleci/config.yml
+1
-2
@@ -107,8 +107,7 @@ jobs:
107
- run:
108
command: |
109
mkdir -p ./build/__test_utils__
110
- node ./scripts/print-warnings/print-warnings.js > build/WARNINGS
111
- node ./scripts/print-warnings/print-warnings.js --js > build/__test_utils__/ReactAllWarnings.js
110
+ node ./scripts/print-warnings/print-warnings.js > build/__test_utils__/ReactAllWarnings.js
111
- persist_to_workspace:
112
root: .
113
paths:
.github/workflows/commit_artifacts.yml
+1
-2
@@ -123,9 +123,8 @@ jobs:
123
mkdir ./compiled
124
mv build/facebook-www ./compiled
125
126
- # Move WARNINGS to facebook-www
126
+ # Move ReactAllWarnings.js to facebook-www
127
mkdir ./compiled/facebook-www/__test_utils__
128
- mv build/WARNINGS ./compiled/facebook-www/WARNINGS
128
mv build/__test_utils__/ReactAllWarnings.js ./compiled/facebook-www/__test_utils__/ReactAllWarnings.js
129
130
# Move eslint-plugin-react-hooks into facebook-www
scripts/print-warnings/print-warnings.js
+5
-13
@@ -75,11 +75,10 @@ gs([
75
'!**/node_modules/**/*.js',
76
]).pipe(
77
through.obj(transform, cb => {
78
- if (process.argv[2] === '--js') {
79
- const warningsArray = Array.from(warnings);
80
- warningsArray.sort();
81
- process.stdout.write(
82
- `/**
78
+ const warningsArray = Array.from(warnings);
79
+ warningsArray.sort();
80
+ process.stdout.write(
81
+ `/**
82
* Copyright (c) Meta Platforms, Inc. and affiliates.
83
*
84
* This source code is licensed under the MIT license found in the
@@ -92,14 +91,7 @@ gs([
91
92
export default ${JSON.stringify(warningsArray, null, 2)};
93
`
95
- );
96
- } else {
97
- process.stdout.write(
98
- Array.from(warnings, warning => JSON.stringify(warning))
99
- .sort()
100
- .join('\n') + '\n'
101
- );
102
- }
94
+ );
95
cb();
96
})
97
);