mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-10-28 02:27:55 +08:00
refactor: CB-2288 manifests
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
||||
|
||||
# dependencies
|
||||
/node_modules
|
||||
/.pnp
|
||||
.pnp.js
|
||||
|
||||
# testing
|
||||
/coverage
|
||||
|
||||
# production
|
||||
/lib
|
||||
|
||||
# misc
|
||||
.DS_Store
|
||||
.env*
|
||||
|
||||
# debug
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"name": "@cloudbeaver/core-browser",
|
||||
"sideEffects": false,
|
||||
"version": "0.1.0",
|
||||
"description": "",
|
||||
"license": "Apache-2.0",
|
||||
"main": "lib/index.js",
|
||||
"module": "lib/index.js",
|
||||
"types": "src/index.ts",
|
||||
"scripts": {
|
||||
"prebuild": "rimraf lib/*",
|
||||
"build": "webpack --config ../../configs/webpack.plugin.config.js",
|
||||
"postbuild": "tsc",
|
||||
"lint": "eslint ./src/ --ext .ts,.tsx",
|
||||
"lint-fix": "eslint ./src/ --ext .ts,.tsx --fix"
|
||||
},
|
||||
"dependencies": {
|
||||
"@cloudbeaver/core-di": "~0.1.0",
|
||||
"@cloudbeaver/core-plugin": "~0.1.0",
|
||||
"react": "~18.x.x",
|
||||
"react-dom": "~18.x.x",
|
||||
"reakit": "~1.x.x",
|
||||
"mobx": "~6.x.x",
|
||||
"mobx-react-lite": "~3.x.x",
|
||||
"reshadow": "~0.x.x"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* CloudBeaver - Cloud Database Manager
|
||||
* Copyright (C) 2020-2022 DBeaver Corp and others
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0.
|
||||
* you may not use this file except in compliance with the License.
|
||||
*/
|
||||
|
||||
import { injectable } from '@cloudbeaver/core-di';
|
||||
|
||||
import { CookiesSettingsService } from './CookiesSettingsService';
|
||||
|
||||
@injectable()
|
||||
export class CookiesService {
|
||||
get cookiesEnabled() {
|
||||
return !this.cookiesSettingsService.settings.getValue('disabled');
|
||||
}
|
||||
|
||||
constructor(private readonly cookiesSettingsService: CookiesSettingsService) {}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* CloudBeaver - Cloud Database Manager
|
||||
* Copyright (C) 2020-2022 DBeaver Corp and others
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0.
|
||||
* you may not use this file except in compliance with the License.
|
||||
*/
|
||||
|
||||
import { injectable } from '@cloudbeaver/core-di';
|
||||
import { PluginManagerService, PluginSettings } from '@cloudbeaver/core-plugin';
|
||||
|
||||
const defaultSettings = {
|
||||
disabled: false,
|
||||
};
|
||||
|
||||
export type CookiesSettings = typeof defaultSettings;
|
||||
|
||||
@injectable()
|
||||
export class CookiesSettingsService {
|
||||
readonly settings: PluginSettings<CookiesSettings>;
|
||||
|
||||
constructor(private readonly pluginManagerService: PluginManagerService) {
|
||||
this.settings = this.pluginManagerService.getPluginSettings('core.cookies', defaultSettings);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
export * from './CookiesService';
|
||||
export * from './manifest';
|
||||
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* CloudBeaver - Cloud Database Manager
|
||||
* Copyright (C) 2020-2022 DBeaver Corp and others
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0.
|
||||
* you may not use this file except in compliance with the License.
|
||||
*/
|
||||
|
||||
import type { PluginManifest } from '@cloudbeaver/core-di';
|
||||
|
||||
import { CookiesService } from './CookiesService';
|
||||
import { CookiesSettingsService } from './CookiesSettingsService';
|
||||
|
||||
|
||||
export const coreBrowserManifest: PluginManifest = {
|
||||
info: {
|
||||
name: 'Core Browser',
|
||||
},
|
||||
|
||||
providers: [
|
||||
CookiesSettingsService,
|
||||
CookiesService,
|
||||
],
|
||||
};
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"rootDir": "src",
|
||||
"outDir": "lib",
|
||||
"composite": true
|
||||
},
|
||||
"include": ["src"],
|
||||
"exclude": ["**/node_modules", "**/.*/"],
|
||||
"references": [{ "path": "../*" }]
|
||||
}
|
||||
Reference in New Issue
Block a user