Goodbye JSPM.
This commit is contained in:
parent
7607759e3f
commit
64c823db55
10 changed files with 1235 additions and 593 deletions
|
@ -11,7 +11,7 @@ RUN yarn
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
RUN yarn run jspm && yarn run build
|
RUN yarn run build
|
||||||
|
|
||||||
ENV PORT 3000
|
ENV PORT 3000
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
|
7
app.js
7
app.js
|
@ -13,6 +13,7 @@ import debugname from 'debug';
|
||||||
import * as redis from './lib/redis';
|
import * as redis from './lib/redis';
|
||||||
import api, { ws } from './api/app';
|
import api, { ws } from './api/app';
|
||||||
import web from './web/app';
|
import web from './web/app';
|
||||||
|
import { isContext } from 'vm';
|
||||||
|
|
||||||
const debug = debugname('hostr');
|
const debug = debugname('hostr');
|
||||||
|
|
||||||
|
@ -23,11 +24,11 @@ if (process.env.SENTRY_DSN) {
|
||||||
Raven.config(process.env.SENTRY_DSN);
|
Raven.config(process.env.SENTRY_DSN);
|
||||||
Raven.install();
|
Raven.install();
|
||||||
app.use(async (ctx, next) => {
|
app.use(async (ctx, next) => {
|
||||||
this.Raven = Raven;
|
ctx.Raven = Raven;
|
||||||
await next();
|
await next();
|
||||||
});
|
});
|
||||||
app.ws.use(async (ctx, next) => {
|
app.ws.use(async (ctx, next) => {
|
||||||
this.Raven = Raven;
|
ctx.Raven = Raven;
|
||||||
await next();
|
await next();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -37,7 +38,7 @@ app.use(helmet());
|
||||||
app.use(async (ctx, next) => {
|
app.use(async (ctx, next) => {
|
||||||
ctx.set('Server', 'Nintendo 64');
|
ctx.set('Server', 'Nintendo 64');
|
||||||
if (ctx.req.headers['x-forwarded-proto'] === 'http') {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
|
54
package.json
54
package.json
|
@ -9,23 +9,27 @@
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "npm run build-js && npm run build-sass",
|
"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-js": "webpack --progress -p -c webpack.config.js",
|
||||||
"build-sass": "node-sass -r -o web/public/styles/ web/public/styles/",
|
"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",
|
"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();\"",
|
"init": "babel-node -e \"require('./lib/storage').default();\"",
|
||||||
"initdb": "node -r babel-register test/initdb.js",
|
"initdb": "node -r babel-register test/initdb.js",
|
||||||
"jspm": "jspm install",
|
|
||||||
"lint": "eslint .",
|
"lint": "eslint .",
|
||||||
"start": "node -r babel-register app.js",
|
"start": "node -r babel-register app.js",
|
||||||
"test": "npm run test-seed && mocha -r babel-register test/**/*.spec.js",
|
"test": "npm run test-seed && mocha -r babel-register test/**/*.spec.js",
|
||||||
"test-seed": "babel-node test/fixtures/user.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": "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-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": {
|
"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",
|
"async-busboy": "^0.6.2",
|
||||||
"aws-sdk": "^2.245.1",
|
"aws-sdk": "^2.245.1",
|
||||||
"babel": "^6.5.2",
|
"babel": "^6.5.2",
|
||||||
|
@ -35,18 +39,21 @@
|
||||||
"babel-plugin-transform-object-rest-spread": "^6.8.0",
|
"babel-plugin-transform-object-rest-spread": "^6.8.0",
|
||||||
"babel-register": "^6.9.0",
|
"babel-register": "^6.9.0",
|
||||||
"basic-auth": "~2.0.0",
|
"basic-auth": "~2.0.0",
|
||||||
|
"bootstrap-sass": "^3.3.6",
|
||||||
"busboy": "^0.2.14",
|
"busboy": "^0.2.14",
|
||||||
"co": "~4.6.0",
|
"co": "~4.6.0",
|
||||||
"co-redis": "^2.1.0",
|
"co-redis": "^2.1.0",
|
||||||
"co-views": "~2.1.0",
|
"co-views": "~2.1.0",
|
||||||
|
"copy-webpack-plugin": "^4.5.1",
|
||||||
"debug": "~3.1.0",
|
"debug": "~3.1.0",
|
||||||
|
"dropzone": "~4.0.1",
|
||||||
"ejs": "^2.6.1",
|
"ejs": "^2.6.1",
|
||||||
"form-data": "^2.3.2",
|
"form-data": "^2.3.2",
|
||||||
"http-errors": "^1.6.3",
|
"http-errors": "^1.6.3",
|
||||||
"image-size": "^0.6.2",
|
"image-size": "^0.6.2",
|
||||||
"image-type": "^3.0.0",
|
"image-type": "^3.0.0",
|
||||||
"jimp": "0.2.28",
|
"jimp": "0.2.28",
|
||||||
"jspm": "0.16.53",
|
"jquery": "^2.2.4",
|
||||||
"kcors": "^2.2.1",
|
"kcors": "^2.2.1",
|
||||||
"koa": "^2.5.1",
|
"koa": "^2.5.1",
|
||||||
"koa-bodyparser": "^4.2.1",
|
"koa-bodyparser": "^4.2.1",
|
||||||
|
@ -77,11 +84,14 @@
|
||||||
"redis": "^2.8.0",
|
"redis": "^2.8.0",
|
||||||
"sendgrid": "^5.2.3",
|
"sendgrid": "^5.2.3",
|
||||||
"sequelize": "^4.37.10",
|
"sequelize": "^4.37.10",
|
||||||
"ssh2": "^0.6.1",
|
"smooth-scroll": "https://github.com/cferdinandi/smooth-scroll#5.3.7",
|
||||||
"statsy": "~0.2.0",
|
"statsy": "~0.2.0",
|
||||||
"stripe": "^6.0.0",
|
"stripe": "^6.0.0",
|
||||||
"swig": "~1.4.2",
|
"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": {
|
"devDependencies": {
|
||||||
"babel-eslint": "^8.2.3",
|
"babel-eslint": "^8.2.3",
|
||||||
|
@ -94,31 +104,5 @@
|
||||||
"nodemon": "^1.17.4",
|
"nodemon": "^1.17.4",
|
||||||
"supertest": "^3.1.0",
|
"supertest": "^3.1.0",
|
||||||
"tmp": "0.0.33"
|
"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"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import angular from 'angular';
|
import angular from 'angular';
|
||||||
import 'angular/route';
|
import 'angular-route';
|
||||||
import 'angular/resource';
|
import 'angular-resource';
|
||||||
import 'angular-reconnecting-websocket';
|
import 'angular-reconnecting-websocket/angular-reconnecting-websocket';
|
||||||
import 'angular-strap/dist/modules/dimensions';
|
import 'angular-strap/dist/modules/dimensions';
|
||||||
import 'angular-strap/dist/modules/compiler';
|
import 'angular-strap/dist/modules/compiler';
|
||||||
import 'angular-strap/dist/modules/tooltip';
|
import 'angular-strap/dist/modules/tooltip';
|
||||||
|
|
|
@ -6,7 +6,7 @@ html, body {
|
||||||
height: 100%;
|
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
|
// MAIN VARIABLES
|
||||||
$body-bg: #ededf3;
|
$body-bg: #ededf3;
|
||||||
|
@ -33,7 +33,7 @@ $nav-pills-active-link-hover-color: $brand-primary;
|
||||||
|
|
||||||
$tooltip-bg: $brand-primary !default;
|
$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-color: #96d4a1 !default;
|
||||||
$throbber-highlight-color: #39b54a !default;
|
$throbber-highlight-color: #39b54a !default;
|
||||||
|
|
|
@ -10,7 +10,7 @@ body {
|
||||||
min-height: 100%;
|
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
|
// MAIN VARIABLES
|
||||||
$body-bg: #0d0d1a;
|
$body-bg: #0d0d1a;
|
||||||
|
@ -44,7 +44,7 @@ $nav-link-hover-bg: rgba(255,255,255,0);
|
||||||
|
|
||||||
|
|
||||||
// bower: scss
|
// bower: scss
|
||||||
@import '../jspm_packages/npm/bootstrap-sass@3.3.6/assets/stylesheets/bootstrap';
|
@import 'bootstrap-sass/assets/stylesheets/bootstrap';
|
||||||
// endbower
|
// endbower
|
||||||
html,
|
html,
|
||||||
body {
|
body {
|
||||||
|
|
|
@ -97,10 +97,7 @@
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<% } %>
|
<% } %>
|
||||||
<script src='/jspm_packages/system-polyfills.js'></script>
|
<script src="/build/bundle.js"></script>
|
||||||
<script src='/jspm_packages/system.js'></script>
|
|
||||||
<script src='/config.js'></script>
|
|
||||||
<script>System.import('/build/app');</script>
|
|
||||||
<script src="https://checkout.stripe.com/checkout.js"></script>
|
<script src="https://checkout.stripe.com/checkout.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
13
webpack.config.js
Normal file
13
webpack.config.js
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
const path = require('path');
|
||||||
|
const CopyWebpackPlugin = require('copy-webpack-plugin')
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
entry: './web/public/src/app.js',
|
||||||
|
output: {
|
||||||
|
filename: 'bundle.js',
|
||||||
|
path: path.resolve(__dirname, 'web', 'public', 'build')
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
new CopyWebpackPlugin([{ from: './web/public/src/partials', to: 'partials' }])
|
||||||
|
]
|
||||||
|
};
|
|
@ -1,11 +1,11 @@
|
||||||
import co from 'co';
|
import co from 'co';
|
||||||
import kue from 'kue';
|
import kue from 'kue';
|
||||||
import raven from 'raven';
|
import Raven from 'raven';
|
||||||
import debuglog from 'debug';
|
import debuglog from 'debug';
|
||||||
|
|
||||||
const debug = debuglog('hostr:worker');
|
const debug = debuglog('hostr:worker');
|
||||||
|
|
||||||
raven.config(process.env.SENTRY_DSN).install();
|
Raven.config(process.env.SENTRY_DSN).install();
|
||||||
|
|
||||||
const queue = kue.createQueue({
|
const queue = kue.createQueue({
|
||||||
redis: process.env.REDIS_URL,
|
redis: process.env.REDIS_URL,
|
||||||
|
@ -16,7 +16,7 @@ function store(data, done) {
|
||||||
|
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
debug(err);
|
debug(err);
|
||||||
raven.captureException(err);
|
Raven.captureException(err);
|
||||||
return done();
|
return done();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue