import { createPlugin , createApiFactory , discoveryApiRef , createRouteRef , createRoutableExtension , } from '@backstage/core-plugin-api' ; import { buildKiteApiRef , BuildkiteApi } from './api' ; export const entityContentRouteRef = createRouteRef ( { id : 'Buildkite Entity Content' , } ) ; export const buildViewRouteRef = createRouteRef ( { id : 'Buildkite Build view' , } ) ; export const buildkitePlugin = createPlugin ( { id : 'buildkite' , apis : [ createApiFactory ( { api : buildKiteApiRef , deps : { discoveryApi : discoveryApiRef } , factory : ( { discoveryApi } ) => new BuildkiteApi ( { discoveryApi } ) , } ) , ] , routes : { entityContent : entityContentRouteRef , buildView : buildViewRouteRef , } , } ) ; export const EntityBuildkiteContent = buildkitePlugin . provide ( createRoutableExtension ( { name : 'EntityBuildkiteContent' , component : ( ) => import ( './components/Router' ) . then ( m => m . Router ) , mountPoint : entityContentRouteRef , } ) ) ;