mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-05-01 15:33:57 +00:00
removed native module tooling
This commit is contained in:
3
.github/workflows/build-app-beta.yaml
vendored
3
.github/workflows/build-app-beta.yaml
vendored
@@ -47,9 +47,6 @@ jobs:
|
|||||||
yarn printSecrets
|
yarn printSecrets
|
||||||
env:
|
env:
|
||||||
GIST_UPLOAD_SECRET : ${{secrets.GIST_UPLOAD_SECRET}}
|
GIST_UPLOAD_SECRET : ${{secrets.GIST_UPLOAD_SECRET}}
|
||||||
- name: fillNativeModulesElectron
|
|
||||||
run: |
|
|
||||||
yarn fillNativeModulesElectron
|
|
||||||
- name: fillPackagedPlugins
|
- name: fillPackagedPlugins
|
||||||
run: |
|
run: |
|
||||||
yarn fillPackagedPlugins
|
yarn fillPackagedPlugins
|
||||||
|
|||||||
5
.github/workflows/build-app-pro-beta.yaml
vendored
5
.github/workflows/build-app-pro-beta.yaml
vendored
@@ -87,11 +87,6 @@ jobs:
|
|||||||
yarn printSecrets
|
yarn printSecrets
|
||||||
env:
|
env:
|
||||||
GIST_UPLOAD_SECRET : ${{secrets.GIST_UPLOAD_SECRET}}
|
GIST_UPLOAD_SECRET : ${{secrets.GIST_UPLOAD_SECRET}}
|
||||||
- name: fillNativeModulesElectron
|
|
||||||
run: |
|
|
||||||
cd ..
|
|
||||||
cd dbgate-merged
|
|
||||||
yarn fillNativeModulesElectron
|
|
||||||
- name: fillPackagedPlugins
|
- name: fillPackagedPlugins
|
||||||
run: |
|
run: |
|
||||||
cd ..
|
cd ..
|
||||||
|
|||||||
5
.github/workflows/build-app-pro.yaml
vendored
5
.github/workflows/build-app-pro.yaml
vendored
@@ -88,11 +88,6 @@ jobs:
|
|||||||
yarn printSecrets
|
yarn printSecrets
|
||||||
env:
|
env:
|
||||||
GIST_UPLOAD_SECRET : ${{secrets.GIST_UPLOAD_SECRET}}
|
GIST_UPLOAD_SECRET : ${{secrets.GIST_UPLOAD_SECRET}}
|
||||||
- name: fillNativeModulesElectron
|
|
||||||
run: |
|
|
||||||
cd ..
|
|
||||||
cd dbgate-merged
|
|
||||||
yarn fillNativeModulesElectron
|
|
||||||
- name: fillPackagedPlugins
|
- name: fillPackagedPlugins
|
||||||
run: |
|
run: |
|
||||||
cd ..
|
cd ..
|
||||||
|
|||||||
3
.github/workflows/build-app.yaml
vendored
3
.github/workflows/build-app.yaml
vendored
@@ -50,9 +50,6 @@ jobs:
|
|||||||
yarn printSecrets
|
yarn printSecrets
|
||||||
env:
|
env:
|
||||||
GIST_UPLOAD_SECRET : ${{secrets.GIST_UPLOAD_SECRET}}
|
GIST_UPLOAD_SECRET : ${{secrets.GIST_UPLOAD_SECRET}}
|
||||||
- name: fillNativeModulesElectron
|
|
||||||
run: |
|
|
||||||
yarn fillNativeModulesElectron
|
|
||||||
- name: fillPackagedPlugins
|
- name: fillPackagedPlugins
|
||||||
run: |
|
run: |
|
||||||
yarn fillPackagedPlugins
|
yarn fillPackagedPlugins
|
||||||
|
|||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -28,8 +28,6 @@ docker/plugins
|
|||||||
npm-debug.log*
|
npm-debug.log*
|
||||||
yarn-debug.log*
|
yarn-debug.log*
|
||||||
yarn-error.log*
|
yarn-error.log*
|
||||||
app/src/nativeModulesContent.js
|
|
||||||
packages/api/src/nativeModulesContent.js
|
|
||||||
packages/api/src/packagedPluginsContent.js
|
packages/api/src/packagedPluginsContent.js
|
||||||
.VSCodeCounter
|
.VSCodeCounter
|
||||||
|
|
||||||
|
|||||||
@@ -430,7 +430,6 @@ function createWindow() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
global.API_PACKAGE = apiPackage;
|
global.API_PACKAGE = apiPackage;
|
||||||
global.NATIVE_MODULES = path.join(__dirname, 'nativeModules');
|
|
||||||
|
|
||||||
// console.log('global.API_PACKAGE', global.API_PACKAGE);
|
// console.log('global.API_PACKAGE', global.API_PACKAGE);
|
||||||
const api = require(apiPackage);
|
const api = require(apiPackage);
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
const content = require('./nativeModulesContent');
|
|
||||||
|
|
||||||
module.exports = content;
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
const fs = require('fs');
|
|
||||||
|
|
||||||
let fillContent = '';
|
|
||||||
|
|
||||||
if (process.platform == 'win32') {
|
|
||||||
fillContent += `content.msnodesqlv8 = () => require('msnodesqlv8');\n`;
|
|
||||||
}
|
|
||||||
fillContent += `content['better-sqlite3'] = () => require('better-sqlite3');\n`;
|
|
||||||
fillContent += `content['oracledb'] = () => require('oracledb');\n`;
|
|
||||||
|
|
||||||
const getContent = empty => `
|
|
||||||
// this file is generated automatically by script fillNativeModules.js, do not edit it manually
|
|
||||||
const content = {};
|
|
||||||
|
|
||||||
${empty ? '' : fillContent}
|
|
||||||
|
|
||||||
module.exports = content;
|
|
||||||
`;
|
|
||||||
|
|
||||||
fs.writeFileSync(
|
|
||||||
'packages/api/src/nativeModulesContent.js',
|
|
||||||
getContent(process.argv.includes('--electron') ? true : false)
|
|
||||||
);
|
|
||||||
fs.writeFileSync('app/src/nativeModulesContent.js', getContent(false));
|
|
||||||
@@ -47,8 +47,6 @@
|
|||||||
"printSecrets": "node printSecrets",
|
"printSecrets": "node printSecrets",
|
||||||
"generatePadFile": "node generatePadFile",
|
"generatePadFile": "node generatePadFile",
|
||||||
"adjustPackageJson": "node adjustPackageJson",
|
"adjustPackageJson": "node adjustPackageJson",
|
||||||
"fillNativeModules": "node fillNativeModules",
|
|
||||||
"fillNativeModulesElectron": "node fillNativeModules --electron",
|
|
||||||
"fillPackagedPlugins": "node fillPackagedPlugins",
|
"fillPackagedPlugins": "node fillPackagedPlugins",
|
||||||
"resetPackagedPlugins": "node resetPackagedPlugins",
|
"resetPackagedPlugins": "node resetPackagedPlugins",
|
||||||
"prettier": "prettier --write packages/api/src && prettier --write packages/datalib/src && prettier --write packages/filterparser/src && prettier --write packages/sqltree/src && prettier --write packages/tools/src && prettier --write packages/types && prettier --write packages/web/src && prettier --write app/src",
|
"prettier": "prettier --write packages/api/src && prettier --write packages/datalib/src && prettier --write packages/filterparser/src && prettier --write packages/sqltree/src && prettier --write packages/tools/src && prettier --write packages/types && prettier --write packages/web/src && prettier --write app/src",
|
||||||
@@ -62,7 +60,7 @@
|
|||||||
"ts:api": "yarn workspace dbgate-api ts",
|
"ts:api": "yarn workspace dbgate-api ts",
|
||||||
"ts:web": "yarn workspace dbgate-web ts",
|
"ts:web": "yarn workspace dbgate-web ts",
|
||||||
"ts": "yarn ts:api && yarn ts:web",
|
"ts": "yarn ts:api && yarn ts:web",
|
||||||
"postinstall": "yarn resetPackagedPlugins && yarn build:lib && patch-package && yarn fillNativeModules && yarn build:plugins:frontend",
|
"postinstall": "yarn resetPackagedPlugins && yarn build:lib && patch-package && yarn build:plugins:frontend",
|
||||||
"dbgate-serve": "node packages/dbgate/bin/dbgate-serve.js"
|
"dbgate-serve": "node packages/dbgate/bin/dbgate-serve.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
const argIndex = process.argv.indexOf('--native-modules');
|
|
||||||
const redirectFile = global['NATIVE_MODULES'] || (argIndex > 0 ? process.argv[argIndex + 1] : null);
|
|
||||||
|
|
||||||
function requireDynamic(file) {
|
|
||||||
try {
|
|
||||||
// @ts-ignore
|
|
||||||
return __non_webpack_require__(redirectFile);
|
|
||||||
} catch (err) {
|
|
||||||
return require(redirectFile);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = redirectFile ? requireDynamic(redirectFile) : require('./nativeModulesContent');
|
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
const path = require('path');
|
const path = require('path');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const { pluginsdir, packagedPluginsDir, getPluginBackendPath } = require('../utility/directories');
|
const { pluginsdir, packagedPluginsDir, getPluginBackendPath } = require('../utility/directories');
|
||||||
const nativeModules = require('../nativeModules');
|
|
||||||
const platformInfo = require('../utility/platformInfo');
|
const platformInfo = require('../utility/platformInfo');
|
||||||
const authProxy = require('../utility/authProxy');
|
const authProxy = require('../utility/authProxy');
|
||||||
const { getLogger } = require('dbgate-tools');
|
const { getLogger } = require('dbgate-tools');
|
||||||
@@ -11,7 +10,6 @@ const loadedPlugins = {};
|
|||||||
|
|
||||||
const dbgateEnv = {
|
const dbgateEnv = {
|
||||||
dbgateApi: null,
|
dbgateApi: null,
|
||||||
nativeModules,
|
|
||||||
platformInfo,
|
platformInfo,
|
||||||
authProxy,
|
authProxy,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -17,9 +17,6 @@ const listenApiChild = process.argv.includes('--listen-api-child') || listenApi;
|
|||||||
|
|
||||||
function getPassArgs() {
|
function getPassArgs() {
|
||||||
const res = [];
|
const res = [];
|
||||||
if (global['NATIVE_MODULES']) {
|
|
||||||
res.push('--native-modules', global['NATIVE_MODULES']);
|
|
||||||
}
|
|
||||||
if (global['PLUGINS_DIR']) {
|
if (global['PLUGINS_DIR']) {
|
||||||
res.push('--plugins-dir', global['PLUGINS_DIR']);
|
res.push('--plugins-dir', global['PLUGINS_DIR']);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user