From e6f0724c4ec1470d9b175a2d889108ca62216ca5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dawid=20Ma=C5=82ecki?= Date: Wed, 18 Mar 2026 09:29:02 -0700 Subject: [PATCH] Add option to generate a single snapshot view from CLI (#56071) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/56071 Changelog: [Internal] Adds `--view` argument to the snapshot generator, which allows to generate a single snapshot view instead of all of them. Reviewed By: cipolleschi Differential Revision: D96280524 fbshipit-source-id: 6ebf3689e7b0256ba54c3d5a8e1dd602b044ec02 --- scripts/cxx-api/parser/__main__.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/cxx-api/parser/__main__.py b/scripts/cxx-api/parser/__main__.py index 4e4e88089d3..bdaac3147bc 100644 --- a/scripts/cxx-api/parser/__main__.py +++ b/scripts/cxx-api/parser/__main__.py @@ -198,6 +198,11 @@ def main(): type=str, help="Directory containing committed snapshots for comparison (used with --check)", ) + parser.add_argument( + "--view", + type=str, + help="Name of the API view to generate", + ) parser.add_argument( "--test", action="store_true", @@ -250,6 +255,9 @@ def main(): def build_snapshots(output_dir: str, verbose: bool) -> None: if not args.test: for config in snapshot_configs: + if args.view and config.snapshot_name != args.view: + continue + build_snapshot_for_view( api_view=config.snapshot_name, react_native_dir=react_native_package_dir,