Files
react-native/packages/react-native/scripts/featureflags/update.js
T
Rubén Norte 5030f4e015 Move feature flag definitions to JS file instead of JSON (#42815)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42815

Feature flags were originally defined in a JSON file for easier interoperability but we're only using the definitions in JS anyway, so having the definitions in a JS file is more flexible (e.g.: adding comments).

Changelog: [internal]

Reviewed By: huntie

Differential Revision: D53351483

fbshipit-source-id: 23fe0a3898b4facf2f2cf9645f78c45d78937f31
2024-02-05 11:02:48 -08:00

67 lines
1.4 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
* @format
*/
import generateFiles from './generateFiles';
import featureFlagDefinitions from './ReactNativeFeatureFlags.config';
import path from 'path';
const REACT_NATIVE_PACKAGE_ROOT = path.join(__dirname, '..', '..');
export default function update(verifyUnchanged: boolean): void {
generateFiles(
{
featureFlagDefinitions,
jsPath: path.join(
REACT_NATIVE_PACKAGE_ROOT,
'src',
'private',
'featureflags',
),
commonCxxPath: path.join(
REACT_NATIVE_PACKAGE_ROOT,
'ReactCommon',
'react',
'featureflags',
),
commonNativeModuleCxxPath: path.join(
REACT_NATIVE_PACKAGE_ROOT,
'ReactCommon',
'react',
'nativemodule',
'featureflags',
),
androidPath: path.join(
REACT_NATIVE_PACKAGE_ROOT,
'ReactAndroid',
'src',
'main',
'java',
'com',
'facebook',
'react',
'internal',
'featureflags',
),
androidJniPath: path.join(
REACT_NATIVE_PACKAGE_ROOT,
'ReactAndroid',
'src',
'main',
'jni',
'react',
'featureflags',
),
},
{
verifyUnchanged,
},
);
}