-
Notifications
You must be signed in to change notification settings - Fork 81
feat(marketplace): integrate plugins-info plugin #1395
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
Changes from 10 commits
db8f890
405e045
2b7a4c6
d1f56b6
8d464ea
a414de9
8610897
69f3930
0660152
2aaaa38
c290b15
66609c9
42a921f
e296c28
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| --- | ||
| '@red-hat-developer-hub/backstage-plugin-marketplace-backend': minor | ||
| '@red-hat-developer-hub/backstage-plugin-marketplace': major | ||
| --- | ||
|
|
||
| Integrate plugins-info plugin and add `Installed packages` tab with enhanced UI. | ||
|
|
||
| BREAKING: The deprecated `InstallationContextProvider` export behavior changed. | ||
|
|
||
| - We now export a null component `InstallationContextProvider` from `plugin.ts` solely for backward compatibility. It no longer provides context and will be removed in a future release. | ||
| - Migration: There is no replacement API; this was internal-only. Please upgrade to the latest RHDH where features no longer rely on this provider. | ||
|
|
||
| Also: | ||
|
|
||
| - New `Installed packages` tab with dual-source mapping and client-side filtering/pagination. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -50,7 +50,8 @@ | |
| "minimatch": "3", | ||
| "node-gyp": "^9.0.0", | ||
| "prettier": "^3.4.2", | ||
| "typescript": "~5.3.0" | ||
| "typescript": "~5.3.0", | ||
| "yaml": "^2.8.1" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this is needed on the workspace level? :) |
||
| }, | ||
| "resolutions": { | ||
| "@types/react": "^18", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,6 +34,7 @@ | |
| }, | ||
| "dependencies": { | ||
| "@backstage/backend-defaults": "^0.11.1", | ||
| "@backstage/backend-dynamic-feature-service": "^0.7.3", | ||
| "@backstage/backend-plugin-api": "^1.4.1", | ||
| "@backstage/catalog-client": "^1.10.2", | ||
| "@backstage/catalog-model": "^1.7.5", | ||
|
|
@@ -44,7 +45,6 @@ | |
| "@red-hat-developer-hub/backstage-plugin-marketplace-common": "workspace:^", | ||
| "express": "^4.17.1", | ||
| "express-promise-router": "^4.1.0", | ||
| "yaml": "^2.7.1", | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| "zod": "^3.22.4" | ||
| }, | ||
| "devDependencies": { | ||
|
|
@@ -56,7 +56,8 @@ | |
| "@types/express": "*", | ||
| "@types/supertest": "^2.0.12", | ||
| "msw": "^1.0.0", | ||
| "supertest": "^6.2.4" | ||
| "supertest": "^6.2.4", | ||
| "yaml": "^2.7.1" | ||
| }, | ||
| "files": [ | ||
| "dist" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| /* | ||
| * Copyright The Backstage Authors | ||
| * | ||
| * 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 { DiscoveryApi, FetchApi } from '@backstage/core-plugin-api'; | ||
| import { DynamicPluginInfo, DynamicPluginsInfoApi } from '.'; | ||
|
|
||
| export interface DynamicPluginsInfoClientOptions { | ||
| discoveryApi: DiscoveryApi; | ||
| fetchApi: FetchApi; | ||
| } | ||
|
|
||
| const loadedPluginsEndpoint = '/loaded-plugins'; | ||
|
|
||
| export class DynamicPluginsInfoClient implements DynamicPluginsInfoApi { | ||
| private readonly discoveryApi: DiscoveryApi; | ||
| private readonly fetchApi: FetchApi; | ||
|
|
||
| constructor(options: DynamicPluginsInfoClientOptions) { | ||
| this.discoveryApi = options.discoveryApi; | ||
| this.fetchApi = options.fetchApi; | ||
| } | ||
| async listLoadedPlugins(): Promise<DynamicPluginInfo[]> { | ||
| const baseUrl = await this.discoveryApi.getBaseUrl('extensions'); | ||
| const targetUrl = `${baseUrl}${loadedPluginsEndpoint}`; | ||
| const response = await this.fetchApi.fetch(targetUrl); | ||
| const data = await response.json(); | ||
| if (!response.ok) { | ||
| const message = data.error?.message || data.message || data.toString?.(); | ||
| throw new Error(`Failed to load dynamic plugin info: ${message}`); | ||
| } | ||
| return data; | ||
| } | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.