Register the to the DevApp fixing the issue to launch locally the plugin. Add a new section to the plugin scaffolder README. #23684

Signed-off-by: cmoulliard <cmoulliard@redhat.com>
This commit is contained in:
cmoulliard
2024-05-02 09:57:49 +02:00
parent 32cc4e6468
commit faa86f3981
3 changed files with 20 additions and 12 deletions
+6 -12
View File
@@ -14,11 +14,9 @@
* limitations under the License.
*/
import { CatalogClient } from '@backstage/catalog-client';
import { createDevApp } from '@backstage/dev-utils';
import { scmIntegrationsApiRef } from '@backstage/integration-react';
import {
catalogApiRef,
starredEntitiesApiRef,
MockStarredEntitiesApi,
} from '@backstage/plugin-catalog-react';
@@ -30,18 +28,10 @@ import {
fetchApiRef,
identityApiRef,
} from '@backstage/core-plugin-api';
import { CatalogEntityPage } from '@backstage/plugin-catalog';
import { CatalogEntityPage, catalogPlugin } from '@backstage/plugin-catalog';
createDevApp()
.addPage({
path: '/catalog/:kind/:namespace/:name',
element: <CatalogEntityPage />,
})
.registerApi({
api: catalogApiRef,
deps: { discoveryApi: discoveryApiRef },
factory: ({ discoveryApi }) => new CatalogClient({ discoveryApi }),
})
.registerPlugin(catalogPlugin)
.registerApi({
api: starredEntitiesApiRef,
deps: {},
@@ -63,6 +53,10 @@ createDevApp()
identityApi,
}),
})
.addPage({
path: '/catalog/:kind/:namespace/:name',
element: <CatalogEntityPage />,
})
.addPage({
path: '/create',
title: 'Create',