From 1625b507d6c3ea59b993668a5cc93c9c65c7419f Mon Sep 17 00:00:00 2001 From: Jonathan Cremin Date: Thu, 23 Jul 2015 08:51:00 +0100 Subject: [PATCH] Restore postinstall --- .gitignore | 1 + Procfile | 2 +- app.js | 7 ++-- package.json | 95 ++++++++++++++++++++++++++------------------------ views/error.js | 2 +- 5 files changed, 54 insertions(+), 53 deletions(-) diff --git a/.gitignore b/.gitignore index 85ed90f..13035f8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ public/jspm_packages +public/views node_modules public/**/*.gz .DS_Store diff --git a/Procfile b/Procfile index 60498b1..063b78f 100644 --- a/Procfile +++ b/Procfile @@ -1 +1 @@ -web: npm run build && npm start +web: npm start diff --git a/app.js b/app.js index 667482a..f766f1d 100644 --- a/app.js +++ b/app.js @@ -28,7 +28,7 @@ app.use(function* (next) { yield next; } catch (err) { if (!err.status) { - console.error(err.stack); + debug('Error: %o', err); } else if (err.status === 404) { let Handler = yield createHandler(routes, this.request.url); @@ -37,6 +37,7 @@ app.use(function* (next) { this.body = '\n' + content; } else { + debug('Error: %o', err); throw err; } } @@ -89,10 +90,6 @@ app.use(route.get('/recent', function* () { this.body = {recents: recents}; })); -app.use(route.get('*', function* () { - this.throw(404); -})); - module.exports = app; if (!module.parent) { diff --git a/package.json b/package.json index 8d2321f..e9143e5 100644 --- a/package.json +++ b/package.json @@ -4,68 +4,71 @@ "private": true, "scripts": { "build": "babel -d public/views views && npm run jspm", + "cover": "istanbul cover _mocha -- --require babel/register --require co-mocha test/**/*.js", "jspm": "./node_modules/.bin/jspm config registries.github.auth $JSPM_GITHUB_AUTH_TOKEN && jspm install", - "start": "node -r 'babel/register' app.js", + "start": "node -r babel/register app.js", + "postinstall": "npm run build", "test": "mocha --require co-mocha --compilers js:babel/register test/**/*.js --timeout=10000", "watch": "parallelshell \"npm run watch-js\" \"npm run watch-server\"", "watch-js": "babel --modules system -wd public/views views", - "watch-server": "nodemon -x \"node -r 'babel/register'\" -e js,jsx -i public/ app.js" + "watch-server": "nodemon -x \"node -r babel/register\" -e js,jsx -i public/ app.js" }, "engines": { "iojs": "~2.3.0" }, "dependencies": { - "babel": "^5.5.8", - "babelify": "^6.0.2", - "bluebird": "^2.9.30", - "browserify": "^10.1.3", - "co": "^4.5.4", - "debug": "^2.1.1", - "jspm": "^0.16.0-beta.3", - "koa": "^0.21.0", - "koa-bodyparser": "^2.0.0", - "koa-compress": "^1.0.8", - "koa-favicon": "^1.2.0", - "koa-file-server": "^2.3.1", - "koa-logger": "^1.2.2", - "koa-route": "^2.4.0", - "moment": "^2.10.3", - "mongodb-promisified": "^1.0.2", - "node-uuid": "^1.4.2", - "playmusic": "^2.0.0", - "rdio": "^2.0.0", - "react": "^0.13.3", - "react-google-analytics": "^0.2.0", - "react-router": "^0.13.3", - "reactify": "^1.1.1", - "spotify": "^0.3.0", - "superagent": "^1.2.0", - "superagent-bluebird-promise": "^2.0.2" + "babel": "~5.6.14", + "babelify": "~6.0.2", + "bluebird": "~2.9.30", + "browserify": "~10.1.3", + "co": "~4.6.0", + "debug": "~2.1.1", + "jspm": "~0.16.0-beta.3", + "koa": "~0.21.0", + "koa-bodyparser": "~2.0.0", + "koa-compress": "~1.0.8", + "koa-favicon": "~1.2.0", + "koa-file-server": "~2.3.1", + "koa-logger": "~1.2.2", + "koa-route": "~2.4.0", + "moment": "~2.10.3", + "mongodb-promisified": "~1.0.2", + "node-uuid": "~1.4.2", + "playmusic": "~2.0.0", + "rdio": "~2.0.0", + "react": "~0.13.3", + "react-google-analytics": "~0.2.0", + "react-router": "~0.13.3", + "reactify": "~1.1.1", + "spotify": "~0.3.0", + "superagent": "~1.2.0", + "superagent-bluebird-promise": "~2.0.2" }, "devDependencies": { - "co-mocha": "^1.1.0", - "eslint": "^0.24.0", - "eslint-plugin-react": "^2.5.1", - "mocha": "^2.1.0", - "nodemon": "^1.3.7", - "parallelshell": "^1.1.1", - "should": "^7.0.1", - "spdy": "^1.32.0" + "co-mocha": "~1.1.0", + "eslint": "~0.24.0", + "eslint-plugin-react": "~2.7.0", + "istanbul": "^0.3.17", + "mocha": "~2.1.0", + "nodemon": "~1.3.7", + "parallelshell": "~1.1.1", + "should": "~7.0.1", + "spdy": "~1.32.0" }, "jspm": { - "directories": { - "baseURL": "public" - }, - "dependencies": { - "react": "npm:react@^0.13.3", - "react-google-analytics": "npm:react-google-analytics@^0.2.0", - "react-router": "npm:react-router@^0.13.3", - "superagent": "npm:superagent@^1.2.0" - }, - "devDependencies": {}, "buildConfig": { "minify": true, "transpileES6": true + }, + "dependencies": { + "react": "npm:react@~0.13.3", + "react-google-analytics": "npm:react-google-analytics@~0.2.0", + "react-router": "npm:react-router@~0.13.3", + "superagent": "npm:superagent@~1.2.0" + }, + "devDependencies": {}, + "directories": { + "baseURL": "public" } } } diff --git a/views/error.js b/views/error.js index a9143e7..856e37f 100644 --- a/views/error.js +++ b/views/error.js @@ -24,7 +24,7 @@ export default React.createClass({

{this.props.status}

{this.props.message}

-
{this.props.error.stack || ''}
+
{this.props.error || ''}