Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove WARNINGS file from FB #27820

Merged
merged 1 commit into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,7 @@ jobs:
- run:
command: |
mkdir -p ./build/__test_utils__
node ./scripts/print-warnings/print-warnings.js > build/WARNINGS
node ./scripts/print-warnings/print-warnings.js --js > build/__test_utils__/ReactAllWarnings.js
node ./scripts/print-warnings/print-warnings.js > build/__test_utils__/ReactAllWarnings.js
- persist_to_workspace:
root: .
paths:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/commit_artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,8 @@ jobs:
mkdir ./compiled
mv build/facebook-www ./compiled

# Move WARNINGS to facebook-www
# Move ReactAllWarnings.js to facebook-www
mkdir ./compiled/facebook-www/__test_utils__
mv build/WARNINGS ./compiled/facebook-www/WARNINGS
mv build/__test_utils__/ReactAllWarnings.js ./compiled/facebook-www/__test_utils__/ReactAllWarnings.js

# Move eslint-plugin-react-hooks into facebook-www
Expand Down
18 changes: 5 additions & 13 deletions scripts/print-warnings/print-warnings.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,10 @@ gs([
'!**/node_modules/**/*.js',
]).pipe(
through.obj(transform, cb => {
if (process.argv[2] === '--js') {
const warningsArray = Array.from(warnings);
warningsArray.sort();
process.stdout.write(
`/**
const warningsArray = Array.from(warnings);
warningsArray.sort();
process.stdout.write(
`/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
Expand All @@ -92,14 +91,7 @@ gs([

export default ${JSON.stringify(warningsArray, null, 2)};
`
);
} else {
process.stdout.write(
Array.from(warnings, warning => JSON.stringify(warning))
.sort()
.join('\n') + '\n'
);
}
);
cb();
})
);