import { createPlugin , createApiFactory , createRouteRef , createRoutableExtension , createComponentExtension , } from '@backstage/core-plugin-api' ; import { githubPullRequestsApiRef , GithubPullRequestsClient } from './api' ; export const entityContentRouteRef = createRouteRef ( { id : 'github-pull-requests' , } ) ; export const githubPullRequestsPlugin = createPlugin ( { id : 'github-pull-requests' , apis : [ createApiFactory ( githubPullRequestsApiRef , new GithubPullRequestsClient ( ) ) , ] , routes : { entityContent : entityContentRouteRef , } , } ) ; export const EntityGithubPullRequestsContent = githubPullRequestsPlugin . provide ( createRoutableExtension ( { name : 'EntityGithubPullRequestsContent' , component : ( ) => import ( './components/Router' ) . then ( m => m . Router ) , mountPoint : entityContentRouteRef , } ) ) ; export const EntityGithubPullRequestsOverviewCard = githubPullRequestsPlugin . provide ( createComponentExtension ( { name : 'EntityGithubPullRequestsOverviewCard' , component : { lazy : ( ) => import ( './components/PullRequestsStatsCard' ) . then ( m => m . PullRequestsStatsCard ) , } , } ) ) ; export const EntityGithubPullRequestsTable = githubPullRequestsPlugin . provide ( createComponentExtension ( { name : 'EntityGithubPullRequestsTable' , component : { lazy : ( ) => import ( './components/PullRequestsTable' ) . then ( m => m . PullRequestsTable ) , } , } ) ) ;