Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions workspaces/app-defaults/packages/app/knip-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@
| @backstage/plugin-techdocs | package.json:40:6 | error |
| @backstage/plugin-signals | package.json:39:6 | error |
| @backstage/plugin-org | package.json:36:6 | error |
| react-router | package.json:50:6 | error |
| react-router | package.json:54:6 | error |

## Unused devDependencies (4)
## Unused devDependencies (3)

| Name | Location | Severity |
| :----------------------------- | :---------------- | :------- |
| @backstage/frontend-test-utils | package.json:54:6 | error |
| @testing-library/user-event | package.json:59:6 | error |
| @testing-library/dom | package.json:56:6 | error |
| cross-env | package.json:61:6 | error |
| @backstage/frontend-test-utils | package.json:58:6 | error |
| @testing-library/user-event | package.json:63:6 | error |
| cross-env | package.json:65:6 | error |

2 changes: 1 addition & 1 deletion workspaces/app-defaults/packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
"@material-ui/icons": "^4.9.1",
"@mui/material": "^5.18.0",
"@red-hat-developer-hub/backstage-plugin-app-auth": "workspace:^",
"@red-hat-developer-hub/backstage-plugin-app-defaults": "workspace:^",
"@red-hat-developer-hub/backstage-plugin-app-integrations": "workspace:^",
"@red-hat-developer-hub/backstage-plugin-app-react": "workspace:^",
"@red-hat-developer-hub/backstage-plugin-global-header": "^1.21.0",
"material-icons": "^1.13.14",
"react": "^18.0.2",
Expand Down
4 changes: 2 additions & 2 deletions workspaces/app-defaults/packages/app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { createApp } from '@backstage/frontend-defaults';
import catalogPlugin from '@backstage/plugin-catalog/alpha';
import { appAuthModule } from '@red-hat-developer-hub/backstage-plugin-app-auth/alpha';
import { appIntegrationsModule } from '@red-hat-developer-hub/backstage-plugin-app-integrations/alpha';
import { appDrawerModule } from '@red-hat-developer-hub/backstage-plugin-app-react/alpha';
import appDefaultsModule from '@red-hat-developer-hub/backstage-plugin-app-defaults';
import {
globalHeaderModule,
globalHeaderTranslationsModule,
Expand All @@ -32,7 +32,7 @@ export default createApp({
navModule,
appAuthModule,
appIntegrationsModule,
appDrawerModule,
appDefaultsModule,
drawerDemoModule,
globalHeaderModule,
globalHeaderTranslationsModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import { useAppDrawer } from '@red-hat-developer-hub/backstage-plugin-app-react';
import { useAppDrawer } from '@red-hat-developer-hub/backstage-plugin-app-defaults';
import { GlobalHeaderMenuItem } from '@red-hat-developer-hub/backstage-plugin-global-header/alpha';
import Box from '@mui/material/Box';
import Divider from '@mui/material/Divider';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

import { createFrontendModule } from '@backstage/frontend-plugin-api';
import { AppDrawerContentBlueprint } from '@red-hat-developer-hub/backstage-plugin-app-react/alpha';
import { AppDrawerContentBlueprint } from '@red-hat-developer-hub/backstage-plugin-app-defaults';
import { GlobalHeaderMenuItemBlueprint } from '@red-hat-developer-hub/backstage-plugin-global-header/alpha';
import {
ChatDrawerContent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
} from '@backstage/core-components';
import { NavContentBlueprint } from '@backstage/plugin-app-react';
import { SidebarLogo } from './SidebarLogo';
import { useAppDrawer } from '@red-hat-developer-hub/backstage-plugin-app-react';
import { useAppDrawer } from '@red-hat-developer-hub/backstage-plugin-app-defaults';
import MenuIcon from '@material-ui/icons/Menu';
import SearchIcon from '@material-ui/icons/Search';
import ChatIcon from '@material-ui/icons/Chat';
Expand Down
9 changes: 9 additions & 0 deletions workspaces/app-defaults/plugins/app-auth/knip-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Knip report

## Unused devDependencies (2)

| Name | Location | Severity |
| :--------------------- | :---------------- | :------- |
| @testing-library/react | package.json:64:6 | error |
| @backstage/test-utils | package.json:62:6 | error |

Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# @red-hat-developer-hub/backstage-plugin-app-defaults

# @red-hat-developer-hub/backstage-plugin-app-react

## 0.0.5
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @red-hat-developer-hub/backstage-plugin-app-react
# @red-hat-developer-hub/backstage-plugin-app-defaults

Shared UI components and extension APIs for the RHDH app shell. Provides the
application drawer system that lets plugins contribute persistent side panels
Expand All @@ -9,7 +9,7 @@ with host-owned state.
Add the package as a dependency in your plugin or app:

```bash
yarn add @red-hat-developer-hub/backstage-plugin-app-react
yarn add @red-hat-developer-hub/backstage-plugin-app-defaults
```

## App Integration
Expand All @@ -18,11 +18,11 @@ Register the drawer module in your app's `createApp` call:

```typescript
import { createApp } from '@backstage/frontend-defaults';
import { appDrawerModule } from '@red-hat-developer-hub/backstage-plugin-app-react/alpha';
import appDefaultsModule from '@red-hat-developer-hub/backstage-plugin-app-defaults';

export default createApp({
features: [
appDrawerModule,
appDefaultsModule,
// ...other plugins and modules
],
});
Expand All @@ -38,12 +38,11 @@ wrapping provider.

### Contributing a Drawer

Use `AppDrawerContentBlueprint` to declare drawer content in your plugin's
`/alpha` export:
Use `AppDrawerContentBlueprint` to declare drawer content in your plugin:

```typescript
import { createFrontendPlugin } from '@backstage/frontend-plugin-api';
import { AppDrawerContentBlueprint } from '@red-hat-developer-hub/backstage-plugin-app-react/alpha';
import { AppDrawerContentBlueprint } from '@red-hat-developer-hub/backstage-plugin-app-defaults';

const myDrawerExtension = AppDrawerContentBlueprint.make({
name: 'my-drawer',
Expand Down Expand Up @@ -92,7 +91,7 @@ app:
Use the `useAppDrawer()` hook from anywhere in the app:

```typescript
import { useAppDrawer } from '@red-hat-developer-hub/backstage-plugin-app-react';
import { useAppDrawer } from '@red-hat-developer-hub/backstage-plugin-app-defaults';

function MyHeaderButton() {
const { openDrawer } = useAppDrawer();
Expand All @@ -119,7 +118,7 @@ The hook provides:
### Closing from Inside the Drawer

```typescript
import { useAppDrawer } from '@red-hat-developer-hub/backstage-plugin-app-react';
import { useAppDrawer } from '@red-hat-developer-hub/backstage-plugin-app-defaults';

function MyDrawerContent() {
const { closeDrawer } = useAppDrawer();
Expand All @@ -136,15 +135,9 @@ function MyDrawerContent() {

## Exports

### Main entry (`@red-hat-developer-hub/backstage-plugin-app-react`)
### Main entry (`@red-hat-developer-hub/backstage-plugin-app-default`)

- `useAppDrawer` -- hook to control drawers
- `ApplicationDrawer` -- drawer renderer component
- `DrawerPanel` -- low-level MUI drawer wrapper
- `AppDrawerContent` / `AppDrawerApi` / `ApplicationDrawerProps` / `DrawerPanelProps` types

### Alpha entry (`@red-hat-developer-hub/backstage-plugin-app-react/alpha`)

- `appDrawerContentDataRef` -- extension data ref
- `AppDrawerContent` / `AppDrawerApi` types
- `AppDrawerContentBlueprint` -- blueprint for contributing drawers
- `appDrawerModule` -- frontend module (registers the drawer wrapper extension)
- `appDrawerContentDataRef` -- extension data ref
- `useAppDrawer` -- hook to control drawers
8 changes: 8 additions & 0 deletions workspaces/app-defaults/plugins/app-defaults/knip-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Knip report

## Unused devDependencies (1)

| Name | Location | Severity |
| :-------------------- | :---------------- | :------- |
| @backstage/test-utils | package.json:45:6 | error |

Original file line number Diff line number Diff line change
@@ -1,39 +1,25 @@
{
"name": "@red-hat-developer-hub/backstage-plugin-app-react",
"name": "@red-hat-developer-hub/backstage-plugin-app-defaults",
"version": "0.0.5",
"license": "Apache-2.0",
"description": "Shared UI components and extension APIs for the RHDH app shell",
"description": "Defaults app plugin extensions and extensions APIs for the RHDH app shell",
"main": "src/index.ts",
"types": "src/index.ts",
"exports": {
".": "./src/index.ts",
"./alpha": "./src/alpha.ts",
"./package.json": "./package.json"
},
"typesVersions": {
"*": {
"alpha": [
"src/alpha.ts"
],
"package.json": [
"package.json"
]
}
},
"publishConfig": {
"access": "public"
"access": "public",
"main": "dist/index.cjs.js",
"module": "dist/index.esm.js",
"types": "dist/index.d.ts"
},
"repository": {
"type": "git",
"url": "https://github.com/redhat-developer/rhdh-plugins",
"directory": "workspaces/app-defaults/plugins/app-react"
"directory": "workspaces/app-defaults/plugins/app-defaults"
},
"backstage": {
"role": "web-library",
"role": "frontend-plugin-module",
"pluginId": "app",
"pluginPackages": [
"@red-hat-developer-hub/backstage-plugin-app-react"
]
"pluginPackage": "@backstage/plugin-app"
},
"sideEffects": false,
"scripts": {
Expand All @@ -46,7 +32,6 @@
"postpack": "backstage-cli package postpack"
},
"dependencies": {
"@backstage/core-plugin-api": "^1.12.4",
"@backstage/frontend-plugin-api": "^0.15.1",
"@backstage/plugin-app-react": "^0.2.1",
"@backstage/version-bridge": "^1.0.12",
Expand Down
108 changes: 108 additions & 0 deletions workspaces/app-defaults/plugins/app-defaults/report.api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
## API Report File for "@red-hat-developer-hub/backstage-plugin-app-defaults"

> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).

```ts
import { AppDrawerContent as AppDrawerContent_2 } from '@red-hat-developer-hub/backstage-plugin-app-react';
import { ConfigurableExtensionDataRef } from '@backstage/frontend-plugin-api';
import { ExtensionDataRef } from '@backstage/frontend-plugin-api';
import { ExtensionInput } from '@backstage/frontend-plugin-api';
import { FrontendModule } from '@backstage/frontend-plugin-api';
import { OverridableExtensionDefinition } from '@backstage/frontend-plugin-api';
import { ReactNode } from 'react';

// @public
const appDefaults: FrontendModule;
export default appDefaults;

// @public
export interface AppDrawerApi {
activeDrawerId: string | null;
closeDrawer(id: string): void;
getWidth(id: string): number;
isOpen(id: string): boolean;
openDrawer(id: string): void;
setWidth(id: string, width: number): void;
toggleDrawer(id: string): void;
}

// @public
export interface AppDrawerContent {
defaultWidth?: number;
element: React.ReactElement;
id: string;
priority?: number;
resizable?: boolean;
}

// @public
export const appDrawerExtension: OverridableExtensionDefinition<{
config: {};
configInput: {};
output: ExtensionDataRef<
(props: { children: ReactNode }) => JSX.Element | null,
'app.root.wrapper',
{}
>;
inputs: {
drawers: ExtensionInput<
ConfigurableExtensionDataRef<
AppDrawerContent_2,
'app.drawer.content',
{}
>,
{
singleton: false;
optional: false;
internal: false;
}
>;
};
kind: 'app-root-wrapper';
name: 'drawer';
params: {
Component?: [error: 'Use the `component` parameter instead'];
component: (props: { children: ReactNode }) => JSX.Element | null;
};
}>;

// Warning: (ae-missing-release-tag) "appDrawerExtensions" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export const appDrawerExtensions: OverridableExtensionDefinition<{
config: {};
configInput: {};
output: ExtensionDataRef<
(props: { children: ReactNode }) => JSX.Element | null,
'app.root.wrapper',
{}
>;
inputs: {
drawers: ExtensionInput<
ConfigurableExtensionDataRef<
AppDrawerContent_2,
'app.drawer.content',
{}
>,
{
singleton: false;
optional: false;
internal: false;
}
>;
};
kind: 'app-root-wrapper';
name: 'drawer';
params: {
Component?: [error: 'Use the `component` parameter instead'];
component: (props: { children: ReactNode }) => JSX.Element | null;
};
}>[];

// @public
export const useAppDrawer: () => AppDrawerApi;

// Warnings were encountered during analysis:
//
// src/drawer/extensions.d.ts:32:22 - (ae-undocumented) Missing documentation for "appDrawerExtensions".
```
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import { appDrawerContentDataRef } from './appDrawerContentDataRef';
* });
* ```
*
* @alpha
* @public
*/
export const AppDrawerContentBlueprint = createExtensionBlueprint({
kind: 'app-drawer-content',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import type { AppDrawerContent } from '../types';
/**
* Extension data ref carrying drawer content from a plugin to the host.
*
* @alpha
* @public
*/
export const appDrawerContentDataRef =
createExtensionDataRef<AppDrawerContent>().with({
Expand Down
Loading
Loading