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

@dweber019/backstage-plugin-endoflife

v0.0.6

Published

Welcome to the end of life plugin!

Downloads

1,939

Readme

End of life Plugin

Welcome to the end of life plugin!

This plugin will show end of life data for entities from endoflife.date or your own data provided by a URL or integrations.

OpenShift Python

Setup

Install this plugin:

# From your Backstage root directory
yarn --cwd packages/app add @dweber019/backstage-plugin-endoflife

Annotations

You can use the annotation endoflife.date/products to define products at endoflife.date.
Use the product name in the url address (e.g. angular) for your annotation.

apiVersion: backstage.io/v1alpha1
kind: Resource
metadata:
  name: eol-angular
  annotations:
    endoflife.date/products: angular

You can even use multiple products with a comma separated list.

apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
  name: eol-angular-nginx-app
  annotations:
    endoflife.date/products: angular,nginx

Additionally, you can specify the version by using the release column (in the API called cycle).

apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
  name: eol-angular-nignx-version-app
  annotations:
    endoflife.date/products: angular@17,[email protected]

In addition to loading information from endoflife.date you can load information from URL's or your repository by providing the annotations endoflife.date/url-location or endoflife.date/source-location and using the type EndOfLifeCycle at plugins/endoflife/src/api/types.ts.

apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
  name: angular-app
  annotations:
    endoflife.date/url-location: https://gist.githubusercontent.com/dweber019/.../raw/.../versions.json
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
  name: 'angular-app'
  annotations:
    endoflife.date/source-location: /versions.json

The endoflife.date/source-location has to be relative to your source repository

To use the endoflife.date/source-location, you need to install the backend plugin

The annotations can't be combined and the order is endoflife.date/products, endoflife.date/url-location, endoflife.date/source-location

Entity Pages

Add the EntityEndOfLifeCard to the EntityPage.

You could use this directly on components like this

// packages/app/src/components/catalog/EntityPage.tsx

import { EntityEndOfLifeCard } from '@dweber019/backstage-plugin-endoflife';

const overviewContent = (
  <Grid container spacing={3} alignItems="stretch">
    {entityWarningContent}
    ...
    <EntitySwitch>
      <EntitySwitch.Case if={hasLabels}>
        <Grid item md={4} xs={12}>
          <EntityLabelsCard />
        </Grid>
      </EntitySwitch.Case>
    </EntitySwitch>
    <EntitySwitch>
      <EntitySwitch.Case if={isEndOfLifeAvailable}>
        <Grid item md={6}>
          <EntityEndOfLifeCard />
        </Grid>
      </EntitySwitch.Case>
    </EntitySwitch>
    ...
  </Grid>
);

or if you have resources representing technologies like databases or angular, you could use

// packages/app/src/components/catalog/EntityPage.tsx

import {
  EntityEndOfLifeCard,
  isEndOfLifeAvailable,
} from '@dweber019/backstage-plugin-endoflife';

const resourcePage = (
  <EntityLayoutWrapper>
    <EntityLayout.Route path="/" title="Overview">
      <Grid container spacing={3} alignItems="stretch">
        {entityWarningContent}
        ...
        <EntitySwitch>
          <EntitySwitch.Case if={isEndOfLifeAvailable}>
            <Grid item md={6}>
              <EntityEndOfLifeCard variant="gridItem" />
            </Grid>
          </EntitySwitch.Case>
        </EntitySwitch>
      </Grid>
    </EntityLayout.Route>
    ...
  </EntityLayoutWrapper>
);

or if you have API entities you could use the annotation endoflife.date/source-location to make version lifecycles visible to consumers.

Help text

You can customize the help text in the right upper corner by using the following configuration in app-config.yaml

endOfLife:
  helpText: |
    # Custom help text

    You can use markdown if you like

Troubleshooting

Behavior 'endoflife.date/products': angular

Using this annotation will result in a call to Get all details.

Behavior 'endoflife.date/products': angular@17

Using this annotation will result in a call to Single cycle details.

Behavior 'endoflife.date/products': angular@17,nginx

Using this annotation will result in multiple calls to the respective behavior above, depending on if the version is defined.

Wrong or missing data

All data is comming from endoflife.date and can be wrong or missing.
Please correct this by contributing back to the community.

Local development

There is a local setup at plugins/endoflife/dev which can be started with yarn --cwd plugins/endoflife start from the root.