From 953a7e66f9da6eee86a90fc0433e401521933e3d Mon Sep 17 00:00:00 2001 From: Rogerio Angeliski Date: Fri, 18 Jun 2021 18:01:27 -0300 Subject: [PATCH] feat: update plugin path to match same behavior in the main app resolves #6108 Signed-off-by: Rogerio Angeliski --- .changeset/friendly-bikes-double.md | 5 +++++ docs/plugins/create-a-plugin.md | 8 ++++---- packages/cli/templates/default-plugin/dev/index.tsx.hbs | 1 + 3 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 .changeset/friendly-bikes-double.md diff --git a/.changeset/friendly-bikes-double.md b/.changeset/friendly-bikes-double.md new file mode 100644 index 0000000000..5ee9f959c1 --- /dev/null +++ b/.changeset/friendly-bikes-double.md @@ -0,0 +1,5 @@ +--- +'@backstage/cli': patch +--- + +updated plugin template to generate path equals plugin id for the root page diff --git a/docs/plugins/create-a-plugin.md b/docs/plugins/create-a-plugin.md index 4ccd48f17e..c35f4b91fa 100644 --- a/docs/plugins/create-a-plugin.md +++ b/docs/plugins/create-a-plugin.md @@ -22,9 +22,9 @@ yarn create-plugin 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`. +> If the Backstage App is already running (with `yarn start` or `yarn dev`) you +> should be able to see the default page for your new plugin directly by +> navigating to `http://localhost:3000/my-plugin`. ![](../assets/my-plugin_screenshot.png) @@ -32,7 +32,7 @@ You can also serve the plugin in isolation by running `yarn start` in the plugin directory. Or by using the yarn workspace command, for example: ```bash -yarn workspace @backstage/plugin-welcome start # Also supports --check +yarn workspace @backstage/my-plugin start # Also supports --check ``` This method of serving the plugin provides quicker iteration speed and a faster diff --git a/packages/cli/templates/default-plugin/dev/index.tsx.hbs b/packages/cli/templates/default-plugin/dev/index.tsx.hbs index ade00a1613..14fecf73e1 100644 --- a/packages/cli/templates/default-plugin/dev/index.tsx.hbs +++ b/packages/cli/templates/default-plugin/dev/index.tsx.hbs @@ -7,5 +7,6 @@ createDevApp() .addPage({ element: <{{ extensionName }} />, title: 'Root Page', + path: '/{{ id }}' }) .render();