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

@rsc-labs/backstage-highlights-plugin

v0.3.0

Published

<img src='https://raw.githubusercontent.com/RSC-Labs/backstage-highlights-plugin/main/docs/highlighter.png' width='100' height='150' alt='Highlights screenshot'>

Downloads

126

Readme

@rsc-labs/backstage-highlights-plugin

Backstage Highlights Plugin is configurable and customizable plugin for viewing the most important information about your entity.

Why?

We have a lot information from different plugins and also in Overview tab, but sometimes:

  • we want to see some short summary from couple of plugins
  • we do not want to jump to every card to get such information

The "Highlights" shall provide you possibility to create such small, useful view.

Getting started

If you haven't already, check out the Backstage docs and create a Backstage application with

npx @backstage/create-app

Then, you will need to install and configure the highlights plugins for the frontend and the backend. Backend plugin installation can be found here: Backend plugin

Frontend plugin

Install:

cd packages/app
yarn add @rsc-labs/backstage-highlights-plugin

Card:

Add the card to packages/app/src/components/catalog/EntityPage.tsx:

// import:
import { isGitlabHighlightsAvailable, EntityHighlightsCard } from '@rsc-labs/backstage-highlights-plugin';

// use it in entity view
const overviewContent = (
  <Grid container
  ...
    <Grid item md={12} xs={12}>
      <EntitySwitch>
          <EntitySwitch.Case if={isGitlabHighlightsAvailable}>
            <EntityHighlightsCard />
          </EntitySwitch.Case>
        </EntitySwitch>
    </Grid>
  </Grid>
)

For the best UX we strongly recommend to use as much horizontal space as possible. Thanks to that you will have your highlights on top of your page as a bar.

Of course, you can also make it smaller and near the other card.

Built-in fields

At this moment, "highlights plugin" comes with built-in support of basic information about Git. As you can see in above picture, we support following fields:

  • latest tag
  • number of branches
  • latest commit
  • date of latest commit
  • author of latest commit
  • clone button

You can click at the field and get more information. For example, when you click on latest tag you will get longer history:

Other fields can have similar functionality, but it depends on the provider (Github API provides more information)

At this moment built-in fields supports Github and Gitlab (see: Configuration of Backend).

Frontend configuration

By default, you can use EntityHighlights without any parameter - it gives you above built-in fields. However, you may want change a behaviour or implement your custom fields. Below you can find an interface:

/** @public */
export interface EntityHighlightsProps {
  fields?: EHighlightFields[];
  customFields?: HighlightCustomField[];
}
  1. fields - this parameter describes what built-in you would like to see and in what order
  2. customFields - this parameter can let you define your own field. Every custom field contains:
    • fieldLabel - it is a title of the field (you can see it in built-in fields). It is optional parameter as your field can be also without a title (example: Clone button in built-in fields)
    • field - it is simple React component

TODO

[ ] Unit tests

[ ] More fields to support

Contribution

Contributions are welcome and they are greatly appreciated!

License

Licensed under the Mozilla Public License, Version 2.0: https://www.mozilla.org/en-US/MPL/2.0/


© 2023 RSC https://rsoftcon.com/