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

plugin(npm): create a standalone demo application for npm plugin #1516

Merged
merged 1 commit into from
Oct 23, 2024

Conversation

karthikjeeyar
Copy link
Contributor

@karthikjeeyar karthikjeeyar commented Oct 11, 2024

This PR adds a standalone npm demo application.

image

How to test:

  1. navigate into the workspaces/npm/plugins/npm folder
  2. run yarn start

✔️ 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)

@karthikjeeyar karthikjeeyar requested a review from a team as a code owner October 11, 2024 05:03
@karthikjeeyar karthikjeeyar requested a review from awanlin October 11, 2024 05:03
@backstage-goalie
Copy link
Contributor

backstage-goalie bot commented Oct 11, 2024

Changed Packages

Package Name Package Path Changeset Bump Current Version
app workspaces/npm/packages/app none v0.0.1
@backstage-community/plugin-npm workspaces/npm/plugins/npm patch v1.0.0

workspaces/npm/plugins/npm/dev/index.tsx Outdated Show resolved Hide resolved
workspaces/npm/plugins/npm/src/plugin.ts Outdated Show resolved Hide resolved
@backstage-goalie
Copy link
Contributor

Thanks for the contribution!
All commits need to be DCO signed before they are reviewed. Please refer to the the DCO section in CONTRIBUTING.md or the DCO status for more info.

Copy link
Member

@christoph-jerolimov christoph-jerolimov left a comment

Choose a reason for hiding this comment

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

Some tiny code style ideas :)

workspaces/npm/plugins/npm/dev/index.tsx Outdated Show resolved Hide resolved
workspaces/npm/plugins/npm/dev/index.tsx Show resolved Hide resolved
workspaces/npm/plugins/npm/package.json Outdated Show resolved Hide resolved
workspaces/npm/plugins/npm/src/index.ts Outdated Show resolved Hide resolved
@karthikjeeyar karthikjeeyar changed the title plugin(npm): create a standalone demo application plugin(npm): make npm plugin public and create a standalone demo application Oct 11, 2024
Copy link
Member

@christoph-jerolimov christoph-jerolimov left a comment

Choose a reason for hiding this comment

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

Thanks for that change. Lgtm!

@karthikjeeyar
Copy link
Contributor Author

cc: @nickboldt

Copy link
Contributor

@awanlin awanlin left a comment

Choose a reason for hiding this comment

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

Thanks for the adjustments @karthikjeeyar, just one change needed around the changeset config 👍

workspaces/npm/.changeset/config.json Outdated Show resolved Hide resolved
@karthikjeeyar karthikjeeyar force-pushed the standalone-app branch 2 times, most recently from 55631e4 to 051f7a5 Compare October 22, 2024 04:24
@karthikjeeyar karthikjeeyar changed the title plugin(npm): make npm plugin public and create a standalone demo application plugin(npm): create a standalone demo application for npm plugin Oct 22, 2024
@karthikjeeyar
Copy link
Contributor Author

This PR now contains only the standalone demo application, I have removed all the release related changes.

Copy link
Member

@christoph-jerolimov christoph-jerolimov left a comment

Choose a reason for hiding this comment

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

Thanks @karthikjeeyar, lgtm!

Copy link
Contributor

@awanlin awanlin left a comment

Choose a reason for hiding this comment

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

Hi @karthikjeeyar, thanks for the changes to match things going on outside this PR impacting you. 🙏

Looking over this again and I left a comment about the exports in your plugin.ts, you also need to add a changeset as the code is changing and you'll want a new package version published to NPM.

workspaces/npm/plugins/npm/src/plugin.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@awanlin awanlin left a comment

Choose a reason for hiding this comment

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

Solid! Thanks again @karthikjeeyar 🚀

@awanlin awanlin merged commit 12d5926 into backstage:main Oct 23, 2024
11 checks passed
@christoph-jerolimov
Copy link
Member

Solid! Thanks again @karthikjeeyar 🚀

Actually, this breaks the existing code because it changes the exported names. :-/

The direction is fine, of course; the usage of createComponentExtension is great!

And I'm thankful for the code improvement and review!

But at the same moment, it's a bit sad that I didn't had "the chance" to review this.

@awanlin
Copy link
Contributor

awanlin commented Oct 23, 2024

Hi @christoph-jerolimov, sorry, you are absolutely correct. In this case I moved too fast. How best should we move forward? I'm willing to put a PR together if needed.

@christoph-jerolimov
Copy link
Member

It's fine! I don't expect any users at the moment 😏 🤷‍♂️

I just wanted share "that feeling" and thanks that you accepting the feedback. 🤗

Moving fast, breaking things and fixing them is fine.

I will look into that report.api.md issue and raise a PR later today, but we don't need to rush on that for me.

@awanlin
Copy link
Contributor

awanlin commented Oct 23, 2024

Thanks, it for sure was not intentional, I had some time to review and this looked ready to go.

There are 117 downloads for this package, people are using it and for them this would be a breaking change. Do you want me to at least update the changelog to match that reality?

@awanlin
Copy link
Contributor

awanlin commented Oct 23, 2024

I have the code change waiting in a branch here: main...awanlin:community-plugins:topic/npm-changelog-correction, if you want me to make a PR just let me know.

@christoph-jerolimov
Copy link
Member

christoph-jerolimov commented Oct 23, 2024

Fine for me. I thought about exporting Entity*Card as *Card as well, and marking it as deprecated. (Work in progress)

@awanlin
Copy link
Contributor

awanlin commented Oct 23, 2024

It's your plugin and I'm tryin to correct my mistake, if the deprecated path if the one you want to take I'm fine with that 👍

@awanlin
Copy link
Contributor

awanlin commented Oct 23, 2024

How does this look to you? main...awanlin:community-plugins:topic/npm-correction

@christoph-jerolimov
Copy link
Member

You're fast :) I worked on a similar idea, wdyt about #1751?

@christoph-jerolimov
Copy link
Member

Actually, I'm confused why the renaming was required. Last week, when I checked this with Karthik we both had issues with the api exports which I couldn't reproduce..

And I'm not sure if its a best practice to prefix entity Cards with Entity*

@awanlin
Copy link
Contributor

awanlin commented Oct 23, 2024

#1751 looks good to me, I've approved but leaving it to you to tell me when to merge.

As for the Entity prefix it's been a common convention used for a long time by various plugins but it's not something you have to do. My quick scan I saw it at about 50/50 in the 4 plugins I looked at. The idea was that it helps identify that it "needs" to be used in the Catalog as part of an entity as the component likely uses useEntity.

@karthikjeeyar
Copy link
Contributor Author

Actually, I'm confused why the renaming was required. Last week, when I checked this with Karthik we both had issues with the api exports which I couldn't reproduce..

And I'm not sure if its a best practice to prefix entity Cards with Entity*

Apologies for introducing breaking changes, my intent was to follow Entity* naming convention which helps to clarify that these component needs to be wrapped inside EntityProvider for it to work. To resolve the api exports issue, I replaced the regular function exports with arrow function exports.

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