From 12afbbc8dc77aa77cf6a0eb6a9025f2a4dd548ff Mon Sep 17 00:00:00 2001 From: Philipp Hugenroth Date: Wed, 31 Jan 2024 15:14:44 +0100 Subject: [PATCH] Add alpha export for new fe system Signed-off-by: Philipp Hugenroth --- plugins/org/api-report-alpha.md | 25 ++++++++++++++++ plugins/org/package.json | 17 +++++++++++ plugins/org/src/alpha.tsx | 52 +++++++++++++++++++++++++++++++++ yarn.lock | 2 ++ 4 files changed, 96 insertions(+) create mode 100644 plugins/org/api-report-alpha.md create mode 100644 plugins/org/src/alpha.tsx diff --git a/plugins/org/api-report-alpha.md b/plugins/org/api-report-alpha.md new file mode 100644 index 0000000000..b9605a45f5 --- /dev/null +++ b/plugins/org/api-report-alpha.md @@ -0,0 +1,25 @@ +## API Report File for "@backstage/plugin-org" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts +import { BackstagePlugin } from '@backstage/frontend-plugin-api'; +import { ExtensionDefinition } from '@backstage/frontend-plugin-api'; +import { ExternalRouteRef } from '@backstage/frontend-plugin-api'; + +// @alpha (undocumented) +const _default: BackstagePlugin< + {}, + { + catalogIndex: ExternalRouteRef; + } +>; +export default _default; + +// @alpha (undocumented) +export const EntityGroupProfileCard: ExtensionDefinition<{ + filter?: string | undefined; +}>; + +// (No @packageDocumentation comment for this package) +``` diff --git a/plugins/org/package.json b/plugins/org/package.json index 4355e265aa..01aa872e32 100644 --- a/plugins/org/package.json +++ b/plugins/org/package.json @@ -4,6 +4,21 @@ "version": "0.6.20-next.1", "main": "src/index.ts", "types": "src/index.ts", + "exports": { + ".": "./src/index.ts", + "./alpha": "./src/alpha.tsx", + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "alpha": [ + "src/alpha.tsx" + ], + "package.json": [ + "package.json" + ] + } + }, "license": "Apache-2.0", "publishConfig": { "access": "public", @@ -31,8 +46,10 @@ }, "dependencies": { "@backstage/catalog-model": "workspace:^", + "@backstage/core-compat-api": "workspace:^", "@backstage/core-components": "workspace:^", "@backstage/core-plugin-api": "workspace:^", + "@backstage/frontend-plugin-api": "workspace:^", "@backstage/plugin-catalog-common": "workspace:^", "@backstage/plugin-catalog-react": "workspace:^", "@material-ui/core": "^4.12.2", diff --git a/plugins/org/src/alpha.tsx b/plugins/org/src/alpha.tsx new file mode 100644 index 0000000000..30cda2a4c7 --- /dev/null +++ b/plugins/org/src/alpha.tsx @@ -0,0 +1,52 @@ +/* + * Copyright 2023 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { + compatWrapper, + convertLegacyRouteRefs, +} from '@backstage/core-compat-api'; +import { createPlugin } from '@backstage/frontend-plugin-api'; +import React from 'react'; +import { catalogIndexRouteRef } from './routes'; +import { createEntityCardExtension } from '@backstage/plugin-catalog-react/alpha'; + +/** @alpha */ +export const EntityGroupProfileCard = createEntityCardExtension({ + name: 'group-profile', + loader: async () => + import('./components/Cards/Group/GroupProfile/GroupProfileCard').then(m => + compatWrapper(), + ), +}); + +/** @alpha */ +/* export const EntityMembersListCard = createEntityCardExtension({ + name: 'members-list', + loader: async () => + import('./components/').then(m => + compatWrapper(), + ), + }); + */ + +/** @alpha */ +export default createPlugin({ + id: 'org', + extensions: [EntityGroupProfileCard], + externalRoutes: convertLegacyRouteRefs({ + catalogIndex: catalogIndexRouteRef, + }), +}); diff --git a/yarn.lock b/yarn.lock index 75fde2bc1b..bd654c7dad 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7839,9 +7839,11 @@ __metadata: "@backstage/catalog-model": "workspace:^" "@backstage/cli": "workspace:^" "@backstage/core-app-api": "workspace:^" + "@backstage/core-compat-api": "workspace:^" "@backstage/core-components": "workspace:^" "@backstage/core-plugin-api": "workspace:^" "@backstage/dev-utils": "workspace:^" + "@backstage/frontend-plugin-api": "workspace:^" "@backstage/plugin-catalog": "workspace:^" "@backstage/plugin-catalog-common": "workspace:^" "@backstage/plugin-catalog-react": "workspace:^"