npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@soheileizadi/cmdb-plugin

v0.1.0

Published

Backstage CMDB Plugin

Downloads

30

Readme

@backstage/plugin-cmdb

A frontend for CMDB-service, this plugin allows you to applications that are managed by CMDB backend.

This is an experimental plugin to understand how to integrate with backstage echo system.

Introduction

Getting Started

To get started, you will need a running instance of CMDB-service. It's likely you will need to enable CORS to integrate with Backstage. I am hoping that I can use the backend proxy and avoid this need.

When you have an instance running that Backstage can hook into, first install the plugin into your app:

For now I am building the plugin into the tree, later I will play around with building it as a package and try the following:

$ yarn add @backstage/plugin-cmdb

Then make sure to export the plugin in your app's plugins.ts to enable the plugin:

export { plugin as CmdbPlugin } from 'cmdb-plugin';

So for now since I don't have the package I will reference it directly and see if things work:

export { plugin as CmdbPlugin } from '../../../plugins/cmdb/src';

Modify your app routes in App.tsx to include the Router component exported from the plugin, for example:

Similarly reference the CMDB Router directly:

export { Router as CmdbRouter } from '../../../plugins/cmdb/src';
// At the top imports
import { Router as LighthouseRouter } from '@backstage/plugin-lighthouse';

// Inside App component
<Routes>
  // ...
  <Route path="/cmdb/*" element={<CmdbRouter />} />
  // ...
</Routes>;

Then configure the cmdb-service URL in your app-config.yaml.

cmdb:
  baseUrl: http://your-service-url

Integration with the Catalog

The Lighthouse plugin can be integrated into the catalog so that Lighthouse audit information relating to a component can be displayed within that component's entity page. In order to link an Entity to its Lighthouse audits, the entity must be annotated as follows:

apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
  # ...
  annotations:
    # ...
    lighthouse.com/website-url: # A single website url e.g. https://backstage.io/

NOTE: The plugin only supports one website URL per component at this time.

Add a Cmdb tab to the EntityPage:

Similarly reference the CMDB Router directly:

export { EmbeddedRouter as CmdbRouter } from '../../../plugins/cmdb/src';
// packages/app/src/components/catalog/EntityPage.tsx
import { EmbeddedRouter as CmdbRouter } from '@backstage/plugin-cmdb';

// ...
const WebsiteEntityPage = ({ entity }: { entity: Entity }) => (
  <EntityPageLayout>
    // ...
    <EntityPageLayout.Content
      path="/lighthouse/*"
      title="Lighthouse"
      element={<LighthouseRouter entity={entity} />}
    />
  </EntityPageLayout>
);

NOTE: The embedded router renders page content without a header section allowing it to be rendered within a catalog plugin page.

Add a Lighthouse card to the overview tab on the EntityPage:

// packages/app/src/components/catalog/EntityPage.tsx
import {
  LastCmdbhouseAuditCard,
  isPluginApplicableToEntity as isCmdbAvailable,
} from '@backstage/plugin-lighthouse';

// ...

const OverviewContent = ({ entity }: { entity: Entity }) => (
  <Grid container spacing={3}>
    // ...
    {isCmdbAvailable(entity) && (
      <Grid item sm={4}>
        <LastCmdbAuditCard />
      </Grid>
    )}
  </Grid>
);

Development

npm publish