Files
react-native/packages/react-native/scripts/featureflags/generateJavaScriptModules.js
T
Rubén Norte 4799d0cc5c Move spec files to specs directories in react-native/src/private (#43395)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43395

Changelog: [internal]

This moves native module specs to `specs` directory to align with the general convention.

Reviewed By: cortinico

Differential Revision: D54680056

fbshipit-source-id: 8b6ae6187e2ffa9120159b7d1fa25957677e0f4f
2024-03-12 09:54:11 -07:00

36 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 type {GeneratorConfig, GeneratorResult} from './types';
import NativeReactNativeFeatureFlagsCPP from './templates/js/NativeReactNativeFeatureFlags.cpp-template';
import NativeReactNativeFeatureFlagsH from './templates/js/NativeReactNativeFeatureFlags.h-template';
import NativeReactNativeFeatureFlagsJS from './templates/js/NativeReactNativeFeatureFlags.js-template';
import ReactNativeFeatureFlagsJS from './templates/js/ReactNativeFeatureFlags.js-template';
import path from 'path';
export default function generateCommonCxxModules(
generatorConfig: GeneratorConfig,
): GeneratorResult {
const {jsPath, commonNativeModuleCxxPath, featureFlagDefinitions} =
generatorConfig;
return {
[path.join(jsPath, 'ReactNativeFeatureFlags.js')]:
ReactNativeFeatureFlagsJS(featureFlagDefinitions),
[path.join(jsPath, 'specs', 'NativeReactNativeFeatureFlags.js')]:
NativeReactNativeFeatureFlagsJS(featureFlagDefinitions),
[path.join(commonNativeModuleCxxPath, 'NativeReactNativeFeatureFlags.h')]:
NativeReactNativeFeatureFlagsH(featureFlagDefinitions),
[path.join(commonNativeModuleCxxPath, 'NativeReactNativeFeatureFlags.cpp')]:
NativeReactNativeFeatureFlagsCPP(featureFlagDefinitions),
};
}