From c9c3df2363b5757c7209dc9057558dcf637dcaad Mon Sep 17 00:00:00 2001 From: Bilawal Hameed Date: Mon, 3 Feb 2020 16:01:08 +0100 Subject: [PATCH] Update docs to explain how to import plugin --- README.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ef5b88b0d6..5c357471bf 100644 --- a/README.md +++ b/README.md @@ -14,10 +14,27 @@ Backstage is an open platform for building developer portals. Run the following: -```terminal +```bash $ ./tools/cookiecutter/init.sh frontend/packages/plugins/_template --output-dir frontend/packages/plugins ``` +This will generate a plugin in the `frontend/packages/plugins` folder. It is important to note you will still need to include the plugin in your `frontend/packages/app` in the `package.json`. You will then be able to import it as follows: + +```bash +$ ./tools/cookiecutter/init.sh frontend/packages/plugins/_template --output-dir frontend/packages/plugins +plugin_name [example-plugin]: github-api + +$ vim frontend/packages/app/package.json +# Add the following line to your package.json +# Note all plugins are prefixed with "plugin-" by default with a version number of "0.0.0" +# "@backstage/plugin-github-api": "0.0.0", + +$ vim frontend/packages/app/src/App.tsx +# Add the following line to import your generated component +# import { ExampleComponent } from '@backstage/plugin-github-api'; +# +``` + ## Documentation ## License