| 1 | /** |
| 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. |
| 3 | * |
| 4 | * This source code is licensed under the MIT license found in the |
| 5 | * LICENSE file in the root directory of this source tree. |
| 6 | */ |
| 7 | |
| 8 | 'use strict'; |
| 9 | |
| 10 | process.on('unhandledRejection', err => { |
| 11 | throw err; |
| 12 | }); |
| 13 | |
| 14 | const runFlow = require('../flow/runFlow'); |
| 15 | const inlinedHostConfigs = require('../shared/inlinedHostConfigs'); |
| 16 | |
| 17 | async function check(shortName) { |
| 18 | if (shortName == null) { |
| 19 | throw new Error('Expected an inlinedHostConfig shortName'); |
| 20 | } |
| 21 | const rendererInfo = inlinedHostConfigs.find( |
| 22 | config => config.shortName === shortName |
| 23 | ); |
| 24 | if (rendererInfo == null) { |
| 25 | throw new Error(`Could not find inlinedHostConfig for ${shortName}`); |
| 26 | } |
| 27 | if (rendererInfo.isFlowTyped) { |
| 28 | await runFlow(rendererInfo.shortName, ['check']); |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | check(process.argv[2]); |