From 23cfee4c98dee7e84080c61724538c975b91c2ad Mon Sep 17 00:00:00 2001 From: chenshuai2144 Date: Fri, 23 Sep 2022 17:02:53 +0800 Subject: [PATCH] docs: update readme close https://github.com/ant-design/ant-design-pro/issues/10248 --- README.md | 46 +++++++++++++++++++++++++++++++--------------- README.zh-CN.md | 46 +++++++++++++++++++++++++++++++--------------- 2 files changed, 62 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index 4364f81f82..2cf4d673ed 100644 --- a/README.md +++ b/README.md @@ -82,22 +82,38 @@ We need your help: https://github.com/ant-design/ant-design-pro/issues/120 ### Use bash +We provide pro-cli to quickly initialize scaffolding. + ```bash -$ mkdir -$ cd -$ yarn create umi # or npm create umi - -# Choose ant-design-pro: - Select the boilerplate type (Use arrow keys) -❯ ant-design-pro - Create project with an layout-only ant-design-pro boilerplate, use together with umi block. - app - Create project with a simple boilerplate, support typescript. - block - Create a umi block. - library - Create a library with umi. - plugin - Create a umi plugin. - -$ git init -$ npm install -$ npm start # visit http://localhost:8000 +# use npm +npm i @ant-design/pro-cli -g +pro create myapp +``` + +select umi version + +```shell +🐂 Use umi@4 or umi@3 ? (Use arrow keys) +❯ umi@4 + umi@3 +``` + +> If the umi@4 version is selected, full blocks are not yet supported. + +If you choose umi@3, you can also choose the pro template. Pro is the basic template, which only provides the basic content of the framework operation. Complete contains all blocks, which is not suitable for secondary development as a basic template. + +```shell +? 🚀 Full or a simple scaffold? (Use arrow keys) +❯ simple + complete +``` + +Install dependencies: + +```shell +$ cd myapp && tyarn +// or +$ cd myapp && npm install ``` ## Browsers support diff --git a/README.zh-CN.md b/README.zh-CN.md index 0cdd9df5a4..1e0febca10 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -74,22 +74,38 @@ Language : [🇺🇸](./README.md) | 🇨🇳 | [🇷🇺](./README.ru-RU.md) | ## 使用 +我们提供了 pro-cli 来快速的初始化脚手架。 + ```bash -$ mkdir -$ cd -$ yarn create umi # or npm create umi - -# Choose ant-design-pro: - Select the boilerplate type (Use arrow keys) -❯ ant-design-pro - Create project with an layout-only ant-design-pro boilerplate, use together with umi block. - app - Create project with a simple boilerplate, support typescript. - block - Create a umi block. - library - Create a library with umi. - plugin - Create a umi plugin. - -$ git init -$ npm install -$ npm start # visit http://localhost:8000 +# 使用 npm +npm i @ant-design/pro-cli -g +pro create myapp +``` + +选择 umi 的版本 + +```shell +? 🐂 使用 umi@4 还是 umi@3 ? (Use arrow keys) +❯ umi@4 + umi@3 +``` + +> 如果选择了 umi@4 版本,暂时还不支持全量区块。 + +如果选择了 umi@3,还可以选择 pro 的模板,pro 是基础模板,只提供了框架运行的基本内容,complete 包含所有区块,不太适合当基础模板来进行二次开发 + +```shell +? 🚀 要全量的还是一个简单的脚手架? (Use arrow keys) +❯ simple + complete +``` + +安装依赖: + +```shell +$ cd myapp && tyarn +// 或 +$ cd myapp && npm install ``` 更多信息请参考 [使用文档](http://pro.ant.design/docs/getting-started)。