Skip to content

Commit

Permalink
Add files from issue #18 + .babelrc changes + App.styl
Browse files Browse the repository at this point in the history
  • Loading branch information
kristerkari committed Nov 29, 2018
1 parent 7550de3 commit 16d7b67
Show file tree
Hide file tree
Showing 6 changed files with 1,316 additions and 52 deletions.
11 changes: 10 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
{
"presets": ["module:metro-react-native-babel-preset"]
"presets": ["module:metro-react-native-babel-preset"],
"plugins": [
"react-native-classname-to-style",
[
"react-native-platform-specific-extensions",
{
"extensions": ["styl"]
}
]
]
}
3 changes: 2 additions & 1 deletion App.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import React, {Component} from 'react';
import {Platform, StyleSheet, Text, View} from 'react-native';
import appStyles from './App.styl';

const instructions = Platform.select({
ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu',
Expand All @@ -21,7 +22,7 @@ export default class App extends Component<Props> {
render() {
return (
<View style={styles.container}>
<Text style={styles.welcome}>Welcome to React Native!</Text>
<Text className={appStyles.text}>Welcome to React Native!</Text>
<Text style={styles.instructions}>To get started, edit App.js</Text>
<Text style={styles.instructions}>{instructions}</Text>
</View>
Expand Down
6 changes: 6 additions & 0 deletions App.styl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
default-size = 48px

.text
font-size default-size
font-weight bold
color red
35 changes: 31 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,43 @@
"test": "jest"
},
"dependencies": {
"@babel/plugin-proposal-decorators": "^7.1.6",
"@babel/runtime": "^7.1.5",
"lodash": "^4.17.11",
"metro-config": "^0.49.2",
"mobx": "^5.6.0",
"mobx-react": "^5.4.2",
"mobx-state-tree": "^3.8.1",
"react": "16.5.0",
"react-native": "0.57.0"
"react-native": "0.57.0",
"react-native-app-intro": "^1.1.5",
"react-native-app-intro-slider": "^1.0.1",
"react-native-navigation": "latest",
"react-native-scrollable-tab-view": "^0.10.0",
"react-native-vector-icons": "^6.1.0",
"styl": "^0.2.9"
},
"devDependencies": {
"babel-eslint": "^10.0.1",
"babel-jest": "23.6.0",
"babel-plugin-react-native-classname-to-style": "^1.2.1",
"babel-plugin-react-native-platform-specific-extensions": "^1.1.1",
"eslint": "^5.9.0",
"eslint-config-airbnb": "^17.1.0",
"eslint-config-prettier": "^3.3.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jsx-a11y": "^6.1.2",
"eslint-plugin-prettier": "^3.0.0",
"eslint-plugin-react": "^7.11.1",
"flow-bin": "^0.86.0",
"jest": "23.6.0",
"metro-react-native-babel-preset": "0.49.2",
"react-test-renderer": "16.5.0"
"metro-react-native-babel-preset": "0.49.1",
"prettier": "^1.15.2",
"react-native-stylus-transformer": "^1.1.2",
"react-test-renderer": "16.6.0-alpha.8af6728",
"stylus": "^0.54.5"
},
"jest": {
"preset": "react-native"
}
}
}
15 changes: 15 additions & 0 deletions rn-cli.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const { getDefaultConfig } = require("metro-config");

module.exports = (async () => {
const {
resolver: { sourceExts }
} = await getDefaultConfig();
return {
transformer: {
babelTransformerPath: require.resolve("react-native-stylus-transformer")
},
resolver: {
sourceExts: [...sourceExts, "styl"]
}
};
})();

0 comments on commit 16d7b67

Please sign in to comment.