diff --git a/.changeset/pretty-jeans-smell.md b/.changeset/pretty-jeans-smell.md new file mode 100644 index 0000000000..9092a53deb --- /dev/null +++ b/.changeset/pretty-jeans-smell.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-lighthouse-backend': patch +--- + +Added support for the [new backend system](https://backstage.io/docs/backend-system/) diff --git a/.changeset/rare-crabs-taste.md b/.changeset/rare-crabs-taste.md new file mode 100644 index 0000000000..9749ae1a1d --- /dev/null +++ b/.changeset/rare-crabs-taste.md @@ -0,0 +1,5 @@ +--- +'@backstage/core-components': patch +--- + +Parse unicode characters in name for avatar component diff --git a/.changeset/tricky-toes-train.md b/.changeset/tricky-toes-train.md new file mode 100644 index 0000000000..d93ad81a19 --- /dev/null +++ b/.changeset/tricky-toes-train.md @@ -0,0 +1,8 @@ +--- +'@backstage/plugin-catalog-unprocessed-entities': patch +'@backstage/plugin-devtools': patch +'@backstage/plugin-puppetdb': patch +'@backstage/plugin-nomad': patch +--- + +update some peer dependencies to silence yarn install diff --git a/.github/vale/Vocab/Backstage/accept.txt b/.github/vale/Vocab/Backstage/accept.txt index 627e0aa0f3..efd6186405 100644 --- a/.github/vale/Vocab/Backstage/accept.txt +++ b/.github/vale/Vocab/Backstage/accept.txt @@ -402,6 +402,7 @@ Uffizzi ui unbreak Unconference +unicode unmanaged unregister unregistering diff --git a/microsite/data/plugins/k8sgpt.yaml b/microsite/data/plugins/k8sgpt.yaml index a8b38dc8b4..f509009a4f 100644 --- a/microsite/data/plugins/k8sgpt.yaml +++ b/microsite/data/plugins/k8sgpt.yaml @@ -1,7 +1,7 @@ --- title: k8sgpt author: suxess-it -authorUrl: github.com/suxess-it +authorUrl: https://github.com/suxess-it category: Monitoring description: show all k8sgpt results of the k8sgpt operator related to your entity documentation: https://github.com/suxess-it/backstage-plugin-k8sgpt/blob/main/README.md diff --git a/microsite/src/pages/home/_home.tsx b/microsite/src/pages/home/_home.tsx index deb0d4cd6f..07e05068c6 100644 --- a/microsite/src/pages/home/_home.tsx +++ b/microsite/src/pages/home/_home.tsx @@ -31,7 +31,7 @@ const HomePage = () => {
{ )} >
- 🗞️ Want to stay up to date with Backstage? Sign up for our{' '} - - Newsletter - - ! + CFP is now open for BackstageCon 2023 🚀
- -
hideNewsletterBanner(true)} - > - + - - + Submit a talk +
- ) + {!hiddenNewsletterBanner && ( +
+
+ 🗞️ Want to stay up to date with Backstage? Sign up for our{' '} + + Newsletter + + ! +
+ +
hideNewsletterBanner(true)} + > + + + +
+
+ )} + } > { expect(extractInitials('Jenny Doe')).toEqual('JD'); }); + it('extract unicode initials', async () => { + expect(extractInitials('Petr Čech')).toEqual('PČ'); + }); + it('extract single letter for short name', async () => { expect(extractInitials('Doe')).toEqual('D'); }); diff --git a/packages/core-components/src/components/Avatar/utils.ts b/packages/core-components/src/components/Avatar/utils.ts index 4f71d736f1..79627d5996 100644 --- a/packages/core-components/src/components/Avatar/utils.ts +++ b/packages/core-components/src/components/Avatar/utils.ts @@ -28,5 +28,8 @@ export function stringToColor(str: string) { } export function extractInitials(value: string) { - return value.match(/\b\w/g)?.join('').slice(0, 2); + return value + .match(/(? Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { CatalogClient } from '@backstage/catalog-client'; +import { BackendFeature } from '@backstage/backend-plugin-api'; +import { CatalogApi } from '@backstage/catalog-client'; import { Config } from '@backstage/config'; import { Logger } from 'winston'; import { PluginTaskScheduler } from '@backstage/backend-tasks'; @@ -12,7 +13,7 @@ import { TokenManager } from '@backstage/backend-common'; // @public (undocumented) export interface CreateLighthouseSchedulerOptions { // (undocumented) - catalogClient: CatalogClient; + catalogClient: CatalogApi; // (undocumented) config: Config; // (undocumented) @@ -28,5 +29,8 @@ export function createScheduler( options: CreateLighthouseSchedulerOptions, ): Promise; +// @public +export const lighthousePlugin: () => BackendFeature; + // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/lighthouse-backend/package.json b/plugins/lighthouse-backend/package.json index 03a5c6e0fc..07e24f2984 100644 --- a/plugins/lighthouse-backend/package.json +++ b/plugins/lighthouse-backend/package.json @@ -39,10 +39,12 @@ }, "dependencies": { "@backstage/backend-common": "workspace:^", + "@backstage/backend-plugin-api": "workspace:^", "@backstage/backend-tasks": "workspace:^", "@backstage/catalog-client": "workspace:^", "@backstage/catalog-model": "workspace:^", "@backstage/config": "workspace:^", + "@backstage/plugin-catalog-node": "workspace:^", "@backstage/plugin-lighthouse-common": "workspace:^", "@backstage/types": "workspace:^", "winston": "^3.2.1" diff --git a/plugins/lighthouse-backend/src/index.ts b/plugins/lighthouse-backend/src/index.ts index ee878b9214..5773beed56 100644 --- a/plugins/lighthouse-backend/src/index.ts +++ b/plugins/lighthouse-backend/src/index.ts @@ -14,4 +14,5 @@ * limitations under the License. */ -export * from './service/plugin'; +export * from './service/createScheduler'; +export { lighthousePlugin } from './plugin'; diff --git a/plugins/lighthouse-backend/src/plugin.ts b/plugins/lighthouse-backend/src/plugin.ts new file mode 100644 index 0000000000..7acbd45634 --- /dev/null +++ b/plugins/lighthouse-backend/src/plugin.ts @@ -0,0 +1,55 @@ +/* + * 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 { loggerToWinstonLogger } from '@backstage/backend-common'; +import { + createBackendPlugin, + coreServices, +} from '@backstage/backend-plugin-api'; +import { catalogServiceRef } from '@backstage/plugin-catalog-node/alpha'; + +import { createScheduler } from './service/createScheduler'; + +/** + * Lighthouse backend plugin + * + * @public + */ +export const lighthousePlugin = createBackendPlugin({ + pluginId: 'lighthouse', + register(env) { + env.registerInit({ + deps: { + catalogClient: catalogServiceRef, + config: coreServices.config, + logger: coreServices.logger, + scheduler: coreServices.scheduler, + tokenManager: coreServices.tokenManager, + }, + async init({ catalogClient, config, logger, scheduler, tokenManager }) { + const winstonLogger = loggerToWinstonLogger(logger); + + await createScheduler({ + catalogClient, + config, + logger: winstonLogger, + scheduler, + tokenManager, + }); + }, + }); + }, +}); diff --git a/plugins/lighthouse-backend/src/service/plugin.ts b/plugins/lighthouse-backend/src/service/createScheduler.ts similarity index 97% rename from plugins/lighthouse-backend/src/service/plugin.ts rename to plugins/lighthouse-backend/src/service/createScheduler.ts index 089f20f4ed..498e459a09 100644 --- a/plugins/lighthouse-backend/src/service/plugin.ts +++ b/plugins/lighthouse-backend/src/service/createScheduler.ts @@ -16,10 +16,7 @@ import { Logger } from 'winston'; import { PluginTaskScheduler } from '@backstage/backend-tasks'; -import { - CATALOG_FILTER_EXISTS, - CatalogClient, -} from '@backstage/catalog-client'; +import { CATALOG_FILTER_EXISTS, CatalogApi } from '@backstage/catalog-client'; import { Config } from '@backstage/config'; import { LighthouseRestApi } from '@backstage/plugin-lighthouse-common'; import { stringifyEntityRef } from '@backstage/catalog-model'; @@ -31,7 +28,7 @@ export interface CreateLighthouseSchedulerOptions { logger: Logger; config: Config; scheduler?: PluginTaskScheduler; - catalogClient: CatalogClient; + catalogClient: CatalogApi; tokenManager: TokenManager; } diff --git a/plugins/nomad/package.json b/plugins/nomad/package.json index ed745ee31d..df8fe97db4 100644 --- a/plugins/nomad/package.json +++ b/plugins/nomad/package.json @@ -36,7 +36,8 @@ }, "peerDependencies": { "react": "^16.13.1 || ^17.0.0", - "react-router-dom": "*" + "react-dom": "^16.13.1 || ^17.0.0", + "react-router-dom": "6.0.0-beta.0 || ^6.3.0" }, "devDependencies": { "@backstage/cli": "workspace:^", diff --git a/plugins/puppetdb/package.json b/plugins/puppetdb/package.json index e8a1d2eb6b..1d53a1f03c 100644 --- a/plugins/puppetdb/package.json +++ b/plugins/puppetdb/package.json @@ -47,6 +47,7 @@ }, "peerDependencies": { "react": "^16.13.1 || ^17.0.0", + "react-dom": "^16.13.1 || ^17.0.0", "react-router-dom": "6.0.0-beta.0 || ^6.3.0" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index 52a770e2b8..f7a1c3a7dd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5983,6 +5983,8 @@ __metadata: react-use: ^17.2.4 peerDependencies: react: ^16.13.1 || ^17.0.0 + react-dom: ^16.13.1 || ^17.0.0 + react-router-dom: 6.0.0-beta.0 || ^6.3.0 languageName: unknown linkType: soft @@ -6448,6 +6450,7 @@ __metadata: peerDependencies: "@types/react": ^16.13.1 || ^17.0.0 react: ^16.13.1 || ^17.0.0 + react-dom: ^16.13.1 || ^17.0.0 react-router-dom: 6.0.0-beta.0 || ^6.3.0 languageName: unknown linkType: soft @@ -7688,11 +7691,13 @@ __metadata: resolution: "@backstage/plugin-lighthouse-backend@workspace:plugins/lighthouse-backend" dependencies: "@backstage/backend-common": "workspace:^" + "@backstage/backend-plugin-api": "workspace:^" "@backstage/backend-tasks": "workspace:^" "@backstage/catalog-client": "workspace:^" "@backstage/catalog-model": "workspace:^" "@backstage/cli": "workspace:^" "@backstage/config": "workspace:^" + "@backstage/plugin-catalog-node": "workspace:^" "@backstage/plugin-lighthouse-common": "workspace:^" "@backstage/types": "workspace:^" winston: ^3.2.1 @@ -7955,7 +7960,8 @@ __metadata: react-use: ^17.2.4 peerDependencies: react: ^16.13.1 || ^17.0.0 - react-router-dom: "*" + react-dom: ^16.13.1 || ^17.0.0 + react-router-dom: 6.0.0-beta.0 || ^6.3.0 languageName: unknown linkType: soft @@ -8405,6 +8411,7 @@ __metadata: react-use: ^17.2.4 peerDependencies: react: ^16.13.1 || ^17.0.0 + react-dom: ^16.13.1 || ^17.0.0 react-router-dom: 6.0.0-beta.0 || ^6.3.0 languageName: unknown linkType: soft @@ -24977,6 +24984,7 @@ __metadata: "@backstage/plugin-devtools-backend": "workspace:^" "@backstage/plugin-entity-feedback-backend": "workspace:^" "@backstage/plugin-kubernetes-backend": "workspace:^" + "@backstage/plugin-lighthouse-backend": "workspace:^" "@backstage/plugin-linguist-backend": "workspace:^" "@backstage/plugin-permission-backend": "workspace:^" "@backstage/plugin-permission-common": "workspace:^"