From 1c0fc5a6c22e0b94a00d394059a86050886e1732 Mon Sep 17 00:00:00 2001 From: Sayak Mukhopadhyay Date: Tue, 20 Dec 2022 16:05:16 +0530 Subject: [PATCH] feat: update docs where `create-plugin` is used with `new --select plugin` Signed-off-by: Sayak Mukhopadhyay --- docs/getting-started/contributors.md | 2 +- docs/getting-started/project-structure.md | 2 +- docs/local-dev/cli-commands.md | 8 ++++---- docs/plugins/backend-plugin.md | 2 +- docs/plugins/create-a-plugin.md | 3 ++- docs/plugins/integrating-plugin-into-software-catalog.md | 2 +- docs/tutorials/journey.md | 2 +- docs/tutorials/quickstart-app-plugin.md | 4 ++-- 8 files changed, 13 insertions(+), 12 deletions(-) diff --git a/docs/getting-started/contributors.md b/docs/getting-started/contributors.md index cda53f8a54..b6a12be013 100644 --- a/docs/getting-started/contributors.md +++ b/docs/getting-started/contributors.md @@ -116,7 +116,7 @@ yarn clean # Remove all output folders and @backstage/cli cache yarn diff # Make sure all plugins are up to date with the latest plugin template -yarn create-plugin # Create a new plugin +yarn new # Create a new module ``` > See diff --git a/docs/getting-started/project-structure.md b/docs/getting-started/project-structure.md index 858f0d8370..7873613a7b 100644 --- a/docs/getting-started/project-structure.md +++ b/docs/getting-started/project-structure.md @@ -101,7 +101,7 @@ are separated out into their own folder, see further down. - [`cli/`](https://github.com/backstage/backstage/tree/master/packages/cli) - One of the biggest packages in our project, the `cli` is used to build, serve, - diff, create-plugins and more. In the early days of this project, we started + diff, create plugins and more. In the early days of this project, we started out with calling tools directly - such as `eslint` - through `package.json`. But as it was tricky to have a good development experience around that when we change named tooling, we opted for wrapping those in our own CLI. That way diff --git a/docs/local-dev/cli-commands.md b/docs/local-dev/cli-commands.md index 715d586545..b43825d733 100644 --- a/docs/local-dev/cli-commands.md +++ b/docs/local-dev/cli-commands.md @@ -201,15 +201,15 @@ Usage: backstage-cli package postpack [options] Restores the changes made by the prepack command ``` -## create +## new -The `create` command opens up an interactive guide for you to create new things +The `new` command opens up an interactive guide for you to create new things in your app. If you do not pass in any options it is completely interactive, but it is possible to pre-select what you want to create using the `--select` flag, -and provide options using `--options`, for example: +and provide options using `--option`, for example: ```bash -backstage-cli create --select plugin --option id=foo +backstage-cli new --select plugin --option id=foo ``` This command is typically added as script in the root `package.json` to be diff --git a/docs/plugins/backend-plugin.md b/docs/plugins/backend-plugin.md index 65a668d391..517779d161 100644 --- a/docs/plugins/backend-plugin.md +++ b/docs/plugins/backend-plugin.md @@ -28,7 +28,7 @@ lowercase characters separated by dashes, for example `carmen`, if it's a package that adds an integration with a system named Carmen, for example. The full NPM package name would then be something like `@internal/plugin-carmen-backend`, depending on the other flags passed to the -`create-plugin` command, and your settings for the `create-plugin` command in +`new` command, and your settings for the `new` command in your root `package.json`. Creating the plugin will take a little while, so be patient. It will helpfully diff --git a/docs/plugins/create-a-plugin.md b/docs/plugins/create-a-plugin.md index 29607af140..5d1b283dba 100644 --- a/docs/plugins/create-a-plugin.md +++ b/docs/plugins/create-a-plugin.md @@ -11,13 +11,14 @@ A Backstage Plugin adds functionality to Backstage. To create a new plugin, make sure you've run `yarn install` and installed dependencies, then run the following on your command line (a shortcut to invoking the -[`backstage-cli create-plugin`](../local-dev/cli-commands.md#create-plugin)) +[`backstage-cli new --select plugin`](../local-dev/cli-commands.md#new)) from the root of your project. ```bash yarn new --select plugin ``` +// Todo: change the asses to show the output of the new command ![](../assets/getting-started/create-plugin_output.png) This will create a new Backstage Plugin based on the ID that was provided. It diff --git a/docs/plugins/integrating-plugin-into-software-catalog.md b/docs/plugins/integrating-plugin-into-software-catalog.md index 97efa56ac3..a44e6d01c0 100644 --- a/docs/plugins/integrating-plugin-into-software-catalog.md +++ b/docs/plugins/integrating-plugin-into-software-catalog.md @@ -21,7 +21,7 @@ should have a separate package in a folder, which represents your plugin. Example: ``` -$ yarn create-plugin +$ yarn new --select plugin > ? Enter an ID for the plugin [required] my-plugin > ? Enter the owner(s) of the plugin. If specified, this will be added to CODEOWNERS for the plugin path. [optional] diff --git a/docs/tutorials/journey.md b/docs/tutorials/journey.md index 126bb5ae0d..af78cbe597 100644 --- a/docs/tutorials/journey.md +++ b/docs/tutorials/journey.md @@ -28,7 +28,7 @@ organization to easily install and add to their Backstage installation. # 1. A New Plugin Sam chooses to develop this plugin in a standalone project and creates a new -plugin using `npx @backstage/cli create-plugin`, which detects that it's not +plugin using `npx @backstage/cli new --select plugin`, which detects that it's not being run in an existing project and therefore creates a separate plugin repo. Spinning up the frontend with `yarn start`, Sam goes to work with getting the diff --git a/docs/tutorials/quickstart-app-plugin.md b/docs/tutorials/quickstart-app-plugin.md index ea0a511c93..a1b30829b3 100644 --- a/docs/tutorials/quickstart-app-plugin.md +++ b/docs/tutorials/quickstart-app-plugin.md @@ -29,8 +29,8 @@ title: Adding Custom Plugin to Existing Monorepo App # The Skeleton Plugin -1. Start by using the built in creator. From the terminal and root of your - project run: `yarn create-plugin` +1. Start by using the built-in creator. From the terminal and root of your + project run: `yarn new --select plugin` 1. Enter a plugin ID. I used `github-playground` 1. When the process finishes, let's start the backend: `yarn --cwd packages/backend start`