Created
September 18, 2018 03:09
-
-
Save heycalmdown/7d132f2dab3a1687f12d000adc9b2b24 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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