Remove unnecessary bluebird dependency
This commit is contained in:
parent
b87476abc9
commit
42b6cd5a32
9 changed files with 10437 additions and 231 deletions
|
@ -1,6 +1,5 @@
|
|||
import { parse } from 'url';
|
||||
import request from 'superagent';
|
||||
import 'superagent-bluebird-promise';
|
||||
import debuglog from 'debug';
|
||||
import urlMatch from './url';
|
||||
|
||||
|
@ -49,7 +48,7 @@ function looseMatch(needle, haystack, type, various) {
|
|||
export function* lookupId(id, type) {
|
||||
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) {
|
||||
const error = new Error('Not Found');
|
||||
error.status = 404;
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import { parse } from 'url';
|
||||
import querystring from 'querystring';
|
||||
import request from 'superagent';
|
||||
import 'superagent-bluebird-promise';
|
||||
import urlMatch from './url';
|
||||
|
||||
const apiRoot = 'https://itunes.apple.com';
|
||||
|
|
|
@ -3,7 +3,6 @@ import querystring from 'querystring';
|
|||
import request from 'superagent';
|
||||
import Nodebrainz from 'nodebrainz';
|
||||
import { toSeconds, parse as ptParse } from 'iso8601-duration';
|
||||
import 'superagent-bluebird-promise';
|
||||
import debuglog from 'debug';
|
||||
import urlMatch from './url';
|
||||
|
||||
|
@ -30,7 +29,7 @@ const apiRoot = 'https://www.googleapis.com/youtube/v3';
|
|||
export function* lookupId(id) {
|
||||
const path = `/videos?part=snippet%2CcontentDetails&id=${id}&key=${credentials.key}`;
|
||||
try {
|
||||
const result = yield request.get(apiRoot + path).promise();
|
||||
const result = yield request.get(apiRoot + path);
|
||||
const item = result.body.items[0].snippet;
|
||||
|
||||
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 result = yield request.get(apiRoot + path).promise();
|
||||
const result = yield request.get(apiRoot + path);
|
||||
const item = result.body.items[0];
|
||||
|
||||
if (!item) {
|
||||
|
|
14
package.json
14
package.json
|
@ -4,7 +4,7 @@
|
|||
"repository": "https://github.com/kudos/match.audio",
|
||||
"license": "MIT",
|
||||
"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",
|
||||
"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",
|
||||
|
@ -33,7 +33,7 @@
|
|||
"css-loader": "^0.28.11",
|
||||
"debug": "^3.1.0",
|
||||
"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",
|
||||
"iso8601-duration": "^1.1.1",
|
||||
"kcors": "^1.3.3",
|
||||
|
@ -58,16 +58,16 @@
|
|||
"spotify-web-api-node": "^3.0.0",
|
||||
"style-loader": "^0.20.3",
|
||||
"superagent": "^3.8.2",
|
||||
"superagent-bluebird-promise": "^4.2.0",
|
||||
"uglifyjs-webpack-plugin": "^1.2.4",
|
||||
"vue": "^2.5.16",
|
||||
"vue-loader": "^14.2.2",
|
||||
"vue-router": "^2.8.1",
|
||||
"vue-router": "^3.0.1",
|
||||
"vue-server-renderer": "^2.5.16",
|
||||
"vue-template-compiler": "^2.5.16",
|
||||
"vuex": "^2.5.0",
|
||||
"vuex-router-sync": "^4.3.2",
|
||||
"webpack": "^3.11.0",
|
||||
"vuex": "^3.0.1",
|
||||
"vuex-router-sync": "^5.0.0",
|
||||
"webpack": "^4.5.0",
|
||||
"webpack-cli": "^2.0.14",
|
||||
"webpack-stats-plugin": "^0.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import request from 'superagent';
|
||||
import 'superagent-bluebird-promise';
|
||||
|
||||
export function fetchItem(service, type, id) {
|
||||
return request.get(`/${service}/${type}/${id}.json`);
|
||||
|
|
|
@ -75,6 +75,6 @@ module.exports = {
|
|||
});
|
||||
return `${JSON.stringify(manifest, null, 2)}\n`;
|
||||
},
|
||||
}),
|
||||
})
|
||||
],
|
||||
};
|
||||
|
|
|
@ -2,6 +2,7 @@ const path = require('path');
|
|||
const webpack = require('webpack');
|
||||
|
||||
module.exports = {
|
||||
mode: "none",
|
||||
target: 'node',
|
||||
entry: './public/src/entry-server.js',
|
||||
output: {
|
||||
|
|
8740
yarn-error.log
Normal file
8740
yarn-error.log
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue