Remove unnecessary bluebird dependency

This commit is contained in:
Jonathan Cremin 2018-04-13 18:36:58 +01:00
parent b87476abc9
commit 42b6cd5a32
9 changed files with 10437 additions and 231 deletions

View file

@ -1,6 +1,5 @@
import { parse } from 'url'; import { parse } from 'url';
import request from 'superagent'; import request from 'superagent';
import 'superagent-bluebird-promise';
import debuglog from 'debug'; import debuglog from 'debug';
import urlMatch from './url'; import urlMatch from './url';
@ -49,7 +48,7 @@ function looseMatch(needle, haystack, type, various) {
export function* lookupId(id, type) { export function* lookupId(id, type) {
const path = `/${type}/${id}?size=xl`; const path = `/${type}/${id}?size=xl`;
const { body } = yield request.get(apiRoot + path).promise(); const { body } = yield request.get(apiRoot + path);
if (!body || body.error) { if (!body || body.error) {
const error = new Error('Not Found'); const error = new Error('Not Found');
error.status = 404; error.status = 404;

View file

@ -1,7 +1,6 @@
import { parse } from 'url'; import { parse } from 'url';
import querystring from 'querystring'; import querystring from 'querystring';
import request from 'superagent'; import request from 'superagent';
import 'superagent-bluebird-promise';
import urlMatch from './url'; import urlMatch from './url';
const apiRoot = 'https://itunes.apple.com'; const apiRoot = 'https://itunes.apple.com';

View file

@ -3,7 +3,6 @@ import querystring from 'querystring';
import request from 'superagent'; import request from 'superagent';
import Nodebrainz from 'nodebrainz'; import Nodebrainz from 'nodebrainz';
import { toSeconds, parse as ptParse } from 'iso8601-duration'; import { toSeconds, parse as ptParse } from 'iso8601-duration';
import 'superagent-bluebird-promise';
import debuglog from 'debug'; import debuglog from 'debug';
import urlMatch from './url'; import urlMatch from './url';
@ -30,7 +29,7 @@ const apiRoot = 'https://www.googleapis.com/youtube/v3';
export function* lookupId(id) { export function* lookupId(id) {
const path = `/videos?part=snippet%2CcontentDetails&id=${id}&key=${credentials.key}`; const path = `/videos?part=snippet%2CcontentDetails&id=${id}&key=${credentials.key}`;
try { try {
const result = yield request.get(apiRoot + path).promise(); const result = yield request.get(apiRoot + path);
const item = result.body.items[0].snippet; const item = result.body.items[0].snippet;
const duration = toSeconds(ptParse(result.body.items[0].contentDetails.duration)); const duration = toSeconds(ptParse(result.body.items[0].contentDetails.duration));
@ -85,7 +84,7 @@ export function* search(data) {
} }
const path = `/search?part=snippet&q=${encodeURIComponent(query)}&type=video&videoCaption=any&videoCategoryId=10&key=${credentials.key}`; const path = `/search?part=snippet&q=${encodeURIComponent(query)}&type=video&videoCaption=any&videoCategoryId=10&key=${credentials.key}`;
const result = yield request.get(apiRoot + path).promise(); const result = yield request.get(apiRoot + path);
const item = result.body.items[0]; const item = result.body.items[0];
if (!item) { if (!item) {

View file

@ -4,7 +4,7 @@
"repository": "https://github.com/kudos/match.audio", "repository": "https://github.com/kudos/match.audio",
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
"build": "webpack -p --config webpack.config.js && webpack --config webpack.config.server.js", "build": "webpack --mode=production --config webpack.config.js && webpack --config webpack.config.server.js",
"start": "node -r @babel/register app.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", "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", "test": "mocha -r co-mocha --compilers js:@babel/register test/**/*.js --timeout=15000",
@ -33,7 +33,7 @@
"css-loader": "^0.28.11", "css-loader": "^0.28.11",
"debug": "^3.1.0", "debug": "^3.1.0",
"ejs": "^2.5.8", "ejs": "^2.5.8",
"extract-text-webpack-plugin": "^3.0.2", "extract-text-webpack-plugin": "^4.0.0-beta.0",
"file-loader": "^1.1.11", "file-loader": "^1.1.11",
"iso8601-duration": "^1.1.1", "iso8601-duration": "^1.1.1",
"kcors": "^1.3.3", "kcors": "^1.3.3",
@ -58,16 +58,16 @@
"spotify-web-api-node": "^3.0.0", "spotify-web-api-node": "^3.0.0",
"style-loader": "^0.20.3", "style-loader": "^0.20.3",
"superagent": "^3.8.2", "superagent": "^3.8.2",
"superagent-bluebird-promise": "^4.2.0",
"uglifyjs-webpack-plugin": "^1.2.4", "uglifyjs-webpack-plugin": "^1.2.4",
"vue": "^2.5.16", "vue": "^2.5.16",
"vue-loader": "^14.2.2", "vue-loader": "^14.2.2",
"vue-router": "^2.8.1", "vue-router": "^3.0.1",
"vue-server-renderer": "^2.5.16", "vue-server-renderer": "^2.5.16",
"vue-template-compiler": "^2.5.16", "vue-template-compiler": "^2.5.16",
"vuex": "^2.5.0", "vuex": "^3.0.1",
"vuex-router-sync": "^4.3.2", "vuex-router-sync": "^5.0.0",
"webpack": "^3.11.0", "webpack": "^4.5.0",
"webpack-cli": "^2.0.14",
"webpack-stats-plugin": "^0.2.1" "webpack-stats-plugin": "^0.2.1"
}, },
"devDependencies": { "devDependencies": {

View file

@ -1,5 +1,4 @@
import request from 'superagent'; import request from 'superagent';
import 'superagent-bluebird-promise';
export function fetchItem(service, type, id) { export function fetchItem(service, type, id) {
return request.get(`/${service}/${type}/${id}.json`); return request.get(`/${service}/${type}/${id}.json`);

View file

@ -75,6 +75,6 @@ module.exports = {
}); });
return `${JSON.stringify(manifest, null, 2)}\n`; return `${JSON.stringify(manifest, null, 2)}\n`;
}, },
}), })
], ],
}; };

View file

@ -2,6 +2,7 @@ const path = require('path');
const webpack = require('webpack'); const webpack = require('webpack');
module.exports = { module.exports = {
mode: "none",
target: 'node', target: 'node',
entry: './public/src/entry-server.js', entry: './public/src/entry-server.js',
output: { output: {

8740
yarn-error.log Normal file

File diff suppressed because it is too large Load diff

1901
yarn.lock

File diff suppressed because it is too large Load diff