checkPlugin: Use `updateDeps` to manage `engine`

pull/5323/head
Richard Hansen 2021-06-14 19:27:33 -04:00
parent f0ab112c2d
commit b7dce95802
1 changed files with 4 additions and 11 deletions

View File

@ -188,6 +188,10 @@ fs.readdir(pluginPath, (err, rootFiles) => {
'ep_etherpad-lite': {ver: '>=1.8.6', overwrite: false},
});
updateDeps(parsedPackageJSON, 'engines', {
node: '>=12.13.0',
});
if (packageJSON.toLowerCase().indexOf('eslintconfig') === -1) {
console.warn('No esLintConfig in package.json');
if (autoFix) {
@ -211,17 +215,6 @@ fs.readdir(pluginPath, (err, rootFiles) => {
writePackageJson(parsedPackageJSON);
}
}
if ((packageJSON.toLowerCase().indexOf('engines') === -1) || !parsedPackageJSON.engines.node) {
console.warn('No engines or node engine in package.json');
if (autoFix) {
const engines = {
node: '>=12.13.0',
};
parsedPackageJSON.engines = engines;
writePackageJson(parsedPackageJSON);
}
}
}
if (files.indexOf('package-lock.json') === -1) {