From 3d4974942a46daa36d0a436cb2010aa158c4995e Mon Sep 17 00:00:00 2001 From: Brent Vatne Date: Tue, 13 Sep 2016 21:02:28 -0700 Subject: [PATCH] Make the example project compatible with Exponent and publish it --- Example/.babelrc | 12 ++++++++++++ Example/.gitignore | 1 + Example/exp.json | 23 +++++++++++++++++++++++ Example/main.js | 2 ++ Example/package.json | 10 ++++++---- README.md | 16 ++++++---------- 6 files changed, 50 insertions(+), 14 deletions(-) create mode 100644 Example/.babelrc create mode 100644 Example/exp.json diff --git a/Example/.babelrc b/Example/.babelrc new file mode 100644 index 00000000..1ced9e34 --- /dev/null +++ b/Example/.babelrc @@ -0,0 +1,12 @@ +{ + "presets": [ + "react-native-stage-0/decorator-support" + ], + "env": { + "development": { + "plugins": [ + "transform-react-jsx-source" + ] + } + } +} diff --git a/Example/.gitignore b/Example/.gitignore index 94fc8671..5229a57a 100644 --- a/Example/.gitignore +++ b/Example/.gitignore @@ -1,6 +1,7 @@ # OSX # .DS_Store +.exponent/* # Xcode # diff --git a/Example/exp.json b/Example/exp.json new file mode 100644 index 00000000..be16d3c0 --- /dev/null +++ b/Example/exp.json @@ -0,0 +1,23 @@ +{ + "name": "React Native SVG Examples", + "description": "react-native-svg is built to provide a SVG interface to react native on both iOS and Android. https://github.com/react-native-community/react-native-svg", + "slug": "react-native-svg-examples", + "sdkVersion": "10.0.0", + "version": "1.0.0", + "orientation": "portrait", + "primaryColor": "#cccccc", + "iconUrl": "https://s3.amazonaws.com/exp-brand-assets/ExponentEmptyManifest_192.png", + "notification": { + "iconUrl": "https://s3.amazonaws.com/exp-us-standard/placeholder-push-icon-blue-circle.png", + "color": "#000000" + }, + "loading": { + "iconUrl": "https://s3.amazonaws.com/exp-brand-assets/ExponentEmptyManifest_192.png", + "hideExponentText": false + }, + "packagerOpts": { + "assetExts": [ + "ttf" + ] + } +} diff --git a/Example/main.js b/Example/main.js index de1400aa..073ea60b 100644 --- a/Example/main.js +++ b/Example/main.js @@ -3,6 +3,7 @@ * https://github.com/magicismight/react-native-svg/tree/master/Example */ 'use strict'; +import Exponent from 'exponent'; import React, {Component} from 'react'; import {Dimensions} from 'react-native'; @@ -258,4 +259,5 @@ class SvgExample extends Component { } } +AppRegistry.registerComponent('main', () => SvgExample); AppRegistry.registerComponent('SvgExample', () => SvgExample); diff --git a/Example/package.json b/Example/package.json index 84deb459..476058ce 100644 --- a/Example/package.json +++ b/Example/package.json @@ -6,9 +6,11 @@ "start": "react-native start" }, "dependencies": { - "react": "^15.1.0", - "react-native": "^0.33.0", + "react": "15.3.1", + "react-native": "github:exponentjs/react-native#sdk-10.0.0", "react-native-root-modal": "^1.0.4", - "react-native-svg": "../" - } + "@exponent/vector-icons": "^1.0.1", + "exponent": "^10.0.0" + }, + "main": "main.js" } diff --git a/README.md b/README.md index c2adf96e..43ed649d 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,22 @@ ## react-native-svg [![Version](https://img.shields.io/npm/v/react-native-svg.svg)](https://www.npmjs.com/package/react-native-svg) -[![Build Status](https://travis-ci.org/magicismight/react-native-svg.svg?branch=master)](https://travis-ci.org/magicismight/react-native-svg) [![NPM](https://img.shields.io/npm/dm/react-native-svg.svg)](https://www.npmjs.com/package/react-native-svg) -`react-native-svg` is built to provide a SVG interface to react native on both iOS and Android - -# IMPORTANT: - -`react-native-svg` **NO LONGER rely on ReactNativeART**, it has its own native code dependency now (which is based on ReactNativeART code but support more SVG features) +`react-native-svg` is built to provide a SVG interface to react native on both iOS and Android. +[Check out the demo](https://getexponent.com/@rncommunity/react-native-svg-examples). ### Features -1. Supports most of SVG elements and properties(Rect, Circle, Line, Polyline, Polygon, G ...). -2. Easy to convert SVG code into ReactNative code. +1. Supports most of SVG elements and properties (Rect, Circle, Line, Polyline, Polygon, G ...). +2. Easy to convert SVG code into React Native code. #### Install -### note: +*With Exponent, this is pre-installed. Jump ahead to [Usage](#Usage)* + react-native-svg >= 3.2.0 only supports react-native >= 0.29.0 react-native-svg >= 4.2.0 only supports react-native >= 0.32.0 react-native-svg >= 4.3.0 only supports react-native >= 0.33.0 @@ -44,7 +41,6 @@ Or use rnpm instead rnpm link react-native-svg ``` - #### Usage There is an easy example