diff --git a/.changeset/migrate-1713466110116.md b/.changeset/migrate-1713466110116.md new file mode 100644 index 0000000000..fcd43006e0 --- /dev/null +++ b/.changeset/migrate-1713466110116.md @@ -0,0 +1,7 @@ +--- +'@backstage/plugin-lighthouse': patch +'@backstage/plugin-lighthouse-backend': patch +'@backstage/plugin-lighthouse-common': patch +--- + +These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository. diff --git a/plugins/lighthouse-backend/README.md b/plugins/lighthouse-backend/README.md index df6c2415d9..c6f9098380 100644 --- a/plugins/lighthouse-backend/README.md +++ b/plugins/lighthouse-backend/README.md @@ -1,96 +1,3 @@ -# Lighthouse Backend +# Deprecated -Lighthouse Backend allows you to run scheduled lighthouse Tests for each Website with the annotation `lighthouse.com/website-url`. - -## Setup - -1. Install the plugin using: - -```bash -# From your Backstage root directory -yarn --cwd packages/backend add @backstage/plugin-lighthouse-backend -``` - -2. Create a `lighthouse.ts` file inside `packages/backend/src/plugins/`: - -```typescript -import { createScheduler } from '@backstage/plugin-lighthouse-backend'; -import { PluginEnvironment } from '../types'; -import { CatalogClient } from '@backstage/catalog-client'; - -export default async function createPlugin(env: PluginEnvironment) { - const { logger, scheduler, config, tokenManager } = env; - - const catalogClient = new CatalogClient({ - discoveryApi: env.discovery, - }); - - await createScheduler({ - logger, - scheduler, - config, - catalogClient, - tokenManager, - }); -} -``` - -3. Modify your `packages/backend/src/index.ts` to include: - -```diff - ... - - import { Config } from '@backstage/config'; - import app from './plugins/app'; -+import lighthouse from './plugins/lighthouse'; - import scaffolder from './plugins/scaffolder'; - - ... - - async function main() { - - ... - - const authEnv = useHotMemoize(module, () => createEnv('auth')); -+ const lighthouseEnv = useHotMemoize(module, () => createEnv('lighthouse')); - const proxyEnv = useHotMemoize(module, () => createEnv('proxy')); - - ... - - const apiRouter = Router(); - apiRouter.use('/catalog', await catalog(catalogEnv)); - apiRouter.use('/scaffolder', await scaffolder(scaffolderEnv)); - -+ await lighthouse(lighthouseEnv) -``` - -#### New Backend System - -The Lighthouse backend plugin has support for the [new backend system](https://backstage.io/docs/backend-system/), here's how you can set that up: - -In your `packages/backend/src/index.ts` make the following changes: - -```diff - import { createBackend } from '@backstage/backend-defaults'; - - const backend = createBackend(); - - // ... other feature additions - -+ backend.add(import('@backstage/plugin-lighthouse-backend')); - - backend.start(); -``` - -## Configuration - -You can define how often and when the scheduler should run the audits: - -```yaml -lighthouse: - schedule: - frequency: - hours: 12 # Default: 1 day - timeout: - minutes: 30 # Default: 10 minutes -``` +This package has been moved to the [backstage-community/plugins](https://github.com/backstage/community-plugins) repository. Migrate to using `@backstage-community/plugin-lighthouse-backend` instead. diff --git a/plugins/lighthouse-backend/package.json b/plugins/lighthouse-backend/package.json index 1f10624a2c..4e34fdc370 100644 --- a/plugins/lighthouse-backend/package.json +++ b/plugins/lighthouse-backend/package.json @@ -3,7 +3,8 @@ "version": "0.4.10", "description": "Backend functionalities for lighthouse", "backstage": { - "role": "backend-plugin" + "role": "backend-plugin", + "moved": "@backstage-community/plugin-lighthouse-backend" }, "publishConfig": { "access": "public", @@ -53,5 +54,6 @@ "devDependencies": { "@backstage/cli": "workspace:^" }, - "configSchema": "config.d.ts" + "configSchema": "config.d.ts", + "deprecated": "This package has been moved to the backstage/community-plugins repository. You should migrate to using @backstage-community/plugin-lighthouse-backend instead." } diff --git a/plugins/lighthouse-common/README.md b/plugins/lighthouse-common/README.md index 9ab6d9a86d..ad1a90bf7c 100644 --- a/plugins/lighthouse-common/README.md +++ b/plugins/lighthouse-common/README.md @@ -1,3 +1,3 @@ -# @backstage/plugin-lighthouse-common +# Deprecated -Common types and functionalities for lighthouse, to be shared between lighthouse and lighthouse-backend. +This package has been moved to the [backstage-community/plugins](https://github.com/backstage/community-plugins) repository. Migrate to using `@backstage-community/plugin-lighthouse-common` instead. diff --git a/plugins/lighthouse-common/package.json b/plugins/lighthouse-common/package.json index 1c5976f508..b9c5352239 100644 --- a/plugins/lighthouse-common/package.json +++ b/plugins/lighthouse-common/package.json @@ -3,7 +3,8 @@ "version": "0.1.5", "description": "Common functionalities for lighthouse, to be shared between lighthouse and lighthouse-backend plugin", "backstage": { - "role": "common-library" + "role": "common-library", + "moved": "@backstage-community/plugin-lighthouse-common" }, "publishConfig": { "access": "public", @@ -43,5 +44,6 @@ }, "devDependencies": { "@backstage/cli": "workspace:^" - } + }, + "deprecated": "This package has been moved to the backstage/community-plugins repository. You should migrate to using @backstage-community/plugin-lighthouse-common instead." } diff --git a/plugins/lighthouse/README.md b/plugins/lighthouse/README.md index ee0e1dfd1d..d229494981 100644 --- a/plugins/lighthouse/README.md +++ b/plugins/lighthouse/README.md @@ -1,115 +1,3 @@ -# @backstage/plugin-lighthouse +# Deprecated -A frontend for [lighthouse-audit-service](https://github.com/spotify/lighthouse-audit-service), this plugin allows you to trigger Lighthouse audits on websites and track them over time. - -## Introduction - -Google's [Lighthouse](https://developers.google.com/web/tools/lighthouse) auditing tool for websites -is a great open-source resource for benchmarking and improving the accessibility, performance, SEO, and best practices of your site. -At Spotify, we keep track of Lighthouse audit scores over time to look at trends and overall areas for investment. - -This plugin allows you to generate on-demand Lighthouse audits for websites, and to track the trends for the -top-level categories of Lighthouse at a glance. - -You can learn more in our blog post [Introducing Lighthouse for Backstage](https://backstage.io/blog/2020/04/06/lighthouse-plugin). - -| List of audits | Specific audit | -| ----------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| ![Screen shot of the main Lighthouse plugin page](images/lighthouse-page.png) | ![Screen shot of the resulting audit in the Lighthouse plugin](images/audit-view.png) | - -In the future, we hope to add support for scheduling audits (which we do internally), as well as allowing -custom runs of Lighthouse to be ingested (for auditing sites that require authentication or some session state). - -## Getting Started - -To get started, you will need a running instance of [`lighthouse-audit-service`](https://github.com/spotify/lighthouse-audit-service). -_It's likely you will need to [enable CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) to integrate with Backstage, so initialize the `lighthouse-audit-service` with the environment variable `LAS_CORS` set to `true`._ - -When you have an instance running that Backstage can hook into, first install the plugin into your app: - -```bash -# From your Backstage root directory -yarn --cwd packages/app add @backstage/plugin-lighthouse -``` - -Modify your app routes in `App.tsx` to include the `LighthousePage` component exported from the plugin, for example: - -```tsx -// In packages/app/src/App.tsx -import { LighthousePage } from '@backstage/plugin-lighthouse'; - -const routes = ( - - {/* ...other routes */} - } /> -``` - -Then configure the `lighthouse-audit-service` URL in your [`app-config.yaml`](https://github.com/backstage/backstage/blob/master/app-config.yaml). - -```yaml -backend: - csp: - frame-src: - - http://your-service-url -lighthouse: - baseUrl: http://your-service-url -``` - -## Integration with the Catalog - -The Lighthouse plugin can be integrated into the catalog so that Lighthouse audit information relating to a component -can be displayed within that component's entity page. In order to link an Entity to its Lighthouse audits, the entity -must be annotated as follows: - -```yaml -apiVersion: backstage.io/v1alpha1 -kind: Component -metadata: - # ... - annotations: - lighthouse.com/website-url: # A single website url e.g. https://backstage.io/ -``` - -> NOTE: The plugin only supports one website URL per component at this time. - -Add a Lighthouse tab to the entity page: - -```tsx -// In packages/app/src/components/catalog/EntityPage.tsx -import { EntityLighthouseContent } from '@backstage/plugin-lighthouse'; - -const websiteEntityPage = ( - - {/* other tabs... */} - - - -``` - -> NOTE: The embedded router renders page content without a header section -> allowing it to be rendered within a catalog plugin page. - -Add a **Lighthouse card** to the overview tab on the EntityPage: - -```tsx -// In packages/app/src/components/catalog/EntityPage.tsx -import { - EntityLastLighthouseAuditCard, - isLighthouseAvailable, -} from '@backstage/plugin-lighthouse'; - -const overviewContent = ( - - {/* ...other content */} - - - - - - - -``` - -## Schedule - -If you want to run automated scheduled runs, you can install the [@backstage/lighthouse-backend](../lighthouse-backend/README.md) plugin +This package has been moved to the [backstage-community/plugins](https://github.com/backstage/community-plugins) repository. Migrate to using `@backstage-community/plugin-lighthouse` instead. diff --git a/plugins/lighthouse/package.json b/plugins/lighthouse/package.json index 7605aeb6e1..c0e8d58826 100644 --- a/plugins/lighthouse/package.json +++ b/plugins/lighthouse/package.json @@ -3,7 +3,8 @@ "version": "0.4.19", "description": "A Backstage plugin that integrates towards Lighthouse", "backstage": { - "role": "frontend-plugin" + "role": "frontend-plugin", + "moved": "@backstage-community/plugin-lighthouse" }, "publishConfig": { "access": "public", @@ -78,5 +79,6 @@ } } } - } + }, + "deprecated": "This package has been moved to the backstage/community-plugins repository. You should migrate to using @backstage-community/plugin-lighthouse instead." }