Skip to content
This repository has been archived by the owner on Jun 28, 2021. It is now read-only.

Commit

Permalink
Merge pull request #466 from ahmedelgabri/code-cleanup
Browse files Browse the repository at this point in the history
Tooling cleanup
  • Loading branch information
thabti authored Aug 29, 2016
2 parents d06fdd3 + 1ec1a9b commit 7f57ba1
Show file tree
Hide file tree
Showing 13 changed files with 325 additions and 267 deletions.
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
save-exact = true
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6.3.0
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
sudo: false
language: node_js
env: TEST_SUITE=unit
node_js:
- "6.3.0"
# Node version is handled inside `.nvmrc` file & travis picks it up automatically because it uses `nvm`
# https://docs.travis-ci.com/user/languages/javascript-with-nodejs#Using-.nvmrc
cache:
directories:
- node_modules
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ RUN cp /etc/cron.daily/logrotate /etc/cron.hourly
# cache npm install when package.json hasn't changed
WORKDIR /tmp
ADD package.json package.json
RUN npm install
RUN npm install --silent --no-progress
RUN npm install -g pm2

RUN mkdir /quran
Expand Down
278 changes: 138 additions & 140 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,165 +6,163 @@
"scripts": {
"test": "npm run test:dev:unit",
"test:ci:unit": "karma start --browsers PhantomJS --single-run; npm run test:ci:lint",
"test:ci:functional": "BROWSER=phantomjs bash tests/functional/test.sh start-ci",
"posttest:ci:functional": "bash tests/functional/test.sh stop",
"test:dev:unit": "./node_modules/karma/bin/karma start",
"test:ci:functional": "BROWSER=phantomjs ./tests/functional/test.sh start-ci",
"posttest:ci:functional": "./tests/functional/test.sh stop",
"test:dev:unit": "karma start",
"test:ci:lint": "eslint ./src/**/*.js",
"test:dev:functional": "BROWSER=chrome bash tests/functional/test.sh start",
"posttest:dev:functional": "bash tests/functional/test.sh stop",
"test:dev:lint": "node_modules/eslint/bin/eslint.js ./src/scripts/**/*.js",
"test:stylelint": "node_modules/stylelint/dist/cli.js './src/**/*.scss' --config webpack/.stylelintrc",
"dev": "env NODE_PATH='./src' PORT=8000 UV_THREADPOOL_SIZE=100 node webpack/webpack-dev-server.js & env NODE_PATH='./src' PORT=8000 node ./bin/server.js",
"start": "NODE_PATH=\"./src\" node ./start",
"test:dev:functional": "BROWSER=chrome ./tests/functional/test.sh start",
"posttest:dev:functional": "./tests/functional/test.sh stop",
"test:dev:lint": "eslint ./src/scripts/**/*.js",
"test:stylelint": "stylelint './src/**/*.scss' --config ./webpack/.stylelintrc",
"dev": "env NODE_PATH='./src' PORT=8000 UV_THREADPOOL_SIZE=100 node ./webpack/webpack-dev-server.js & env NODE_PATH='./src' PORT=8000 node ./bin/server.js",
"start": "NODE_PATH='src' node ./start",
"build": "npm run build:client & npm run build:server",
"build:server": "babel src -d dist -D",
"build:client": "node ./node_modules/webpack/bin/webpack.js --config webpack/prod.config.js",
"build:server": "babel ./src -d ./dist -D",
"build:client": "webpack --config ./webpack/prod.config.js",
"validate": "npm ls",
"analyze:build": "env NODE_ENV=production ./node_modules/webpack/bin/webpack.js --json --config webpack/prod.config.js > bundle-stats.json",
"analyze:build": "env NODE_ENV=production webpack --json --config ./webpack/prod.config.js > bundle-stats.json",
"analyze:json": "webpack-bundle-size-analyzer bundle-stats.json"
},
"engines": {
"node": ">= 6.3.0"
},
"dependencies": {
"app-module-path": "^1.0.2",
"autoprefixer-loader": "^3.1.0",
"babel": "^6.5.2",
"babel-cli": "^6.11.4",
"babel-core": "^6.13.2",
"babel-loader": "^6.2.4",
"babel-plugin-add-module-exports": "^0.1.4",
"babel-plugin-system-import-transformer": "^2.0.0",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-plugin-transform-react-constant-elements": "^6.9.1",
"babel-plugin-transform-react-display-name": "^6.5.0",
"babel-plugin-transform-react-inline-elements": "^6.8.0",
"babel-plugin-transform-runtime": "^6.7.5",
"babel-plugin-typecheck": "^3.8.0",
"babel-polyfill": "^6.7.4",
"babel-preset-es2015": "^6.13.2",
"babel-preset-react": "^6.5.0",
"babel-preset-stage-0": "^6.5.0",
"babel-register": "^6.11.6",
"babel-runtime": "^6.11.6",
"body-parser": "^1.14.1",
"bootstrap-loader": "^1.0.10",
"bootstrap-sass": "~3.3.1",
"bootstrap-sass-loader": "^1.0.9",
"bundle-loader": "~0.5.0",
"cache-manager": "^1.1.0",
"clean-webpack-plugin": "^0.1.8",
"compression": "^1.6.0",
"cookie-parser": "^1.3.5",
"copy-to-clipboard": "^1.0.4",
"cors": "^2.7.1",
"crypto-js": "^3.1.6",
"css-loader": "^0.23.1",
"debug": "^2.2.0",
"dotenv": "^1.2.0",
"errorhandler": "^1.4.2",
"express": "~4.14.0",
"express-state": "^1.2.0",
"express-useragent": "^0.2.0",
"app-module-path": "1.0.2",
"autoprefixer-loader": "3.2.0",
"babel-cli": "6.11.4",
"babel-core": "6.13.2",
"babel-loader": "6.2.4",
"babel-plugin-add-module-exports": "0.1.4",
"babel-plugin-system-import-transformer": "2.2.1",
"babel-plugin-transform-decorators-legacy": "1.3.4",
"babel-plugin-transform-react-constant-elements": "6.9.1",
"babel-plugin-transform-react-display-name": "6.8.0",
"babel-plugin-transform-react-inline-elements": "6.8.0",
"babel-plugin-transform-runtime": "6.12.0",
"babel-plugin-typecheck": "3.9.0",
"babel-polyfill": "6.13.0",
"babel-preset-es2015": "6.13.2",
"babel-preset-react": "6.11.1",
"babel-preset-stage-0": "6.5.0",
"babel-register": "6.11.6",
"babel-runtime": "6.11.6",
"body-parser": "1.15.2",
"bootstrap-loader": "1.1.0",
"bootstrap-sass": "3.3.7",
"bootstrap-sass-loader": "1.0.10",
"bundle-loader": "0.5.4",
"cache-manager": "1.5.0",
"clean-webpack-plugin": "0.1.10",
"compression": "1.6.2",
"cookie-parser": "1.4.3",
"copy-to-clipboard": "1.1.1",
"cors": "2.7.1",
"crypto-js": "3.1.6",
"css-loader": "0.23.1",
"debug": "2.2.0",
"dotenv": "1.2.0",
"errorhandler": "1.4.3",
"express": "4.14.0",
"express-state": "1.4.0",
"express-useragent": "0.2.4",
"extract-text-webpack-plugin": "2.0.0-beta.3",
"file-loader": "^0.8.4",
"fontfaceobserver": "^1.7.1",
"html-webpack-plugin": "^1.4.0",
"http-proxy": "^1.13.2",
"humps": "^1.0.0",
"imports-loader": "^0.6.3",
"jquery": "^2.1.4",
"json-loader": "~0.5.1",
"morgan": "^1.6.1",
"node-sass": "^3.2.0",
"normalizr": "^2.0.0",
"phantomjs": "^1.9.18",
"pretty-error": "^2.0.0",
"promise": "^7.0.4",
"proxy-middleware": "^0.14.0",
"qs": "^6.1.0",
"raven": "^0.11.0",
"raw-loader": "^0.5.1",
"react": "^0.14.8",
"react-bootstrap": "^0.29.5",
"react-cookie": "^0.3.4",
"react-dom": "^0.14.0",
"react-helmet": "^3.1.0",
"react-metrics": "^1.1.0",
"react-paginate": "^0.4.0",
"react-redux": "^4.4.1",
"react-router": "^2.4.1",
"react-router-bootstrap": "^0.20.1",
"react-router-redux": "^4.0.0",
"react-router-scroll": "^0.2.0",
"react-scroll": "^1.0.4",
"redux": "^3.3.1",
"redux-connect": "^2.4.0",
"reselect": "^2.5.1",
"resolve-url": "^0.2.1",
"file-loader": "0.8.5",
"fontfaceobserver": "1.7.3",
"html-webpack-plugin": "1.7.0",
"http-proxy": "1.14.0",
"humps": "1.1.0",
"imports-loader": "0.6.5",
"jquery": "2.2.4",
"json-loader": "0.5.4",
"morgan": "1.7.0",
"node-sass": "3.8.0",
"normalizr": "2.2.1",
"pretty-error": "2.0.0",
"promise": "7.1.1",
"proxy-middleware": "0.14.0",
"qs": "6.2.1",
"raven": "0.11.0",
"raw-loader": "0.5.1",
"react": "0.14.8",
"react-bootstrap": "0.29.5",
"react-cookie": "0.3.4",
"react-dom": "0.14.8",
"react-helmet": "3.1.0",
"react-metrics": "1.2.1",
"react-paginate": "0.4.3",
"react-redux": "4.4.5",
"react-router": "2.6.1",
"react-router-bootstrap": "0.20.1",
"react-router-redux": "4.0.5",
"react-router-scroll": "0.2.1",
"react-scroll": "1.2.0",
"redux": "3.5.2",
"redux-connect": "2.4.0",
"reselect": "2.5.3",
"resolve-url": "0.2.1",
"sass-loader": "2.0.1",
"serialize-javascript": "^1.0.0",
"serve-favicon": "^2.2.1",
"sitemap": "^1.5.0",
"strip-loader": "^0.1.2",
"style-loader": "^0.13.1",
"superagent": "^1.2.0",
"url": "^0.11.0",
"url-loader": "~0.5.5",
"serialize-javascript": "1.3.0",
"serve-favicon": "2.3.0",
"sitemap": "1.8.1",
"strip-loader": "0.1.2",
"style-loader": "0.13.1",
"superagent": "1.8.4",
"url": "0.11.0",
"url-loader": "0.5.7",
"webpack": "2.1.0-beta.20",
"webpack-isomorphic-tools": "^2.2.41",
"winston": "^1.1.2"
"webpack-isomorphic-tools": "2.5.7",
"winston": "1.1.2"
},
"devDependencies": {
"babel-eslint": "^6.0.4",
"babel-plugin-react-transform": "^2.0.2",
"babel-preset-react-hmre": "^1.1.1",
"chai": "^3.0.0",
"chromedriver": "^2.22.2",
"del": "^2.0.2",
"enzyme": "^2.2.0",
"eslint": "^2.13.0",
"eslint-config-airbnb": "^9.0.1",
"eslint-loader": "^1.3.0",
"eslint-plugin-import": "^1.8.1",
"eslint-plugin-jsx-a11y": "^1.5.3",
"eslint-plugin-react": "^5.2.2",
"jscs": "^2.1.1",
"karma": "^1.1.2",
"karma-chai": "^0.1.0",
"karma-chai-sinon": "^0.1.5",
"karma-chrome-launcher": "^0.2.0",
"karma-junit-reporter": "^0.3.4",
"karma-mocha": "^0.2.0",
"babel-eslint": "6.0.4",
"babel-plugin-react-transform": "2.0.2",
"babel-preset-react-hmre": "1.1.1",
"chai": "3.0.0",
"chromedriver": "2.22.2",
"del": "2.0.2",
"enzyme": "2.2.0",
"eslint": "2.13.0",
"eslint-config-airbnb": "9.0.1",
"eslint-loader": "1.3.0",
"eslint-plugin-import": "1.8.1",
"eslint-plugin-jsx-a11y": "1.5.3",
"eslint-plugin-react": "5.2.2",
"jscs": "2.1.1",
"karma": "1.2.0",
"karma-chai": "0.1.0",
"karma-chai-sinon": "0.1.5",
"karma-chrome-launcher": "0.2.0",
"karma-junit-reporter": "0.3.4",
"karma-mocha": "0.2.0",
"karma-phantomjs-launcher": "~0.2.1",
"karma-script-launcher": "~0.1.0",
"karma-sinon": "^1.0.4",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^1.6.0",
"mocha": "^2.2.5",
"nodemon": "^1.7.1",
"path": "^0.11.14",
"phantomjs": "^1.9.20",
"karma-sinon": "1.0.4",
"karma-sourcemap-loader": "0.3.7",
"karma-webpack": "1.8.0",
"mocha": "2.2.5",
"nodemon": "1.7.1",
"path": "0.11.14",
"phantomjs": "1.9.20",
"phantomjs-polyfill": "0.0.1",
"piping": "^0.3.0",
"pre-commit": "^1.1.3",
"react-addons-test-utils": "^0.14.7",
"react-transform-catch-errors": "^1.0.0",
"react-transform-hmr": "^1.0.1",
"redbox-react": "^1.1.1",
"redux-devtools": "^3.1.1",
"redux-devtools-dock-monitor": "^1.1.0",
"redux-devtools-log-monitor": "^1.0.5",
"selenium-server": "^2.48.2",
"sinon": "^1.15.3",
"sinon-chai": "^2.8.0",
"stylelint": "^7.1.0",
"stylelint-webpack-plugin": "^0.2.0",
"wdio-mocha-framework": "^0.3.7",
"piping": "0.3.0",
"pre-commit": "1.1.3",
"react-addons-test-utils": "0.14.7",
"react-transform-catch-errors": "1.0.0",
"react-transform-hmr": "1.0.1",
"redbox-react": "1.1.1",
"redux-devtools": "3.1.1",
"redux-devtools-dock-monitor": "1.1.0",
"redux-devtools-log-monitor": "1.0.5",
"selenium-server": "2.48.2",
"sinon": "1.15.3",
"sinon-chai": "2.8.0",
"stylelint": "7.1.0",
"stylelint-webpack-plugin": "0.2.0",
"wdio-mocha-framework": "0.3.7",
"wdio-spec-reporter": "0.0.3",
"webdriverio": "4.2.1",
"webpack-dev-server": "^1.6.5",
"webpack-hot-middleware": "^2.12.2"
"webpack-dev-server": "1.6.5",
"webpack-hot-middleware": "2.12.2"
},
"pre-commit": [
"test:dev:lint",
Expand Down
10 changes: 7 additions & 3 deletions src/styles/bootstrap.config.prod.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
/* eslint-disable */
const bootstrapConfig = require('./bootstrap.config.js');
const bootstrapConfig = require('./bootstrap.config');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
bootstrapConfig.styleLoader = ExtractTextPlugin.extract({fallbackLoader: 'style-loader', loader: 'css-loader!sass-loader'});

bootstrapConfig.styleLoader = ExtractTextPlugin.extract({
fallbackLoader: 'style-loader',
loader: 'css-loader!sass-loader'
});

module.exports = bootstrapConfig;
2 changes: 1 addition & 1 deletion tests/functional/test.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash

#!/bin/bash
if [ "$1" == 'stop' ]; then
echo "Stopping selenium server..."
pid=`ps -eo pid,args | grep selenium-server-standalone | grep -v grep | cut -c1-6`
Expand Down
8 changes: 4 additions & 4 deletions webpack/.stylelintrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"rules": {
"unit-no-unknown": true,
"no-duplicate-selectors": true,
"block-no-empty": true
}
"unit-no-unknown": true,
"no-duplicate-selectors": true,
"block-no-empty": true
}
}
12 changes: 5 additions & 7 deletions webpack/dev-server.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var webpack = require('webpack');
var WebpackDevServer = require('webpack-dev-server');
var config = require('./dev.config');
const webpack = require('webpack');
const WebpackDevServer = require('webpack-dev-server');
const config = require('./dev.config');

new WebpackDevServer(webpack(config), {
publicPath: config.output.publicPath,
Expand All @@ -21,10 +21,8 @@ new WebpackDevServer(webpack(config), {
cache: true,
inline: true,
debug: true,
headers: {"Access-Control-Allow-Origin": "*"},
headers: {'Access-Control-Allow-Origin': '*'},
proxy: {
'*': { target: 'http://localhost:8000' }
}
}).listen(8001, function () {
console.info('==> 💻 Webpack Dev Server at http://localhost:8001');
});
}).listen(8001, () => console.info('==> 💻 Webpack Dev Server at http://localhost:8001'));
Loading

0 comments on commit 7f57ba1

Please sign in to comment.