chore: move public to core

This commit is contained in:
Dmitry Krupenya
2020-05-18 18:51:08 +03:00
parent b77426eb8c
commit 1acf302b29
26 changed files with 25 additions and 10 deletions
@@ -4,6 +4,7 @@
"description": "",
"license": "Apache-2.0",
"main": "dist/index.js",
"module": "dist/index.js",
"scripts": {
"build-plugin": "npm run clean-dist && builder build-plugin",
"serve-plugin": "builder serve-plugin",
+4
View File
@@ -27,6 +27,10 @@ function createWebpackArgv(argv) {
console.log('Plugins list is not found: ', fullPath);
}
// add mandatory plugin
pluginsList = pluginsList.filter(plugin => plugin !== '@dbeaver/core');
pluginsList.unshift('@dbeaver/core')
const webpackArgv = {
mode: 'production',
pluginsList: pluginsList,
@@ -28,26 +28,36 @@ ${names.map(n => ` ${n},\n`).join('')}]`;
return code;
}
function dirExists(path) {
try {
const stats = fs.statSync(path)
return stats && stats.isDirectory()
} catch (e) {
return false;
}
}
function copyPublic(currentDir, pluginsList) {
const pathsToCopy = [];
pluginsList.forEach(plugin => {
try {
const pathToPlugin = resolve.sync(plugin, {basedir: currentDir});
const pathToPlugin = resolve.sync(plugin);
const dir = path.parse(pathToPlugin).dir;
const pathToPublic = path.resolve(dir, '../public');
const stats = fs.statSync(pathToPublic);
if (stats && stats.isDirectory()) {
if (dirExists(pathToPublic)) {
pathsToCopy.push({
from: pathToPublic,
to: '',
});
}
} catch (e) {
console.error(e);
}
});
pathsToCopy.push({from: path.resolve(currentDir, './public'), to: ''});
console.log(pathsToCopy);
const pathToAppPublic = path.resolve(currentDir, './public')
if (dirExists(pathToAppPublic)) {
pathsToCopy.push({from: path.resolve(currentDir, './public'), to: ''});
}
return pathsToCopy;
}
+2 -4
View File
@@ -1,8 +1,8 @@
/* eslint-disable import-helpers/order-imports, import/order */
/* eslint-disable import-helpers/order-imports, import/order, import/no-duplicates */
/* this eslint-disable required for webpack inject */
import 'reflect-metadata';
import coreManifest, { AppBootstrap } from '@dbeaver/core';
import { AppBootstrap } from '@dbeaver/core';
import { App, PluginManifest } from '@dbeaver/core/di';
import { renderLayout } from './renderLayout';
@@ -10,8 +10,6 @@ import { showErrorPage } from './ErrorPage';
const PLUGINS = [] as PluginManifest[]; // will be injected by webpack
PLUGINS.unshift(coreManifest); // this is mandatory plugin
async function bootstrap() {
const app = new App(PLUGINS);
+1
View File
@@ -3,6 +3,7 @@
"version": "0.1.0",
"description": "",
"license": "Apache-2.0",
"main": "dist/index.js",
"module": "dist/index.js",
"types": "dist/types",
"scripts": {

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Before

Width:  |  Height:  |  Size: 913 B

After

Width:  |  Height:  |  Size: 913 B

Before

Width:  |  Height:  |  Size: 438 B

After

Width:  |  Height:  |  Size: 438 B

Before

Width:  |  Height:  |  Size: 778 B

After

Width:  |  Height:  |  Size: 778 B

Before

Width:  |  Height:  |  Size: 211 B

After

Width:  |  Height:  |  Size: 211 B

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Before

Width:  |  Height:  |  Size: 588 B

After

Width:  |  Height:  |  Size: 588 B

Before

Width:  |  Height:  |  Size: 748 B

After

Width:  |  Height:  |  Size: 748 B

Before

Width:  |  Height:  |  Size: 515 B

After

Width:  |  Height:  |  Size: 515 B

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Before

Width:  |  Height:  |  Size: 588 B

After

Width:  |  Height:  |  Size: 588 B

Before

Width:  |  Height:  |  Size: 582 B

After

Width:  |  Height:  |  Size: 582 B

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Before

Width:  |  Height:  |  Size: 635 B

After

Width:  |  Height:  |  Size: 635 B

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

+1
View File
@@ -24,6 +24,7 @@
"@dbeaver/ag-grid-plugin": "^0.1.0",
"@dbeaver/basic-connection-plugin": "^0.1.0",
"@dbeaver/builder": "^0.1.0",
"@dbeaver/core": "^0.1.0",
"@dbeaver/custom-connection-plugin": "^0.1.0",
"@dbeaver/data-viewer-plugin": "^0.1.0",
"@dbeaver/ddl-viewer-plugin": "^0.1.0",