From e3a892249914d44c55fa0ab8c47c983d91f43dc9 Mon Sep 17 00:00:00 2001 From: Alexandre Bodin Date: Wed, 10 Jan 2024 10:39:37 +0100 Subject: [PATCH] docs: update contributor doc for command and add missing plugin info --- docs/docs/docs/01-core/strapi/commands/00-overview.md | 10 ++++------ .../docs/01-core/strapi/commands/plugin/00-overview.md | 6 ++++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/docs/docs/01-core/strapi/commands/00-overview.md b/docs/docs/docs/01-core/strapi/commands/00-overview.md index 9e8f94624e..57717c9aa3 100644 --- a/docs/docs/docs/01-core/strapi/commands/00-overview.md +++ b/docs/docs/docs/01-core/strapi/commands/00-overview.md @@ -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', diff --git a/docs/docs/docs/01-core/strapi/commands/plugin/00-overview.md b/docs/docs/docs/01-core/strapi/commands/plugin/00-overview.md index e39ddf0916..d38b0cbd4c 100644 --- a/docs/docs/docs/01-core/strapi/commands/plugin/00-overview.md +++ b/docs/docs/docs/01-core/strapi/commands/plugin/00-overview.md @@ -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