2
1
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2023-12-13 21:00:40 +01: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:
Naz Gargol 2019-06-03 14:20:23 +02:00 committed by GitHub
parent 525c2753ec
commit acdcadc396
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 10 additions and 58 deletions

View file

@ -3,7 +3,6 @@ language: node_js
node_js:
- '10'
- '8'
- '6'
cache: yarn
services:
- mysql

View file

@ -13,28 +13,15 @@ module.exports = {
try {
return require('@tryghost/html-to-mobiledoc').toMobiledoc;
} catch (err) {
if (process.versions.node.startsWith('v6.')) {
// NOTE: When Node v6 is dropped this code block should be removed
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 upgrade to Node.js v10',
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
});
};
}
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
});
};
}
}
};

View file

@ -173,11 +173,6 @@ describe('Posts API', function () {
});
it('html to plaintext', function () {
// NOTE: only supported in node v8 and higher
if (process.version.startsWith('v6.')) {
this.skip();
}
return request
.get(localUtils.API.getApiQuery(`posts/${testUtils.DataGenerator.Content.posts[0].id}/`))
.set('Origin', config.get('url'))

View file

@ -371,13 +371,6 @@ describe('Unit: v2/utils/serializers/input/posts', 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 () {
const apiConfig = {};
const mobiledoc = '{"version":"0.3.1","atoms":[],"cards":[],"sections":[]}';

View file

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

View file

@ -35,7 +35,7 @@
"postinstall": "cpy node_modules/@tryghost/members-theme-bindings/build/members-theme-bindings.js core/server/public/"
},
"engines": {
"node": "^6.9.0 || ^8.9.0 || ^10.13.0",
"node": "^8.9.0 || ^10.13.0",
"cli": "^1.9.0"
},
"dependencies": {