Permalink
Browse files

refactor start: can basely run

  • Loading branch information...
1 parent 422c5db commit 575b9b2b29dbed43e36681b77aa55bdeef76dbb2 @soliury committed Dec 29, 2015
Showing with 62 additions and 147 deletions.
  1. +1 −1 .editorconfig
  2. +15 −15 gulpFile.coffee
  3. +17 −30 index.ios.js
  4. +1 −1 ios/noder/AppDelegate.m
  5. +2 −2 ios/noder/Base.lproj/LaunchScreen.xib
  6. +26 −36 package.json
  7. +0 −62 webpack.config.js
View
@@ -2,7 +2,7 @@
root = true
[*]
-indent_style = space
+indent_style = tab
indent_size = 4
end_of_line = lf
charset = utf-8
View
@@ -7,31 +7,31 @@ devIp = require 'dev-ip'
child_process = require 'child_process'
-appDelegateSrc = './iOS/AppDelegate.m'
-port = 8081
+appDelegateSrc = './ios/noder/AppDelegate.m'
+port = 8080
gulp.task 'replace', ->
- ip = devIp()[0]
- reg = ///
+ ip = devIp()[0]
+ reg = ///
jsCodeLocation\s=\s
\[NSURL\sURLWithString:
@"http:.*\n
///g
- # ip = 'localhost'
- gulp.src appDelegateSrc
- .pipe replace reg, "jsCodeLocation = [NSURL URLWithString:@\"http://#{ip}:#{port}/index.ios.bundle\"];\n"
- .pipe gulp.dest './iOS'
+ # ip = 'localhost'
+ gulp.src appDelegateSrc
+ .pipe replace reg, "jsCodeLocation = [NSURL URLWithString:@\"http://#{ip}:#{port}/index.ios.bundle\"];\n"
+ .pipe gulp.dest './ios/noder'
gulp.task 'package', (cb)->
- cmd = "./node_modules/react-native/packager/packager.sh"
- start = child_process.spawn cmd, ['--port', port]
- start.stdout.on 'data', (data)->
- gutil.log data.toString()
- start.stderr.on 'data', (data)->
- gutil.log data.toString()
+ cmd = "./node_modules/react-native/packager/packager.sh"
+ start = child_process.spawn cmd, ['--port', port]
+ start.stdout.on 'data', (data)->
+ gutil.log data.toString()
+ start.stderr.on 'data', (data)->
+ gutil.log data.toString()
gulp.task 'start', ->
- runSequence 'replace', 'package'
+ runSequence 'replace', 'package'
View
@@ -1,35 +1,22 @@
-var React = require('react-native')
-var App = require('./app/containers/App')
-
-//var user = require('./app/mocks/user')
-//var userInfo = require('./app/mocks/userInfo')
-//var UserService = require('./app/services/UserService')
-//Object.assign(user, userInfo)
-
-
-// on run
-require('./app/configs/onRun')
-
-
-
-var {
- Component,
- AppRegistry
- } = React
+import React,{
+ Component,
+ AppRegistry,
+ View,
+ Text
+} from 'react-native';
class Noder extends Component {
-
- componentDidMount() {
- //UserService.storage.saveUser(user)
- //UserService.storage.clearUser()
- }
-
- render() {
- return (
- <App></App>
- )
- }
+ render() {
+ return (
+ <View>
+ <Text>
+ adf
+ </Text>
+ </View>
+ )
+ }
}
-AppRegistry.registerComponent('noder', () => Noder)
+
+AppRegistry.registerComponent('noder', () => Noder);
@@ -31,7 +31,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
* on the same Wi-Fi network.
*/
- jsCodeLocation = [NSURL URLWithString:@"http://localhost:8080/index.ios.bundle?platform=ios&dev=true"];
+ jsCodeLocation = [NSURL URLWithString:@"http://169.254.212.62:8080/index.ios.bundle"];
/**
* OPTION 2
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7702" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9531" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES">
<dependencies>
<deployment identifier="iOS"/>
- <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7701"/>
+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
</dependencies>
<objects>
View
62 package.json 100755 → 100644
@@ -1,38 +1,28 @@
{
- "name": "noder",
- "version": "1.0.0",
- "private": false,
- "scripts": {
- "start": "react-native-webpack-server start",
- "hot": "HOT=1 react-native-webpack-server start --hot",
- "bundle": "react-native-webpack-server bundle"
- },
- "dependencies": {
- "markdown": "0.5.0",
- "moment": "^2.10.6",
- "query-string": "^3.0.0",
- "react-native": "^0.15.0",
- "rebound": "0.0.13",
- "redux": "^3.0.5"
- },
- "devDependencies": {
- "babel": "^5.8.23",
- "babel-core": "^5.8.25",
- "babel-loader": "^5.3.2",
- "babel-plugin-react-transform": "^1.1.1",
- "coffee-script": "^1.9.2",
- "dev-ip": "^1.0.1",
- "eslint": "^1.1.0",
- "eslint-plugin-react": "^3.2.2",
- "gulp": "^3.9.0",
- "gulp-replace": "^0.5.4",
- "gulp-util": "^3.0.4",
- "react-native": "^0.15.0",
- "react-native-webpack-server": "^0.8.2",
- "react-transform-hmr": "^1.0.1",
- "run-sequence": "^1.1.0",
- "webpack": "^1.12.2",
- "webpack-dev-server": "^1.12.0"
- },
- "bundleId": "org.reactjs.native.example.noder"
+ "name": "noder",
+ "version": "1.0.0",
+ "private": false,
+ "scripts": {
+ "start": "react-native start"
+ },
+ "dependencies": {
+ "markdown": "0.5.0",
+ "moment": "^2.10.6",
+ "query-string": "^3.0.0",
+ "react-native": "^0.15.0",
+ "rebound": "0.0.13",
+ "redux": "^3.0.5"
+ },
+ "devDependencies": {
+ "coffee-script": "^1.9.2",
+ "dev-ip": "^1.0.1",
+ "eslint": "^1.1.0",
+ "eslint-plugin-react": "^3.2.2",
+ "gulp": "^3.9.0",
+ "gulp-replace": "^0.5.4",
+ "gulp-util": "^3.0.4",
+ "react-native": "^0.15.0",
+ "run-sequence": "^1.1.0"
+ },
+ "bundleId": "org.reactjs.native.example.noder"
}
View
@@ -1,62 +0,0 @@
-var fs = require('fs');
-var path = require('path');
-var webpack = require('webpack');
-
-var config = {
-
- debug: true,
-
- devtool: 'source-map',
-
- entry: {
- 'index.ios': ['./src/main.js'],
- },
-
- output: {
- path: path.resolve(__dirname, 'build'),
- filename: '[name].js',
- },
-
- module: {
- loaders: [{
- test: /\.js$/,
- exclude: /node_modules/,
- loader: 'babel',
- query: {
- stage: 0,
- plugins: []
- }
- }]
- },
-
- plugins: [],
-
-};
-
-// Hot loader
-if (process.env.HOT) {
- config.devtool = 'eval'; // Speed up incremental builds
- config.entry['index.ios'].unshift('react-native-webpack-server/hot/entry');
- config.entry['index.ios'].unshift('webpack/hot/only-dev-server');
- config.entry['index.ios'].unshift('webpack-dev-server/client?http://localhost:8082');
- config.output.publicPath = 'http://localhost:8082/';
- config.plugins.unshift(new webpack.HotModuleReplacementPlugin());
- config.module.loaders[0].query.plugins.push('react-transform');
- config.module.loaders[0].query.extra = {
- 'react-transform': {
- transforms: [{
- transform: 'react-transform-hmr',
- imports: ['react-native'],
- locals: ['module']
- }]
- }
- };
-}
-
-// Production config
-if (process.env.NODE_ENV === 'production') {
- config.plugins.push(new webpack.optimize.OccurrenceOrderPlugin());
- config.plugins.push(new webpack.optimize.UglifyJsPlugin());
-}
-
-module.exports = config;

0 comments on commit 575b9b2

Please sign in to comment.