[Docs] Fixed some more links (#1648)

This commit is contained in:
Stefan Ålund
2020-07-15 15:59:34 +02:00
committed by GitHub
parent d7eabe9207
commit 20f030ab87
11 changed files with 36 additions and 12 deletions
+1 -1
View File
@@ -40,4 +40,4 @@ for it can be found inside the plugin's `dev/` directory.
[Next Step - Structure of a plugin](structure-of-a-plugin.md)
[Back to Getting Started](README.md)
[Back to Getting Started](../README.md)
+1 -1
View File
@@ -8,7 +8,7 @@ development tool as a plugin in Backstage. By following strong
[design guidelines](https://github.com/spotify/backstage/blob/master/docs/design.md)
we ensure the the overall user experience stays consistent between plugins.
![plugin](../docs/getting-started/my-plugin_screenshot.png)
![plugin](my-plugin_screenshot.png)
## Creating a plugin
Binary file not shown.

After

Width:  |  Height:  |  Size: 389 KiB

+78
View File
@@ -0,0 +1,78 @@
# Plugin Development in Backstage
Backstage plugins provide features to a Backstage App.
Each plugin is treated as a self-contained web app and can include almost any
type of content. Plugins all use a common set of platform APIs and reusable UI
components. Plugins can fetch data from external sources using the regular
browser APIs or by depending on external modules to do the work.
<!-- MOVED TO create-a-plugin.md ## Creating a new plugin
On your command line, invoke the `backstage-cli` to create a new plugin:
```bash
yarn create-plugin
```
![](create-plugin_output.png)
This will create a new Backstage Plugin based on the ID that was provided. It will be built and
added to the Backstage App automatically.
*If `yarn start` is already running you should be able to see the default page for your new
plugin directly by navigating to `http://localhost:3000/my-plugin`.*
![](my-plugin_screenshot.png) -->
## Developing guidelines
- Consider writing plugins in `TypeScript`.
- Plan the directory structure of your plugin so that it becomes easy to manage.
- Prefer using the Backstage components, otherwise go with
[Material-UI](https://material-ui.com/).
- Check out the shared Backstage APIs before building a new one.
## Plugin concepts / API
### Routing
Each plugin is responsible for registering its components to corresponding
routes in the app.
The app will call the `createPlugin` method on each plugin, passing in a
`router` object with a set of methods on it.
```jsx
import { createPlugin, createRouteRef } from '@backstage/core';
import ExampleComponent from './components/ExampleComponent';
export const rootRouteRef = createRouteRef({
path: '/new-plugin',
title: 'New plugin',
});
export const plugin = createPlugin({
id: 'new-plugin',
register({ router }) {
router.addRoute(rootRouteRef, ExampleComponent);
},
});
```
#### `router` API
```typescript
addRoute(
target: RouteRef,
Component: ComponentType<any>,
options?: RouteOptions,
): void;
/**
* @deprecated See the `addRoute` method
*/
registerRoute(
path: RoutePath,
Component: ComponentType<any>,
options?: RouteOptions,
): void;
```
+4 -4
View File
@@ -3,9 +3,9 @@
## NPM
NPM packages are published through CI/CD in the
[.github/workflows/master.yml](../.github/workflows/master.yml) workflow. Every
commit that is merged to master will be checked for new versions of all public
packages, and any new versions will automatically be published to NPM.
[.github/workflows/master.yml](../../.github/workflows/master.yml) workflow.
Every commit that is merged to master will be checked for new versions of all
public packages, and any new versions will automatically be published to NPM.
### Creating a new release
@@ -35,4 +35,4 @@ $ git push origin -u new-release
And then create a PR. Once the PR is approved and merged into master, the master
build will publish new versions of all bumped packages.
[Back to Docs](README.md)
[Back to Docs](../README.md)
+1 -1
View File
@@ -104,4 +104,4 @@ either the one you already have (like nginx/haproxy/etc) or the proxy-backend
plugin that we provide for the backstage backend.
[Read more](../../plugins/proxy-backend/README.md)
[Back to Getting Started](README.md)
[Back to Getting Started](../README.md)