Skip to content

Commit

Permalink
Deps update
Browse files Browse the repository at this point in the history
  • Loading branch information
DVLP committed Sep 19, 2015
1 parent a1a5fb8 commit 229fefa
Show file tree
Hide file tree
Showing 15 changed files with 127 additions and 61 deletions.
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"extends": "eslint:recommended",
"parser": "babel-eslint",
"plugins": [
"react"
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Include your project-specific ignores in this file
# Read about how to use .gitignore: https://help.github.com/articles/ignoring-files

build
node_modules
ncp-debug.log
npm-debug.log
npm-debug.log
35 changes: 18 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
"eventemitter3": "1.1.1",
"express": "4.13.3",
"fastclick": "1.0.6",
"fbjs": "0.2.0",
"fbjs": "0.2.1",
"flux": "2.1.1",
"front-matter": "1.0.0",
"history": "1.8.4",
"history": "1.9.1",
"jade": "1.11.0",
"jquery": "^2.1.4",
"lodash": "3.10.1",
Expand All @@ -25,34 +26,34 @@
"react-routing": "0.0.4",
"react-time": "^4.0.0",
"source-map-support": "0.3.2",
"superagent": "1.3.0"
"superagent": "1.4.0"
},
"devDependencies": {
"alt": "^0.17.3",
"autoprefixer": "^5.2.0",
"axios": "^0.5.4",
"babel-eslint": "^4.1.1",
"autoprefixer": "^6.0.2",
"babel-eslint": "^4.1.2",
"babel-loader": "^5.3.2",
"browser-sync": "^2.9.2",
"browser-sync": "^2.9.3",
"css-loader": "^0.18.0",
"css-wipe": "^4.1.2",
"cssnext": "^1.8.3",
"del": "^2.0.1",
"eslint": "^1.3.1",
"csscomb": "^3.1.8",
"del": "^2.0.2",
"eslint": "^1.4.1",
"eslint-loader": "^1.0.0",
"eslint-plugin-react": "^3.3.1",
"fbjs": "^0.2.0",
"flux": "^2.1.1",
"eslint-plugin-react": "^3.3.2",
"gaze": "^0.5.1",
"git-push": "^0.1.1",
"glob": "^5.0.14",
"jest-cli": "^0.5.1",
"jest-cli": "^0.5.4",
"mkdirp": "^0.5.1",
"ncp": "^2.0.0",
"postcss": "^4.1.16",
"postcss-import": "^6.1.1",
"postcss-loader": "^0.5.1",
"postcss-nested": "^0.3.1",
"postcss": "^5.0.5",
"postcss-cssnext": "^2.0.1",
"postcss-import": "^7.0.0",
"postcss-loader": "^0.6.0",
"postcss-nested": "^1.0.0",
"psi": "^1.0.6",
"react-hot-loader": "^1.3.0",
"replace": "^0.3.0",
Expand All @@ -61,7 +62,7 @@
"url-loader": "^0.5.6",
"webpack": "^1.12.1",
"webpack-dev-middleware": "^1.2.0",
"webpack-hot-middleware": "^2.0.0"
"webpack-hot-middleware": "^2.0.2"
},
"jest": {
"rootDir": "./src",
Expand Down
Empty file added src/actions/.gitignore
Empty file.
3 changes: 1 addition & 2 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
import 'babel/polyfill';
import ReactDOM from 'react-dom';
import FastClick from 'fastclick';
import Dispatcher from './core/Dispatcher';
import Router from './Router';
import Router from './routes';
import Location from './core/Location';
import ActionTypes from './constants/ActionTypes';
import { addEventListener, removeEventListener } from './utils/DOMUtils';
Expand Down
5 changes: 3 additions & 2 deletions src/constants/ActionTypes.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*! React Starter Kit | MIT License | http://www.reactstarterkit.com/ */

import keyMirror from 'fbjs/lib/keyMirror';

export default keyMirror({
CHANGE: 'CHANGE',
FETCHING: 'FETCHING'

});
2 changes: 0 additions & 2 deletions src/content/index.jade
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ div.row
div.col-sm-4
h3 Development Tools
dl
dt <a href="http://gulpjs.com">Gulp</a>
dd JavaScript streaming build system and task automation
dt <a href="http://webpack.github.io/">Webpack</a>
dd Compiles front-end source code into modules / bundles
dt <a href="http://www.browsersync.io/">BrowserSync</a>
Expand Down
2 changes: 1 addition & 1 deletion src/decorators/withViewport.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function withViewport(ComposedComponent) {
}

handleResize(value) {
this.setState({viewport: value});
this.setState({viewport: value}); // eslint-disable-line react/no-set-state
}

};
Expand Down
38 changes: 38 additions & 0 deletions src/routes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*! React Starter Kit | MIT License | http://www.reactstarterkit.com/ */

import React from 'react';
import Router from 'react-routing/src/Router';
import http from './core/HttpClient';
import App from './components/App';
import ContentPage from './components/ContentPage';
import NotFoundPage from './components/NotFoundPage';
import ErrorPage from './components/ErrorPage';
import Invoice from './components/Invoice';
import InvoiceES6 from './components/InvoiceES6';

const router = new Router(on => {

on('*', async (state, next) => {
const component = await next();
return component && <App context={state.context}>{component}</App>;
});

on('/contact', async () => <ContactPage />);

on('/login', async () => <LoginPage />);

on('/register', async () => <RegisterPage />);

on('*', async (state) => {
const content = await http.get(`/api/content?path=${state.path}`);
return content && <ContentPage {...content} />;
});

on('error', (state, error) => state.statusCode === 404 ?
<App context={state.context} error={error}><NotFoundPage /></App> :
<App context={state.context} error={error}><ErrorPage /></App>
);

});

export default router;
6 changes: 3 additions & 3 deletions src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import fs from 'fs';
import path from 'path';
import express from 'express';
import ReactDOM from 'react-dom/server';
import Router from './Router';
import Router from './routes';

const server = global.server = express();

Expand Down Expand Up @@ -55,9 +55,9 @@ server.get('*', async (req, res, next) => {
// -----------------------------------------------------------------------------

server.listen(server.get('port'), () => {
/* eslint-disable no-console */
console.log('The server is running at http://localhost:' + server.get('port'));
if (process.send) {
process.send('online');
} else {
console.log('The server is running at http://localhost:' + server.get('port'));
}
});
Empty file added src/stores/.gitignore
Empty file.
5 changes: 5 additions & 0 deletions tools/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"rules": {
"no-console": 0
}
}
36 changes: 19 additions & 17 deletions tools/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,17 @@ import webpack, { DefinePlugin, BannerPlugin } from 'webpack';
import merge from 'lodash/object/merge';

const DEBUG = !process.argv.includes('release');
const WATCH = global.WATCH === undefined ? false : global.WATCH;
const VERBOSE = process.argv.includes('verbose');
const STYLE_LOADER = 'style-loader/useable';
const CSS_LOADER = DEBUG ? 'css-loader' : 'css-loader?minimize';
const WATCH = global.WATCH === undefined ? false : global.WATCH;
const AUTOPREFIXER_BROWSERS = [
'Android 2.3',
'Android >= 4',
'Chrome >= 20',
'Firefox >= 24',
'Explorer >= 8',
'iOS >= 6',
'Chrome >= 35',
'Firefox >= 31',
'Explorer >= 9',
'iOS >= 7',
'Opera >= 12',
'Safari >= 6'
'Safari >= 7.1'
];
const GLOBALS = {
'process.env.NODE_ENV': DEBUG ? '"development"' : '"production"',
Expand Down Expand Up @@ -80,19 +78,23 @@ const config = {
test: /\.txt$/,
loader: 'raw-loader'
}, {
test: /\.(png|jpg|jpeg|gif|svg|woff|ttf|woff2)$/,
test: /\.(png|jpg|jpeg|gif|svg|woff|woff2)$/,
loader: 'url-loader?limit=10000'
}, {
test: /\.(eot|tft|wav|mp3)$/,
test: /\.(eot|ttf|wav|mp3)$/,
loader: 'file-loader'
}]
},

postcss: [
require('postcss-nested'),
require('cssnext')(),
require('autoprefixer')(AUTOPREFIXER_BROWSERS)
]
postcss: function() {
return [
require('postcss-import')({
onImport: files => files.forEach(this.addDependency)
}),
require('postcss-nested')(),
require('postcss-cssnext')({autoprefixer: AUTOPREFIXER_BROWSERS})
];
}
};

//
Expand Down Expand Up @@ -124,7 +126,7 @@ const appConfig = merge({}, config, {
module: {
loaders: [...config.module.loaders, {
test: /\.css$/,
loader: `${STYLE_LOADER}!${CSS_LOADER}!postcss-loader`
loader: 'style-loader/useable!css-loader!postcss-loader'
}]
}
});
Expand Down Expand Up @@ -168,7 +170,7 @@ const serverConfig = merge({}, config, {
module: {
loaders: [...config.module.loaders, {
test: /\.css$/,
loader: `${CSS_LOADER}!postcss-loader`
loader: 'css-loader!postcss-loader'
}]
}
});
Expand Down
12 changes: 6 additions & 6 deletions tools/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@ export default () => new Promise((resolve, reject) => {
if (process.argv.includes('production')) {
remote = {
name: 'production',
url: 'https://github.com/DVLP/invoice.git',
branch: 'gh-pages'
url: 'https://[email protected]:443/billtestx.git',
branch: 'master'
};
} else if (process.argv.includes('staging')) {
remote = {
name: 'staging',
url: 'https://github.com/DVLP/invoice.git',
branch: 'gh-pages'
url: 'https://[email protected]:443/billtestx.git',
branch: 'master'
};
} else {
remote = {
name: 'test',
url: 'https://github.com/DVLP/invoice.git',
branch: 'gh-pages'
url: 'https://[email protected]:443/billtestx.git',
branch: 'master'
};
}

Expand Down
38 changes: 28 additions & 10 deletions tools/serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,38 @@

import path from 'path';
import cp from 'child_process';
import watch from './lib/watch';

/**
* Launches Node.js/Express web server in a separate (forked) process.
*/
export default () => new Promise((resolve, reject) => {
console.log('serve');
const server = cp.fork(path.join(__dirname, '../build/server.js'), {
env: Object.assign({NODE_ENV: 'development'}, process.env)
});
server.once('message', message => {
if (message.match(/^online$/)) {
resolve();
}
});
server.once('error', err => reject(error));
process.on('exit', () => server.kill('SIGTERM'));

function start() {
const server = cp.fork(path.join(__dirname, '../build/server.js'), {
env: Object.assign({ NODE_ENV: 'development' }, process.env),
silent: false
});

server.once('message', message => {
if (message.match(/^online$/)) {
resolve();
}
});
server.once('error', err => reject(err));
process.on('exit', () => server.kill('SIGTERM'));
return server;
}

let server = start();

if (global.WATCH) {
watch('build/server.js').then(watcher => {
watcher.on('changed', () => {
server.kill('SIGTERM');
server = start();
});
});
}
});

0 comments on commit 229fefa

Please sign in to comment.