Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add/migrate new npm plugin (shows information for entities from npmjs.com) #1485

Merged
merged 11 commits into from
Oct 10, 2024

Conversation

christoph-jerolimov
Copy link
Member

@christoph-jerolimov christoph-jerolimov commented Oct 7, 2024

Hey, I just made a Pull Request!

This PR adds a new workspace and plugin to show information from npm. From the plugin README:

Npm info card:

Screenshot

Npm release overview card:

Screenshot

Extended catalog entity overview tab (example):

Screenshot

New catalog entity npm release tab:

Screenshot

How to test the PR

The workspace contains a backstage app with working catalog entities:

cd workspaces/npm
yarn install
yarn dev

✔️ Checklist

  • A changeset describing the change and affected packages. (more info)
  • Added or updated documentation
  • Tests for new functionality and regression tests for bug fixes
  • Screenshots attached (for UI changes)
  • All your commits have a Signed-off-by line in the message. (more info)

@backstage-goalie
Copy link
Contributor

backstage-goalie bot commented Oct 7, 2024

Unnecessary Changesets

The following package(s) are private and do not need a changeset:

  • @backstage-community/plugin-npm

Changed Packages

Package Name Package Path Changeset Bump Current Version
app workspaces/npm/packages/app none v0.0.0
backend workspaces/npm/packages/backend none v0.0.0
@backstage-community/plugin-npm workspaces/npm/plugins/npm major v0.1.0

@christoph-jerolimov
Copy link
Member Author

@BethGriggs @nickboldt @Fortune-Ndlovu @ciiay I created this plugin some time ago in the evening. I will check asynchronously if I'm allowed to mark it as an RH plugin (in the plugin package.json).

I will also add dynamic plugin support as a follow-up. Let me know if anything else is needed, missed or recommended. :)

@christoph-jerolimov
Copy link
Member Author

I've added api reports (and docs) and knip reports. Let's see what's missing next. =)

Signed-off-by: Christoph Jerolimov <[email protected]>
Signed-off-by: Christoph Jerolimov <[email protected]>
Signed-off-by: Christoph Jerolimov <[email protected]>
Signed-off-by: Christoph Jerolimov <[email protected]>
Signed-off-by: Christoph Jerolimov <[email protected]>
Signed-off-by: Christoph Jerolimov <[email protected]>
Signed-off-by: Christoph Jerolimov <[email protected]>
Signed-off-by: Christoph Jerolimov <[email protected]>
Signed-off-by: Christoph Jerolimov <[email protected]>
Copy link
Collaborator

@BethGriggs BethGriggs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the last thing to do is to create a changeset for @backstage-community/plugin-npm to do a patch bump - this is needed to start the release flow. You can generate the changeset using yarn changeset in the workspace.

Copy link
Contributor

@karthikjeeyar karthikjeeyar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally, works well! 🎉

I have tested the components in overview page, npm releases tab (features like filters, sorting, etc) and added some comments and observations.

image

workspaces/npm/plugins/npm/src/components/NpmInfoCard.tsx Outdated Show resolved Hide resolved
workspaces/npm/plugins/npm/src/components/NpmInfoCard.tsx Outdated Show resolved Hide resolved
workspaces/npm/plugins/npm/src/components/NpmInfoCard.tsx Outdated Show resolved Hide resolved
workspaces/npm/plugins/npm/src/components/NpmInfoCard.tsx Outdated Show resolved Hide resolved
workspaces/npm/packages/app/package.json Outdated Show resolved Hide resolved
workspaces/npm/packages/backend/src/index.ts Outdated Show resolved Hide resolved
@christoph-jerolimov
Copy link
Member Author

Thanks @BethGriggs and @karthikjeeyar for the review. I addressed all your comments.

  1. Added a changeset
  2. Removed the kubernetes frontend and backend
  3. Links opens now in a new browser tab (I switched also from Link to a)
  4. Added loading indicators
  5. Shows API errors with an ErrorPanel (added another demo entity for the invalid package name case)

Here is a recording how the errors are displayed:

Screencast.from.2024-10-10.10-52-07.mp4

Copy link
Contributor

@karthikjeeyar karthikjeeyar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@BethGriggs
Copy link
Collaborator

Refs: backstage/community#160

@BethGriggs BethGriggs merged commit ab4b7fd into backstage:main Oct 10, 2024
12 checks passed
@christoph-jerolimov christoph-jerolimov deleted the migrate-npm branch October 10, 2024 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants