From b84139722807258d7bc9954671abf35c6a951bd2 Mon Sep 17 00:00:00 2001 From: winches <329487092@qq.com> Date: Mon, 27 May 2024 22:11:35 +0800 Subject: [PATCH] docs: update cli docs --- apps/docs/content/blog/v2.4.0.mdx | 59 ++++++++++++++++--- .../content/docs/api-references/cli-api.mdx | 2 + apps/docs/content/docs/guide/cli.mdx | 2 + 3 files changed, 54 insertions(+), 9 deletions(-) diff --git a/apps/docs/content/blog/v2.4.0.mdx b/apps/docs/content/blog/v2.4.0.mdx index 5da6a7dab8..49badad758 100644 --- a/apps/docs/content/blog/v2.4.0.mdx +++ b/apps/docs/content/blog/v2.4.0.mdx @@ -157,6 +157,49 @@ interface AppProviderProps { ## CLI Improvements +### Refactor Init Flow View + +We've refactored the init flow view to provide a better user experience. + +The latest flow view output: + +```bash +┌ Create a new project +│ +◇ Select a template (Enter to select) +│ ● App (A Next.js 14 with app directory template pre-configured with NextUI (v2) and Tailwind CSS.) +│ ○ Pages (A Next.js 14 with pages directory template pre-configured with NextUI (v2) and Tailwind CSS.) +│ ○ Vite (A Vite template pre-configured with NextUI (v2) and Tailwind CSS.) +│ +◇ New project name (Enter to skip with default name) +│ my-nextui-app +│ +◇ Select a package manager (Enter to select) +│ ● npm +│ ○ yarn +│ ○ pnpm +│ ○ bun +│ +◇ Template created successfully! +│ +◇ Next steps ───────╮ +│ │ +│ cd my-nextui-app │ +│ npm install │ +│ │ +├────────────────────╯ +│ +└ 🚀 Get started with npm run dev +``` + +### Add Vite Template + +We've introduced a new Vite template pre-configured with NextUI v2 and TailwindCSS. The following command is to initialize a new Vite project named `my-vite-app`. + +```bash +nextui init my-vite-app -t vite +``` + ### Package Manager Flag We've introduced a new flag `-p` (or `--package`) to init command to allow users to choose the package manager to use for the new project. By default, `npm` is used. For example, the following command will initialize a new NextUI project with the app template named my-nextui-app using pnpm package manager. @@ -175,21 +218,19 @@ nextui --no-cache upgrade ### Upgrade Version Output +You can now run the upgrade command and see the summary version of the package you are upgrading to. + ![image](https://github.com/nextui-org/nextui-cli/assets/96854855/2a5945dd-5187-4e20-81b8-4136e9791dde) -You can now run the upgrade command with option either `--major`, `--minor`, or `--patch`. +### Upgrade And Remove Select View Optimization -- The `major` option detects all updatable versions. -- The default `minor` option detects all `minor` and `patch` updatable versions. -- The `patch` option specifically detects `patch` updatable versions. +The disabled option(s) will be displayed in the bottom of the list. -### Add Vite Template +![image](https://github.com/nextui-org/nextui-cli/assets/96854855/c7ddf9e4-3054-4bf1-b8e3-dc2f6226091a) -We've introduced a new Vite template pre-configured with NextUI v2 and TailwindCSS. The following command is to initialize a new Vite project named `my-vite-app`. +### Doctor Command add peerDependencies check -```bash -nextui init my-vite-app -t vite -``` +The `doctor` command now checks for peerDependencies and displays the incorrect peerDependencies, relation: [nextui-org/nextui#2954](https://github.com/nextui-org/nextui/issues/2954). diff --git a/apps/docs/content/docs/api-references/cli-api.mdx b/apps/docs/content/docs/api-references/cli-api.mdx index 28acba345c..fb7a443ba0 100644 --- a/apps/docs/content/docs/api-references/cli-api.mdx +++ b/apps/docs/content/docs/api-references/cli-api.mdx @@ -28,6 +28,7 @@ Usage: nextui [command] Options: -v, --version Show the version number + --no-cache Disable cache, by default data will be cached for 30m after the first request -h, --help Display help for commands Commands: @@ -69,6 +70,7 @@ NextUI CLI v0.2.1 ◇ Select a template (Enter to select) │ ● App (A Next.js 14 with app directory template pre-configured with NextUI (v2) and Tailwind CSS.) │ ○ Pages (A Next.js 14 with pages directory template pre-configured with NextUI (v2) and Tailwind CSS.) +│ ○ Vite (A Vite template pre-configured with NextUI (v2) and Tailwind CSS.) │ ◇ New project name (Enter to skip with default name) │ my-nextui-app diff --git a/apps/docs/content/docs/guide/cli.mdx b/apps/docs/content/docs/guide/cli.mdx index 13d32b19d6..1c51a94fe5 100644 --- a/apps/docs/content/docs/guide/cli.mdx +++ b/apps/docs/content/docs/guide/cli.mdx @@ -57,6 +57,7 @@ Usage: nextui [command] Options: -v, --version Show the version number + --no-cache Disable cache, by default data will be cached for 30m after the first request -h, --help Display help for commands Commands: @@ -88,6 +89,7 @@ You will be prompted to configure your project: ◇ Select a template (Enter to select) │ ● App (A Next.js 14 with app directory template pre-configured with NextUI (v2) and Tailwind CSS.) │ ○ Pages (A Next.js 14 with pages directory template pre-configured with NextUI (v2) and Tailwind CSS.) +│ ○ Vite (A Vite template pre-configured with NextUI (v2) and Tailwind CSS.) │ ◇ New project name (Enter to skip with default name) │ my-nextui-app