@@ -7,7 +7,8 @@
|
||||
"pluginPackages": [
|
||||
"@backstage/plugin-devtools",
|
||||
"@backstage/plugin-devtools-backend",
|
||||
"@backstage/plugin-devtools-common"
|
||||
"@backstage/plugin-devtools-common",
|
||||
"@backstage/plugin-devtools-react"
|
||||
]
|
||||
},
|
||||
"publishConfig": {
|
||||
|
||||
@@ -8,7 +8,8 @@
|
||||
"pluginPackages": [
|
||||
"@backstage/plugin-devtools",
|
||||
"@backstage/plugin-devtools-backend",
|
||||
"@backstage/plugin-devtools-common"
|
||||
"@backstage/plugin-devtools-common",
|
||||
"@backstage/plugin-devtools-react"
|
||||
]
|
||||
},
|
||||
"publishConfig": {
|
||||
|
||||
@@ -1,38 +1,49 @@
|
||||
{
|
||||
"name": "@backstage/plugin-devtools-react",
|
||||
"version": "0.1.0",
|
||||
"license": "Apache-2.0",
|
||||
"private": true,
|
||||
"description": "Web library for the devtools plugin",
|
||||
"main": "src/index.ts",
|
||||
"types": "src/index.ts",
|
||||
"backstage": {
|
||||
"role": "web-library",
|
||||
"pluginId": "devtools",
|
||||
"pluginPackages": [
|
||||
"@backstage/plugin-devtools",
|
||||
"@backstage/plugin-devtools-backend",
|
||||
"@backstage/plugin-devtools-common",
|
||||
"@backstage/plugin-devtools-react"
|
||||
]
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
"main": "dist/index.esm.js",
|
||||
"types": "dist/index.d.ts"
|
||||
},
|
||||
"backstage": {
|
||||
"role": "web-library",
|
||||
"pluginId": "devtools"
|
||||
"private": true,
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/backstage/backstage",
|
||||
"directory": "plugins/devtools-react"
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"sideEffects": false,
|
||||
"main": "src/index.ts",
|
||||
"types": "src/index.ts",
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"scripts": {
|
||||
"start": "backstage-cli package start",
|
||||
"build": "backstage-cli package build",
|
||||
"lint": "backstage-cli package lint",
|
||||
"test": "backstage-cli package test",
|
||||
"clean": "backstage-cli package clean",
|
||||
"lint": "backstage-cli package lint",
|
||||
"prepack": "backstage-cli package prepack",
|
||||
"postpack": "backstage-cli package postpack"
|
||||
"postpack": "backstage-cli package postpack",
|
||||
"start": "backstage-cli package start",
|
||||
"test": "backstage-cli package test"
|
||||
},
|
||||
"dependencies": {
|
||||
"@backstage/core-plugin-api": "workspace:^",
|
||||
"@backstage/frontend-plugin-api": "workspace:^",
|
||||
"@material-ui/core": "^4.9.13"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.13.1 || ^17.0.0 || ^18.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/cli": "workspace:^",
|
||||
"@backstage/test-utils": "workspace:^",
|
||||
@@ -40,7 +51,7 @@
|
||||
"@testing-library/react": "^14.0.0",
|
||||
"react": "^16.13.1 || ^17.0.0 || ^18.0.0"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
]
|
||||
"peerDependencies": {
|
||||
"react": "^16.13.1 || ^17.0.0 || ^18.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import { ExtensionBlueprint } from '@backstage/frontend-plugin-api';
|
||||
import { ExtensionDataRef } from '@backstage/frontend-plugin-api';
|
||||
import { JSX as JSX_2 } from 'react';
|
||||
|
||||
// @alpha
|
||||
// @public
|
||||
export const DevToolsRouteBlueprint: ExtensionBlueprint<{
|
||||
kind: 'devtools-route';
|
||||
params: DevToolsRouteBlueprintParams;
|
||||
@@ -25,7 +25,7 @@ export const DevToolsRouteBlueprint: ExtensionBlueprint<{
|
||||
};
|
||||
}>;
|
||||
|
||||
// @alpha
|
||||
// @public
|
||||
export interface DevToolsRouteBlueprintParams {
|
||||
// (undocumented)
|
||||
loader: () => Promise<JSX_2.Element>;
|
||||
@@ -35,7 +35,7 @@ export interface DevToolsRouteBlueprintParams {
|
||||
title: string;
|
||||
}
|
||||
|
||||
// @alpha
|
||||
// @public
|
||||
export interface DevToolsRouteData {
|
||||
// (undocumented)
|
||||
children: JSX_2.Element;
|
||||
@@ -45,7 +45,7 @@ export interface DevToolsRouteData {
|
||||
title: string;
|
||||
}
|
||||
|
||||
// @alpha
|
||||
// @public
|
||||
export const devToolsRouteDataRef: ConfigurableExtensionDataRef<
|
||||
DevToolsRouteData,
|
||||
'devtools.route',
|
||||
|
||||
@@ -23,7 +23,7 @@ import { JSX } from 'react';
|
||||
|
||||
/**
|
||||
* Parameters for creating a DevTools route extension
|
||||
* @alpha
|
||||
* @public
|
||||
*/
|
||||
export interface DevToolsRouteBlueprintParams {
|
||||
path: string;
|
||||
@@ -44,8 +44,7 @@ export interface DevToolsRouteBlueprintParams {
|
||||
* }
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* @alpha
|
||||
* @public
|
||||
*/
|
||||
export const DevToolsRouteBlueprint = createExtensionBlueprint({
|
||||
kind: 'devtools-route',
|
||||
|
||||
@@ -19,7 +19,7 @@ import { JSX } from 'react';
|
||||
|
||||
/**
|
||||
* Represents a DevTools route that can be contributed by extensions
|
||||
* @alpha
|
||||
* @public
|
||||
*/
|
||||
export interface DevToolsRouteData {
|
||||
path: string;
|
||||
@@ -29,7 +29,7 @@ export interface DevToolsRouteData {
|
||||
|
||||
/**
|
||||
* Extension data reference for DevTools routes
|
||||
* @alpha
|
||||
* @public
|
||||
*/
|
||||
export const devToolsRouteDataRef =
|
||||
createExtensionDataRef<DevToolsRouteData>().with({
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
"pluginPackages": [
|
||||
"@backstage/plugin-devtools",
|
||||
"@backstage/plugin-devtools-backend",
|
||||
"@backstage/plugin-devtools-common"
|
||||
"@backstage/plugin-devtools-common",
|
||||
"@backstage/plugin-devtools-react"
|
||||
]
|
||||
},
|
||||
"publishConfig": {
|
||||
|
||||
@@ -6,9 +6,12 @@
|
||||
import { AnyApiFactory } from '@backstage/frontend-plugin-api';
|
||||
import { AnyRouteRefParams } from '@backstage/frontend-plugin-api';
|
||||
import { ApiFactory } from '@backstage/frontend-plugin-api';
|
||||
import { ConfigurableExtensionDataRef } from '@backstage/frontend-plugin-api';
|
||||
import { DevToolsRouteData } from '@backstage/plugin-devtools-react';
|
||||
import { ExtensionBlueprintParams } from '@backstage/frontend-plugin-api';
|
||||
import { ExtensionDataRef } from '@backstage/frontend-plugin-api';
|
||||
import { ExtensionDefinition } from '@backstage/frontend-plugin-api';
|
||||
import { ExtensionInput } from '@backstage/frontend-plugin-api';
|
||||
import { IconComponent } from '@backstage/core-plugin-api';
|
||||
import { JSX as JSX_2 } from 'react';
|
||||
import { OverridableFrontendPlugin } from '@backstage/frontend-plugin-api';
|
||||
@@ -58,8 +61,6 @@ const _default: OverridableFrontendPlugin<
|
||||
};
|
||||
}>;
|
||||
'page:devtools': ExtensionDefinition<{
|
||||
kind: 'page';
|
||||
name: undefined;
|
||||
config: {
|
||||
path: string | undefined;
|
||||
};
|
||||
@@ -76,7 +77,17 @@ const _default: OverridableFrontendPlugin<
|
||||
optional: true;
|
||||
}
|
||||
>;
|
||||
inputs: {};
|
||||
inputs: {
|
||||
routes: ExtensionInput<
|
||||
ConfigurableExtensionDataRef<DevToolsRouteData, 'devtools.route', {}>,
|
||||
{
|
||||
singleton: false;
|
||||
optional: true;
|
||||
}
|
||||
>;
|
||||
};
|
||||
kind: 'page';
|
||||
name: undefined;
|
||||
params: {
|
||||
defaultPath?: [Error: `Use the 'path' param instead`];
|
||||
path: string;
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
```ts
|
||||
import { BackstagePlugin } from '@backstage/core-plugin-api';
|
||||
import { DevToolsRouteData } from '@backstage/plugin-devtools-react';
|
||||
import { ElementType } from 'react';
|
||||
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
||||
import { ReactNode } from 'react';
|
||||
@@ -27,7 +28,15 @@ export type DevToolsLayoutProps = {
|
||||
};
|
||||
|
||||
// @public (undocumented)
|
||||
export const DevToolsPage: () => JSX_2.Element;
|
||||
export const DevToolsPage: ({
|
||||
extensionRoutes,
|
||||
}: DevToolsPageProps) => JSX_2.Element;
|
||||
|
||||
// @public (undocumented)
|
||||
export interface DevToolsPageProps {
|
||||
// (undocumented)
|
||||
extensionRoutes?: DevToolsRouteData[];
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export const devToolsPlugin: BackstagePlugin<
|
||||
|
||||
@@ -23,16 +23,10 @@ import { ConfigContent } from '../Content/ConfigContent';
|
||||
import { DevToolsLayout } from '../DevToolsLayout';
|
||||
import { InfoContent } from '../Content/InfoContent';
|
||||
import { RequirePermission } from '@backstage/plugin-permission-react';
|
||||
import { DevToolsRouteData } from '@backstage/plugin-devtools-react';
|
||||
|
||||
export interface DefaultDevToolsPageProps {
|
||||
extensionRoutes?: DevToolsRouteData[];
|
||||
}
|
||||
import { DevToolsPageProps } from '../DevToolsPage';
|
||||
|
||||
/** @public */
|
||||
export const DefaultDevToolsPage = ({
|
||||
extensionRoutes,
|
||||
}: DefaultDevToolsPageProps) => (
|
||||
export const DefaultDevToolsPage = ({ extensionRoutes }: DevToolsPageProps) => (
|
||||
<DevToolsLayout>
|
||||
<DevToolsLayout.Route path="info" title="Info">
|
||||
<RequirePermission permission={devToolsInfoReadPermission}>
|
||||
|
||||
@@ -18,6 +18,9 @@ import { useOutlet } from 'react-router-dom';
|
||||
import { DefaultDevToolsPage } from '../DefaultDevToolsPage';
|
||||
import { DevToolsRouteData } from '@backstage/plugin-devtools-react';
|
||||
|
||||
/**
|
||||
@public
|
||||
*/
|
||||
export interface DevToolsPageProps {
|
||||
extensionRoutes?: DevToolsRouteData[];
|
||||
}
|
||||
|
||||
@@ -14,4 +14,4 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export { DevToolsPage } from './DevToolsPage';
|
||||
export { DevToolsPage, type DevToolsPageProps } from './DevToolsPage';
|
||||
|
||||
@@ -16,3 +16,4 @@
|
||||
|
||||
export * from './Content';
|
||||
export * from './DevToolsLayout';
|
||||
export { type DevToolsPageProps } from './DevToolsPage';
|
||||
|
||||
Reference in New Issue
Block a user