-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(compass-shell): convert to new plugin interface COMPASS-7399 (#…
…5086) Co-authored-by: Sergey Petushkov <[email protected]>
- Loading branch information
1 parent
d61268a
commit 072d079
Showing
12 changed files
with
196 additions
and
159 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,32 @@ | ||
import type AppRegistry from 'hadron-app-registry'; | ||
import type { LoggerAndTelemetry } from '@mongodb-js/compass-logging/provider'; | ||
import { createLoggerAndTelemetryLocator } from '@mongodb-js/compass-logging/provider'; | ||
import { ShellPlugin, onActivated } from './plugin'; | ||
import { registerHadronPlugin } from 'hadron-app-registry'; | ||
import { dataServiceLocator } from 'mongodb-data-service/provider'; | ||
import type { DataService } from 'mongodb-data-service'; | ||
|
||
import createPlugin from './plugin'; | ||
|
||
const { store, Plugin } = createPlugin(); | ||
|
||
/** | ||
* Activate all the components in the Compass Shell package. | ||
* @param {Object} appRegistry - The appRegistry to activate this plugin with. | ||
**/ | ||
function activate(appRegistry: AppRegistry): void { | ||
// Register the shell plugin's role in Compass. | ||
appRegistry.registerComponent('Global.Shell', Plugin); | ||
appRegistry.registerStore('CompassShell.Store', store); | ||
function activate(): void { | ||
// noop | ||
} | ||
|
||
/** | ||
* Deactivate all the components in the Compass Shell package. | ||
* @param {Object} appRegistry - The appRegistry to deactivate this plugin with. | ||
**/ | ||
function deactivate(appRegistry: AppRegistry): void { | ||
appRegistry.registerComponent('Global.Shell', Plugin); | ||
appRegistry.deregisterStore('CompassShell.Store'); | ||
function deactivate(): void { | ||
// noop | ||
} | ||
|
||
export default Plugin; | ||
export const CompassShellPlugin = registerHadronPlugin< | ||
unknown, | ||
{ logger: () => LoggerAndTelemetry; dataService: () => DataService } | ||
>( | ||
{ | ||
name: 'CompassShell', | ||
component: ShellPlugin, | ||
activate: onActivated, | ||
}, | ||
{ | ||
logger: createLoggerAndTelemetryLocator('COMPASS-SHELL'), | ||
dataService: dataServiceLocator, | ||
} | ||
); | ||
|
||
export { activate, deactivate }; | ||
export { default as metadata } from '../package.json'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.