From 08d436c36de886c3ca824efa99ea932423d6647c Mon Sep 17 00:00:00 2001 From: winches <329487092@qq.com> Date: Tue, 21 May 2024 22:40:42 +0800 Subject: [PATCH 1/3] docs: sync nextui-cli api --- .../content/docs/api-references/cli-api.mdx | 102 ++++++++++++------ apps/docs/content/docs/guide/cli.mdx | 45 ++++++-- 2 files changed, 104 insertions(+), 43 deletions(-) diff --git a/apps/docs/content/docs/api-references/cli-api.mdx b/apps/docs/content/docs/api-references/cli-api.mdx index 8e4b283fbd..b0e8a15a84 100644 --- a/apps/docs/content/docs/api-references/cli-api.mdx +++ b/apps/docs/content/docs/api-references/cli-api.mdx @@ -51,6 +51,7 @@ nextui init [projectName] [options] ### Options - `-t --template [string]` The template to use for the new project e.g. app, pages +- - `-p --package [string]` The package manager to use for the new project (default: `npm`) ### Example @@ -58,6 +59,38 @@ nextui init [projectName] [options] nextui init my-nextui-app -t app ``` +output: + +```codeBlock bash +NextUI CLI v0.2.1 + +┌ 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.) +│ +◇ 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 next-app-template │ +│ npm install │ +│ │ +├────────────────────────────────╯ +│ +└ 🚀 Get started with npm run dev +``` + ## add > 1. Auto add the missing required `dependencies` to your project @@ -79,7 +112,6 @@ nextui add [components...] [options] - `--prettier` [boolean] Add prettier format in the add content which required installed prettier - (default: false) - `--addApp` [boolean] Add App.tsx file content which required provider (default: `false`) - ### Example Without setting a specific component, the `add` command will show a list of available components. @@ -91,27 +123,22 @@ nextui add Output: ```codeBlock bash -NextUI CLI v0.1.2 +NextUI CLI v0.2.1 -? Which components would you like to add? › - Space to select. Return to submit -Instructions: - ↑/↓: Highlight option - ←/→/[space]: Toggle selection - [a,b,c]/delete: Filter choices - enter/return: Complete answer +? Which components would you like to add? › - Space to select. Return to submit Filtered results for: Enter something to filter -◉ accordion -◯ autocomplete -◯ avatar -◯ badge -◯ breadcrumbs -◯ button -◯ card -◯ checkbox -◯ chip -◯ code +◯ accordion +◯ autocomplete +◯ avatar +◯ badge +◯ breadcrumbs +◯ button +◯ calendar +◯ card +◯ checkbox +◯ ↓ chip ``` If you want to add a specific component, you can specify the component name. @@ -123,7 +150,7 @@ nextui add button input Output: ```bash -NextUI CLI v0.1.2 +NextUI CLI v0.2.1 Adding the required dependencies: @nextui-org/button @@ -142,7 +169,6 @@ Tailwind CSS settings have been updated in: /project-path/tailwind.config.js ✅ Components added successfully ``` - ## upgrade Upgrade the NextUI components to the latest version. @@ -157,27 +183,33 @@ nextui upgrade [components...] [options] - `-a --all` [boolean] Upgrade all the NextUI components (default: `false`). - `-h, --help` Display help for commands. - ### Example ```codeBlock bash nextui upgrade button ``` - Output: ```bash -NextUI CLI v0.1.2 +NextUI CLI v0.2.1 + +╭───────────────────────── Component ─────────────────────────╮ +│ @nextui-org/button ^2.0.11 -> ^2.0.31 │ +╰─────────────────────────────────────────────────────────────╯ + +Required min version: @nextui-org/theme>=2.1.0, tailwindcss>=3.4.0 +╭───────────────────── PeerDependencies ─────────────────────╮ +│ @nextui-org/theme 2.0.1 -> 2.1.0 │ +│ tailwindcss ^3.2.3 -> ^3.4.0 │ +╰────────────────────────────────────────────────────────────╯ +2 minor, 1 patch -╭───────────────────────────────────────────────────────────╮ -│ @nextui-org/button 2.0.24 -> 2.0.27 │ -╰───────────────────────────────────────────────────────────╯ ? Would you like to proceed with the upgrade? › - Use arrow-keys. Return to submit. ❯ Yes No -pnpm add @nextui-org/button@2.0.27 +pnpm add @nextui-org/button@2.0.31 @nextui-org/theme@2.1.0 tailwindcss@3.4.0 Already up to date Progress: resolved 474, reused 465, downloaded 0, added 0, done Done in 2.9s @@ -195,7 +227,6 @@ Remove NextUI components from your project. nextui remove [components...] [options] ``` - ### Options - `-p --packagePath` [string] The path to the package.json file. @@ -213,7 +244,7 @@ nextui remove button Output: ```bash -NextUI CLI v0.1.2 +NextUI CLI v0.2.1 ❗️ Components slated for removal: ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ @@ -249,8 +280,8 @@ nextui list [options] ### Options -- `-p --packagePath` [string] The path to the package.json file. -- `-c --current` List the current installed components. +- `-p --packagePath` [string] The path to the package.json file +- `-r --remote` List all components available remotely ### Example @@ -261,7 +292,7 @@ nextui list Output: ```codeBlock bash -NextUI CLI v0.1.2 +NextUI CLI v0.2.1 Current installed components: @@ -283,6 +314,7 @@ Diagnose problems in your project. > 2. Check whether the NextUI components `required dependencies are installed` in the project > 3. Check the required `tailwind.config.js` file and the content is correct > 4. Check `.npmrc` is correct when using `pnpm` +> 5. Check `peerDependencies with required version` are installed in the project ```codeBlock bash nextui doctor [options] @@ -310,7 +342,7 @@ Output: If there is a problem in your project, the `doctor` command will display the problem information. ```codeBlock bash -NextUI CLI v0.1.2 +NextUI CLI v0.2.1 NextUI CLI: ❌ Your project has 1 issue that require attention @@ -322,7 +354,7 @@ Missing tailwind.config.(j|t)s file. To set up, visit: https://nextui.org/docs/g Otherwise, the `doctor` command will display the following message. ```codeBlock bash -NextUI CLI v0.1.2 +NextUI CLI v0.2.1 ✅ Your project has no detected issues. ``` @@ -348,7 +380,7 @@ nextui env Output: ```codeBlock bash -NextUI CLI 0.1.0 +NextUI CLI 0.2.1 Current installed components: diff --git a/apps/docs/content/docs/guide/cli.mdx b/apps/docs/content/docs/guide/cli.mdx index 37bcd7e046..4ebd57ef43 100644 --- a/apps/docs/content/docs/guide/cli.mdx +++ b/apps/docs/content/docs/guide/cli.mdx @@ -83,19 +83,41 @@ nextui init my-nextui-app You will be prompted to configure your project: ```codeBlock bash -? Select a template › - Use arrow-keys. Return to submit. -❯ App - A Next.js 13 with app directory template pre-configured with NextUI (v2) and Tailwind CSS. - Pages - A Next.js 13 with pages directory template pre-configured with NextUI (v2) and Tailwind CSS. +┌ 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.) +│ +◇ 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 next-app-template │ +│ npm install │ +│ │ +├────────────────────────────────╯ +│ +└ 🚀 Get started with npm run dev ``` Install the dependencies to start the local server: + ```codeBlock bash cd my-nextui-app && npm install ``` Start the local server: + ```codeBlock bash npm run dev ``` @@ -164,9 +186,16 @@ You will be asked to confirm the upgrade: ```codeBlock bash -╭───────────────────────────────────────────────────────────╮ -│ @nextui-org/button 2.0.24 -> 2.0.27 │ -╰───────────────────────────────────────────────────────────╯ +╭───────────────────────── Component ─────────────────────────╮ +│ @nextui-org/button ^2.0.11 -> ^2.0.31 │ +╰─────────────────────────────────────────────────────────────╯ + +Required min version: @nextui-org/theme>=2.1.0, tailwindcss>=3.4.0 +╭───────────────────── PeerDependencies ─────────────────────╮ +│ @nextui-org/theme 2.0.1 -> 2.1.0 │ +│ tailwindcss ^3.2.3 -> ^3.4.0 │ +╰────────────────────────────────────────────────────────────╯ +2 minor, 1 patch ? Would you like to proceed with the upgrade? › - Use arrow-keys. Return to submit. ❯ Yes From d58bcfa58571e476e15b29d8a8c5a9115905d2f1 Mon Sep 17 00:00:00 2001 From: winches <329487092@qq.com> Date: Wed, 22 May 2024 20:50:31 +0800 Subject: [PATCH 2/3] docs: update --- apps/docs/content/docs/api-references/cli-api.mdx | 14 +++++++------- apps/docs/content/docs/guide/cli.mdx | 12 ++++++------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/apps/docs/content/docs/api-references/cli-api.mdx b/apps/docs/content/docs/api-references/cli-api.mdx index b0e8a15a84..28acba345c 100644 --- a/apps/docs/content/docs/api-references/cli-api.mdx +++ b/apps/docs/content/docs/api-references/cli-api.mdx @@ -51,7 +51,7 @@ nextui init [projectName] [options] ### Options - `-t --template [string]` The template to use for the new project e.g. app, pages -- - `-p --package [string]` The package manager to use for the new project (default: `npm`) +- `-p --package [string]` The package manager to use for the new project (default: `npm`) ### Example @@ -81,12 +81,12 @@ NextUI CLI v0.2.1 │ ◇ Template created successfully! │ -◇ Next steps ───────────────────╮ -│ │ -│ cd next-app-template │ -│ npm install │ -│ │ -├────────────────────────────────╯ +◇ Next steps ───────╮ +│ │ +│ cd my-nextui-app │ +│ npm install │ +│ │ +├────────────────────╯ │ └ 🚀 Get started with npm run dev ``` diff --git a/apps/docs/content/docs/guide/cli.mdx b/apps/docs/content/docs/guide/cli.mdx index 4ebd57ef43..13d32b19d6 100644 --- a/apps/docs/content/docs/guide/cli.mdx +++ b/apps/docs/content/docs/guide/cli.mdx @@ -100,12 +100,12 @@ You will be prompted to configure your project: │ ◇ Template created successfully! │ -◇ Next steps ───────────────────╮ -│ │ -│ cd next-app-template │ -│ npm install │ -│ │ -├────────────────────────────────╯ +◇ Next steps ───────╮ +│ │ +│ cd my-nextui-app │ +│ npm install │ +│ │ +├────────────────────╯ │ └ 🚀 Get started with npm run dev ``` From 90b77186da27f51e07d16e9e2ad79145511046ab Mon Sep 17 00:00:00 2001 From: Junior Garcia Date: Wed, 22 May 2024 11:55:19 -0300 Subject: [PATCH 3/3] chore: update routes.json with new path and set updated flag --- apps/docs/config/routes.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/docs/config/routes.json b/apps/docs/config/routes.json index 0294cd4eb4..c7fe48efba 100644 --- a/apps/docs/config/routes.json +++ b/apps/docs/config/routes.json @@ -417,7 +417,8 @@ "key": "cli-api", "title": "NextUI CLI", "keywords": "api references, nextui, api, cli", - "path": "/docs/api-references/cli-api.mdx" + "path": "/docs/api-references/cli-api.mdx", + "updated": true }, { "key": "nextui-provider",