/
githubmr
/
facebook-react-native
Обзор
Документация
Войти
/
githubmr
/
facebook-react-native
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
main
packages/react-native/scripts/swiftpm/headers-mappings.js
149 строк
4 KB
Riccardo Cipolleschi
Create function to create hardlink to header required to build React Native Core (#53635)
22 сен 2025, 20:14
22 сен 2025, 20:14
6807231
Код
Авторство
О чём код?
/** * 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 */ const path = require('path'); /*:: type MappingOption = { destination: string; excludeFolders: Array<string>; preserveStructure: boolean } */ function reactCommonMappings( reactCommonPath /*: string */, headersOutput /*: string */, ) /*: { [string]: MappingOption } */ { let mappings /*: { [string]: MappingOption } */ = {}; mappings[`${reactCommonPath}/react`] = { destination: path.join(headersOutput, 'react'), excludeFolders: [], preserveStructure: true, }; mappings[`${reactCommonPath}/react/renderer/components/view/platform/cxx`] = { destination: path.join(headersOutput, 'React/renderer/components/view'), excludeFolders: [], preserveStructure: false, }; mappings[`${reactCommonPath}/react/renderer/graphics/platform/ios`] = { destination: path.join(headersOutput, 'react/renderer/graphics'), excludeFolders: [], preserveStructure: false, }; mappings[`${reactCommonPath}/react/runtime/platform/ios/ReactCommon`] = { destination: path.join(headersOutput, 'ReactCommon'), excludeFolders: [], preserveStructure: true, }; mappings[`${reactCommonPath}/react/nativemodule/core/platform/ios`] = { destination: headersOutput, excludeFolders: [], preserveStructure: true, }; mappings[`${reactCommonPath}/react/nativemodule/samples/platform/ios`] = { destination: headersOutput, excludeFolders: [], preserveStructure: true, }; mappings[`${reactCommonPath}/callinvoker`] = { destination: headersOutput, excludeFolders: ['tests'], preserveStructure: true, }; mappings[`${reactCommonPath}/cxxreact`] = { destination: path.join(headersOutput, 'cxxreact'), excludeFolders: [], preserveStructure: true, }; mappings[`${reactCommonPath}/jserrorhandler`] = { destination: path.join(headersOutput, 'jserrorhandler'), excludeFolders: [], preserveStructure: true, }; mappings[`${reactCommonPath}/jsinspector-modern`] = { destination: path.join(headersOutput, 'jsinspector-modern'), excludeFolders: [], preserveStructure: true, }; mappings[`${reactCommonPath}/oscompat`] = { destination: path.join(headersOutput, 'oscompat'), excludeFolders: [], preserveStructure: true, }; mappings[`${reactCommonPath}/runtimeexecutor`] = { destination: headersOutput, excludeFolders: [], preserveStructure: true, }; mappings[`${reactCommonPath}/yoga/yoga`] = { destination: path.join(headersOutput, 'yoga'), excludeFolders: [], preserveStructure: true, }; return mappings; } function reactMappings( reactNativePath /*: string */, headersOutput /*: string */, ) /*: { [string]: MappingOption } */ { let mappings /*: { [string]: MappingOption } */ = {}; mappings[`${reactNativePath}/React`] = { destination: path.join(headersOutput, 'React'), excludeFolders: ['includes', 'headers', 'tests'], preserveStructure: false, }; mappings[`${reactNativePath}/React/FBReactNativeSpec`] = { destination: headersOutput, excludeFolders: ['tests'], preserveStructure: true, }; return mappings; } function librariesMappings( reactNativePath /*: string */, headersOutput /*: string */, ) /*: { [string]: MappingOption } */ { let mappings /*: { [string]: MappingOption } */ = {}; mappings[`${reactNativePath}/Libraries`] = { destination: path.join(headersOutput, 'React'), excludeFolders: ['tests'], preserveStructure: false, }; mappings[`${reactNativePath}/Libraries/FBLazyVector`] = { destination: path.join(headersOutput, 'FBLazyVector'), excludeFolders: ['tests'], preserveStructure: false, }; mappings[`${reactNativePath}/Libraries/Required`] = { destination: path.join(headersOutput, 'RCTRequired'), excludeFolders: ['tests'], preserveStructure: false, }; mappings[`${reactNativePath}/Libraries/TypeSafety`] = { destination: path.join(headersOutput, 'RCTTypeSafety'), excludeFolders: ['tests'], preserveStructure: false, }; return mappings; } module.exports = { librariesMappings, reactCommonMappings, reactMappings, };