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:
Halldor Thorhallsson 2022-10-31 15:30:18 -04:00 committed by GitHub
parent 8cde26f986
commit 79c80f28cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 4 additions and 13 deletions

View File

@ -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 = {}) => {

View File

@ -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');

View File

@ -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');

View File

@ -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');

View File

@ -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');

View File

@ -18,7 +18,6 @@
"lib"
],
"devDependencies": {
"bluebird": "3.7.2",
"c8": "7.12.0",
"mocha": "10.1.0",
"should": "13.2.3",

View File

@ -1,5 +1,4 @@
const errors = require('@tryghost/errors');
const Promise = require('bluebird');
const sinon = require('sinon');
const shared = require('../../');

View File

@ -1,5 +1,4 @@
const errors = require('@tryghost/errors');
const Promise = require('bluebird');
const sinon = require('sinon');
const shared = require('../../');

View File

@ -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);
});

View File

@ -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);