-
Notifications
You must be signed in to change notification settings - Fork 96
feat(scorecard): Add New Frontend System (NFS) support #2477
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
Closed
rohitratannagar
wants to merge
11
commits into
redhat-developer:main
from
rohitratannagar:feat/scorecard-nfs
Closed
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
bd59ab0
Adding NFS support in scorecard
rohitratannagar c0efa7f
adding changeset
rohitratannagar bfddcb0
pushing yarn.lock changes
rohitratannagar 302201a
fixing for yarn.lock fails
rohitratannagar dcaa715
fixing it for yarn tsc:full
rohitratannagar 2f9b361
fixing
rohitratannagar da58965
fixing ci
rohitratannagar a010d8e
fix(scorecard): fix API reports CI and TS2742 declaration emit errors
rohitratannagar 9316571
fixing for errors
rohitratannagar 94b4dd7
fix(scorecard): fix api-reports TypeScript errors from node_modules
rohitratannagar 4d6b9a1
chore(scorecard): update API reports
rohitratannagar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@red-hat-developer-hub/backstage-plugin-scorecard': patch | ||
| --- | ||
|
|
||
| Added support for the New Frontend System (NFS), including an alpha export for NFS apps and a new `app-next` package. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| module.exports = require('@backstage/cli/config/eslint-factory')(__dirname); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| { | ||
| "name": "app-next", | ||
| "version": "0.0.0", | ||
| "private": true, | ||
| "backstage": { | ||
| "role": "frontend" | ||
| }, | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "https://github.com/redhat-developer/rhdh-plugins", | ||
| "directory": "workspaces/scorecard/packages/app-next" | ||
| }, | ||
| "scripts": { | ||
| "start": "backstage-cli package start", | ||
| "build": "backstage-cli package build", | ||
| "clean": "backstage-cli package clean" | ||
| }, | ||
| "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" | ||
| }, | ||
| "devDependencies": { | ||
| "@types/react": "^18" | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="utf-8" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
| <meta name="theme-color" content="#000000" /> | ||
| <meta | ||
| name="description" | ||
| content="Backstage is an open source framework for building developer portals" | ||
| /> | ||
| <!-- | ||
| manifest.json provides metadata used when your web app is installed on a | ||
| user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/ | ||
| --> | ||
| <link | ||
| rel="manifest" | ||
| href="<%= publicPath %>/manifest.json" | ||
| crossorigin="use-credentials" | ||
| /> | ||
| <link rel="icon" href="<%= publicPath %>/favicon.ico" /> | ||
| <link rel="shortcut icon" href="<%= publicPath %>/favicon.ico" /> | ||
| <link | ||
| rel="apple-touch-icon" | ||
| sizes="180x180" | ||
| href="<%= publicPath %>/apple-touch-icon.png" | ||
| /> | ||
| <link | ||
| rel="icon" | ||
| type="image/png" | ||
| sizes="32x32" | ||
| href="<%= publicPath %>/favicon-32x32.png" | ||
| /> | ||
| <link | ||
| rel="icon" | ||
| type="image/png" | ||
| sizes="16x16" | ||
| href="<%= publicPath %>/favicon-16x16.png" | ||
| /> | ||
| <link | ||
| rel="mask-icon" | ||
| href="<%= publicPath %>/safari-pinned-tab.svg" | ||
| color="#5bbad5" | ||
| /> | ||
| <title><%= config.getOptionalString('app.title') ?? 'Backstage' %></title> | ||
| </head> | ||
| <body> | ||
| <noscript>You need to enable JavaScript to run this app.</noscript> | ||
| <div id="root"></div> | ||
| <!-- | ||
| This HTML file is a template. | ||
| If you open it directly in the browser, you will see an empty page. | ||
|
|
||
| You can add webfonts, meta tags, or analytics to this file. | ||
| The build step will place the bundled scripts into the <body> tag. | ||
|
|
||
| To begin the development, run `yarn start`. | ||
| To create a production bundle, use `yarn build`. | ||
| --> | ||
| </body> | ||
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| /* | ||
| * Copyright Red Hat, Inc. | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| import { createApp } from '@backstage/frontend-defaults'; | ||
| import { convertLegacyAppOptions } from '@backstage/core-compat-api'; | ||
| import { SignInPage } from '@backstage/core-components'; | ||
| import { githubAuthApiRef, gitlabAuthApiRef } from '@backstage/core-plugin-api'; | ||
| import { getThemes } from '@red-hat-developer-hub/backstage-plugin-theme'; | ||
| import scorecardPlugin, { | ||
| scorecardTranslationsModule, | ||
| createScorecardCatalogModule, | ||
| } from '@red-hat-developer-hub/backstage-plugin-scorecard/alpha'; | ||
|
|
||
| import catalogPlugin from '@backstage/plugin-catalog/alpha'; | ||
| import scaffolderPlugin from '@backstage/plugin-scaffolder/alpha'; | ||
| import userSettingsPlugin from '@backstage/plugin-user-settings/alpha'; | ||
|
|
||
| /* | ||
| * Custom sign-in page (legacy component). SignInPageBlueprint and ThemeBlueprint | ||
| * are deprecated; sign-in and themes are provided via convertLegacyAppOptions. | ||
| */ | ||
| const customSignInPage = (props: React.ComponentProps<typeof SignInPage>) => ( | ||
| <SignInPage | ||
| {...props} | ||
| auto | ||
| providers={[ | ||
| 'guest', | ||
| { | ||
| id: 'github-auth-provider', | ||
| title: 'GitHub', | ||
| message: 'Sign in using GitHub', | ||
| apiRef: githubAuthApiRef, | ||
| }, | ||
| { | ||
| id: 'gitlab-auth-provider', | ||
| title: 'GitLab', | ||
| message: 'Sign in using GitLab', | ||
| apiRef: gitlabAuthApiRef, | ||
| }, | ||
| ]} | ||
| /> | ||
| ); | ||
|
|
||
| /* | ||
| * Legacy options: themes (RHDH light/dark) and SignInPage. | ||
| * Replaces deprecated SignInPageBlueprint and ThemeBlueprint modules. | ||
| */ | ||
| const legacyConvertedOptions = convertLegacyAppOptions({ | ||
| themes: getThemes(), | ||
| components: { | ||
| SignInPage: customSignInPage as React.ComponentType<any>, | ||
| }, | ||
| }); | ||
|
|
||
| /* | ||
| * Scorecard: entity kinds that show the Scorecard tab on the catalog entity page. | ||
| * Catalog module attaches to catalogPlugin for these kinds only. | ||
| */ | ||
| const scorecardEntityKinds = ['component', 'service', 'template']; | ||
| const scorecardCatalogModule = createScorecardCatalogModule({ | ||
| entityKinds: scorecardEntityKinds, | ||
| }); | ||
|
|
||
| const scorecard = [ | ||
| scorecardCatalogModule, | ||
| scorecardTranslationsModule, | ||
| scorecardPlugin, | ||
| ]; | ||
|
|
||
| /* | ||
| * app-next: Backstage app using the New Frontend System (NFS). | ||
| * Sign-in and themes use legacy options (convertLegacyAppOptions). | ||
| */ | ||
| const app = createApp({ | ||
| features: [ | ||
| legacyConvertedOptions, | ||
| ...scorecard, | ||
| catalogPlugin, | ||
| scaffolderPlugin, | ||
| userSettingsPlugin, | ||
| ], | ||
| }); | ||
|
|
||
| export default app.createRoot(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1. Missing react-router-dom dep
🐞 Bug⛯ ReliabilityAgent Prompt
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools