From 968e69c7f25c619a18f0cb0f07ea2e9e8fe4b15c Mon Sep 17 00:00:00 2001 From: Jan Prochazka Date: Tue, 20 Aug 2024 12:18:55 +0200 Subject: [PATCH] DBGATE_TOOLS => DBGATE_PACKAGES --- integration-tests/tools.js | 28 +++++++++++-------- integration-tests/wait.js | 5 +++- packages/api/src/index.js | 6 ++-- .../web/src/plugins/PluginsProvider.svelte | 6 +++- .../dbgate-plugin-csv/src/backend/writer.js | 2 +- .../webpack-frontend.config.js | 2 +- .../webpack-frontend.config.js | 2 +- .../src/backend/createBulkInsertStream.js | 2 +- .../src/frontend/Dumper.js | 2 +- .../src/frontend/driver.js | 2 +- .../webpack-frontend.config.js | 2 +- .../src/frontend/MsSqlDumper.js | 2 +- .../src/frontend/driver.js | 2 +- .../webpack-frontend.config.js | 2 +- .../src/backend/drivers.js | 2 +- .../src/frontend/Dumper.js | 2 +- .../src/frontend/drivers.js | 2 +- .../webpack-frontend.config.js | 2 +- .../src/frontend/Dumper.js | 2 +- .../src/frontend/driver.js | 2 +- .../webpack-frontend.config.js | 2 +- .../src/backend/drivers.js | 2 +- .../src/frontend/Dumper.js | 2 +- .../src/frontend/drivers.js | 2 +- .../webpack-frontend.config.js | 2 +- .../src/frontend/driver.js | 2 +- .../src/backend/driver.js | 2 +- .../src/frontend/Dumper.js | 2 +- .../src/frontend/driver.js | 2 +- .../webpack-frontend.config.js | 2 +- .../dbgate-plugin-xml/src/backend/reader.js | 2 +- .../dbgate-plugin-xml/src/backend/writer.js | 2 +- 32 files changed, 58 insertions(+), 43 deletions(-) diff --git a/integration-tests/tools.js b/integration-tests/tools.js index 821ea7eb..846c2765 100644 --- a/integration-tests/tools.js +++ b/integration-tests/tools.js @@ -1,4 +1,8 @@ -global.DBGATE_TOOLS = require('dbgate-tools'); +global.DBGATE_PACKAGES = { + 'dbgate-tools': require('dbgate-tools'), + 'dbgate-sqltree': require('dbgate-sqltree'), +}; + const requireEngineDriver = require('dbgate-api/src/utility/requireEngineDriver'); const crypto = require('crypto'); @@ -44,16 +48,18 @@ async function connect(engine, database) { } } -const testWrapper = body => async (label, ...other) => { - const engine = other[other.length - 1]; - const driver = requireEngineDriver(engine.connection); - const conn = await connect(engine, randomDbName()); - try { - await body(conn, driver, ...other); - } finally { - await driver.close(conn); - } -}; +const testWrapper = + body => + async (label, ...other) => { + const engine = other[other.length - 1]; + const driver = requireEngineDriver(engine.connection); + const conn = await connect(engine, randomDbName()); + try { + await body(conn, driver, ...other); + } finally { + await driver.close(conn); + } + }; module.exports = { randomDbName, diff --git a/integration-tests/wait.js b/integration-tests/wait.js index ae3a6f09..a61339bb 100644 --- a/integration-tests/wait.js +++ b/integration-tests/wait.js @@ -1,7 +1,10 @@ const requireEngineDriver = require('dbgate-api/src/utility/requireEngineDriver'); const engines = require('./engines'); const { extractConnection } = require('./tools'); -global.DBGATE_TOOLS = require('dbgate-tools'); +global.DBGATE_PACKAGES = { + 'dbgate-tools': require('dbgate-tools'), + 'dbgate-sqltree': require('dbgate-sqltree'), +}; async function connectEngine(engine) { const connection = extractConnection(engine); diff --git a/packages/api/src/index.js b/packages/api/src/index.js index e75101be..4a9f78f2 100644 --- a/packages/api/src/index.js +++ b/packages/api/src/index.js @@ -97,10 +97,12 @@ if (processArgs.listenApi) { } const shell = require('./shell/index'); -const dbgateTools = require('dbgate-tools'); const currentVersion = require('./currentVersion'); -global['DBGATE_TOOLS'] = dbgateTools; +global.DBGATE_PACKAGES = { + 'dbgate-tools': require('dbgate-tools'), + 'dbgate-sqltree': require('dbgate-sqltree'), +}; if (processArgs.startProcess) { const proc = require('./proc'); diff --git a/packages/web/src/plugins/PluginsProvider.svelte b/packages/web/src/plugins/PluginsProvider.svelte index 42a10bce..7524f79e 100644 --- a/packages/web/src/plugins/PluginsProvider.svelte +++ b/packages/web/src/plugins/PluginsProvider.svelte @@ -1,6 +1,9 @@