Merge pull request #20015 from backstage/jhaals/techRadar
tech-radar: Add alpha exports for page and api extensions
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
## API Report File for "@backstage/plugin-tech-radar"
|
||||
|
||||
> 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 { Extension } from '@backstage/frontend-plugin-api';
|
||||
|
||||
// @alpha (undocumented)
|
||||
const _default: BackstagePlugin;
|
||||
export default _default;
|
||||
|
||||
// @alpha (undocumented)
|
||||
export const TechRadarPage: Extension<{
|
||||
height: number;
|
||||
width: number;
|
||||
title: string;
|
||||
path: string;
|
||||
subtitle: string;
|
||||
pageTitle: string;
|
||||
}>;
|
||||
|
||||
// (No @packageDocumentation comment for this package)
|
||||
```
|
||||
@@ -6,9 +6,7 @@
|
||||
"types": "src/index.ts",
|
||||
"license": "Apache-2.0",
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
"main": "dist/index.esm.js",
|
||||
"types": "dist/index.d.ts"
|
||||
"access": "public"
|
||||
},
|
||||
"backstage": {
|
||||
"role": "frontend-plugin"
|
||||
@@ -22,6 +20,21 @@
|
||||
"keywords": [
|
||||
"backstage"
|
||||
],
|
||||
"exports": {
|
||||
".": "./src/index.ts",
|
||||
"./alpha": "./src/alpha.tsx",
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"typesVersions": {
|
||||
"*": {
|
||||
"alpha": [
|
||||
"src/alpha.tsx"
|
||||
],
|
||||
"package.json": [
|
||||
"package.json"
|
||||
]
|
||||
}
|
||||
},
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"build": "backstage-cli package build",
|
||||
@@ -35,6 +48,7 @@
|
||||
"dependencies": {
|
||||
"@backstage/core-components": "workspace:^",
|
||||
"@backstage/core-plugin-api": "workspace:^",
|
||||
"@backstage/frontend-plugin-api": "workspace:^",
|
||||
"@backstage/theme": "workspace:^",
|
||||
"@material-ui/core": "^4.12.2",
|
||||
"@material-ui/icons": "^4.9.1",
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* 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 { createApiFactory, createRouteRef } from '@backstage/core-plugin-api';
|
||||
import {
|
||||
createApiExtension,
|
||||
createPageExtension,
|
||||
createPlugin,
|
||||
createSchemaFromZod,
|
||||
} from '@backstage/frontend-plugin-api';
|
||||
import React from 'react';
|
||||
import { techRadarApiRef } from './api';
|
||||
import { SampleTechRadarApi } from './sample';
|
||||
|
||||
const techRadarRouteRef = createRouteRef({ id: 'plugin.techradar.page' });
|
||||
|
||||
/** @alpha */
|
||||
export const TechRadarPage = createPageExtension({
|
||||
id: 'plugin.techradar.page',
|
||||
defaultPath: '/tech-radar',
|
||||
routeRef: techRadarRouteRef,
|
||||
configSchema: createSchemaFromZod(z =>
|
||||
z.object({
|
||||
title: z.string().default('Tech Radar'),
|
||||
subtitle: z
|
||||
.string()
|
||||
.default('Pick the recommended technologies for your projects'),
|
||||
pageTitle: z.string().default('Company Radar'),
|
||||
path: z.string().default('/tech-radar'),
|
||||
width: z.number().default(1500),
|
||||
height: z.number().default(800),
|
||||
}),
|
||||
),
|
||||
loader: ({ config }) =>
|
||||
import('./components').then(m => <m.RadarPage {...config} />),
|
||||
});
|
||||
|
||||
const sampleTechRadarApi = createApiExtension({
|
||||
api: techRadarApiRef,
|
||||
factory() {
|
||||
return createApiFactory(techRadarApiRef, new SampleTechRadarApi());
|
||||
},
|
||||
});
|
||||
|
||||
/** @alpha */
|
||||
export default createPlugin({
|
||||
id: 'tech-radar',
|
||||
extensions: [TechRadarPage, sampleTechRadarApi],
|
||||
});
|
||||
Reference in New Issue
Block a user