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-accentuate

v0.0.11

Published

Welcome to the accentuate plugin.

Downloads

221

Readme

Accentuate Plugin

Welcome to the accentuate plugin.

This plugin provides the ability to overwrite entities in the UI without change the backing YAML definition from SCM.

Provided are the following functionalities:

  • Component to show that an entity has been overwritten
  • Component to edit entities based on JSON schemas
  • Page to get an overview what has been overwritten
  • Backend storing additional data in the database and responsible for merging

Future ideas:

  • Provide ability to create entities
  • Integrate in inspect dialog

entity-json-schema-editor

Setup

Install this plugin:

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

Configuration

You need to have the accentuate backend plugin configured.

Allowed kinds

You can configure which entity kind (e.g. Group) are modifiable by the plugin by using

accentuate:
  allowedKinds:
    - kind: 'User'
    - kind: 'Group'
    - kind: 'Group'
    - kind: 'Component'
    - kind: 'Resource'
    - kind: 'System'
    - kind: 'Domain'

The list above is the default.

You can even more specific control the allowed entities over the spec.type with

accentuate:
  allowedKinds:
    - kind: 'Component'
      specType: 'service'

This could mean only components of type service are allowed to be accentuated.

Annotations

You can use the following annotation to disable modification on a per-entity level

apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
  name: component-accentuate
  annotations:
    accentuate/disable: 'true'
spec: ...

Entity Pages

You have two options to show and edit an entity.

Info banner

entity-info-banner

For this implement the EntityAccentuateInfo like

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

import {
  EntityAccentuateInfo,
  isAccentuateEnabled,
} from '@dweber019/backstage-plugin-accentuate';

const entityWarningContent = (
  <>
    ...
    <EntitySwitch>
      <EntitySwitch.Case if={isAccentuateEnabled}>
        <Grid item xs={12}>
          <EntityAccentuateInfo />
        </Grid>
      </EntitySwitch.Case>
    </EntitySwitch>
  </>
);

Context menu

entity-context-menu

For this implement the EntityAccentuateInfo like

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

import { EntityLayoutWrapper } from '@dweber019/backstage-plugin-accentuate';

const serviceEntityPage = (
  <EntityLayoutWrapper>
    <EntityLayout.Route path="/" title="Overview">
      {overviewContent}
    </EntityLayout.Route>
    ...
  </EntityLayoutWrapper>
);

If you are other plugins using context menu, you most probably have to reimplement this you own.

Overview page

page-overview

To add the overview page you have to add the page at

// packages/app/src/App.tsx

import { AccentuatePage } from '@dweber019/backstage-plugin-accentuate';

const routes = (
  <FlatRoutes>
    ...
    <Route path="/accentuate" element={<AccentuatePage />} />
  </FlatRoutes>
);

Then extend the navigation like

// packages/app/src/components/Root/Root.tsx

import BrushIcon from '@material-ui/icons/Brush';

export const Root = ({ children }: PropsWithChildren<{}>) => (
  <SidebarPage>
    <Sidebar>
      <SidebarGroup label="Menu" icon={<MenuIcon />}>
        <SidebarScrollWrapper>
          ...
          <SidebarItem icon={BrushIcon} to="accentuate" text="Accentuate" />
        </SidebarScrollWrapper>
      </SidebarGroup>
    </Sidebar>
    {children}
  </SidebarPage>
);

Icon

Thanks to Dust icons created by Konkapp - Flaticon for the icon.