catalog-import: migrated to new composability API
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-catalog-import': patch
|
||||
---
|
||||
|
||||
Migrated to new composability API, exporting the plugin instance as `catalogImportPlugin`, and the page as `CatalogImportPage`.
|
||||
@@ -15,6 +15,6 @@
|
||||
*/
|
||||
|
||||
import { createDevApp } from '@backstage/dev-utils';
|
||||
import { plugin } from '../src/plugin';
|
||||
import { catalogImportPlugin } from '../src/plugin';
|
||||
|
||||
createDevApp().registerPlugin(plugin).render();
|
||||
createDevApp().registerPlugin(catalogImportPlugin).render();
|
||||
|
||||
@@ -14,6 +14,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export { plugin } from './plugin';
|
||||
export {
|
||||
catalogImportPlugin,
|
||||
catalogImportPlugin as plugin,
|
||||
CatalogImportPage,
|
||||
} from './plugin';
|
||||
export { Router } from './components/Router';
|
||||
export * from './api';
|
||||
|
||||
@@ -14,10 +14,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { plugin } from './plugin';
|
||||
import { catalogImportPlugin } from './plugin';
|
||||
|
||||
describe('catalog-import', () => {
|
||||
it('should export plugin', () => {
|
||||
expect(plugin).toBeDefined();
|
||||
expect(catalogImportPlugin).toBeDefined();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -21,6 +21,7 @@ import {
|
||||
discoveryApiRef,
|
||||
githubAuthApiRef,
|
||||
configApiRef,
|
||||
createRoutableExtension,
|
||||
} from '@backstage/core';
|
||||
import { catalogImportApiRef } from './api/CatalogImportApi';
|
||||
import { CatalogImportClient } from './api/CatalogImportClient';
|
||||
@@ -30,7 +31,7 @@ export const rootRouteRef = createRouteRef({
|
||||
title: 'catalog-import',
|
||||
});
|
||||
|
||||
export const plugin = createPlugin({
|
||||
export const catalogImportPlugin = createPlugin({
|
||||
id: 'catalog-import',
|
||||
apis: [
|
||||
createApiFactory({
|
||||
@@ -44,4 +45,14 @@ export const plugin = createPlugin({
|
||||
new CatalogImportClient({ discoveryApi, githubAuthApi, configApi }),
|
||||
}),
|
||||
],
|
||||
routes: {
|
||||
importPage: rootRouteRef,
|
||||
},
|
||||
});
|
||||
|
||||
export const CatalogImportPage = catalogImportPlugin.provide(
|
||||
createRoutableExtension({
|
||||
component: () => import('./components/Router').then(m => m.Router),
|
||||
mountPoint: rootRouteRef,
|
||||
}),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user