Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
"node": true
},
"globals": {
'__CORDOVA__': true,
'__BASE_URL__': true,
expect: true
},
"extends": "eslint:recommended",
Expand Down
10 changes: 0 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,3 @@ npm-debug.log*
# ignore built static files
dist/
webpack-assets.json

# cordova ignores
cordova/www/*
cordova/www/**.*
!cordova/www/.gitkeep
cordova/plugins/
cordova/platforms/

# cordova build and release configurations
scripts/cordova/config/*.json
15 changes: 4 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,20 +105,13 @@ npm run test:all

This will run all files that are suffixed with a `.test.js`.

## Changing the Asset Host
## Deploying to Heroku

In production scenarios, you may want your assets to be hosted elsewhere besides
on your server. Just set an environment variable to point the asset host to
where ever you want, as defaults to `localhost:3001`. Just set it to the CDN of
your choice.

If you're using Heroku:
Just set an environment variable to point the asset host to whereever you want,
since it defaults to `localhost:3001`. If using Heroku to store assets, just use
a local route. Otherwise, set it to the CDN of your choice.
```
heroku config:set ASSET_HOST=/dist/
# OR
heroku config:set ASSET_HOST=https://s3.amazonaws.com/mybucket/myasssets/
```

## Building Cordova Apps

Please see [Building Cordova Apps](docs/cordova.md)
7 changes: 2 additions & 5 deletions client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Provider } from 'react-redux';
import { Router } from 'react-router';
import { routes } from 'routes';
import configureStore from 'config/store';
import { browserHistory, hashHistory } from 'react-router';
import { browserHistory } from 'react-router';
import { syncHistoryWithStore } from 'react-router-redux';

/* Images
Expand All @@ -28,10 +28,7 @@ const rootElement = document.getElementById('app');
// rendering.
const initialState = window.__INITIAL_STATE__;
const store = configureStore(initialState);
const history = syncHistoryWithStore(
(__CORDOVA__ ? hashHistory : browserHistory),
store
);
const history = syncHistoryWithStore(browserHistory, store);

// Render the app!
ReactDOM.render(
Expand Down
24 changes: 0 additions & 24 deletions common/layouts/cordova.html

This file was deleted.

96 changes: 0 additions & 96 deletions docs/cordova.md

This file was deleted.

27 changes: 8 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,35 +13,24 @@
"npm": "3.x.x"
},
"scripts": {
"start": "npm run dev:build && npm run dev:start",
"dev:start": "npm run dev:start:client & npm run dev:start:server",
"dev:start:cordova": "npm run cordova:dev:build:hot; npm run dev:start:server & npm run dev:start:cordova:client",
"dev:start:cordova:client": "NODE_ENV=development node webpack/config.dev.cordova.hot",
"dev:start:server": "NODE_ENV=development $(npm bin)/nodemon server",
"dev:start:client": "NODE_ENV=development node webpack/config.dev.hot",
"dev:build": "NODE_ENV=development $(npm bin)/webpack --progress --colors --display-error-details --config webpack/config.dev.js",
"prod:build": "NODE_ENV=production $(npm bin)/webpack -p --optimize-dedupe --config webpack/config.prod.js",
"prod:start": "NODE_ENV=production pm2 start server --name='callai'",
"cordova:dev:build:hot": "NODE_ENV=development npm run cordova:clean; HOT=true $(npm bin)/webpack --progress --colors --display-error-details --config webpack/config.dev.cordova.js; npm run cordova:prepare",
"cordova:dev:build": "NODE_ENV=development npm run cordova:clean; $(npm bin)/webpack --progress --colors --display-error-details --config webpack/config.dev.cordova.js; npm run cordova:prepare",
"cordova:prod:build": "NODE_ENV=production npm run cordova:clean; NODE_ENV=production $(npm bin)/webpack -p --optimize-dedupe --config webpack/config.prod.cordova.js; npm run cordova:prepare;",
"cordova:dist": "npm run cordova:dist:android && npm run cordova:dist:ios",
"cordova:dist:android": "node ./scripts/cordova --platform android --config release --distribute",
"crodova:dist:ios": "node ./scripts/cordova --platform ios --config release --distribute",
"cordova:clean": "rm -f $(find cordova/www/* 2>/dev/null -type f | grep -v 'gitkeep')",
"cordova:prepare": "cd cordova && cordova prepare",
"start": "npm run build:development && npm run start:development",
"start:production": "NODE_ENV=production node server",
"start:development": "NODE_ENV=development npm run start:development:client & npm run start:development:server",
"start:development:client": "node webpack/config.development.hot",
"start:development:server": "$(npm bin)/nodemon server",
"build:development": "$(npm bin)/webpack --progress --colors --display-error-details --config webpack/config.development.js",
"build:production": "NODE_ENV=production $(npm bin)/webpack -p --optimize-dedupe --config webpack/config.production.js",
"test": "$(npm bin)/mocha --recursive --compilers js:babel-register",
"test:all": "$(npm bin)/mocha --recursive --compilers js:babel-register $(find . -path ./node_modules -prune -o -name '*.test.js' -print)",
"test:watch": "npm test -- --watch",
"test:all:watch": "$(npm bin)/mocha --recursive --compilers js:babel-register $(find . -path ./node_modules -prune -o -name '*.test.js' -print) --watch",
"lint": "$(npm bin)/eslint --ignore-pattern **/node_modules/* --ext .js,.jsx .",
"postinstall": "if [ \"$NODE_ENV\" = \"production\" ]; then npm run prod:build; fi"
"postinstall": "if [ \"$NODE_ENV\" = \"production\" ]; then npm run build:production; fi"
},
"devDependencies": {
"babel-eslint": "6.0.4",
"chai": "3.5.0",
"chai-immutable": "1.5.4",
"cordova-lib": "6.2.0",
"eslint": "2.12.0",
"eslint-plugin-react": "5.1.1",
"mocha": "2.5.3",
Expand Down
47 changes: 0 additions & 47 deletions scripts/cordova/build.js

This file was deleted.

4 changes: 0 additions & 4 deletions scripts/cordova/config/fabric.json.example

This file was deleted.

11 changes: 0 additions & 11 deletions scripts/cordova/config/release.json.example

This file was deleted.

54 changes: 0 additions & 54 deletions scripts/cordova/fabric.js

This file was deleted.

1 change: 0 additions & 1 deletion scripts/cordova/index.js

This file was deleted.

5 changes: 2 additions & 3 deletions server/config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
'use strict';

const env = process.env.NODE_ENV || 'development';
const configFile = env === 'development' ? 'config.dev' : 'config.prod';
const webpackConfig = require(`../webpack/${configFile}`);
var env = process.env.NODE_ENV || 'development';
var webpackConfig = require('../webpack/config.' + env);

import p from '../package.json';

Expand Down
5 changes: 2 additions & 3 deletions webpack/config.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const path = require('path');
const webpack = require('webpack');
const isomorphicConfig = require('./config.isomorphic');
const IsomorphicPlugin = require('webpack-isomorphic-tools/plugin');
const host = require('./host')();
const host = require('./host.devserver');

const isDev = process.env.NODE_ENV === 'development';
const isomorphicPlugin = new IsomorphicPlugin(isomorphicConfig).development(isDev);
Expand Down Expand Up @@ -47,8 +47,7 @@ module.exports = {
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify(process.env.NODE_ENV)
},
'__CORDOVA__': false
}
})
]
};
Loading