diff --git a/app/package.json b/app/package.json index 43b451d9d..03e1965f3 100644 --- a/app/package.json +++ b/app/package.json @@ -71,7 +71,7 @@ "build": "cd ../packages/api && yarn build && cd ../web && yarn build && cd ../../app && yarn dist", "build:local": "cd ../packages/api && yarn build && cd ../web && yarn build && cd ../../app && yarn predist", "postinstall": "electron-builder install-app-deps", - "predist": "copyfiles ../packages/api/dist/* packages && copyfiles \"../packages/web/public/*\" packages && copyfiles \"../packages/web/public/**/*\" packages" + "predist": "copyfiles ../packages/api/dist/* packages && copyfiles \"../packages/web/public/*\" packages && copyfiles \"../packages/web/public/**/*\" packages && copyup \"../plugins/dist/**\" packages" }, "main": "src/electron.js", "devDependencies": { diff --git a/package.json b/package.json index 8d045e427..c23d077b0 100644 --- a/package.json +++ b/package.json @@ -20,13 +20,13 @@ "build:filterparser": "yarn workspace dbgate-filterparser build", "build:tools": "yarn workspace dbgate-tools build", "build:lib": "yarn build:tools && yarn build:sqltree && yarn build:filterparser && yarn build:datalib", - "build:app": "cd app && yarn install && yarn build", + "build:app": "yarn plugins:copydist && cd app && yarn install && yarn build", "build:api": "yarn workspace dbgate-api build", "build:web:docker": "yarn workspace dbgate-web build", "build:plugins:frontend": "workspaces-run --only=\"dbgate-plugin-*\" -- yarn build:frontend", "build:plugins:frontend:watch": "workspaces-run --parallel --only=\"dbgate-plugin-*\" -- yarn build:frontend:watch", "plugins:copydist": "workspaces-run --only=\"dbgate-plugin-*\" -- yarn copydist", - "build:app:local": "cd app && yarn build:local", + "build:app:local": "yarn plugins:copydist && cd app && yarn build:local", "start:app:local": "cd app && yarn start:local", "setCurrentVersion": "node setCurrentVersion", "generatePadFile": "node generatePadFile", diff --git a/packages/api/src/controllers/plugins.js b/packages/api/src/controllers/plugins.js index 3a4e344e7..5c81a366a 100644 --- a/packages/api/src/controllers/plugins.js +++ b/packages/api/src/controllers/plugins.js @@ -99,6 +99,7 @@ module.exports = { const res = []; for (const packageName of _.union(files1, files2)) { + if (!/^dbgate-plugin-.*$/.test(packageName)) continue; const isPackaged = files1.includes(packageName); const manifest = await fs .readFile(path.join(isPackaged ? packagedPluginsDir() : pluginsdir(), packageName, 'package.json'), { diff --git a/packages/api/src/utility/directories.js b/packages/api/src/utility/directories.js index 0f9e3c564..0d5540fe1 100644 --- a/packages/api/src/utility/directories.js +++ b/packages/api/src/utility/directories.js @@ -44,7 +44,7 @@ function packagedPluginsDir() { if (_isRunOnSource()) { return path.resolve(__dirname, '../../../../plugins'); } - return path.resolve(__dirname, '../plugins'); + return path.resolve(__dirname, '../../plugins/dist'); } module.exports = { diff --git a/packages/web/src/plugins/PluginsList.js b/packages/web/src/plugins/PluginsList.js deleted file mode 100644 index 5fb4e197a..000000000 --- a/packages/web/src/plugins/PluginsList.js +++ /dev/null @@ -1,87 +0,0 @@ -// import React from 'react'; -// import styled from 'styled-components'; -// import useTheme from '../theme/useTheme'; -// import { useSetOpenedTabs } from '../utility/globalState'; -// import { extractPluginIcon, extractPluginAuthor } from '../plugins/manifestExtractors'; -// import useOpenNewTab from '../utility/useOpenNewTab'; - -// const Wrapper = styled.div` -// margin: 1px 3px 10px 5px; -// display: flex; -// align-items: center; -// &:hover { -// background-color: ${props => props.theme.left_background_blue[1]}; -// } -// `; - -// const Texts = styled.div` -// margin-left: 10px; -// `; - -// const Name = styled.div` -// font-weight: bold; -// `; - -// const Line = styled.div` -// display: flex; -// `; - -// const Icon = styled.img` -// width: 50px; -// height: 50px; -// `; - -// const Description = styled.div` -// font-style: italic; -// `; - -// const Author = styled.div` -// font-weight: bold; -// `; - -// const Version = styled.div` -// margin-left: 5px; -// `; - -// function openPlugin(openNewTab, packageManifest) { -// openNewTab({ -// title: packageManifest.name, -// icon: 'icon plugin', -// tabComponent: 'PluginTab', -// props: { -// packageName: packageManifest.name, -// }, -// }); -// } - -// function PluginsListItem({ packageManifest }) { -// const openNewTab = useOpenNewTab(); -// const theme = useTheme(); -// return ( -// openPlugin(openNewTab, packageManifest)} theme={theme}> -// -// -// -// {packageManifest.name} -// {packageManifest.version} -// -// -// {packageManifest.description} -// -// -// {extractPluginAuthor(packageManifest)} -// -// -// -// ); -// } - -// export default function PluginsList({ plugins }) { -// return ( -// <> -// {plugins.map(packageManifest => ( -// -// ))} -// -// ); -// } diff --git a/packages/web/src/plugins/manifestExtractors.ts b/packages/web/src/plugins/manifestExtractors.ts index aa51184df..dd6e0d310 100644 --- a/packages/web/src/plugins/manifestExtractors.ts +++ b/packages/web/src/plugins/manifestExtractors.ts @@ -11,6 +11,10 @@ export function extractPluginIcon(packageManifest) { if (match) { return `https://raw.githubusercontent.com/${match[1]}/${match[2]}/master/icon.svg`; } + + if (tested == 'https://dbgate.org') { + return `https://github.com/dbgate/dbgate/raw/master/plugins/${packageManifest.name}/icon.svg`; + } } return 'unknown.svg'; } diff --git a/plugins/dbgate-plugin-csv/package.json b/plugins/dbgate-plugin-csv/package.json index 98068313d..47d3af43d 100644 --- a/plugins/dbgate-plugin-csv/package.json +++ b/plugins/dbgate-plugin-csv/package.json @@ -2,13 +2,12 @@ "name": "dbgate-plugin-csv", "main": "dist/backend.js", "version": "1.0.9", - "homepage": "https://github.com/dbgate/dbgate-plugin-csv", + "homepage": "https://dbgate.org", "description": "CSV import/export plugin for DbGate", "repository": { "type": "git", - "url": "https://github.com/dbgate/dbgate-plugin-csv.git" + "url": "https://github.com/dbgate/dbgate" }, - "funding": "https://www.paypal.com/paypalme/JanProchazkaCz/30eur", "author": "Jan Prochazka", "license": "GPL", "keywords": [ @@ -19,7 +18,8 @@ "dbgateplugin" ], "files": [ - "dist" + "dist", + "icon.svg" ], "scripts": { "build:frontend": "webpack --config webpack-frontend.config", diff --git a/plugins/dbgate-plugin-excel/package.json b/plugins/dbgate-plugin-excel/package.json index 39efaf549..711dc1035 100644 --- a/plugins/dbgate-plugin-excel/package.json +++ b/plugins/dbgate-plugin-excel/package.json @@ -2,13 +2,12 @@ "name": "dbgate-plugin-excel", "main": "dist/backend.js", "version": "1.0.8", - "homepage": "https://github.com/dbgate/dbgate-plugin-excel", "description": "MS Excel import/export plugin for DbGate", + "homepage": "https://dbgate.org", "repository": { "type": "git", - "url": "https://github.com/dbgate/dbgate-plugin-excel.git" + "url": "https://github.com/dbgate/dbgate" }, - "funding": "https://www.paypal.com/paypalme/JanProchazkaCz/30eur", "author": "Jan Prochazka", "license": "GPL", "keywords": [ @@ -19,7 +18,8 @@ "dbgateplugin" ], "files": [ - "dist" + "dist", + "icon.svg" ], "scripts": { "build:frontend": "webpack --config webpack-frontend.config", diff --git a/plugins/dbgate-plugin-mongo/package.json b/plugins/dbgate-plugin-mongo/package.json index 2ed7ce36f..02abf66a1 100644 --- a/plugins/dbgate-plugin-mongo/package.json +++ b/plugins/dbgate-plugin-mongo/package.json @@ -4,9 +4,12 @@ "version": "1.0.1", "license": "MIT", "author": "Jan Prochazka", - "homepage": "https://github.com/dbgate/dbgate-plugin-mongo", + "homepage": "https://dbgate.org", "description": "MongoDB connect plugin for DbGate", - "funding": "https://www.paypal.com/paypalme/JanProchazkaCz/30eur", + "repository": { + "type": "git", + "url": "https://github.com/dbgate/dbgate" + }, "keywords": [ "dbgate", "dbgateplugin", @@ -14,7 +17,8 @@ "mongodb" ], "files": [ - "dist" + "dist", + "icon.svg" ], "scripts": { "build:frontend": "webpack --config webpack-frontend.config", @@ -34,5 +38,8 @@ "mongodb": "^3.6.5", "webpack": "^4.42.0", "webpack-cli": "^3.3.11" + }, + "dependencies": { + "mongodb-client-encryption": "^1.2.3" } } diff --git a/plugins/dbgate-plugin-mssql/package.json b/plugins/dbgate-plugin-mssql/package.json index 1e0a4a82c..dfd92ddec 100644 --- a/plugins/dbgate-plugin-mssql/package.json +++ b/plugins/dbgate-plugin-mssql/package.json @@ -2,13 +2,12 @@ "name": "dbgate-plugin-mssql", "main": "dist/backend.js", "version": "1.2.2", - "homepage": "https://github.com/dbgate/dbgate-plugin-mssql", + "homepage": "https://dbgate.org", "description": "MS SQL connect plugin for DbGate", "repository": { "type": "git", - "url": "https://github.com/dbgate/dbgate-plugin-mssql.git" + "url": "https://github.com/dbgate/dbgate" }, - "funding": "https://www.paypal.com/paypalme/JanProchazkaCz/30eur", "author": "Jan Prochazka", "license": "GPL", "keywords": [ @@ -18,7 +17,8 @@ "dbgateplugin" ], "files": [ - "dist" + "dist", + "icon.svg" ], "scripts": { "build:frontend": "webpack --config webpack-frontend.config", diff --git a/plugins/dbgate-plugin-mysql/package.json b/plugins/dbgate-plugin-mysql/package.json index 18c2b4384..42381c311 100644 --- a/plugins/dbgate-plugin-mysql/package.json +++ b/plugins/dbgate-plugin-mysql/package.json @@ -2,13 +2,12 @@ "name": "dbgate-plugin-mysql", "main": "dist/backend.js", "version": "1.2.2", - "homepage": "https://github.com/dbgate/dbgate-plugin-mysql", + "homepage": "https://dbgate.org", "description": "MySQL connect plugin for DbGate", "repository": { "type": "git", - "url": "https://github.com/dbgate/dbgate-plugin-mysql.git" + "url": "https://github.com/dbgate/dbgate" }, - "funding": "https://www.paypal.com/paypalme/JanProchazkaCz/30eur", "author": "Jan Prochazka", "license": "MIT", "keywords": [ @@ -18,7 +17,8 @@ "mysql" ], "files": [ - "dist" + "dist", + "icon.svg" ], "scripts": { "build:frontend": "webpack --config webpack-frontend.config", diff --git a/plugins/dbgate-plugin-postgres/package.json b/plugins/dbgate-plugin-postgres/package.json index feecdab52..32cc49257 100644 --- a/plugins/dbgate-plugin-postgres/package.json +++ b/plugins/dbgate-plugin-postgres/package.json @@ -4,12 +4,11 @@ "version": "1.2.2", "license": "MIT", "description": "PostgreSQL connector plugin for DbGate", - "homepage": "https://github.com/dbgate/dbgate-plugin-postgres", + "homepage": "https://dbgate.org", "repository": { "type": "git", - "url": "https://github.com/dbgate/dbgate-plugin-postgres.git" + "url": "https://github.com/dbgate/dbgate" }, - "funding": "https://www.paypal.com/paypalme/JanProchazkaCz/30eur", "author": "Jan Prochazka", "keywords": [ "dbgate", @@ -17,7 +16,8 @@ "postgresql" ], "files": [ - "dist" + "dist", + "icon.svg" ], "scripts": { "build:frontend": "webpack --config webpack-frontend.config", diff --git a/yarn.lock b/yarn.lock index 278ca7076..ad2a06d5e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5908,6 +5908,16 @@ moment@^2.24.0: resolved "https://registry.yarnpkg.com/moment/-/moment-2.24.0.tgz#0d055d53f5052aa653c9f6eb68bb5d12bf5c2b5b" integrity sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg== +mongodb-client-encryption@^1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/mongodb-client-encryption/-/mongodb-client-encryption-1.2.3.tgz#0078f2cf385762e052b0c12d9be256eb1ef9a347" + integrity sha512-w+mvB2wLwWjnGvPYUmVDfec7OmkXfPTJh/BRAt23A1Q0g+duOFlZD+qRB0fQYwhGblkno5NBMR7HXSSRx5+AwQ== + dependencies: + bindings "^1.5.0" + bl "^2.2.1" + nan "^2.14.2" + prebuild-install "6.0.1" + mongodb@^3.6.5: version "3.6.6" resolved "https://registry.yarnpkg.com/mongodb/-/mongodb-3.6.6.tgz#92e3658f45424c34add3003e3046c1535c534449" @@ -6923,6 +6933,27 @@ postgres-interval@^1.1.0: dependencies: xtend "^4.0.0" +prebuild-install@6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/prebuild-install/-/prebuild-install-6.0.1.tgz#5902172f7a40eb67305b96c2a695db32636ee26d" + integrity sha512-7GOJrLuow8yeiyv75rmvZyeMGzl8mdEX5gY69d6a6bHWmiPevwqFw+tQavhK0EYMaSg3/KD24cWqeQv1EWsqDQ== + dependencies: + detect-libc "^1.0.3" + expand-template "^2.0.3" + github-from-package "0.0.0" + minimist "^1.2.3" + mkdirp-classic "^0.5.3" + napi-build-utils "^1.0.1" + node-abi "^2.7.0" + noop-logger "^0.1.1" + npmlog "^4.0.1" + pump "^3.0.0" + rc "^1.2.7" + simple-get "^3.0.3" + tar-fs "^2.0.0" + tunnel-agent "^0.6.0" + which-pm-runs "^1.0.0" + prebuild-install@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/prebuild-install/-/prebuild-install-6.0.0.tgz#669022bcde57c710a869e39c5ca6bf9cd207f316"