Skip to content
Open
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
10 changes: 10 additions & 0 deletions workspaces/quickstart/.changeset/remove-ofs-reexports.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@red-hat-developer-hub/backstage-plugin-quickstart': major
---

**Breaking:** Legacy (OFS) component exports have been removed from the main `./` entry point and are now exclusively available at the `./legacy` subpath. OFS consumers must update their imports:

```diff
- import { QuickstartDrawerProvider } from '@red-hat-developer-hub/backstage-plugin-quickstart';
+ import { QuickstartDrawerProvider } from '@red-hat-developer-hub/backstage-plugin-quickstart/legacy';
```
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@

import { SidebarItem } from '@backstage/core-components';
import WavingHandOutlinedIcon from '@mui/icons-material/WavingHandOutlined';
import { useQuickstartDrawerContext } from '@red-hat-developer-hub/backstage-plugin-quickstart';
import { configApiRef, useApi } from '@backstage/core-plugin-api';
import { useMemo } from 'react';
import {
useQuickstartDrawerContext,
filterQuickstartItemsByRole,
QuickstartItemData,
} from '@red-hat-developer-hub/backstage-plugin-quickstart';
} from '@red-hat-developer-hub/backstage-plugin-quickstart/legacy';
import { configApiRef, useApi } from '@backstage/core-plugin-api';
import { useMemo } from 'react';

export const QuickstartSidebarItem = () => {
const configApi = useApi(configApiRef);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import {
QuickstartDrawerProvider,
QuickstartDrawerContent,
QuickstartDrawerStateExposer,
} from '@red-hat-developer-hub/backstage-plugin-quickstart';
} from '@red-hat-developer-hub/backstage-plugin-quickstart/legacy';
import { QuickstartSidebarItem } from './QuickstartSidebarItem';
import { Administration } from '@backstage-community/plugin-rbac';
import { ApplicationDrawer } from './ApplicationDrawer';
Expand Down
24 changes: 20 additions & 4 deletions workspaces/quickstart/plugins/quickstart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ If you want to install the plugin as a dynamic plugin in Red Hat Developer Hub:
- Follow the [Installing plugins guide](https://github.com/redhat-developer/rhdh/blob/main/docs/dynamic-plugins/installing-plugins.md)
- Add the content of `app-config.dynamic.yaml` into your `app-config.local.yaml`

#### Dynamic plugin configuration
#### Dynamic plugin configuration (OFS)

Add the extension point inside your `app-config.yaml` or `app-config.local.yaml` file:
Legacy exports require `module: Legacy`. Add the extension point inside your `app-config.yaml` or `app-config.local.yaml` file:

```yaml
dynamicPlugins:
Expand All @@ -34,18 +34,34 @@ dynamicPlugins:
mountPoints:
- mountPoint: application/provider
importName: QuickstartDrawerProvider
module: Legacy
- mountPoint: application/internal/drawer-state
importName: QuickstartDrawerStateExposer
module: Legacy
- mountPoint: application/internal/drawer-content
importName: QuickstartDrawerContent
module: Legacy
config:
id: quickstart
- mountPoint: global.header/help
importName: QuickstartButton
module: Legacy
config:
priority: 100
```

### Legacy / OFS consumers

Legacy component imports have been **removed from the main package path**. OFS consumers must update imports to use the `./legacy` subpath:

```ts
// Before (no longer works)
import { QuickstartDrawerProvider } from '@red-hat-developer-hub/backstage-plugin-quickstart';

// After (required)
import { QuickstartDrawerProvider } from '@red-hat-developer-hub/backstage-plugin-quickstart/legacy';
```

### Static Installation

1. Install the plugin package:
Expand All @@ -58,7 +74,7 @@ yarn add --cwd packages/app @red-hat-developer-hub/backstage-plugin-quickstart
2. Add the plugin to your Backstage app by modifying `packages/app/src/App.tsx`:

```tsx
import { QuickstartDrawerProvider } from '@red-hat-developer-hub/backstage-plugin-quickstart';
import { QuickstartDrawerProvider } from '@red-hat-developer-hub/backstage-plugin-quickstart/legacy';

// Wrap your app with the QuickstartDrawerProvider
const App = () => (
Expand Down Expand Up @@ -171,7 +187,7 @@ app:
Access quickstart drawer functionality in your components:

```tsx
import { useQuickstartDrawerContext } from '@red-hat-developer-hub/backstage-plugin-quickstart';
import { useQuickstartDrawerContext } from '@red-hat-developer-hub/backstage-plugin-quickstart/legacy';

const MyComponent = () => {
const { openDrawer, closeDrawer, isDrawerOpen } =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
dynamicPlugins:
frontend:
red-hat-developer-hub.backstage-plugin-quickstart:
# Legacy exports require `module: Legacy` — they are not available on the default module.
translationResources:
- importName: quickstartTranslations
ref: quickstartTranslationRef
mountPoints:
- mountPoint: application/provider
importName: QuickstartDrawerProvider
module: Legacy
- mountPoint: application/internal/drawer-state
importName: QuickstartDrawerStateExposer
module: Legacy
- mountPoint: application/internal/drawer-content
importName: QuickstartDrawerContent
module: Legacy
config:
id: quickstart
- mountPoint: global.header/help
importName: QuickstartButton
module: Legacy
config:
priority: 100
2 changes: 1 addition & 1 deletion workspaces/quickstart/plugins/quickstart/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
"name": "red-hat-developer-hub.backstage-plugin-quickstart",
"exposedModules": {
"PluginRoot": "./src/index.tsx",
"QuickstartPlugin": "./src/index.tsx",
"Legacy": "./src/legacyExports.ts",
"Alpha": "./src/alpha.ts"
}
},
Expand Down
88 changes: 0 additions & 88 deletions workspaces/quickstart/plugins/quickstart/report.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,12 @@

```ts
import { AppDrawerContent } from '@red-hat-developer-hub/backstage-plugin-app-react';
import { BackstagePlugin } from '@backstage/core-plugin-api';
import { CSSProperties } from 'react';
import { ExtensionDataRef } from '@backstage/frontend-plugin-api';
import { FrontendModule } from '@backstage/frontend-plugin-api';
import { GlobalHeaderMenuItemData } from '@red-hat-developer-hub/backstage-plugin-global-header/alpha';
import { JSX as JSX_2 } from 'react/jsx-runtime';
import { MenuItemParams } from '@red-hat-developer-hub/backstage-plugin-global-header/alpha';
import { OverridableExtensionDefinition } from '@backstage/frontend-plugin-api';
import { OverridableFrontendPlugin } from '@backstage/frontend-plugin-api';
import { PropsWithChildren } from 'react';
import { TranslationRef } from '@backstage/frontend-plugin-api';
import { TranslationResource } from '@backstage/frontend-plugin-api';

Expand Down Expand Up @@ -80,87 +76,9 @@ const _default: OverridableFrontendPlugin<
>;
export default _default;

// @public
export type DrawerPartialState = {
id: string;
isDrawerOpen: boolean;
drawerWidth: number;
setDrawerWidth: (width: number) => void;
closeDrawer: () => void;
};

// @public
export type DrawerStateExposerProps = {
onStateChange: (state: DrawerPartialState) => void;
};

// @public
export const filterQuickstartItemsByRole: (
items: QuickstartItemData[],
userRole: string,
) => QuickstartItemData[];

// @public
export const QuickstartButton: (
input: QuickstartButtonProps,
) => JSX_2.Element | null;

// @public
export interface QuickstartButtonProps {
onClick?: () => void;
style?: CSSProperties;
title?: string;
}

// @public
export const QuickstartDrawerContent: () => JSX_2.Element | null;

// @public
export interface QuickstartDrawerContextType {
closeDrawer: () => void;
drawerWidth: number;
isDrawerOpen: boolean;
openDrawer: () => void;
roleLoading: boolean;
setDrawerWidth: React.Dispatch<React.SetStateAction<number>>;
toggleDrawer: () => void;
userRole: UserRole | null;
}

// @public
export const QuickstartDrawerProvider: (
input: PropsWithChildren,
) => JSX_2.Element;

// @public
export const QuickstartDrawerStateExposer: (
input: DrawerStateExposerProps,
) => null;

// @public
export const quickstartInitModule: FrontendModule;

// @public
export interface QuickstartItemCtaData {
link: string;
text: string;
textKey?: string;
}

// @public
export interface QuickstartItemData {
cta?: QuickstartItemCtaData;
description: string;
descriptionKey?: string;
icon?: string;
roles?: string[];
title: string;
titleKey?: string;
}

// @public
export const quickstartPlugin: BackstagePlugin<{}, {}, {}>;

// @public
export const quickstartTranslationRef: TranslationRef<
'plugin.quickstart',
Expand Down Expand Up @@ -232,11 +150,5 @@ export const quickstartTranslations: TranslationResource<'plugin.quickstart'>;
// @public
export const quickstartTranslationsModule: FrontendModule;

// @public
export const useQuickstartDrawerContext: () => QuickstartDrawerContextType;

// @public
export type UserRole = 'admin' | 'developer';

// (No @packageDocumentation comment for this package)
```
2 changes: 0 additions & 2 deletions workspaces/quickstart/plugins/quickstart/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,3 @@ export {
quickstartTranslationRef,
quickstartTranslations,
} from './translations';

export * from './legacyExports';
Loading