Removed bluebird from api-framework
module (#15685)
refs: https://github.com/TryGhost/Ghost/issues/14882 - Removing bluebird specific methods in favour of the Ghost sequence method so we can remove the bluebird dependency
This commit is contained in:
parent
8cde26f986
commit
79c80f28cc
@ -1,6 +1,5 @@
|
||||
const url = require('url');
|
||||
const debug = require('@tryghost/debug')('headers');
|
||||
const Promise = require('bluebird');
|
||||
const INVALIDATE_ALL = '/*';
|
||||
|
||||
const cacheInvalidate = (result, options = {}) => {
|
||||
|
@ -1,5 +1,4 @@
|
||||
const debug = require('@tryghost/debug')('pipeline');
|
||||
const Promise = require('bluebird');
|
||||
const _ = require('lodash');
|
||||
const errors = require('@tryghost/errors');
|
||||
const {sequence} = require('@tryghost/promise');
|
||||
|
@ -1,5 +1,4 @@
|
||||
const debug = require('@tryghost/debug')('serializers:handle');
|
||||
const Promise = require('bluebird');
|
||||
const {sequence} = require('@tryghost/promise');
|
||||
const errors = require('@tryghost/errors');
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
const debug = require('@tryghost/debug')('validators:handle');
|
||||
const Promise = require('bluebird');
|
||||
const errors = require('@tryghost/errors');
|
||||
const {sequence} = require('@tryghost/promise');
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
const debug = require('@tryghost/debug')('validators:input:all');
|
||||
const _ = require('lodash');
|
||||
const Promise = require('bluebird');
|
||||
const tpl = require('@tryghost/tpl');
|
||||
const {BadRequestError, ValidationError} = require('@tryghost/errors');
|
||||
const validator = require('@tryghost/validator');
|
||||
|
@ -18,7 +18,6 @@
|
||||
"lib"
|
||||
],
|
||||
"devDependencies": {
|
||||
"bluebird": "3.7.2",
|
||||
"c8": "7.12.0",
|
||||
"mocha": "10.1.0",
|
||||
"should": "13.2.3",
|
||||
|
@ -1,5 +1,4 @@
|
||||
const errors = require('@tryghost/errors');
|
||||
const Promise = require('bluebird');
|
||||
const sinon = require('sinon');
|
||||
const shared = require('../../');
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
const errors = require('@tryghost/errors');
|
||||
const Promise = require('bluebird');
|
||||
const sinon = require('sinon');
|
||||
const shared = require('../../');
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
const errors = require('@tryghost/errors');
|
||||
const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const Promise = require('bluebird');
|
||||
const shared = require('../../../');
|
||||
|
||||
describe('validators/input/all', function () {
|
||||
@ -148,7 +147,7 @@ describe('validators/input/all', function () {
|
||||
};
|
||||
|
||||
return shared.validators.input.all.all(apiConfig, frame)
|
||||
.then(Promise.reject)
|
||||
.then(Promise.reject.bind(Promise))
|
||||
.catch((err) => {
|
||||
should.not.exist(err);
|
||||
});
|
||||
@ -169,7 +168,7 @@ describe('validators/input/all', function () {
|
||||
};
|
||||
|
||||
return shared.validators.input.all.all(apiConfig, frame)
|
||||
.then(Promise.reject)
|
||||
.then(Promise.reject.bind(Promise))
|
||||
.catch((err) => {
|
||||
should.not.exist(err);
|
||||
});
|
||||
|
@ -168,7 +168,7 @@ function sendWelcomeEmail(email, mailAPI) {
|
||||
};
|
||||
|
||||
return mail.utils.generateContent({data: data, template: 'welcome'})
|
||||
.then((content) => {
|
||||
.then(async (content) => {
|
||||
const message = {
|
||||
to: email,
|
||||
subject: tpl(messages.yourNewGhostBlog),
|
||||
@ -183,7 +183,7 @@ function sendWelcomeEmail(email, mailAPI) {
|
||||
}]
|
||||
};
|
||||
|
||||
mailAPI.send(payload, {context: {internal: true}})
|
||||
await mailAPI.send(payload, {context: {internal: true}})
|
||||
.catch((err) => {
|
||||
err.context = tpl(messages.unableToSendWelcomeEmail);
|
||||
logging.error(err);
|
||||
|
Loading…
Reference in New Issue
Block a user