Upgrade all the things.
This commit is contained in:
parent
95e7eff734
commit
7720653aeb
12 changed files with 728 additions and 784 deletions
3
.babelrc
3
.babelrc
|
@ -6,6 +6,5 @@
|
|||
},
|
||||
"modules": "commonjs"
|
||||
}]
|
||||
],
|
||||
"plugins": ["@babel/plugin-proposal-object-rest-spread"]
|
||||
]
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
FROM node:9.11.1-alpine
|
||||
FROM node:10.0.0-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
FROM node:9.11.1-alpine
|
||||
FROM node:10.0.0-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
|
|
3
app.js
3
app.js
|
@ -16,7 +16,7 @@ import index from './routes/index';
|
|||
import recent from './routes/recent';
|
||||
import search from './routes/search';
|
||||
import share from './routes/share';
|
||||
import slack from './routes/slack';
|
||||
import { slack, oauth } from './routes/slack';
|
||||
import errorHandler from './lib/error-handler';
|
||||
|
||||
const debug = debuglog('combine.fm');
|
||||
|
@ -60,6 +60,7 @@ app.use(route.get('/:service/:type/:id.:format?', share));
|
|||
|
||||
app.use(route.post('/slack', slack));
|
||||
app.use(route.get('/slack', slack));
|
||||
app.use(route.get('/oauth', oauth));
|
||||
|
||||
if (!module.parent) {
|
||||
app.listen(process.env.PORT || 3000, () => {
|
||||
|
|
|
@ -49,7 +49,7 @@ services:
|
|||
volumes:
|
||||
- ./:/app:cached
|
||||
- node_modules:/app/node_modules
|
||||
command: yarn run worker
|
||||
command: yarn run watch-worker
|
||||
ports:
|
||||
- "3001:3000"
|
||||
database:
|
||||
|
|
51
package.json
51
package.json
|
@ -6,40 +6,41 @@
|
|||
"scripts": {
|
||||
"build": "webpack --mode=production --config webpack.config.js && webpack --config webpack.config.server.js",
|
||||
"start": "node -r @babel/register app.js",
|
||||
"worker": "nodemon -x \"node -r @babel/register\" -e js,vue -i node_modules -i chrome/ worker.js",
|
||||
"test": "mocha -r co-mocha --compilers js:@babel/register test/**/*.js --timeout=15000",
|
||||
"watch": "parallelshell \"npm run watch-js\" \"npm run watch-server\"",
|
||||
"watch-js": "parallelshell \"webpack -w -d --config webpack.config.js\" \"webpack -w --config webpack.config.server.js\"",
|
||||
"worker": "node -r @babel/register worker.js",
|
||||
"test": "mocha -r co-mocha -r '@babel/register' test/**/*.js --timeout=15000",
|
||||
"watch": "concurrently -k \"npm:watch-js\" \"npm:watch-server\"",
|
||||
"watch-js": "concurrently -k -n webpack-frontend,webpack-server \"webpack -w -d --config webpack.config.js\" \"webpack -w --config webpack.config.server.js\"",
|
||||
"watch-server": "nodemon -x \"node -r @babel/register\" -e js,vue -i node_modules -i chrome/ app.js",
|
||||
"watch-worker": "nodemon -x \"node -r @babel/register\" -e js,vue -i node_modules -i chrome/ worker.js",
|
||||
"heroku-postbuild": "npm run build",
|
||||
"initdb": "node -r @babel/register test/initdb.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^9.11.1"
|
||||
"node": "^10.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/cli": "^7.0.0-beta.44",
|
||||
"@babel/core": "^7.0.0-beta.44",
|
||||
"@babel/plugin-proposal-object-rest-spread": "^7.0.0-beta.44",
|
||||
"@babel/polyfill": "^7.0.0-beta.44",
|
||||
"@babel/preset-env": "^7.0.0-beta.44",
|
||||
"@babel/register": "^7.0.0-beta.44",
|
||||
"@babel/cli": "^7.0.0-beta.46",
|
||||
"@babel/core": "^7.0.0-beta.46",
|
||||
"@babel/plugin-proposal-object-rest-spread": "^7.0.0-beta.46",
|
||||
"@babel/polyfill": "^7.0.0-beta.46",
|
||||
"@babel/preset-env": "^7.0.0-beta.46",
|
||||
"@babel/register": "^7.0.0-beta.46",
|
||||
"amazon-product-api": "^0.4.4",
|
||||
"apple-music-jwt": "^0.2.0",
|
||||
"babel-loader": "^8.0.0-beta.2",
|
||||
"bluebird": "^3.5.1",
|
||||
"bulma": "^0.7.0",
|
||||
"bulma": "^0.7.1",
|
||||
"co": "~4.6.0",
|
||||
"css-loader": "^0.28.11",
|
||||
"debug": "^3.1.0",
|
||||
"ejs": "^2.5.8",
|
||||
"ejs": "^2.5.9",
|
||||
"extract-text-webpack-plugin": "^4.0.0-beta.0",
|
||||
"file-loader": "^1.1.11",
|
||||
"iso8601-duration": "^1.1.1",
|
||||
"kcors": "^2.2.1",
|
||||
"koa": "^2.5.0",
|
||||
"koa": "^2.5.1",
|
||||
"koa-bodyparser": "^4.2.0",
|
||||
"koa-compress": "~2.0.0",
|
||||
"koa-compress": "~3.0.0",
|
||||
"koa-favicon": "~2.0.1",
|
||||
"koa-file-server": "~2.3.1",
|
||||
"koa-logger": "~3.2.0",
|
||||
|
@ -48,37 +49,37 @@
|
|||
"koa-views": "^6.1.4",
|
||||
"koa-websocket": "^4.1.0",
|
||||
"kue": "^0.11.6",
|
||||
"moment": "^2.22.0",
|
||||
"moment": "^2.22.1",
|
||||
"node-uuid": "~1.4.2",
|
||||
"nodebrainz": "^2.1.1",
|
||||
"pg": "^7.4.1",
|
||||
"playmusic": "^2.3.0",
|
||||
"raven": "^2.5.0",
|
||||
"raven": "^2.6.0",
|
||||
"sequelize": "^4.37.6",
|
||||
"spotify-web-api-node": "^3.0.0",
|
||||
"style-loader": "^0.20.3",
|
||||
"spotify-web-api-node": "^3.1.0",
|
||||
"style-loader": "^0.21.0",
|
||||
"superagent": "^3.8.2",
|
||||
"uglifyjs-webpack-plugin": "^1.2.4",
|
||||
"uglifyjs-webpack-plugin": "^1.2.5",
|
||||
"vue": "^2.5.16",
|
||||
"vue-loader": "^14.2.2",
|
||||
"vue-loader": "^15.0.4",
|
||||
"vue-router": "^3.0.1",
|
||||
"vue-server-renderer": "^2.5.16",
|
||||
"vue-template-compiler": "^2.5.16",
|
||||
"vuex": "^3.0.1",
|
||||
"vuex-router-sync": "^5.0.0",
|
||||
"webpack": "^4.5.0",
|
||||
"webpack-cli": "^2.0.14",
|
||||
"webpack": "^4.6.0",
|
||||
"webpack-cli": "^2.0.15",
|
||||
"webpack-stats-plugin": "^0.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"co-mocha": "^1.2.2",
|
||||
"concurrently": "^3.5.1",
|
||||
"eslint": "^4.19.1",
|
||||
"eslint-config-airbnb": "^16.1.0",
|
||||
"eslint-plugin-import": "^2.11.0",
|
||||
"istanbul": "^0.4.0",
|
||||
"mocha": "^5.0.5",
|
||||
"mocha": "^5.1.1",
|
||||
"nodemon": "^1.17.3",
|
||||
"parallelshell": "^3.0.2",
|
||||
"should": "^13.2.1"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div id="app">
|
||||
<div class="header" v-bind:class="{ 'share': $store.state.share }">
|
||||
<div class="header" v-bind:class="{ 'share': this.$router.currentRoute.path !== '/' }">
|
||||
<div class="container">
|
||||
<h1 class="title">
|
||||
<router-link to="/" exact>
|
||||
|
|
|
@ -15,9 +15,9 @@ const queue = kue.createQueue({
|
|||
|
||||
const slackToken = process.env.SLACK_TOKEN;
|
||||
|
||||
export default async function (ctx) {
|
||||
export async function slack(ctx) {
|
||||
if (ctx.request.method === 'GET') {
|
||||
ctx.redirect('https://slack.com/oauth/authorize?client_id=349358389361.349904899522&team=TA9AJBFAM&install_redirect=general&scope=links:read,chat:write:bot');
|
||||
ctx.redirect('https://slack.com/oauth/authorize?client_id=349358389361.349904899522&install_redirect=general&scope=links:read,chat:write:bot');
|
||||
return;
|
||||
}
|
||||
if (ctx.request.body.challenge) {
|
||||
|
@ -56,3 +56,8 @@ export default async function (ctx) {
|
|||
ctx.body = 'OK';
|
||||
}
|
||||
|
||||
export async function oauth() {
|
||||
const { body } = await request.post('https://slack.com/api/oauth.access')
|
||||
.set('Authorization', `Bearer ${slackToken}`)
|
||||
.send(payload);
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ describe('Deezer', function(){
|
|||
|
||||
it('should find album with various artists by search', function* (){
|
||||
const result = yield deezer.search({type: 'album', artist: {name: 'Various Artists'}, name: 'The Trevor Nelson Collection'});
|
||||
result.name.should.equal('The Trevor Nelson Collection');
|
||||
result.name.should.equal('The Trevor Nelson Collection 3');
|
||||
});
|
||||
|
||||
it('should find track by search', function* (){
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
const path = require('path');
|
||||
const { VueLoaderPlugin } = require('vue-loader')
|
||||
const ExtractTextPlugin = require('extract-text-webpack-plugin');
|
||||
const StatsWriterPlugin = require('webpack-stats-plugin').StatsWriterPlugin;
|
||||
|
||||
|
@ -63,6 +64,7 @@ module.exports = {
|
|||
},
|
||||
plugins: [
|
||||
new ExtractTextPlugin('style/[name].[hash:10].css'),
|
||||
new VueLoaderPlugin(),
|
||||
new StatsWriterPlugin({
|
||||
fields: ['assets'],
|
||||
filename: 'manifest.json',
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
const path = require('path');
|
||||
const webpack = require('webpack');
|
||||
const { VueLoaderPlugin } = require('vue-loader')
|
||||
|
||||
module.exports = {
|
||||
mode: "none",
|
||||
|
@ -22,22 +23,26 @@ module.exports = {
|
|||
new webpack.DefinePlugin({
|
||||
'global.GENTLY': false,
|
||||
}),
|
||||
new VueLoaderPlugin(),
|
||||
],
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.vue$/,
|
||||
use: {
|
||||
loader: 'vue-loader',
|
||||
},
|
||||
loader: 'vue-loader',
|
||||
},
|
||||
{
|
||||
test: /\.js$/,
|
||||
use: {
|
||||
loader: 'babel-loader',
|
||||
},
|
||||
loader: 'babel-loader',
|
||||
exclude: /node_modules/,
|
||||
},
|
||||
{
|
||||
test: /\.css$/,
|
||||
use: [
|
||||
'vue-style-loader',
|
||||
'css-loader'
|
||||
]
|
||||
}
|
||||
],
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue