UNPKG

@roadiehq/backstage-plugin-github-insights

Version:
85 lines (82 loc) 3.1 kB
import { jsx } from 'react/jsx-runtime'; import { ApiBlueprint, configApiRef, createFrontendPlugin } from '@backstage/frontend-plugin-api'; import { GithubClient } from './apis/GithubClient.esm.js'; import { githubApiRef } from './apis/githubApiRef.esm.js'; import { scmAuthApiRef } from '@backstage/integration-react'; import { EntityContentBlueprint, EntityCardBlueprint } from '@backstage/plugin-catalog-react/alpha'; import { isGithubInsightsAvailable } from './components/utils/isGithubInsightsAvailable.esm.js'; const githubApi = ApiBlueprint.make({ params: (defineParams) => defineParams({ api: githubApiRef, deps: { configApi: configApiRef, scmAuthApi: scmAuthApiRef }, factory: (deps) => new GithubClient(deps) }) }); const githubInsightsEntityContent = EntityContentBlueprint.make({ params: { path: "/github-insights", title: "GitHub Insights", filter: isGithubInsightsAvailable, loader: () => import('./components/InsightsPage/index.esm.js').then((m) => /* @__PURE__ */ jsx(m.InsightsPage, {})) } }); const githubInsightsComplianceEntityCard = EntityCardBlueprint.make({ name: "compliance", params: { filter: isGithubInsightsAvailable, loader: () => import('./components/Widgets/index.esm.js').then((m) => /* @__PURE__ */ jsx(m.ComplianceCard, {})) } }); const githubInsightsContributorsEntityCard = EntityCardBlueprint.make({ name: "contributors", params: { filter: isGithubInsightsAvailable, loader: () => import('./components/Widgets/index.esm.js').then((m) => /* @__PURE__ */ jsx(m.ContributorsCard, {})) } }); const githubInsightsLanguagesEntityCard = EntityCardBlueprint.make({ name: "languages", params: { filter: isGithubInsightsAvailable, loader: () => import('./components/Widgets/index.esm.js').then((m) => /* @__PURE__ */ jsx(m.LanguagesCard, {})) } }); const githubInsightsReadmeEntityCard = EntityCardBlueprint.make({ name: "readme", params: { filter: isGithubInsightsAvailable, loader: () => import('./components/Widgets/index.esm.js').then((m) => /* @__PURE__ */ jsx(m.ReadMeCard, {})) } }); const githubInsightsReleasesEntityCard = EntityCardBlueprint.make({ name: "releases", params: { filter: isGithubInsightsAvailable, loader: () => import('./components/Widgets/index.esm.js').then((m) => /* @__PURE__ */ jsx(m.ReleasesCard, {})) } }); const githubInsightsEnvironmentsEntityCard = EntityCardBlueprint.make({ name: "environments", params: { filter: isGithubInsightsAvailable, loader: () => import('./components/Widgets/index.esm.js').then((m) => /* @__PURE__ */ jsx(m.EnvironmentsCard, {})) } }); var alpha = createFrontendPlugin({ pluginId: "code-insights", extensions: [ githubApi, githubInsightsEntityContent, githubInsightsComplianceEntityCard, githubInsightsContributorsEntityCard, githubInsightsLanguagesEntityCard, githubInsightsReadmeEntityCard, githubInsightsReleasesEntityCard, githubInsightsEnvironmentsEntityCard ] }); export { alpha as default }; //# sourceMappingURL=alpha.esm.js.map