mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-05-02 18:23:59 +00:00
centralized dependencies
This commit is contained in:
@@ -1,10 +1,34 @@
|
|||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
function adjustFile(file) {
|
function adjustFile(file) {
|
||||||
const json = JSON.parse(fs.readFileSync(file, { encoding: 'utf-8' }));
|
const json = JSON.parse(fs.readFileSync(file, { encoding: 'utf-8' }));
|
||||||
|
|
||||||
|
for (const packageName of fs.readdirSync('plugins')) {
|
||||||
|
if (!packageName.startsWith('dbgate-plugin-')) continue;
|
||||||
|
const pluginJson = JSON.parse(
|
||||||
|
fs.readFileSync(path.join('plugins', packageName, 'package.json'), { encoding: 'utf-8' })
|
||||||
|
);
|
||||||
|
for (const depkey of ['dependencies', 'optionalDependencies']) {
|
||||||
|
for (const dependency of Object.keys(pluginJson[depkey] || {})) {
|
||||||
|
if (!json[depkey]) {
|
||||||
|
json[depkey] = {};
|
||||||
|
}
|
||||||
|
if (json[depkey][dependency]) {
|
||||||
|
if (json[depkey][dependency] != pluginJson[depkey][dependency]) {
|
||||||
|
console.log(`Dependency ${dependency} in ${packageName} is different from ${file}`);
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
json[depkey][dependency] = pluginJson[depkey][dependency];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (process.platform != 'win32') {
|
if (process.platform != 'win32') {
|
||||||
delete json.optionalDependencies.msnodesqlv8;
|
delete json.optionalDependencies.msnodesqlv8;
|
||||||
}
|
}
|
||||||
|
|
||||||
fs.writeFileSync(file, JSON.stringify(json, null, 2), 'utf-8');
|
fs.writeFileSync(file, JSON.stringify(json, null, 2), 'utf-8');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@aws-sdk/rds-signer": "^3.665.0",
|
"@aws-sdk/rds-signer": "^3.665.0",
|
||||||
"activedirectory2": "^2.1.0",
|
"activedirectory2": "^2.1.0",
|
||||||
"async-lock": "^1.2.4",
|
"async-lock": "^1.2.6",
|
||||||
"axios": "^0.21.1",
|
"axios": "^0.21.1",
|
||||||
"body-parser": "^1.19.0",
|
"body-parser": "^1.19.0",
|
||||||
"bufferutil": "^4.0.1",
|
"bufferutil": "^4.0.1",
|
||||||
|
|||||||
Reference in New Issue
Block a user