devtools: pull available modules

Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
This commit is contained in:
Vincenzo Scamporlino
2023-07-18 10:40:25 +02:00
committed by Patrik Oldsberg
parent e940ddcdf8
commit f690a28e5a
2 changed files with 3 additions and 1 deletions
+1
View File
@@ -28,6 +28,7 @@
"postpack": "backstage-cli package postpack"
},
"dependencies": {
"@backstage/autodetect": "workspace:^",
"@backstage/core-components": "workspace:^",
"@backstage/core-plugin-api": "workspace:^",
"@backstage/errors": "workspace:^",
@@ -41,6 +41,7 @@ import {
DevToolsInfo,
PackageDependency,
} from '@backstage/plugin-devtools-common';
import * as autodetect from '@backstage/autodetect';
const PACKAGES_GLOBAL = '__backstage_detected_packages__';
@@ -78,7 +79,7 @@ const copyToClipboard = ({ about }: { about: DevToolsInfo | undefined }) => {
export const InfoContent = () => {
const classes = useStyles();
const { about, loading, error } = useInfo();
console.log('ooo', autodetect.getAvailablePlugins());
const availablePlugins: PackageDependency[] = (window as any)[PACKAGES_GLOBAL]
? (
(window as any)[PACKAGES_GLOBAL].modules as Array<Record<string, any>>