Skip to content

Commit 97a983d

Browse files
committed
Changes:
- Improve webpack configuration files - Deprecate and remove Cordova support - Add babel-plugin-resolver and set to /common directory - Improve component/container/routes directory structure
1 parent aef6884 commit 97a983d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+262
-591
lines changed

.babelrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"plugins": [
77
"transform-class-properties",
88
"transform-decorators",
9-
"transform-object-rest-spread"
9+
"transform-object-rest-spread",
10+
["resolver", { "resolveDirs": ["common"] }]
1011
]
1112
}

.eslintrc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@
3030
"node": true
3131
},
3232
"globals": {
33-
"__CORDOVA__": true,
34-
"__PRODUCTION__": true,
35-
"__DEVELOPMENT__": true,
36-
"__BASE_URL__": true,
3733
expect: true
3834
},
3935
"extends": "eslint:recommended",

.gitignore

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,3 @@ npm-debug.log*
55
# ignore built static files
66
dist/
77
webpack-assets.json
8-
9-
# cordova ignores
10-
cordova/www/*
11-
cordova/www/**.*
12-
!cordova/www/.gitkeep
13-
cordova/plugins/
14-
cordova/platforms/
15-
16-
# cordova build config
17-
cordova-build/*.json
18-
cordova-build/config/*.json

README.md

Lines changed: 2 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
A universal starter kit built with react, react-router and redux. Server
44
rendering with react and express, bundles with Webpack with hot module reloading
5-
and hot style reloading with SCSS support. Bonus: Cordova support.
5+
and hot style reloading with SCSS support.
66

77
## Prerequisites
88

@@ -70,9 +70,8 @@ Direct your browser to `http://localhost:3000`.
7070
│   ├── shared # Shared actions and components and do not belong to a single route.
7171
│   │   ├── actions
7272
│   │   └── components
73-
│   ├── templates # HTML templates
73+
│   ├── layouts # Layout files
7474
│   └── util # Utility methods
75-
├── cordova-build # Cordova build tools
7675
│   └── config
7776
├── server # Server-side code.
7877
└── webpack # Webpack configuration files.
@@ -128,82 +127,6 @@ heroku config:set ASSET_HOST=/dist/
128127
heroku config:set ASSET_HOST=https://s3.amazonaws.com/mybucket/myasssets/
129128
```
130129

131-
## Building Cordova Apps
132-
133-
First, make sure you have Cordova installed:
134-
135-
```
136-
npm install -g cordova
137-
```
138-
139-
Initialize the Cordova app:
140-
141-
```
142-
cordova create cordova/ com.org.appname "My App"
143-
```
144-
145-
Add the platform(s) you want to build for:
146-
147-
```
148-
cd cordova/
149-
cordova platform add ios # or 'android'
150-
```
151-
152-
Install plugins (if you don't have a `/plugins` folder)
153-
```
154-
cordova prepare
155-
```
156-
157-
### Build/Start Dev Environment
158-
159-
```
160-
npm run start:cordova # build for development with hot reloading
161-
npm run build:cordova # build for development without hot reloading
162-
npm run build:cordova:development # alias for above
163-
npm run build:cordova:production # build for production without hot reloading
164-
```
165-
166-
### Start a simulator/emulator
167-
168-
* iOS - CLI
169-
170-
Install XCode, then:
171-
172-
```
173-
npm install -g ios-deploy
174-
cd cordova && cordova run ios
175-
```
176-
177-
* iOS - XCode
178-
179-
Open the file located in `./cordova/platforms/ios/MarcasDirectos.xcodeproj`.
180-
181-
* Android - CLI
182-
183-
Install the Android SDK, then:
184-
```
185-
cd cordova && cordova run android
186-
```
187-
188-
## Distributing Betas
189-
190-
You may want to distribute the app via Fabric (Crashlytics). To do so, prepare
191-
the following files (copy and rename them):
192-
193-
```
194-
build/fabric.json.example -> build/fabric.json
195-
build/config/release.json.example -> build/config/release.json
196-
```
197-
198-
Fill in the fields in the JSON files properly, then run the following commands:
199-
200-
```
201-
npm run build:cordova:production # build the source files for cordova's www
202-
npm run dist:android # build the binary and upload to Crashlytics
203-
# OR
204-
npm run dist:ios
205-
```
206-
207130
## Additional Notes
208131

209132
If you're debugging in a mobile browser and you want to access your project

client/index.js

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import React from 'react';
33
import ReactDOM from 'react-dom';
44
import { Provider } from 'react-redux';
55
import { Router } from 'react-router';
6-
import { routes } from '../common/routes';
7-
import configureStore from '../common/config/store';
8-
import { browserHistory, hashHistory } from 'react-router';
6+
import { routes } from 'routes';
7+
import configureStore from 'config/store';
8+
import { browserHistory } from 'react-router';
99
import { syncHistoryWithStore } from 'react-router-redux';
1010

1111
/* Images
@@ -28,18 +28,7 @@ const rootElement = document.getElementById('app');
2828
// rendering.
2929
const initialState = window.__INITIAL_STATE__;
3030
const store = configureStore(initialState);
31-
const history = syncHistoryWithStore(
32-
(__CORDOVA__ ? hashHistory : browserHistory),
33-
store
34-
);
35-
36-
/* FastClick
37-
* Disables the 300ms delay for mobile apps. Comment out or add a conditional
38-
* for __CORDOVA__ if you only want this in your Cordova app.
39-
*/
40-
document.addEventListener('DOMContentLoaded', () => {
41-
require('fastclick').attach(document.body);
42-
}, false);
31+
const history = syncHistoryWithStore(browserHistory, store);
4332

4433
// Render the app!
4534
ReactDOM.render(
File renamed without changes.
File renamed without changes.

common/config/history.js

Lines changed: 0 additions & 36 deletions
This file was deleted.

common/config/store.dev.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { compose, createStore, applyMiddleware } from 'redux';
22
import thunk from 'redux-thunk';
3-
import rootReducer from '../reducers';
3+
import rootReducer from 'reducers';
44
import persistState from 'redux-localstorage';
5-
import DevTools from '../shared/containers/DevTools';
5+
import DevTools from 'containers/DevTools';
66

77
/* localStorage Persisted States
88
* Set up persisted state properties via localStorage. They should be added

0 commit comments

Comments
 (0)