From 610b5a86580ab46dfa3d5aeafaa68b3e7147e5d6 Mon Sep 17 00:00:00 2001 From: Jan Kassens Date: Fri, 8 Dec 2023 16:00:26 -0500 Subject: [PATCH] Remove WARNINGS file from FB --- .circleci/config.yml | 3 +-- .github/workflows/commit_artifacts.yml | 3 +-- scripts/print-warnings/print-warnings.js | 18 +++++------------- 3 files changed, 7 insertions(+), 17 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a978278455218..4e9d85cd8ddde 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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: diff --git a/.github/workflows/commit_artifacts.yml b/.github/workflows/commit_artifacts.yml index 64bcdf56968bb..db72ecf2df005 100644 --- a/.github/workflows/commit_artifacts.yml +++ b/.github/workflows/commit_artifacts.yml @@ -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 diff --git a/scripts/print-warnings/print-warnings.js b/scripts/print-warnings/print-warnings.js index a05c0700b89fb..69b986b3a0d58 100644 --- a/scripts/print-warnings/print-warnings.js +++ b/scripts/print-warnings/print-warnings.js @@ -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 @@ -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(); }) );