mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
a7a513fc96
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/49257 Adds minimal dependency resolution to `yarn build-types`. - This enables us to opt in React Native APIs by entry point, with the build script resolving all necessary dependencies. Improves correctness and removes concern of globbing paths manually. Other notes: - The `ActionSheetIOS.js` entry point is temporarily disabled as input; needs further work. Changelog: [Internal] Reviewed By: j-piasecki Differential Revision: D69255015 fbshipit-source-id: 2d99c014b50e41e4695549f46ca874a2b546f545
60 lines
1.1 KiB
JavaScript
60 lines
1.1 KiB
JavaScript
/**
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @flow
|
|
* @format
|
|
* @oncall react_native
|
|
*/
|
|
|
|
require('../babel-register').registerForScript();
|
|
|
|
const buildTypes = require('./build-types/buildTypes');
|
|
const chalk = require('chalk');
|
|
const debug = require('debug');
|
|
const {parseArgs} = require('util');
|
|
|
|
const config = {
|
|
options: {
|
|
debug: {type: 'boolean'},
|
|
help: {type: 'boolean'},
|
|
},
|
|
};
|
|
|
|
async function main() {
|
|
const {
|
|
values: {debug: debugEnabled, help},
|
|
} = parseArgs(config);
|
|
|
|
if (help) {
|
|
console.log(`
|
|
Usage: node ./scripts/build/build-types.js
|
|
|
|
[Experimental] Build generated TypeScript types for react-native.
|
|
`);
|
|
process.exitCode = 0;
|
|
return;
|
|
}
|
|
|
|
if (debugEnabled) {
|
|
debug.enable('build-types:*');
|
|
}
|
|
|
|
console.log(
|
|
'\n' +
|
|
chalk.bold.inverse.yellow(
|
|
'EXPERIMENTAL - Building generated react-native package types',
|
|
) +
|
|
'\n',
|
|
);
|
|
|
|
await buildTypes();
|
|
}
|
|
|
|
if (require.main === module) {
|
|
// eslint-disable-next-line no-void
|
|
void main();
|
|
}
|