feat: update docs where create-plugin is used with new --select plugin
Signed-off-by: Sayak Mukhopadhyay <mukhopadhyaysayak@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||

|
||||
|
||||
This will create a new Backstage Plugin based on the ID that was provided. It
|
||||
|
||||
@@ -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]
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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`
|
||||
|
||||
Reference in New Issue
Block a user