@roadiehq/backstage-plugin-github-insights
Version:
89 lines (86 loc) • 3.13 kB
JavaScript
import { createPlugin, createApiFactory, configApiRef, createRoutableExtension, createComponentExtension } from '@backstage/core-plugin-api';
import { rootRouteRef } from './routes.esm.js';
import { GithubClient } from './apis/GithubClient.esm.js';
import { githubApiRef } from './apis/githubApiRef.esm.js';
import { scmAuthApiRef } from '@backstage/integration-react';
const githubInsightsPlugin = createPlugin({
id: "code-insights",
apis: [
createApiFactory({
api: githubApiRef,
deps: {
configApi: configApiRef,
scmAuthApi: scmAuthApiRef
},
factory: (deps) => new GithubClient(deps)
})
],
routes: {
root: rootRouteRef
}
});
const EntityGithubInsightsContent = githubInsightsPlugin.provide(
createRoutableExtension({
name: "EntityGithubInsightsContent",
component: () => import('./components/InsightsPage/index.esm.js').then((m) => m.InsightsPage),
mountPoint: rootRouteRef
})
);
const EntityGithubInsightsComplianceCard = githubInsightsPlugin.provide(
createComponentExtension({
name: "EntityGithubInsightsComplianceCard",
component: {
lazy: () => import('./components/Widgets/index.esm.js').then((m) => m.ComplianceCard)
}
})
);
const EntityGithubInsightsContributorsCard = githubInsightsPlugin.provide(
createComponentExtension({
name: "EntityGithubInsightsContributorsCard",
component: {
lazy: () => import('./components/Widgets/index.esm.js').then((m) => m.ContributorsCard)
}
})
);
const EntityGithubInsightsLanguagesCard = githubInsightsPlugin.provide(
createComponentExtension({
name: "EntityGithubInsightsLanguagesCard",
component: {
lazy: () => import('./components/Widgets/index.esm.js').then((m) => m.LanguagesCard)
}
})
);
const EntityGithubInsightsReadmeCard = githubInsightsPlugin.provide(
createComponentExtension({
name: "EntityGithubInsightsReadmeCard",
component: {
lazy: () => import('./components/Widgets/index.esm.js').then((m) => m.ReadMeCard)
}
})
);
const EntityGithubInsightsReleasesCard = githubInsightsPlugin.provide(
createComponentExtension({
name: "EntityGithubInsightsReleasesCard",
component: {
lazy: () => import('./components/Widgets/index.esm.js').then((m) => m.ReleasesCard)
}
})
);
const EntityGithubInsightsEnvironmentsCard = githubInsightsPlugin.provide(
createComponentExtension({
name: "EntityGithubInsightsEnvironmentsCard",
component: {
lazy: () => import('./components/Widgets/index.esm.js').then((m) => m.EnvironmentsCard)
}
})
);
githubInsightsPlugin.provide(
createComponentExtension({
name: "GithubInsightsMarkdownContent",
component: {
lazy: () => import('./components/Widgets/index.esm.js').then((m) => m.MarkdownContent)
}
})
);
export { EntityGithubInsightsComplianceCard, EntityGithubInsightsContent, EntityGithubInsightsContributorsCard, EntityGithubInsightsEnvironmentsCard, EntityGithubInsightsLanguagesCard, EntityGithubInsightsReadmeCard, EntityGithubInsightsReleasesCard, githubInsightsPlugin };
//# sourceMappingURL=plugin.esm.js.map