mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Convert build scripts to regular Flow syntax (#49103)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/49103 Changelog: [Internal] Reviewed By: j-piasecki Differential Revision: D68960540 fbshipit-source-id: 0ac01529eaea97db98b85b6021532092997d633b
This commit is contained in:
committed by
Facebook GitHub Bot
parent
e1575857dd
commit
3cf400a51b
@@ -9,6 +9,8 @@
|
||||
* @oncall react_native
|
||||
*/
|
||||
|
||||
require('../babel-register').registerForScript();
|
||||
|
||||
const {PACKAGES_DIR, REPO_ROOT} = require('../consts');
|
||||
const translateSourceFile = require('./build-types/translateSourceFile');
|
||||
const chalk = require('chalk');
|
||||
@@ -103,11 +105,11 @@ async function main() {
|
||||
);
|
||||
}
|
||||
|
||||
function getPackageName(file /*: string */) /*: string */ {
|
||||
function getPackageName(file: string): string {
|
||||
return path.relative(PACKAGES_DIR, file).split(path.sep)[0];
|
||||
}
|
||||
|
||||
function getBuildPath(file /*: string */) /*: string */ {
|
||||
function getBuildPath(file: string): string {
|
||||
const packageDir = path.join(PACKAGES_DIR, getPackageName(file));
|
||||
|
||||
return path.join(
|
||||
@@ -119,9 +121,9 @@ function getBuildPath(file /*: string */) /*: string */ {
|
||||
);
|
||||
}
|
||||
|
||||
function ignoreShadowedFiles(files /*: Array<string> */) /*: Array<string> */ {
|
||||
const shadowedPrefixes /*: Record<string, boolean> */ = {};
|
||||
const result /*: Array<string> */ = [];
|
||||
function ignoreShadowedFiles(files: Array<string>): Array<string> {
|
||||
const shadowedPrefixes: Record<string, boolean> = {};
|
||||
const result: Array<string> = [];
|
||||
|
||||
// Find all flow definition files that shadow other files
|
||||
for (const file of files) {
|
||||
|
||||
Reference in New Issue
Block a user