feat(scorecard): Add New Frontend System (NFS) support#2477
feat(scorecard): Add New Frontend System (NFS) support#2477rohitratannagar wants to merge 11 commits intoredhat-developer:mainfrom
Conversation
Signed-off-by: rohitratannagar <rohitratannagar2003@gmail.com>
Signed-off-by: rohitratannagar <rohitratannagar2003@gmail.com>
Changed Packages
|
Review Summary by QodoAdd New Frontend System (NFS) support to scorecard plugin
WalkthroughsDescription• Add New Frontend System (NFS) support to scorecard plugin • Create new app-next package with NFS-compatible Backstage app • Implement alpha exports for NFS plugin architecture • Add configurable entity kind filtering for scorecard tab visibility Diagramflowchart LR
A["Scorecard Plugin"] -->|"alpha exports"| B["NFS Architecture"]
B -->|"uses"| C["app-next Package"]
C -->|"configures"| D["Entity Kind Filter"]
D -->|"controls"| E["Scorecard Tab Visibility"]
File Changes1. workspaces/scorecard/packages/app-next/package.json
|
Code Review by Qodo
1.
|
Signed-off-by: rohitratannagar <rohitratannagar2003@gmail.com>
| export function createScorecardEntityContent( | ||
| options?: ScorecardEntityContentOptions, | ||
| ): ExtensionDefinition { | ||
| const filter = | ||
| options?.entityKinds?.length && | ||
| `kind:${options.entityKinds.map(k => k.toLowerCase()).join(',')}`; | ||
| return EntityContentBlueprint.make({ | ||
| name: 'scorecard', | ||
| params: { | ||
| ...defaultScorecardEntityContentParams, | ||
| ...(filter && { filter }), | ||
| }, | ||
| }); | ||
| } | ||
|
|
||
| /** Scorecard translation resources */ | ||
| const scorecardTranslation = TranslationBlueprint.make({ | ||
| params: { | ||
| resource: scorecardTranslations, | ||
| }, | ||
| }); | ||
|
|
||
| /** Main Scorecard frontend plugin */ | ||
| export default createFrontendPlugin({ | ||
| pluginId: 'scorecard', | ||
| extensions: [scorecardApi], | ||
| routes: { root: rootRouteRef }, | ||
| }); | ||
|
|
||
| /** | ||
| * Creates a module that registers the Scorecard entity tab with the given options. | ||
| * Pass entity kinds from the app (e.g. in app-next App.tsx) to control which entities show the tab. | ||
| * @public | ||
| */ | ||
| export function createScorecardCatalogModule( | ||
| options?: ScorecardEntityContentOptions, | ||
| ) { | ||
| return createFrontendModule({ | ||
| pluginId: 'catalog', | ||
| extensions: [createScorecardEntityContent(options)], | ||
| }); | ||
| } | ||
|
|
||
| /** Module registering Scorecard translations in app */ | ||
| export const scorecardTranslationsModule = createFrontendModule({ | ||
| pluginId: 'app', | ||
| extensions: [scorecardTranslation], | ||
| }); |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
Signed-off-by: rohitratannagar <rohitratannagar2003@gmail.com>
Signed-off-by: rohitratannagar <rohitratannagar2003@gmail.com>
Signed-off-by: rohitratannagar <rohitratannagar2003@gmail.com>
Signed-off-by: rohitratannagar <rohitratannagar2003@gmail.com>
Signed-off-by: rohitratannagar <rohitratannagar2003@gmail.com>
Signed-off-by: rohitratannagar <rohitratannagar2003@gmail.com>
Review Summary by QodoAdd New Frontend System (NFS) support to scorecard plugin
WalkthroughsDescription• Add New Frontend System (NFS) support with alpha exports • Create app-next package for NFS-based Backstage application • Add TypeScript type annotations to API and translation references • Fix TypeScript compilation errors and type safety issues • Add translation type casting for i18n function calls Diagramflowchart LR
A["Scorecard Plugin"] -->|"NFS Alpha Exports"| B["Frontend Plugin API"]
A -->|"Entity Content"| C["Catalog Integration"]
A -->|"Translations"| D["Translation Module"]
E["app-next Package"] -->|"Uses"| A
E -->|"NFS Features"| B
F["Type Annotations"] -->|"Improves"| G["Type Safety"]
File Changes1. workspaces/scorecard/plugins/scorecard/src/api/index.ts
|
Code Review by Qodo
1.
|
Review Summary by QodoAdd New Frontend System (NFS) support to scorecard plugin
WalkthroughsDescription• Add New Frontend System (NFS) support with alpha exports • Create new app-next package for NFS-based Backstage app • Add TypeScript type annotations for API and translation refs • Fix TypeScript compilation errors and type safety issues Diagramflowchart LR
A["Scorecard Plugin"] -->|"NFS Alpha Exports"| B["Frontend Plugin API"]
A -->|"Entity Content Extension"| C["Catalog Integration"]
A -->|"Translation Module"| D["App Translations"]
E["app-next Package"] -->|"Uses NFS"| B
E -->|"Scorecard Module"| C
E -->|"Legacy Compat"| F["Core Components"]
File Changes1. workspaces/scorecard/plugins/scorecard/src/api/index.ts
|
Code Review by Qodo
1. Missing react-router-dom dep
|
|
closing this pr due to mess -- |
|
| "dependencies": { | ||
| "@backstage/cli": "^0.34.5", | ||
| "@backstage/core-compat-api": "^0.5.5", | ||
| "@backstage/core-components": "^0.18.3", | ||
| "@backstage/core-plugin-api": "^1.12.0", | ||
| "@backstage/frontend-defaults": "^0.4.0", | ||
| "@backstage/plugin-catalog": "^1.32.0", | ||
| "@backstage/plugin-scaffolder": "^1.34.3", | ||
| "@backstage/plugin-user-settings": "^0.8.29", | ||
| "@backstage/ui": "^0.9.1", | ||
| "@red-hat-developer-hub/backstage-plugin-scorecard": "workspace:^", | ||
| "@red-hat-developer-hub/backstage-plugin-theme": "^0.12.0", | ||
| "react": "^18.0.2", | ||
| "react-dom": "^18.0.2" | ||
| }, |
There was a problem hiding this comment.
1. Missing react-router-dom dep 🐞 Bug ⛯ Reliability
app-next depends on @backstage/frontend-defaults, which declares react-router-dom as a peer dependency, but app-next does not declare it. This makes app-next fragile when built/used in isolation (e.g., focused installs) and can result in runtime/module resolution errors or peer dependency failures.
Agent Prompt
## Issue description
`workspaces/scorecard/packages/app-next` depends on `@backstage/frontend-defaults`, which has a `react-router-dom` peer dependency, but `app-next` does not declare `react-router-dom`.
## Issue Context
This can break `app-next` builds/starts when installed or built independently (e.g., focused installs, extracting app-next into its own repo, stricter peer-dep enforcement).
## Fix Focus Areas
- workspaces/scorecard/packages/app-next/package.json[18-35]
- workspaces/scorecard/yarn.lock[2714-2733]
## Proposed change
Add `react-router-dom` to `dependencies` for app-next (use a version range compatible with the Backstage packages in this workspace, e.g. `^6.30.2`).
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Hey, I just made a Pull Request!
scorecard entity tab -- when options are passed
Screen.Recording.2026-03-06.at.3.34.08.PM.mov
scorecard entity tab -- when options are not passed (Scorecard is shown for each kind of entity)
Screen.Recording.2026-03-06.at.3.38.40.PM.mov
Legacy App after changes
Screen.Recording.2026-03-06.at.4.00.03.PM.mov
✔️ Checklist