mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-10-24 01:23:21 +08:00
refactor: migrate to pure esm CB-5684 (#2929)
* refactor: migrate to pure esm * chore: revert `useDefineForClassFields` tsconf * chore: remove patch.js
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"name": "@cloudbeaver/plugin-devtools",
|
||||
"type": "module",
|
||||
"sideEffects": [
|
||||
"src/**/*.css",
|
||||
"src/**/*.scss",
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
import type { IContextMenuItemProps } from '@cloudbeaver/core-ui';
|
||||
import { MenuCustomItem } from '@cloudbeaver/core-view';
|
||||
|
||||
import { SearchResourceMenuItemComponent } from './SearchResourceMenuItemComponent';
|
||||
import { SearchResourceMenuItemComponent } from './SearchResourceMenuItemComponent.js';
|
||||
|
||||
export class SearchResourceMenuItem extends MenuCustomItem<IContextMenuItemProps> {
|
||||
constructor() {
|
||||
|
||||
@@ -13,7 +13,7 @@ import { useDataContextLink } from '@cloudbeaver/core-data-context';
|
||||
import type { IContextMenuItemProps } from '@cloudbeaver/core-ui';
|
||||
import type { ICustomMenuItemComponent } from '@cloudbeaver/core-view';
|
||||
|
||||
import { DATA_CONTEXT_MENU_SEARCH } from './DATA_CONTEXT_MENU_SEARCH';
|
||||
import { DATA_CONTEXT_MENU_SEARCH } from './DATA_CONTEXT_MENU_SEARCH.js';
|
||||
import styles from './SearchResourceMenuItemComponent.module.css';
|
||||
|
||||
export const SearchResourceMenuItemComponent: ICustomMenuItemComponent<IContextMenuItemProps> = observer(function SearchResourceMenuItemComponent({
|
||||
|
||||
@@ -75,7 +75,7 @@ export class DevToolsService {
|
||||
|
||||
function getDefaultDevToolsSettings(): IDevToolsSettings {
|
||||
return {
|
||||
enabled: process.env.NODE_ENV === 'development',
|
||||
enabled: process.env['NODE_ENV'] === 'development',
|
||||
distributed: false,
|
||||
configuration: false,
|
||||
};
|
||||
|
||||
@@ -5,26 +5,26 @@
|
||||
* Licensed under the Apache License, Version 2.0.
|
||||
* you may not use this file except in compliance with the License.
|
||||
*/
|
||||
import { App, Bootstrap, injectable, IServiceConstructor, IServiceProvider } from '@cloudbeaver/core-di';
|
||||
import { App, Bootstrap, injectable, type IServiceConstructor, IServiceProvider } from '@cloudbeaver/core-di';
|
||||
import { CachedResource } from '@cloudbeaver/core-resource';
|
||||
import { EAdminPermission, PermissionsService } from '@cloudbeaver/core-root';
|
||||
import { ActionService, DATA_CONTEXT_SUBMENU_ITEM, MenuBaseItem, MenuService } from '@cloudbeaver/core-view';
|
||||
import { TOP_NAV_BAR_SETTINGS_MENU } from '@cloudbeaver/plugin-settings-menu';
|
||||
import { MENU_USER_PROFILE } from '@cloudbeaver/plugin-user-profile';
|
||||
|
||||
import { ACTION_DEVTOOLS } from './actions/ACTION_DEVTOOLS';
|
||||
import { ACTION_DEVTOOLS_MODE_CONFIGURATION } from './actions/ACTION_DEVTOOLS_MODE_CONFIGURATION';
|
||||
import { ACTION_DEVTOOLS_MODE_DISTRIBUTED } from './actions/ACTION_DEVTOOLS_MODE_DISTRIBUTED';
|
||||
import { DATA_CONTEXT_MENU_SEARCH } from './ContextMenu/DATA_CONTEXT_MENU_SEARCH';
|
||||
import { SearchResourceMenuItem } from './ContextMenu/SearchResourceMenuItem';
|
||||
import { DevToolsService } from './DevToolsService';
|
||||
import { MENU_DEVTOOLS } from './menu/MENU_DEVTOOLS';
|
||||
import { MENU_PLUGIN } from './menu/MENU_PLUGIN';
|
||||
import { MENU_PLUGINS } from './menu/MENU_PLUGINS';
|
||||
import { MENU_RESOURCE } from './menu/MENU_RESOURCE';
|
||||
import { MENU_RESOURCES } from './menu/MENU_RESOURCES';
|
||||
import { PluginSubMenuItem } from './menu/PluginSubMenuItem';
|
||||
import { ResourceSubMenuItem } from './menu/ResourceSubMenuItem';
|
||||
import { ACTION_DEVTOOLS } from './actions/ACTION_DEVTOOLS.js';
|
||||
import { ACTION_DEVTOOLS_MODE_CONFIGURATION } from './actions/ACTION_DEVTOOLS_MODE_CONFIGURATION.js';
|
||||
import { ACTION_DEVTOOLS_MODE_DISTRIBUTED } from './actions/ACTION_DEVTOOLS_MODE_DISTRIBUTED.js';
|
||||
import { DATA_CONTEXT_MENU_SEARCH } from './ContextMenu/DATA_CONTEXT_MENU_SEARCH.js';
|
||||
import { SearchResourceMenuItem } from './ContextMenu/SearchResourceMenuItem.js';
|
||||
import { DevToolsService } from './DevToolsService.js';
|
||||
import { MENU_DEVTOOLS } from './menu/MENU_DEVTOOLS.js';
|
||||
import { MENU_PLUGIN } from './menu/MENU_PLUGIN.js';
|
||||
import { MENU_PLUGINS } from './menu/MENU_PLUGINS.js';
|
||||
import { MENU_RESOURCE } from './menu/MENU_RESOURCE.js';
|
||||
import { MENU_RESOURCES } from './menu/MENU_RESOURCES.js';
|
||||
import { PluginSubMenuItem } from './menu/PluginSubMenuItem.js';
|
||||
import { ResourceSubMenuItem } from './menu/ResourceSubMenuItem.js';
|
||||
|
||||
@injectable()
|
||||
export class PluginBootstrap extends Bootstrap {
|
||||
@@ -39,7 +39,7 @@ export class PluginBootstrap extends Bootstrap {
|
||||
super();
|
||||
}
|
||||
|
||||
register(): void {
|
||||
override register(): void {
|
||||
this.menuService.addCreator({
|
||||
menus: [TOP_NAV_BAR_SETTINGS_MENU],
|
||||
isApplicable: () => this.permissionsService.has(EAdminPermission.admin),
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
import { devToolsPlugin } from './manifest';
|
||||
/*
|
||||
* CloudBeaver - Cloud Database Manager
|
||||
* Copyright (C) 2020-2024 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 { devToolsPlugin } from './manifest.js';
|
||||
|
||||
export { devToolsPlugin };
|
||||
export default devToolsPlugin;
|
||||
|
||||
export * from './DevToolsService';
|
||||
export * from './DevToolsService.js';
|
||||
|
||||
@@ -11,5 +11,5 @@ export const devToolsPlugin: PluginManifest = {
|
||||
info: {
|
||||
name: 'DevTools plugin',
|
||||
},
|
||||
providers: [() => import('./PluginBootstrap').then(m => m.PluginBootstrap), () => import('./DevToolsService').then(m => m.DevToolsService)],
|
||||
providers: [() => import('./PluginBootstrap.js').then(m => m.PluginBootstrap), () => import('./DevToolsService.js').then(m => m.DevToolsService)],
|
||||
};
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
import type { PluginManifest } from '@cloudbeaver/core-di';
|
||||
import { MenuSubMenuItem } from '@cloudbeaver/core-view';
|
||||
|
||||
import { MENU_PLUGIN } from './MENU_PLUGIN';
|
||||
import { MENU_PLUGIN } from './MENU_PLUGIN.js';
|
||||
|
||||
export class PluginSubMenuItem extends MenuSubMenuItem {
|
||||
readonly plugin: PluginManifest;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
import type { IServiceConstructor } from '@cloudbeaver/core-di';
|
||||
import { MenuSubMenuItem } from '@cloudbeaver/core-view';
|
||||
|
||||
import { MENU_RESOURCE } from './MENU_RESOURCE';
|
||||
import { MENU_RESOURCE } from './MENU_RESOURCE.js';
|
||||
|
||||
export class ResourceSubMenuItem extends MenuSubMenuItem {
|
||||
readonly resource: IServiceConstructor<any>;
|
||||
|
||||
Reference in New Issue
Block a user