Added alpha support for the New Frontend System

Signed-off-by: Andre Wanlin <awanlin@spotify.com>
This commit is contained in:
Andre Wanlin
2023-12-27 11:07:04 -06:00
parent d7a1adf48b
commit 4f42918c4f
9 changed files with 130 additions and 4 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-linguist': patch
---
Added alpha support for the New Frontend System (Declarative Integration)
+1 -1
View File
@@ -15,7 +15,7 @@ app:
- entity-card:catalog/links:
config:
filter: kind:component has:links
- entity-card:linguist/languages
# Entity page content
- entity-content:techdocs
+3
View File
@@ -51,6 +51,8 @@ import {
import { createSignInPageExtension } from '@backstage/frontend-plugin-api';
import { SignInPage } from '@backstage/core-components';
import linguistPlugin from '@backstage/plugin-linguist/alpha';
/*
# Notes
@@ -125,6 +127,7 @@ const app = createApp({
userSettingsPlugin,
homePlugin,
appVisualizerPlugin,
linguistPlugin,
...collectedLegacyPlugins,
createExtensionOverrides({
extensions: [
+13
View File
@@ -0,0 +1,13 @@
## API Report File for "@backstage/plugin-linguist"
> 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';
// @alpha (undocumented)
const _default: BackstagePlugin<{}, {}>;
export default _default;
// (No @packageDocumentation comment for this package)
```
+18 -3
View File
@@ -5,9 +5,22 @@
"types": "src/index.ts",
"license": "Apache-2.0",
"publishConfig": {
"access": "public",
"main": "dist/index.esm.js",
"types": "dist/index.d.ts"
"access": "public"
},
"exports": {
".": "./src/index.ts",
"./alpha": "./src/alpha.ts",
"./package.json": "./package.json"
},
"typesVersions": {
"*": {
"alpha": [
"src/alpha.ts"
],
"package.json": [
"package.json"
]
}
},
"backstage": {
"role": "frontend-plugin"
@@ -30,9 +43,11 @@
},
"dependencies": {
"@backstage/catalog-model": "workspace:^",
"@backstage/core-compat-api": "workspace:^",
"@backstage/core-components": "workspace:^",
"@backstage/core-plugin-api": "workspace:^",
"@backstage/errors": "workspace:^",
"@backstage/frontend-plugin-api": "workspace:^",
"@backstage/plugin-catalog-react": "workspace:^",
"@backstage/plugin-linguist-common": "workspace:^",
"@material-ui/core": "^4.9.13",
+18
View File
@@ -0,0 +1,18 @@
/*
* 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.
*/
export * from './alpha/index';
export { default } from './alpha/index';
+17
View File
@@ -0,0 +1,17 @@
/*
* 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.
*/
export { default } from './plugin';
+53
View File
@@ -0,0 +1,53 @@
/*
* 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 React from 'react';
import {
createApiExtension,
createApiFactory,
createPlugin,
discoveryApiRef,
identityApiRef,
} from '@backstage/frontend-plugin-api';
import { LinguistClient, linguistApiRef } from '../api';
import { compatWrapper } from '@backstage/core-compat-api';
import { createEntityCardExtension } from '@backstage/plugin-catalog-react/alpha';
/** @alpha */
export const entityLinguistCard = createEntityCardExtension({
name: 'languages',
loader: async () =>
import('../components/LinguistCard').then(m =>
compatWrapper(<m.LinguistCard />),
),
});
/** @alpha */
export const linguistApi = createApiExtension({
factory: createApiFactory({
api: linguistApiRef,
deps: { discoveryApi: discoveryApiRef, identityApi: identityApiRef },
factory: ({ discoveryApi, identityApi }) =>
new LinguistClient({ discoveryApi, identityApi }),
}),
});
/** @alpha */
export default createPlugin({
id: 'linguist',
extensions: [linguistApi, entityLinguistCard],
});
+2
View File
@@ -7487,10 +7487,12 @@ __metadata:
dependencies:
"@backstage/catalog-model": "workspace:^"
"@backstage/cli": "workspace:^"
"@backstage/core-compat-api": "workspace:^"
"@backstage/core-components": "workspace:^"
"@backstage/core-plugin-api": "workspace:^"
"@backstage/dev-utils": "workspace:^"
"@backstage/errors": "workspace:^"
"@backstage/frontend-plugin-api": "workspace:^"
"@backstage/plugin-catalog-react": "workspace:^"
"@backstage/plugin-linguist-common": "workspace:^"
"@material-ui/core": ^4.9.13