diff --git a/Dockerfile b/Dockerfile
index 901c90c..e81ba54 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -11,7 +11,7 @@ RUN yarn
COPY . .
-RUN yarn run jspm && yarn run build
+RUN yarn run build
ENV PORT 3000
EXPOSE 3000
diff --git a/app.js b/app.js
index f707f71..25b943b 100644
--- a/app.js
+++ b/app.js
@@ -13,6 +13,7 @@ import debugname from 'debug';
import * as redis from './lib/redis';
import api, { ws } from './api/app';
import web from './web/app';
+import { isContext } from 'vm';
const debug = debugname('hostr');
@@ -23,11 +24,11 @@ if (process.env.SENTRY_DSN) {
Raven.config(process.env.SENTRY_DSN);
Raven.install();
app.use(async (ctx, next) => {
- this.Raven = Raven;
+ ctx.Raven = Raven;
await next();
});
app.ws.use(async (ctx, next) => {
- this.Raven = Raven;
+ ctx.Raven = Raven;
await next();
});
}
@@ -37,7 +38,7 @@ app.use(helmet());
app.use(async (ctx, next) => {
ctx.set('Server', 'Nintendo 64');
if (ctx.req.headers['x-forwarded-proto'] === 'http') {
- ctx.redirect(`https://${this.req.headers.host}${this.req.url}`);
+ ctx.redirect(`https://${ctx.req.headers.host}${ctx.req.url}`);
return;
}
try {
diff --git a/package.json b/package.json
index 99642da..3cc2c65 100644
--- a/package.json
+++ b/package.json
@@ -9,23 +9,27 @@
},
"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/",
+ "build-js": "webpack --progress -p -c webpack.config.js",
+ "build-sass": "node-sass --include-path ./node_modules/ -r -o web/public/styles/ web/public/styles/",
"cover": "istanbul cover _mocha -- -r babel-register test/**/*.spec.js",
- "heroku-postbuild": "jspm install && npm run build",
+ "heroku-postbuild": "npm run build",
"init": "babel-node -e \"require('./lib/storage').default();\"",
"initdb": "node -r babel-register test/initdb.js",
- "jspm": "jspm install",
"lint": "eslint .",
"start": "node -r babel-register app.js",
"test": "npm run test-seed && mocha -r babel-register test/**/*.spec.js",
"test-seed": "babel-node test/fixtures/user.js",
"watch": "concurrently -k -n watch-js,watch-server \"npm run watch-js\" \"npm run watch-server\"",
- "watch-js": "babel -Dw -m system -d web/public/build web/public/src",
+ "watch-js": "webpack --mode=development --progress -c webpack.config.js",
"watch-server": "nodemon -r babel-register -i web/public",
- "watch-sass": "node-sass -w -r -o web/public/styles/ web/public/styles/"
+ "watch-sass": "node-sass --include-path ./node_modules/ -w -r -o web/public/styles/ web/public/styles/"
},
"dependencies": {
+ "angular": "^1.5.6",
+ "angular-reconnecting-websocket": "https://github.com/adieu/angular-reconnecting-websocket#0.1.1",
+ "angular-resource": "^1.5.6",
+ "angular-route": "^1.5.6",
+ "angular-strap": "^2.3.8",
"async-busboy": "^0.6.2",
"aws-sdk": "^2.245.1",
"babel": "^6.5.2",
@@ -35,18 +39,21 @@
"babel-plugin-transform-object-rest-spread": "^6.8.0",
"babel-register": "^6.9.0",
"basic-auth": "~2.0.0",
+ "bootstrap-sass": "^3.3.6",
"busboy": "^0.2.14",
"co": "~4.6.0",
"co-redis": "^2.1.0",
"co-views": "~2.1.0",
+ "copy-webpack-plugin": "^4.5.1",
"debug": "~3.1.0",
+ "dropzone": "~4.0.1",
"ejs": "^2.6.1",
"form-data": "^2.3.2",
"http-errors": "^1.6.3",
"image-size": "^0.6.2",
"image-type": "^3.0.0",
"jimp": "0.2.28",
- "jspm": "0.16.53",
+ "jquery": "^2.2.4",
"kcors": "^2.2.1",
"koa": "^2.5.1",
"koa-bodyparser": "^4.2.1",
@@ -77,11 +84,14 @@
"redis": "^2.8.0",
"sendgrid": "^5.2.3",
"sequelize": "^4.37.10",
- "ssh2": "^0.6.1",
+ "smooth-scroll": "https://github.com/cferdinandi/smooth-scroll#5.3.7",
"statsy": "~0.2.0",
"stripe": "^6.0.0",
"swig": "~1.4.2",
- "validate-ip": "^1.0.1"
+ "validate-ip": "^1.0.1",
+ "webpack": "^4.10.2",
+ "webpack-cli": "^3.0.1",
+ "zeroclipboard": "^2.2.0"
},
"devDependencies": {
"babel-eslint": "^8.2.3",
@@ -94,31 +104,5 @@
"nodemon": "^1.17.4",
"supertest": "^3.1.0",
"tmp": "0.0.33"
- },
- "jspm": {
- "directories": {
- "baseURL": "web/public"
- },
- "dependencies": {
- "angular": "npm:angular@^1.5.6",
- "angular-reconnecting-websocket": "github:adieu/angular-reconnecting-websocket@~0.1.1",
- "angular-strap": "npm:angular-strap@^2.3.8",
- "angular/resource": "npm:angular-resource@^1.5.6",
- "angular/route": "npm:angular-route@^1.5.6",
- "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.2.4",
- "zeroclipboard": "npm:zeroclipboard@^2.2.0"
- },
- "devDependencies": {
- "babel": "npm:babel-core@^5.8.24",
- "babel-runtime": "npm:babel-runtime@^5.8.24",
- "core-js": "npm:core-js@^1.1.4"
- }
- },
- "cacheDirectories": [
- "node_modules",
- "web/public/jspm_packages"
- ]
+ }
}
diff --git a/web/public/src/app.js b/web/public/src/app.js
index 4741c2b..354cabd 100644
--- a/web/public/src/app.js
+++ b/web/public/src/app.js
@@ -1,7 +1,7 @@
import angular from 'angular';
-import 'angular/route';
-import 'angular/resource';
-import 'angular-reconnecting-websocket';
+import 'angular-route';
+import 'angular-resource';
+import 'angular-reconnecting-websocket/angular-reconnecting-websocket';
import 'angular-strap/dist/modules/dimensions';
import 'angular-strap/dist/modules/compiler';
import 'angular-strap/dist/modules/tooltip';
diff --git a/web/public/styles/app.scss b/web/public/styles/app.scss
index 2691eca..893d80a 100644
--- a/web/public/styles/app.scss
+++ b/web/public/styles/app.scss
@@ -6,7 +6,7 @@ html, body {
height: 100%;
}
-$icon-font-path: "../jspm_packages/npm/bootstrap-sass@3.3.6/assets/fonts/bootstrap/";
+$icon-font-path: "bootstrap-sass/assets/fonts/bootstrap/";
// MAIN VARIABLES
$body-bg: #ededf3;
@@ -33,7 +33,7 @@ $nav-pills-active-link-hover-color: $brand-primary;
$tooltip-bg: $brand-primary !default;
-@import '../jspm_packages/npm/bootstrap-sass@3.3.6/assets/stylesheets/bootstrap';
+@import 'bootstrap-sass/assets/stylesheets/bootstrap';
$throbber-color: #96d4a1 !default;
$throbber-highlight-color: #39b54a !default;
diff --git a/web/public/styles/style.scss b/web/public/styles/style.scss
index 20d8c64..be73631 100644
--- a/web/public/styles/style.scss
+++ b/web/public/styles/style.scss
@@ -10,7 +10,7 @@ body {
min-height: 100%;
}
-$icon-font-path: "../jspm_packages/npm/bootstrap-sass@3.3.6/assets/fonts/bootstrap/";
+$icon-font-path: "bootstrap-sass/assets/fonts/bootstrap/";
// MAIN VARIABLES
$body-bg: #0d0d1a;
@@ -44,7 +44,7 @@ $nav-link-hover-bg: rgba(255,255,255,0);
// bower: scss
-@import '../jspm_packages/npm/bootstrap-sass@3.3.6/assets/stylesheets/bootstrap';
+@import 'bootstrap-sass/assets/stylesheets/bootstrap';
// endbower
html,
body {
diff --git a/web/views/index.ejs b/web/views/index.ejs
index 2355095..54f5569 100644
--- a/web/views/index.ejs
+++ b/web/views/index.ejs
@@ -97,10 +97,7 @@
};
<% } %>
-
-
-
-
+