diff --git a/.changeset/migrate-1713466204983.md b/.changeset/migrate-1713466204983.md new file mode 100644 index 0000000000..b2c8f467ea --- /dev/null +++ b/.changeset/migrate-1713466204983.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-shortcuts': patch +--- + +These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository. diff --git a/plugins/shortcuts/README.md b/plugins/shortcuts/README.md index 18deb7ae37..752b88a92c 100644 --- a/plugins/shortcuts/README.md +++ b/plugins/shortcuts/README.md @@ -1,95 +1,3 @@ -# shortcuts +# Deprecated -The shortcuts plugin allows a user to have easy access to pages within a Backstage app by storing them as "shortcuts" in the Sidebar. - -## Usage - -### Install the package: - -```bash -# From your Backstage root directory -yarn --cwd packages/app add @backstage/plugin-shortcuts -``` - -### Register plugin: - -This plugin requires explicit registration, so you will need to add it to your App's `plugins.ts` file: - -```ts -// ... -export { shortcutsPlugin } from '@backstage/plugin-shortcuts'; -``` - -If you don't have a `plugins.ts` file see: [troubleshooting](#troubleshooting) - -### Add the `` component within your ``: - -Edit file `packages/app/src/components/Root/Root.tsx` - -```tsx -import { - Sidebar, - SidebarDivider, - SidebarSpace, -} from '@backstage/core-components'; -import { Shortcuts } from '@backstage/plugin-shortcuts'; - -export const SidebarComponent = () => ( - - {/* ... */} - - - - -); -``` - -To allow external links to be added as shortcut, you can add `allowExternalLinks` property to the `` component. - -The plugin exports a `shortcutApiRef` but the plugin includes a default implementation of the `ShortcutApi` that uses `localStorage` to store each user's shortcuts. - -To overwrite the default implementation add it to the App's `apis.ts`: - -```ts -import { shortcutsApiRef } from '@backstage/plugin-shortcuts'; -import { CustomShortcutsImpl } from '...'; - -export const apis = [ - // ... - createApiFactory({ - api: shortcutsApiRef, - deps: {}, - factory: () => new CustomShortcutsImpl(), - }), -]; -``` - -# Troubleshooting - -If you don't have a `plugins.ts` file, you can create it with the path `packages/app/src/plugins.ts` and then import it into your `App.tsx`: - -```diff -+ import * as plugins from './plugins'; - -const app = createApp({ - apis, -+ plugins: Object.values(plugins), - bindRoutes({ bind }) { - /* ... */ - }, -}); -``` - -Or simply edit `App.tsx` with: - -```diff -+ import { shortcutsPlugin } from '@backstage/plugin-shortcuts - -const app = createApp({ - apis, -+ plugins: [shortcutsPlugin], - bindRoutes({ bind }) { - /* ... */ - }, -}); -``` +This package has been moved to the [backstage-community/plugins](https://github.com/backstage/community-plugins) repository. Migrate to using `@backstage-community/plugin-shortcuts` instead. diff --git a/plugins/shortcuts/package.json b/plugins/shortcuts/package.json index 745ae3fe28..7d16a2bf03 100644 --- a/plugins/shortcuts/package.json +++ b/plugins/shortcuts/package.json @@ -3,7 +3,8 @@ "version": "0.3.23", "description": "A Backstage plugin that provides a shortcuts feature to the sidebar", "backstage": { - "role": "frontend-plugin" + "role": "frontend-plugin", + "moved": "@backstage-community/plugin-shortcuts" }, "publishConfig": { "access": "public", @@ -58,5 +59,6 @@ "react": "^16.13.1 || ^17.0.0 || ^18.0.0", "react-dom": "^16.13.1 || ^17.0.0 || ^18.0.0", "react-router-dom": "6.0.0-beta.0 || ^6.3.0" - } + }, + "deprecated": "This package has been moved to the backstage/community-plugins repository. You should migrate to using @backstage-community/plugin-shortcuts instead." }