From 9ee47f3dfccdf2bc8059be2188f970ac872bcdb6 Mon Sep 17 00:00:00 2001 From: Joel Arvidsson Date: Mon, 6 Jul 2015 12:20:24 +0200 Subject: [PATCH] Support for RN 0.7.0 packager. Fixes #4 --- Entypo.js | 2 +- EvilIcons.js | 2 +- Examples/IconExplorer/package.json | 2 +- .../TabBarExample.xcodeproj/project.pbxproj | 24 +++++++++---------- Examples/TabBarExample/index.ios.js | 2 +- Examples/TabBarExample/package.json | 2 +- FontAwesome.js | 2 +- Foundation.js | 2 +- Ionicons.js | 2 +- MaterialIcons.js | 2 +- README.md | 12 +++++----- Zocial.js | 2 +- lib/create-icon-set-from-fontello.js | 2 +- lib/create-icon-set.js | 2 +- package.json | 2 +- template/iconSet.tpl | 2 +- 16 files changed, 32 insertions(+), 32 deletions(-) diff --git a/Entypo.js b/Entypo.js index e095b69..c70af99 100644 --- a/Entypo.js +++ b/Entypo.js @@ -6,7 +6,7 @@ */ 'use strict'; -var createIconSet = require('createIconSet'); +var createIconSet = require('./lib/create-icon-set'); var glyphMap = { "500px": 61696, "500px-with-circle": 61697, diff --git a/EvilIcons.js b/EvilIcons.js index 45cca16..8813846 100644 --- a/EvilIcons.js +++ b/EvilIcons.js @@ -6,7 +6,7 @@ */ 'use strict'; -var createIconSet = require('createIconSet'); +var createIconSet = require('./lib/create-icon-set'); var glyphMap = { "archive": 61696, "arrow-down": 61697, diff --git a/Examples/IconExplorer/package.json b/Examples/IconExplorer/package.json index d34b462..fa24a07 100644 --- a/Examples/IconExplorer/package.json +++ b/Examples/IconExplorer/package.json @@ -7,7 +7,7 @@ }, "dependencies": { "lodash": "^3.8.0", - "react-native": "^0.5.0", + "react-native": "^0.7.0-rc.2", "react-native-vector-icons": "file:../../" } } diff --git a/Examples/TabBarExample/TabBarExample.xcodeproj/project.pbxproj b/Examples/TabBarExample/TabBarExample.xcodeproj/project.pbxproj index 972f87c..481a579 100644 --- a/Examples/TabBarExample/TabBarExample.xcodeproj/project.pbxproj +++ b/Examples/TabBarExample/TabBarExample.xcodeproj/project.pbxproj @@ -23,7 +23,7 @@ 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; - 5DBEB1991B18D39B00B34395 /* libRNVectorIcons.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DBEB1981B18D39100B34395 /* libRNVectorIcons.a */; }; + 5D6C177B1B4A8C9A00B100C5 /* libRNVectorIcons.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5D6C177A1B4A8C8A00B100C5 /* libRNVectorIcons.a */; }; 5DE064991B1C9A2B00536BA2 /* Entypo.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 5DE064921B1C9A2B00536BA2 /* Entypo.ttf */; }; 5DE0649A1B1C9A2B00536BA2 /* EvilIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 5DE064931B1C9A2B00536BA2 /* EvilIcons.ttf */; }; 5DE0649B1B1C9A2B00536BA2 /* FontAwesome.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 5DE064941B1C9A2B00536BA2 /* FontAwesome.ttf */; }; @@ -105,9 +105,9 @@ remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192; remoteInfo = React; }; - 5DBEB1971B18D39100B34395 /* PBXContainerItemProxy */ = { + 5D6C17791B4A8C8A00B100C5 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 5DBEB1881B18D39100B34395 /* RNVectorIcons.xcodeproj */; + containerPortal = 5D6C17751B4A8C8A00B100C5 /* RNVectorIcons.xcodeproj */; proxyType = 2; remoteGlobalIDString = 5DBEB1501B18CEA900B34395; remoteInfo = RNVectorIcons; @@ -149,7 +149,7 @@ 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = iOS/Info.plist; sourceTree = ""; }; 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = iOS/main.m; sourceTree = ""; }; 146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "node_modules/react-native/React/React.xcodeproj"; sourceTree = ""; }; - 5DBEB1881B18D39100B34395 /* RNVectorIcons.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RNVectorIcons.xcodeproj; path = ../../RNVectorIcons.xcodeproj; sourceTree = ""; }; + 5D6C17751B4A8C8A00B100C5 /* RNVectorIcons.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RNVectorIcons.xcodeproj; path = "node_modules/react-native-vector-icons/RNVectorIcons.xcodeproj"; sourceTree = ""; }; 5DE064921B1C9A2B00536BA2 /* Entypo.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = Entypo.ttf; sourceTree = ""; }; 5DE064931B1C9A2B00536BA2 /* EvilIcons.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = EvilIcons.ttf; sourceTree = ""; }; 5DE064941B1C9A2B00536BA2 /* FontAwesome.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = FontAwesome.ttf; sourceTree = ""; }; @@ -173,7 +173,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 5DBEB1991B18D39B00B34395 /* libRNVectorIcons.a in Frameworks */, 146834051AC3E58100842450 /* libReact.a in Frameworks */, 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */, 00C302E61ABCBA2D00DB3ED1 /* libRCTAdSupport.a in Frameworks */, @@ -185,6 +184,7 @@ 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */, 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */, 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */, + 5D6C177B1B4A8C9A00B100C5 /* libRNVectorIcons.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -294,10 +294,10 @@ name = Products; sourceTree = ""; }; - 5DBEB1891B18D39100B34395 /* Products */ = { + 5D6C17761B4A8C8A00B100C5 /* Products */ = { isa = PBXGroup; children = ( - 5DBEB1981B18D39100B34395 /* libRNVectorIcons.a */, + 5D6C177A1B4A8C8A00B100C5 /* libRNVectorIcons.a */, ); name = Products; sourceTree = ""; @@ -328,7 +328,7 @@ 832341AE1AAA6A7D00B99B32 /* Libraries */ = { isa = PBXGroup; children = ( - 5DBEB1881B18D39100B34395 /* RNVectorIcons.xcodeproj */, + 5D6C17751B4A8C8A00B100C5 /* RNVectorIcons.xcodeproj */, 146833FF1AC3E56700842450 /* React.xcodeproj */, 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */, 00C302AF1ABCB8E700DB3ED1 /* RCTAdSupport.xcodeproj */, @@ -484,8 +484,8 @@ ProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */; }, { - ProductGroup = 5DBEB1891B18D39100B34395 /* Products */; - ProjectRef = 5DBEB1881B18D39100B34395 /* RNVectorIcons.xcodeproj */; + ProductGroup = 5D6C17761B4A8C8A00B100C5 /* Products */; + ProjectRef = 5D6C17751B4A8C8A00B100C5 /* RNVectorIcons.xcodeproj */; }, ); projectRoot = ""; @@ -560,11 +560,11 @@ remoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 5DBEB1981B18D39100B34395 /* libRNVectorIcons.a */ = { + 5D6C177A1B4A8C8A00B100C5 /* libRNVectorIcons.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = libRNVectorIcons.a; - remoteRef = 5DBEB1971B18D39100B34395 /* PBXContainerItemProxy */; + remoteRef = 5D6C17791B4A8C8A00B100C5 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; 78C398B91ACF4ADC00677621 /* libRCTLinking.a */ = { diff --git a/Examples/TabBarExample/index.ios.js b/Examples/TabBarExample/index.ios.js index d18718c..3bbf416 100644 --- a/Examples/TabBarExample/index.ios.js +++ b/Examples/TabBarExample/index.ios.js @@ -12,7 +12,7 @@ var { TouchableOpacity, } = React; -var Icon = require('Ionicons'); +var Icon = require('react-native-vector-icons/Ionicons'); var ColoredView = React.createClass({ componentWillMount: function() { diff --git a/Examples/TabBarExample/package.json b/Examples/TabBarExample/package.json index 6eb10cb..207304b 100644 --- a/Examples/TabBarExample/package.json +++ b/Examples/TabBarExample/package.json @@ -6,7 +6,7 @@ "start": "node_modules/react-native/packager/packager.sh" }, "dependencies": { - "react-native": "^0.5.0", + "react-native": "^0.7.0-rc.2", "react-native-vector-icons": "file:../../" } } diff --git a/FontAwesome.js b/FontAwesome.js index 920372e..d7e5222 100644 --- a/FontAwesome.js +++ b/FontAwesome.js @@ -6,7 +6,7 @@ */ 'use strict'; -var createIconSet = require('createIconSet'); +var createIconSet = require('./lib/create-icon-set'); var glyphMap = { "glass": 61440, "music": 61441, diff --git a/Foundation.js b/Foundation.js index 27edfa5..bbc9226 100644 --- a/Foundation.js +++ b/Foundation.js @@ -6,7 +6,7 @@ */ 'use strict'; -var createIconSet = require('createIconSet'); +var createIconSet = require('./lib/create-icon-set'); var glyphMap = { "address-book": 61696, "alert": 61697, diff --git a/Ionicons.js b/Ionicons.js index 22b7f89..a171349 100644 --- a/Ionicons.js +++ b/Ionicons.js @@ -6,7 +6,7 @@ */ 'use strict'; -var createIconSet = require('createIconSet'); +var createIconSet = require('./lib/create-icon-set'); var glyphMap = { "alert": 61697, "alert-circled": 61696, diff --git a/MaterialIcons.js b/MaterialIcons.js index a1303fc..4cfa2ea 100644 --- a/MaterialIcons.js +++ b/MaterialIcons.js @@ -6,7 +6,7 @@ */ 'use strict'; -var createIconSet = require('createIconSet'); +var createIconSet = require('./lib/create-icon-set'); var glyphMap = { "3d-rotation": 61696, "access-alarm": 61697, diff --git a/README.md b/README.md index f8b5ff7..a75ec0e 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ You can either use one of the bundled icons or roll your own custom font. Curren * [`Zocial`](http://zocial.smcllns.com/) by Sam Collins (v1.0, **100** icons) ```js -var Icon = require('FontAwesome'); +var Icon = require('react-native-vector-icons/FontAwesome'); var myIcon = () ``` @@ -98,7 +98,7 @@ Note: Since [`NavBarIOS` doesn't rerender with new state](https://github.com/fac Returns your own custom font based on the `glyphMap` where the key is the icon name and the value is either a UTF-8 character or it's character code. `fontFamily` is the name of the font **NOT** the filename. Open the font in Font Book.app or similar to learn the name. ```js -var createIconSet = require('createIconSet'); +var { createIconSet } = require('react-native-vector-icons'); var glyphMap = { 'icon-name': 1234, test: '∆' }; var Icon = createIconSet(glyphMap, 'FontName'); ``` @@ -107,7 +107,7 @@ var Icon = createIconSet(glyphMap, 'FontName'); Convenience method to create a custom font based on a [fontello](http://fontello.com) config file. Don't forget to import the font as described above and drop the `config.json` somewhere convenient in your project. ```js -var require('createIconSetFromFontello'); +var { createIconSetFromFontello } = require('react-native-vector-icons'); var fontelloConfig = require('./config.json'); var Icon = createIconSetFromFontello(fontelloConfig); ``` @@ -123,7 +123,7 @@ Try the `IconExplorer` project in `Examples/IconExplorer` folder, there you can ### Basic Example ```js var React = require('react-native'); -var Icon = require('Ionicons'); +var Icon = require('react-native-vector-icons/Ionicons'); var ExampleView = React.createClass({ render: function() { @@ -142,7 +142,7 @@ var { Text, TabBarIOS, } = React; -var Icon = require('Ionicons'); +var Icon = require('react-native-vector-icons/Ionicons'); var TabBarView = React.createClass({ render: function() { @@ -167,7 +167,7 @@ By nesting a `` element and assigning padding and background color you can ![buttons](https://cloud.githubusercontent.com/assets/378279/7667568/2e9021b2-fc0d-11e4-8e68-cf91c329a6f4.png) ```js -var Icon = require('FontAwesome') +var Icon = require('react-native-vector-icons/FontAwesome') var styles = StyleSheet.create({ icon: { diff --git a/Zocial.js b/Zocial.js index 62bb285..1562c06 100644 --- a/Zocial.js +++ b/Zocial.js @@ -6,7 +6,7 @@ */ 'use strict'; -var createIconSet = require('createIconSet'); +var createIconSet = require('./lib/create-icon-set'); var glyphMap = { "acrobat": 61696, "amazon": 61697, diff --git a/lib/create-icon-set-from-fontello.js b/lib/create-icon-set-from-fontello.js index 4663924..f97f36c 100644 --- a/lib/create-icon-set-from-fontello.js +++ b/lib/create-icon-set-from-fontello.js @@ -4,7 +4,7 @@ */ 'use strict'; -var createIconSet = require('createIconSet'); +var createIconSet = require('./create-icon-set'); function createIconSetFromFontello(config : Object, fontFamily? : string) : Function { var glyphMap = {}; diff --git a/lib/create-icon-set.js b/lib/create-icon-set.js index f2696b0..15918fd 100644 --- a/lib/create-icon-set.js +++ b/lib/create-icon-set.js @@ -11,8 +11,8 @@ var { Text, StyleSheet, TabBarIOS, + NativeModules, } = React; -var NativeModules = require('NativeModules'); var RNVectorIconsManager = NativeModules.RNVectorIconsManager; var invariant = require('invariant'); var merge = require('merge'); diff --git a/package.json b/package.json index 682be96..4398a83 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ }, "license": "MIT", "peerDependencies": { - "react-native": ">=0.4.0 <1.0.0" + "react-native": ">=0.4.0 || 0.5.0-rc1 || 0.6.0-rc || 0.7.0-rc || 0.7.0-rc.2" }, "dependencies": { "lodash": "^3.8.0", diff --git a/template/iconSet.tpl b/template/iconSet.tpl index e31e30a..b80cdbe 100644 --- a/template/iconSet.tpl +++ b/template/iconSet.tpl @@ -6,7 +6,7 @@ */ 'use strict'; -var createIconSet = require('createIconSet'); +var createIconSet = require('./lib/create-icon-set'); var glyphMap = ${glyphMap}; var ${componentName} = createIconSet(glyphMap, '${fontFamily}');