Skip to content
Merged
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
35 changes: 35 additions & 0 deletions workspaces/bulk-import/.changeset/promote-nfs-stable.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
'@red-hat-developer-hub/backstage-plugin-bulk-import': major
Comment thread
divyanshiGupta marked this conversation as resolved.
---

**BREAKING**: Graduated the New Frontend System (NFS) bulk-import plugin to stable API.
The NFS plugin (`createFrontendPlugin`) has been promoted from the `./alpha` subpath to the primary `.` entry point. The `./alpha` subpath now only exports translations. Legacy (OFS) exports (`bulkImportPlugin`, `BulkImportPage`, `BulkImportSidebarItem`, `BulkImportIcon`) have been moved to the new `./legacy` subpath.

**Migration for NFS consumers (previously using `./alpha`):**

```diff
- import bulkImportPlugin, { bulkImportTranslationsModule } from '@red-hat-developer-hub/backstage-plugin-bulk-import/alpha';
+ import bulkImportPlugin, { bulkImportTranslationsModule } from '@red-hat-developer-hub/backstage-plugin-bulk-import';
```

**Migration for OFS consumers:**

```diff
- import { BulkImportPage } from '@red-hat-developer-hub/backstage-plugin-bulk-import';
+ import { BulkImportPage } from '@red-hat-developer-hub/backstage-plugin-bulk-import/legacy';
```

**Migration for dynamic plugin configurations:**

Legacy exports require `module: Legacy` — they are not available on the default module.

```yaml
dynamicPlugins:
frontend:
red-hat-developer-hub.backstage-plugin-bulk-import:
# Legacy exports require `module: Legacy`
dynamicRoutes:
- path: /bulk-import
importName: BulkImportPage
module: Legacy
```
1 change: 1 addition & 0 deletions workspaces/bulk-import/.prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ coverage
.eslintrc.js
report.api.md
report-alpha.api.md
report-legacy.api.md

# Generated
plugins/bulk-import-backend/api-docs
Expand Down
6 changes: 4 additions & 2 deletions workspaces/bulk-import/packages/app-legacy/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ import {
OrchestratorPage,
orchestratorTranslations,
} from '@red-hat-developer-hub/backstage-plugin-orchestrator';
import { BulkImportPage } from '@red-hat-developer-hub/backstage-plugin-bulk-import';
import {
BulkImportPage,
bulkImportTranslations,
} from '@red-hat-developer-hub/backstage-plugin-bulk-import/legacy';
import { getThemes } from '@red-hat-developer-hub/backstage-plugin-theme';
import { SignalsDisplay } from '@backstage/plugin-signals';
import { RbacPage } from '@backstage-community/plugin-rbac';
Expand All @@ -59,7 +62,6 @@ import { apis } from './apis';
import { entityPage } from './components/catalog/EntityPage';
import { Root } from './components/Root';
import { searchPage } from './components/search/SearchPage';
import { bulkImportTranslations } from '@red-hat-developer-hub/backstage-plugin-bulk-import/alpha';

const app = createApp({
apis,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import MenuIcon from '@mui/icons-material/Menu';
import GroupIcon from '@mui/icons-material/People';
import SearchIcon from '@mui/icons-material/Search';
import Box from '@mui/material/Box';
import { BulkImportSidebarItem } from '@red-hat-developer-hub/backstage-plugin-bulk-import';
import { BulkImportSidebarItem } from '@red-hat-developer-hub/backstage-plugin-bulk-import/legacy';
import {
LogoFull,
LogoIcon,
Expand Down
2 changes: 1 addition & 1 deletion workspaces/bulk-import/packages/app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import { navModule } from './modules/nav';
// Import the new frontend system plugin for bulk-import
import bulkImportPlugin, {
bulkImportTranslationsModule,
} from '@red-hat-developer-hub/backstage-plugin-bulk-import/alpha';
} from '@red-hat-developer-hub/backstage-plugin-bulk-import';

// Import core Backstage plugins (NFS versions)
import catalogPlugin from '@backstage/plugin-catalog/alpha';
Expand Down
3 changes: 3 additions & 0 deletions workspaces/bulk-import/plugins/bulk-import/.prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ renovate.json
dist-dynamic
dist-scalprum
playwright-report
report.api.md
report-alpha.api.md
report-legacy.api.md
18 changes: 13 additions & 5 deletions workspaces/bulk-import/plugins/bulk-import/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ This plugin allows bulk import of multiple catalog entities into the catalog.
The sections below are relevant for static plugins. If the plugin is expected to be installed as a dynamic one:

- Follow https://github.com/janus-idp/backstage-showcase/blob/main/showcase-docs/dynamic-plugins.md#installing-a-dynamic-plugin-package-in-the-showcase
- Add content of `app-config.janus-idp.yaml` into `app-config.local.yaml`.
- Add content of `app-config.yaml` into `app-config.local.yaml`.

> **Important:** Dynamic plugin configurations must now use `module: Legacy` instead of `module: BulkImportPlugin`. See the `app-config.yaml` in this plugin for the updated configuration.

#### Prerequisites

Expand Down Expand Up @@ -46,7 +48,7 @@ g, user:default/<login-id/user-name>, role:default/team_a

```tsx title="packages/app/src/App.tsx"
/* highlight-add-next-line */
import { BulkImportPage } from '@red-hat-developer-hub/backstage-plugin-bulk-import';
import { BulkImportPage } from '@red-hat-developer-hub/backstage-plugin-bulk-import/legacy';
...
/* highlight-add-start */
<Route
Expand All @@ -61,7 +63,7 @@ g, user:default/<login-id/user-name>, role:default/team_a

```tsx title="packages/app/src/components/Root/Root.tsx"
/* highlight-add-next-line */
import { BulkImportSidebarItem } from '@red-hat-developer-hub/backstage-plugin-bulk-import';
import { BulkImportSidebarItem } from '@red-hat-developer-hub/backstage-plugin-bulk-import/legacy';

export const Root = ({ children }: PropsWithChildren<{}>) => (
<SidebarPage>
Expand All @@ -74,6 +76,8 @@ g, user:default/<login-id/user-name>, role:default/team_a
);
```

> **Note:** The main entry point (`@red-hat-developer-hub/backstage-plugin-bulk-import`) now exports the New Frontend System (NFS) plugin. Legacy (OFS) consumers must use the `./legacy` subpath.

## On Behalf of User Access

The Bulk Import plugin can fetch repository and organization listings **on behalf of the signed-in user** using their OAuth credentials, so that users see only the repositories and organizations they personally have access to.
Expand Down Expand Up @@ -117,16 +121,19 @@ Refer to the Backstage documentation for [GitHub auth](https://backstage.io/docs

## New Frontend System

If you're using Backstage's new frontend system, add the plugin to your app:
The main entry point (`@red-hat-developer-hub/backstage-plugin-bulk-import`) exports the New Frontend System (NFS) plugin as the default export. Add it to your app:

```tsx
// packages/app/src/App.tsx
import bulkImportPlugin from '@red-hat-developer-hub/backstage-plugin-bulk-import/alpha';
import bulkImportPlugin, {
bulkImportTranslationsModule,
} from '@red-hat-developer-hub/backstage-plugin-bulk-import';

export default createApp({
features: [
// ...other plugins
bulkImportPlugin,
bulkImportTranslationsModule,
],
});
```
Expand All @@ -135,6 +142,7 @@ The plugin will automatically provide:

- Bulk Import page at `/bulk-import` with all existing features
- A "Bulk import" navigation item in the sidebar
- Translations support (via `bulkImportTranslationsModule`)

### Extensions

Expand Down
5 changes: 3 additions & 2 deletions workspaces/bulk-import/plugins/bulk-import/app-config.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
dynamicPlugins:
frontend:
red-hat-developer-hub.backstage-plugin-bulk-import:
# Legacy exports require `module: Legacy` — they are not available on the default module.
appIcons:
- name: bulkImportIcon
module: BulkImportPlugin
module: Legacy
importName: BulkImportIcon
dynamicRoutes:
- path: /bulk-import
importName: BulkImportPage
module: BulkImportPlugin
module: Legacy
menuItem:
icon: bulkImportIcon
text: Bulk import
31 changes: 19 additions & 12 deletions workspaces/bulk-import/plugins/bulk-import/dev/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,26 +52,17 @@ import MenuItem from '@mui/material/MenuItem';

import { rhdhThemeModule } from '@red-hat-developer-hub/backstage-plugin-theme/alpha';

import bulkImportPlugin, { bulkImportTranslationsModule } from '../src/alpha';
import bulkImportPlugin, { bulkImportTranslationsModule } from '../src';
import {
bulkImportApiRef,
mockBulkImportApi,
mockCatalogApi,
mockConfigApi,
} from './mocks';

const bulkImportDevModule = createFrontendModule({
pluginId: 'bulk-import',
const appDevOverrides = createFrontendModule({
pluginId: 'app',
extensions: [
ApiBlueprint.make({
name: 'bulk-import-mock',
params: defineParams =>
defineParams({
api: bulkImportApiRef,
deps: {},
factory: () => mockBulkImportApi,
}),
}),
ApiBlueprint.make({
name: 'config-mock',
params: defineParams =>
Expand Down Expand Up @@ -102,6 +93,21 @@ const bulkImportDevModule = createFrontendModule({
],
});

const bulkImportDevModule = createFrontendModule({
pluginId: 'bulk-import',
extensions: [
ApiBlueprint.make({
name: 'bulk-import-mock',
params: defineParams =>
defineParams({
api: bulkImportApiRef,
deps: {},
factory: () => mockBulkImportApi,
}),
}),
],
});

function ThemeIcon({
active,
icon,
Expand Down Expand Up @@ -216,6 +222,7 @@ const app = createApp({
bulkImportPlugin,
bulkImportTranslationsModule,
bulkImportDevModule,
appDevOverrides,
rhdhThemeModule,
devNavModule,
],
Expand Down
17 changes: 14 additions & 3 deletions workspaces/bulk-import/plugins/bulk-import/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,18 @@
"types": "src/index.ts",
"license": "Apache-2.0",
"exports": {
".": "./src/index.ts",
"./alpha": "./src/alpha.tsx",
".": "./src/index.tsx",
"./alpha": "./src/alpha.ts",
"./legacy": "./src/legacyExports.ts",
"./package.json": "./package.json"
},
"typesVersions": {
"*": {
"alpha": [
"src/alpha.tsx"
"src/alpha.ts"
],
"legacy": [
"src/legacyExports.ts"
],
"package.json": [
"package.json"
Expand Down Expand Up @@ -97,6 +101,13 @@
"prettier": "3.8.4",
"react": "16.13.1 || ^17.0.0 || ^18.0.0"
},
"scalprum": {
"name": "red-hat-developer-hub.backstage-plugin-bulk-import",
"exposedModules": {
"PluginRoot": "./src/index.tsx",
"Legacy": "./src/legacyExports.ts"
}
},
"configSchema": "config.d.ts",
"files": [
"dist",
Expand Down
Loading
Loading