Skip to content

Instantly share code, notes, and snippets.

@heycalmdown
Created September 18, 2018 03:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save heycalmdown/7d132f2dab3a1687f12d000adc9b2b24 to your computer and use it in GitHub Desktop.
Save heycalmdown/7d132f2dab3a1687f12d000adc9b2b24 to your computer and use it in GitHub Desktop.
const json = require('./package.json');
Object.keys(json.dependencies).forEach(i => {
if (isInHousePackage(i)) {
json.dependencies[i] = 'next';
}
});
Object.keys(json.devDependencies).forEach(i => {
if (isInHousePackage(i)) {
json.devDependencies[i] = 'next';
}
});
const fs = require('fs');
fs.writeFileSync('./package.json', JSON.stringify(json, null, 2) + '\n');
function isInHousePackage(line) {
const inHousePackages = [
'binary-jwt',
'consul-lb',
'distlock',
'dns-consul',
'game-publisher',
'game-publisher-nexon',
'game-publisher-tencent',
'island',
'island-base',
'island-di',
'island-endpoint-tester',
'island-keeper',
'island-loggers',
'island-status-exporter',
'island-status-transfer',
'mongoose-transaction-plugin',
'redis-bluebird',
'tencent-aas',
'tencent-c4b',
'tencent-dirapi',
'tencent-itc',
'tencent-oidbcomm',
'tencent-sigapi',
'tencent-tss'
];
return inHousePackages.some(p => line.indexOf(p) !== -1);
}
// vim: sw=2 sts=2 ts=2 et
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment