mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Summary: Pull Request resolved: https://github.com/react/react-native/pull/57611 Directly follows D112733139 (Metro). **Motivation** - New Node builtins are *only* available under the prefix (e.g. `node:sqlite`), as this allows Node to introduce them without ecosystem-breaking changes, so this is the direction of travel and the only choice that'll allow consistency. - Encouraging them and grouping them separately makes it easier to reason about a module's 3rd party dependencies. Changelog: [Internal] Reviewed By: robhogan Differential Revision: D112803684 fbshipit-source-id: 40668d746a7151b3aa4800ff8af997902a18d198
63 lines
1.5 KiB
JavaScript
63 lines
1.5 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 strict-local
|
|
* @format
|
|
*/
|
|
|
|
import {run} from './scripts/utils';
|
|
import {apple} from '@react-native/core-cli-utils';
|
|
import {Option, program} from 'commander';
|
|
import {readFileSync} from 'node:fs';
|
|
|
|
program.version(JSON.parse(readFileSync('./package.json', 'utf8')).version);
|
|
|
|
const bootstrap = program.command('bootstrap');
|
|
|
|
type BootstrapOptions = {
|
|
arch: 'old' | 'new',
|
|
jsvm: 'hermes' | 'jsc',
|
|
frameworks?: 'static' | 'dynamic',
|
|
};
|
|
|
|
bootstrap
|
|
.command('ios')
|
|
.description('Bootstrap iOS')
|
|
.addOption(
|
|
new Option('--arch <arch>', "Choose React Native's architecture")
|
|
.choices(['new', 'old'])
|
|
.default('new'),
|
|
)
|
|
.addOption(
|
|
new Option(
|
|
'--frameworks <linkage>',
|
|
'Use frameworks instead of static libraries',
|
|
)
|
|
.choices(['static', 'dynamic'])
|
|
.default(undefined),
|
|
)
|
|
.addOption(
|
|
new Option('--jsvm <vm>', 'Choose VM used on device')
|
|
.choices(['jsc', 'hermes'])
|
|
.default('hermes'),
|
|
)
|
|
.action(async ({jsvm, arch, frameworks}: BootstrapOptions) => {
|
|
await run(
|
|
apple.bootstrap({
|
|
cwd: __dirname,
|
|
frameworks,
|
|
hermes: jsvm === 'hermes',
|
|
newArchitecture: arch === 'new',
|
|
}),
|
|
);
|
|
});
|
|
|
|
if (require.main === module) {
|
|
program.parse();
|
|
}
|
|
|
|
export default program;
|