mirror of
https://github.com/strapi/strapi.git
synced 2025-08-30 19:56:05 +00:00
docs: update contributor doc for command and add missing plugin info
This commit is contained in:
parent
a2fc472261
commit
e3a8922499
@ -7,7 +7,6 @@ tags:
|
||||
|
||||
The CLI is largely contained to the `@strapi/strapi` package, however some packages are able to inject their own commands:
|
||||
|
||||
- [`@strapi/admin`](/docs/core/admin/intro)
|
||||
- [`@strapi/data-transfer`](/docs/core/data-transfer/intro)
|
||||
|
||||
## Structure of command
|
||||
@ -15,16 +14,15 @@ The CLI is largely contained to the `@strapi/strapi` package, however some packa
|
||||
The CLI is built with `commander` and as such every command we create can be described as:
|
||||
|
||||
```ts
|
||||
import type { Command } from 'commander';
|
||||
import { createCommand, Command } from 'commander';
|
||||
|
||||
type StrapiCommand = (params: { command: Command; argv: string[]; ctx: CLIContext }) => void;
|
||||
type StrapiCommand = (params: { command: Command; argv: string[]; ctx: CLIContext }) => Command;
|
||||
|
||||
// usage
|
||||
|
||||
const myCommand: StrapiCommand = ({ command, argv, ctx }) => {
|
||||
const myCommand: StrapiCommand = ({ argv, ctx }) => {
|
||||
// do something
|
||||
command
|
||||
.command('develop')
|
||||
return createCommand('develop')
|
||||
.alias('dev')
|
||||
.option(
|
||||
'--no-build',
|
||||
|
@ -13,8 +13,10 @@ This is an experimental API that is subject to change at any moment, hence why i
|
||||
|
||||
## Available Commands
|
||||
|
||||
- [plugin:build](build) - Build a plugin for publishing
|
||||
- [plugin:watch](watch) - Watch & compile a plugin in local development
|
||||
- [plugin:init](./03-init.md) - Create a new plugin
|
||||
- [plugin:build](./01-build.md) - Build a plugin for publishing
|
||||
- [plugin:watch](./02-watch.md) - Watch & compile a plugin in local development
|
||||
- [plugin:verify](./04-check.md) - Verify the build output of the plugin before publication
|
||||
|
||||
## Setting up your package
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user