From 24e42343e46a42c003ea2fceb5cc2dd0cd8456a0 Mon Sep 17 00:00:00 2001 From: Jonathan Cremin Date: Thu, 2 Jun 2016 21:06:52 +0100 Subject: [PATCH] Finish updating deps --- .babelrc | 7 ++++ .eslintrc | 3 +- package.json | 46 +++++++++++++---------- web/app.js | 11 ++++-- web/public/config.js | 87 +++++++++++++++++++++++++++---------------- web/public/error.html | 14 +++---- 6 files changed, 103 insertions(+), 65 deletions(-) create mode 100644 .babelrc diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..b765fa3 --- /dev/null +++ b/.babelrc @@ -0,0 +1,7 @@ +{ + "plugins": [ + "transform-es2015-modules-commonjs", + "transform-es2015-destructuring", + "transform-object-rest-spread" + ] +} diff --git a/.eslintrc b/.eslintrc index 0e493ba..6ec1c20 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,8 +1,7 @@ { "extends": "airbnb/base", "ecmaFeatures": { - "modules": true, - "jsx": true + "modules": true }, "env": { "node": true, diff --git a/package.json b/package.json index 3c0a7b9..df94385 100644 --- a/package.json +++ b/package.json @@ -5,27 +5,32 @@ "version": "0.0.0", "private": true, "engines": { - "node": "^6.0.0", + "node": "^6.2.0", "npm": "^3.8.5" }, "scripts": { "build": "npm run build-js && npm run build-sass", "build-js": "babel -D -m system -d web/public/build -i web/public web/public/src", "build-sass": "node-sass -r -o web/public/styles/ web/public/styles/", - "cover": "istanbul cover _mocha -- -r babel/register test/**/*.spec.js", - "init": "node -r babel/register -e \"require('./lib/storage')();\"", + "cover": "istanbul cover _mocha -- -r babel-register test/**/*.spec.js", + "init": "babel-node -e \"require('./lib/storage').default();\"", "jspm": "jspm install", - "start": "npm run build && node -r babel/register app.js", - "test": "npm run test-seed && mocha -r babel/register test/**/*.spec.js", + "start": "npm run build && node -r babel-register app.js", + "test": "npm run test-seed && mocha -r babel-register test/**/*.spec.js", "test-seed": "node test/fixtures/mongo-user.js && node test/fixtures/mongo-file.js", "watch": "parallelshell \"npm run watch-js\" \"npm run watch-sass\" \"npm run watch-server\"", "watch-js": "babel -Dw -m system -d web/public/build web/public/src", - "watch-server": "nodemon -r babel/register app.js", + "watch-server": "nodemon -r babel-register app.js", "watch-sass": "node-sass -w -r -o web/public/styles/ web/public/styles/" }, "dependencies": { "aws-sdk": "^2.3.16", - "babel": "~5.8.21", + "babel": "^6.5.2", + "babel-cli": "^6.9.0", + "babel-plugin-transform-es2015-destructuring": "^6.9.0", + "babel-plugin-transform-es2015-modules-commonjs": "^6.8.0", + "babel-plugin-transform-object-rest-spread": "^6.8.0", + "babel-register": "^6.9.0", "basic-auth": "~1.0.3", "co": "~4.6.0", "co-busboy": "~1.3.0", @@ -73,9 +78,10 @@ "swig": "~1.4.2" }, "devDependencies": { - "babel-eslint": "^4.0.10", - "eslint": "~1.3.0", - "eslint-config-airbnb": "0.0.8", + "babel-eslint": "^6.0.4", + "eslint": "^2.11.1", + "eslint-config-airbnb": "^9.0.1", + "eslint-plugin-import": "^1.8.1", "istanbul": "^0.4.3", "mocha": "^2.5.3", "nodemon": "^1.9.2", @@ -89,21 +95,21 @@ "baseURL": "web/public" }, "dependencies": { - "angular": "npm:angular@~1.4.3", + "angular": "npm:angular@^1.5.6", "angular-reconnecting-websocket": "github:adieu/angular-reconnecting-websocket@~0.1.1", - "angular-strap": "npm:angular-strap@~2.3.1", - "angular/resource": "npm:angular-resource@~1.4.3", - "angular/route": "npm:angular-route@~1.4.3", - "bootstrap-sass": "npm:bootstrap-sass@~3.3.5", + "angular/resource": "npm:angular-resource@^1.5.6", + "angular/route": "npm:angular-route@^1.5.6", + "angular-strap": "npm:angular-strap@^2.3.8", + "bootstrap-sass": "npm:bootstrap-sass@^3.3.6", "cferdinandi/smooth-scroll": "github:cferdinandi/smooth-scroll@~5.3.7", "dropzone": "npm:dropzone@~4.0.1", - "jquery": "npm:jquery@~2.1.4", - "zeroclipboard": "npm:zeroclipboard@~2.2.0" + "jquery": "npm:jquery@^2.2.4", + "zeroclipboard": "npm:zeroclipboard@^2.2.0" }, "devDependencies": { - "babel": "npm:babel-core@^5.8.22", - "babel-runtime": "npm:babel-runtime@^5.8.20", - "core-js": "npm:core-js@^1.1.0" + "babel": "npm:babel-core@^5.8.24", + "babel-runtime": "npm:babel-runtime@^5.8.24", + "core-js": "npm:core-js@^1.1.4" } } } diff --git a/web/app.js b/web/app.js index b810a1c..ba6189e 100644 --- a/web/app.js +++ b/web/app.js @@ -3,9 +3,9 @@ import Router from 'koa-router'; import csrf from 'koa-csrf'; import views from 'koa-views'; import stats from 'koa-statsd'; -import * as redis from '../lib/redis'; import StatsD from 'statsy'; import errors from 'koa-error'; +import * as redis from '../lib/redis'; import * as index from './routes/index'; import * as file from './routes/file'; import * as pro from './routes/pro'; @@ -13,7 +13,10 @@ import * as user from './routes/user'; const router = new Router(); -router.use(errors({template: path.join(__dirname, 'public', 'error.html')})); +router.use(errors({ + engine: 'ejs', + template: path.join(__dirname, 'public', 'error.html') +})); const statsdOpts = {prefix: 'hostr-web', host: process.env.STATSD_HOST}; router.use(stats(statsdOpts)); @@ -37,8 +40,8 @@ router.use(function* stateMiddleware(next) { router.use(csrf()); -router.use(views('views', { - default: 'ejs', +router.use(views(path.join(__dirname, 'views'), { + extension: 'ejs' })); router.get('/', index.main); diff --git a/web/public/config.js b/web/public/config.js index cdd96e5..66c790d 100644 --- a/web/public/config.js +++ b/web/public/config.js @@ -1,9 +1,11 @@ System.config({ + baseURL: "/", defaultJSExtensions: true, transpiler: "babel", babelOptions: { "optional": [ - "runtime" + "runtime", + "optimisation.modules.system" ] }, paths: { @@ -12,62 +14,83 @@ System.config({ }, map: { - "angular": "npm:angular@1.4.5", + "angular": "npm:angular@1.5.6", "angular-reconnecting-websocket": "github:adieu/angular-reconnecting-websocket@0.1.1", - "angular-strap": "npm:angular-strap@2.3.1", - "angular/resource": "npm:angular-resource@1.4.5", - "angular/route": "npm:angular-route@1.4.5", - "babel": "npm:babel-core@5.8.23", - "babel-runtime": "npm:babel-runtime@5.8.20", - "bootstrap-sass": "npm:bootstrap-sass@3.3.5", + "angular/resource": "npm:angular-resource@1.5.6", + "angular/route": "npm:angular-route@1.5.6", + "angular-strap": "npm:angular-strap@2.3.8", + "babel": "npm:babel-core@5.8.38", + "babel-runtime": "npm:babel-runtime@5.8.38", + "bootstrap-sass": "npm:bootstrap-sass@3.3.6", "cferdinandi/smooth-scroll": "github:cferdinandi/smooth-scroll@5.3.7", - "core-js": "npm:core-js@1.1.3", + "core-js": "npm:core-js@1.2.6", "dropzone": "npm:dropzone@4.0.1", - "jquery": "npm:jquery@2.1.4", + "jquery": "npm:jquery@2.2.4", "zeroclipboard": "npm:zeroclipboard@2.2.0", + "github:jspm/nodelibs-assert@0.1.0": { + "assert": "npm:assert@1.4.1" + }, "github:jspm/nodelibs-buffer@0.1.0": { - "buffer": "npm:buffer@3.4.3" + "buffer": "npm:buffer@3.6.0" }, "github:jspm/nodelibs-path@0.1.0": { "path-browserify": "npm:path-browserify@0.0.0" }, - "github:jspm/nodelibs-process@0.1.1": { - "process": "npm:process@0.10.1" + "github:jspm/nodelibs-process@0.1.2": { + "process": "npm:process@0.11.3" }, - "npm:angular-strap@2.3.1": { + "github:jspm/nodelibs-util@0.1.0": { + "util": "npm:util@0.10.3" + }, + "npm:angular-strap@2.3.8": { "buffer": "github:jspm/nodelibs-buffer@0.1.0", + "child_process": "github:jspm/nodelibs-child_process@0.1.0", "fs": "github:jspm/nodelibs-fs@0.1.2", "path": "github:jspm/nodelibs-path@0.1.0", - "process": "github:jspm/nodelibs-process@0.1.1", - "systemjs-json": "github:systemjs/plugin-json@0.1.0" + "process": "github:jspm/nodelibs-process@0.1.2", + "util": "github:jspm/nodelibs-util@0.1.0" }, - "npm:angular@1.4.5": { - "process": "github:jspm/nodelibs-process@0.1.1" + "npm:assert@1.4.1": { + "assert": "github:jspm/nodelibs-assert@0.1.0", + "buffer": "github:jspm/nodelibs-buffer@0.1.0", + "process": "github:jspm/nodelibs-process@0.1.2", + "util": "npm:util@0.10.3" }, - "npm:babel-runtime@5.8.20": { - "process": "github:jspm/nodelibs-process@0.1.1" + "npm:babel-runtime@5.8.38": { + "process": "github:jspm/nodelibs-process@0.1.2" }, - "npm:buffer@3.4.3": { + "npm:buffer@3.6.0": { "base64-js": "npm:base64-js@0.0.8", - "ieee754": "npm:ieee754@1.1.6", - "is-array": "npm:is-array@1.0.1" - }, - "npm:core-js@1.1.3": { + "child_process": "github:jspm/nodelibs-child_process@0.1.0", "fs": "github:jspm/nodelibs-fs@0.1.2", - "process": "github:jspm/nodelibs-process@0.1.1", - "systemjs-json": "github:systemjs/plugin-json@0.1.0" + "ieee754": "npm:ieee754@1.1.6", + "isarray": "npm:isarray@1.0.0", + "process": "github:jspm/nodelibs-process@0.1.2" + }, + "npm:core-js@1.2.6": { + "fs": "github:jspm/nodelibs-fs@0.1.2", + "path": "github:jspm/nodelibs-path@0.1.0", + "process": "github:jspm/nodelibs-process@0.1.2", + "systemjs-json": "github:systemjs/plugin-json@0.1.2" }, "npm:dropzone@4.0.1": { - "process": "github:jspm/nodelibs-process@0.1.1" + "process": "github:jspm/nodelibs-process@0.1.2" }, - "npm:jquery@2.1.4": { - "process": "github:jspm/nodelibs-process@0.1.1" + "npm:inherits@2.0.1": { + "util": "github:jspm/nodelibs-util@0.1.0" }, "npm:path-browserify@0.0.0": { - "process": "github:jspm/nodelibs-process@0.1.1" + "process": "github:jspm/nodelibs-process@0.1.2" + }, + "npm:process@0.11.3": { + "assert": "github:jspm/nodelibs-assert@0.1.0" + }, + "npm:util@0.10.3": { + "inherits": "npm:inherits@2.0.1", + "process": "github:jspm/nodelibs-process@0.1.2" }, "npm:zeroclipboard@2.2.0": { - "process": "github:jspm/nodelibs-process@0.1.1" + "process": "github:jspm/nodelibs-process@0.1.2" } } }); diff --git a/web/public/error.html b/web/public/error.html index d9f0a73..1c6d3d1 100644 --- a/web/public/error.html +++ b/web/public/error.html @@ -21,17 +21,17 @@
-

{{ status }}

- {% if status >= 500 %} -

{{ error }}

+

<%= status %>

+ <% if (status >= 500) { %> +

<%= error %>

Refreshing might fix the problem. If not, sit tight! We're on it!

- {% elseif status === 404 %} + <% } else if (status === 404) { %>

Sorry, it looks like the file you asked for is gone.

Take Me Home - {% else %} -

{{ error }}

+ <% } else { %> +

<%= error %>

Take Me Home - {% endif %} + <% } %>