From a701a44d3995c6438cebdc72c60361c27ec3010e Mon Sep 17 00:00:00 2001 From: Xianming Zhong Date: Thu, 19 Oct 2017 20:48:27 +0800 Subject: [PATCH 1/4] chore(fonts): Not link all fonts from react-native-vector-icons --- rn-cli.config.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 rn-cli.config.js diff --git a/rn-cli.config.js b/rn-cli.config.js new file mode 100644 index 000000000..ec09b46d2 --- /dev/null +++ b/rn-cli.config.js @@ -0,0 +1,18 @@ +const defaultConfig = require('react-native/local-cli/core/default.config.js'); + +const config = { + getDependencyConfig(packageName) { + if (packageName === 'react-native-vector-icons') { + // we do not need link all fonts from it, #402 + return { + assets: [], + commands: {}, + params: [], + }; + } + + return defaultConfig.getDependencyConfig(packageName); + }, +}; + +module.exports = config; From b746b79a28d92b790c5d855a7a9672d9844d834c Mon Sep 17 00:00:00 2001 From: Xianming Zhong Date: Thu, 19 Oct 2017 20:56:13 +0800 Subject: [PATCH 2/4] fix(fonts): Add the missing Menlo --- ios/GitPoint.xcodeproj/project.pbxproj | 4 ++++ ios/GitPoint/Info.plist | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ios/GitPoint.xcodeproj/project.pbxproj b/ios/GitPoint.xcodeproj/project.pbxproj index 8c19e0d30..0a9ad47c0 100644 --- a/ios/GitPoint.xcodeproj/project.pbxproj +++ b/ios/GitPoint.xcodeproj/project.pbxproj @@ -51,6 +51,7 @@ B58367881AB44EC4944D4698 /* Nunito-Italic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = E37A1EB69E2D4FD7B138343D /* Nunito-Italic.ttf */; }; B66611A59CDF49A19C845B57 /* Nunito-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 78A9FAE6B34B4FAC9F27CBC3 /* Nunito-Regular.ttf */; }; B8D599F61D2A4797A2F71CAA /* libRNVectorIcons.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AFDBB5669CAB4C5C8215B571 /* libRNVectorIcons.a */; }; + D2C2FCD70676466EA8E466D6 /* Menlo.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 18487F5E165143648CF0950E /* Menlo.ttf */; }; DC5C35E71E37AD1800F3F526 /* FontAwesome.ttf in Resources */ = {isa = PBXBuildFile; fileRef = DC5C35DD1E37AD1800F3F526 /* FontAwesome.ttf */; }; EB0F176BE52B4561B9FF07AB /* libReactNativeConfig.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D7043BDB577E427391ECFBB0 /* libReactNativeConfig.a */; }; /* End PBXBuildFile section */ @@ -343,6 +344,7 @@ 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = GitPoint/Info.plist; sourceTree = ""; }; 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = GitPoint/main.m; sourceTree = ""; }; 146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "../node_modules/react-native/React/React.xcodeproj"; sourceTree = ""; }; + 18487F5E165143648CF0950E /* Menlo.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Menlo.ttf; path = ../src/assets/fonts/Menlo.ttf; sourceTree = ""; }; 1ABB0D8AB2424B1595DABB16 /* libRNPhotoView.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNPhotoView.a; sourceTree = ""; }; 24C757CE6CB049658C31ED0E /* Nunito-Bold.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "Nunito-Bold.ttf"; path = "../src/assets/fonts/Nunito-Bold.ttf"; sourceTree = ""; }; 27CFE4061F920B7700951EF2 /* MaterialIcons.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = MaterialIcons.ttf; sourceTree = ""; }; @@ -557,6 +559,7 @@ ED1B22A89E134AA89E251577 /* Nunito-Light.ttf */, 78A9FAE6B34B4FAC9F27CBC3 /* Nunito-Regular.ttf */, FBD0F4CBD299403498005E08 /* Nunito-SemiBold.ttf */, + 18487F5E165143648CF0950E /* Menlo.ttf */, ); name = Resources; sourceTree = ""; @@ -1233,6 +1236,7 @@ 5DC6C311356B4973AE2599BF /* Nunito-Light.ttf in Resources */, B66611A59CDF49A19C845B57 /* Nunito-Regular.ttf in Resources */, 4A0E0CE9909244398A873436 /* Nunito-SemiBold.ttf in Resources */, + D2C2FCD70676466EA8E466D6 /* Menlo.ttf in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/ios/GitPoint/Info.plist b/ios/GitPoint/Info.plist index fc2257eda..921b1b580 100644 --- a/ios/GitPoint/Info.plist +++ b/ios/GitPoint/Info.plist @@ -49,7 +49,7 @@ NSLocationWhenInUseUsageDescription - + UIAppFonts FontAwesome.ttf @@ -60,6 +60,7 @@ Nunito-Light.ttf Nunito-Regular.ttf Nunito-SemiBold.ttf + Menlo.ttf UIRequiredDeviceCapabilities From 0e3fa0766b3692d8fc1c15fe2def2742efabe654 Mon Sep 17 00:00:00 2001 From: Xianming Zhong Date: Thu, 19 Oct 2017 23:19:05 +0800 Subject: [PATCH 3/4] fix(cli): Fix for RN 0.48 --- rn-cli.config.js | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/rn-cli.config.js b/rn-cli.config.js index ec09b46d2..27b74d768 100644 --- a/rn-cli.config.js +++ b/rn-cli.config.js @@ -1,17 +1,37 @@ -const defaultConfig = require('react-native/local-cli/core/default.config.js'); +// Inspired by react-native/local-cli/core/index.js + +const android = require('react-native/local-cli/core/android'); +const ios = require('react-native/local-cli/core/ios'); +const windows = require('react-native/local-cli/core/windows'); +const findAssets = require('react-native/local-cli/core/findAssets'); +const wrapCommands = require('react-native/local-cli/core/wrapCommands'); + +const path = require('path'); + +const getRNPMConfig = folder => + // eslint-disable-next-line import/no-dynamic-require + require(path.join(folder, './package.json')).rnpm || {}; const config = { getDependencyConfig(packageName) { + const folder = path.join(process.cwd(), 'node_modules', packageName); + const rnpm = getRNPMConfig( + path.join(process.cwd(), 'node_modules', packageName) + ); + if (packageName === 'react-native-vector-icons') { // we do not need link all fonts from it, #402 - return { - assets: [], - commands: {}, - params: [], - }; + rnpm.assets = []; } - return defaultConfig.getDependencyConfig(packageName); + return Object.assign({}, rnpm, { + ios: ios.dependencyConfig(folder, rnpm.ios || {}), + android: android.dependencyConfig(folder, rnpm.android || {}), + windows: windows.dependencyConfig(folder, rnpm.windows || {}), + assets: findAssets(folder, rnpm.assets), + commands: wrapCommands(rnpm.commands), + params: rnpm.params || [], + }); }, }; From 1c7ba05d47e7ddd83d5d5bf126efb6fb19f6400c Mon Sep 17 00:00:00 2001 From: Xianming Zhong Date: Thu, 19 Oct 2017 23:44:34 +0800 Subject: [PATCH 4/4] chore(cli): Run `yarn run link` again --- ios/GitPoint.xcodeproj/project.pbxproj | 1 - 1 file changed, 1 deletion(-) diff --git a/ios/GitPoint.xcodeproj/project.pbxproj b/ios/GitPoint.xcodeproj/project.pbxproj index 0a9ad47c0..4e0ddeab7 100644 --- a/ios/GitPoint.xcodeproj/project.pbxproj +++ b/ios/GitPoint.xcodeproj/project.pbxproj @@ -5,7 +5,6 @@ }; objectVersion = 46; objects = { - /* Begin PBXBuildFile section */ 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; }; 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; };