tech-radar: migrated to new composability API
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-tech-radar': patch
|
||||
---
|
||||
|
||||
Migrated to new composability API, exporting the plugin instance as `techRadarPlugin` and the page as `TechRadarPage`.
|
||||
@@ -14,7 +14,14 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { createDevApp } from '@backstage/dev-utils';
|
||||
import { plugin } from '../src';
|
||||
import { techRadarPlugin, TechRadarPage } from '../src';
|
||||
|
||||
createDevApp().registerPlugin(plugin).render();
|
||||
createDevApp()
|
||||
.registerPlugin(techRadarPlugin)
|
||||
.addPage({
|
||||
title: 'Tech Radar',
|
||||
element: <TechRadarPage width={1280} height={720} />,
|
||||
})
|
||||
.render();
|
||||
|
||||
@@ -14,7 +14,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export { plugin } from './plugin';
|
||||
export {
|
||||
techRadarPlugin,
|
||||
techRadarPlugin as plugin,
|
||||
TechRadarPage,
|
||||
} from './plugin';
|
||||
|
||||
export { RadarPage as Router } from './components/RadarPage';
|
||||
|
||||
|
||||
@@ -14,10 +14,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { plugin } from './plugin';
|
||||
import { techRadarPlugin } from './plugin';
|
||||
|
||||
describe('tech-radar', () => {
|
||||
it('should export plugin', () => {
|
||||
expect(plugin).toBeDefined();
|
||||
expect(techRadarPlugin).toBeDefined();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -14,8 +14,26 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { createPlugin } from '@backstage/core';
|
||||
import {
|
||||
createPlugin,
|
||||
createRouteRef,
|
||||
createRoutableExtension,
|
||||
} from '@backstage/core';
|
||||
|
||||
export const plugin = createPlugin({
|
||||
id: 'tech-radar',
|
||||
const rootRouteRef = createRouteRef({
|
||||
title: 'Tech Radar',
|
||||
});
|
||||
|
||||
export const techRadarPlugin = createPlugin({
|
||||
id: 'tech-radar',
|
||||
routes: {
|
||||
root: rootRouteRef,
|
||||
},
|
||||
});
|
||||
|
||||
export const TechRadarPage = techRadarPlugin.provide(
|
||||
createRoutableExtension({
|
||||
component: () => import('./components/RadarPage').then(m => m.RadarPage),
|
||||
mountPoint: rootRouteRef,
|
||||
}),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user