mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
🔥 Dropped Node v6 support (#10771)
no issue - Node v6 has come to EOL as of 2019-04-30 (ref. https://github.com/nodejs/Release#end-of-life-releases) - Removed Node v6 specific tests and code
This commit is contained in:
parent
525c2753ec
commit
acdcadc396
6 changed files with 10 additions and 58 deletions
|
@ -3,7 +3,6 @@ language: node_js
|
||||||
node_js:
|
node_js:
|
||||||
- '10'
|
- '10'
|
||||||
- '8'
|
- '8'
|
||||||
- '6'
|
|
||||||
cache: yarn
|
cache: yarn
|
||||||
services:
|
services:
|
||||||
- mysql
|
- mysql
|
||||||
|
|
|
@ -13,28 +13,15 @@ module.exports = {
|
||||||
try {
|
try {
|
||||||
return require('@tryghost/html-to-mobiledoc').toMobiledoc;
|
return require('@tryghost/html-to-mobiledoc').toMobiledoc;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (process.versions.node.startsWith('v6.')) {
|
return () => {
|
||||||
// NOTE: When Node v6 is dropped this code block should be removed
|
throw new common.errors.InternalServerError({
|
||||||
return () => {
|
message: 'Unable to convert from source HTML to Mobiledoc',
|
||||||
throw new common.errors.InternalServerError({
|
context: 'The html-to-mobiledoc package was not installed',
|
||||||
message: 'Unable to convert from source HTML to Mobiledoc',
|
help: 'Please review any errors from the install process by checking the Ghost logs',
|
||||||
context: 'The html-to-mobiledoc package was not installed',
|
code: 'HTML_TO_MOBILEDOC_INSTALLATION',
|
||||||
help: 'Please upgrade to Node.js v10',
|
err: err
|
||||||
code: 'HTML_TO_MOBILEDOC_INSTALLATION',
|
});
|
||||||
err: err
|
};
|
||||||
});
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
return () => {
|
|
||||||
throw new common.errors.InternalServerError({
|
|
||||||
message: 'Unable to convert from source HTML to Mobiledoc',
|
|
||||||
context: 'The html-to-mobiledoc package was not installed',
|
|
||||||
help: 'Please review any errors from the install process by checking the Ghost logs',
|
|
||||||
code: 'HTML_TO_MOBILEDOC_INSTALLATION',
|
|
||||||
err: err
|
|
||||||
});
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -173,11 +173,6 @@ describe('Posts API', function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('html to plaintext', function () {
|
it('html to plaintext', function () {
|
||||||
// NOTE: only supported in node v8 and higher
|
|
||||||
if (process.version.startsWith('v6.')) {
|
|
||||||
this.skip();
|
|
||||||
}
|
|
||||||
|
|
||||||
return request
|
return request
|
||||||
.get(localUtils.API.getApiQuery(`posts/${testUtils.DataGenerator.Content.posts[0].id}/`))
|
.get(localUtils.API.getApiQuery(`posts/${testUtils.DataGenerator.Content.posts[0].id}/`))
|
||||||
.set('Origin', config.get('url'))
|
.set('Origin', config.get('url'))
|
||||||
|
|
|
@ -371,13 +371,6 @@ describe('Unit: v2/utils/serializers/input/posts', function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Ensure html to mobiledoc conversion', function () {
|
describe('Ensure html to mobiledoc conversion', function () {
|
||||||
before(function () {
|
|
||||||
// NOTE: only supported in node v8 and higher
|
|
||||||
if (process.version.startsWith('v6.')) {
|
|
||||||
this.skip();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
it('no transformation when no html source option provided', function () {
|
it('no transformation when no html source option provided', function () {
|
||||||
const apiConfig = {};
|
const apiConfig = {};
|
||||||
const mobiledoc = '{"version":"0.3.1","atoms":[],"cards":[],"sections":[]}';
|
const mobiledoc = '{"version":"0.3.1","atoms":[],"cards":[],"sections":[]}';
|
||||||
|
|
|
@ -1,22 +0,0 @@
|
||||||
const should = require('should');
|
|
||||||
const converters = require('../../../../../server/lib/mobiledoc/converters');
|
|
||||||
|
|
||||||
describe('Unit: lib/mobiledoc/converters', function () {
|
|
||||||
describe('htmlToMobiledocConverter should be unsupported in node v6', function () {
|
|
||||||
before(function () {
|
|
||||||
if (!process.version.startsWith('v6.')) {
|
|
||||||
this.skip();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should throw when running on node v6', function () {
|
|
||||||
try {
|
|
||||||
const thrower = converters.htmlToMobiledocConverter();
|
|
||||||
thrower();
|
|
||||||
throw new Error('should not execute');
|
|
||||||
} catch (err) {
|
|
||||||
err.message.should.equal('Unable to convert from source HTML to Mobiledoc');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
|
@ -35,7 +35,7 @@
|
||||||
"postinstall": "cpy node_modules/@tryghost/members-theme-bindings/build/members-theme-bindings.js core/server/public/"
|
"postinstall": "cpy node_modules/@tryghost/members-theme-bindings/build/members-theme-bindings.js core/server/public/"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^6.9.0 || ^8.9.0 || ^10.13.0",
|
"node": "^8.9.0 || ^10.13.0",
|
||||||
"cli": "^1.9.0"
|
"cli": "^1.9.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
Loading…
Add table
Reference in a new issue