Skip to content

Commit

Permalink
renamed spotlight plugin class
Browse files Browse the repository at this point in the history
  • Loading branch information
hasith committed Aug 31, 2024
1 parent 2a06033 commit 906a027
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
15 changes: 13 additions & 2 deletions docs/plugins/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,20 @@ Productled offers a variety of plugin libraries to extend its capabilities. You
npm install @productled/<plugin-name>
```

Register the plugin with Productled Core at application start.
e.g.,

```bash
npm install @productled/spotlights
```

Register the plugin with Productled Core at application start. e.g., in file: index.tsx

``` typescript
productled.registerPlugin(new <PluginClass>());
```

e.g.,

e.g., in file: index.tsx
``` typescript
productled.registerPlugin(new SpotlightPlugin());
```
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { type Plugin } from "@productled/core";
import { Spotlight } from "./Spotlight";

class SpotlightPlugin implements Plugin {
class SpotlightsPlugin implements Plugin {
private key: string = "spotlights";

get Name(): string {
Expand All @@ -22,4 +22,4 @@ class SpotlightPlugin implements Plugin {
}
}

export default SpotlightPlugin;
export default SpotlightsPlugin;
4 changes: 2 additions & 2 deletions packages/@productled/spotlights/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
import SpotlightPlugin from './SpotlightPlugin';
export {SpotlightPlugin};
import SpotlightsPlugin from './SpotlightsPlugin';
export {SpotlightsPlugin};
4 changes: 2 additions & 2 deletions packages/samples/react-sample/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
import { SpotlightPlugin } from '@productled/spotlights';
import { SpotlightsPlugin } from '@productled/spotlights';
import productledConf from './productled-config.json';
import { Productled } from '@productled/core';

Expand All @@ -16,7 +16,7 @@ const productled = Productled.getInstance();
// load the configuration
productled.loadConfig(productledConf);
// register the plugins
productled.registerPlugin(new SpotlightPlugin());
productled.registerPlugin(new SpotlightsPlugin());

root.render(
<React.StrictMode>
Expand Down

0 comments on commit 906a027

Please sign in to comment.