Browse Source

Merge pull request #5107 from abpframework/Cli-new-project-default-mobile-none

Cli new project default mobile "none"
pull/5130/head
Halil İbrahim Kalkan 6 years ago
committed by GitHub
parent
commit
f27d2fbf75
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      docs/en/CLI.md
  2. 2
      docs/en/Getting-Started-React-Native.md
  3. 9
      docs/en/Getting-Started.md
  4. 19
      docs/en/Startup-Templates/Application.md
  5. BIN
      docs/en/images/solution-files-non-mvc.png
  6. 4
      docs/zh-Hans/CLI.md
  7. 4
      docs/zh-Hans/Getting-Started-React-Native.md
  8. 9
      docs/zh-Hans/Getting-Started.md
  9. 16
      docs/zh-Hans/Startup-Templates/Application.md
  10. 4
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs

3
docs/en/CLI.md

@ -79,8 +79,7 @@ abp new Acme.BookStore
* `--separate-identity-server`: Separates the identity server application from the API host application. If not specified, you will have a single endpoint in the server side.
* `none`: Without UI. There are some additional options for this template:
* `--separate-identity-server`: Separates the identity server application from the API host application. If not specified, you will have a single endpoint in the server side.
* `--mobile` or `-m`: Specifies the mobile application framework. Default framework is `react-native`. Available frameworks:
* `none`: no mobile application.
* `--mobile` or `-m`: Specifies the mobile application framework. If not specified, no mobile application will be created. Available options:
* `react-native`: React Native.
* `--database-provider` or `-d`: Specifies the database provider. Default provider is `ef`. Available providers:
* `ef`: Entity Framework Core.

2
docs/en/Getting-Started-React-Native.md

@ -2,7 +2,7 @@
ABP platform provide basic [React Native](https://reactnative.dev/) startup template to develop mobile applications **integrated to your ABP based backends**.
When you **create a new application** as described in the [getting started document](Getting-Started.md), the solution includes the React Native application in the `react-native` folder as default.
When you **create a new application** as described in the [getting started document](Getting-Started.md), you have to add `-m react-native` option to include `react-native` project in your solution.
## Configure Your Local IP Address

9
docs/en/Getting-Started.md

@ -65,8 +65,6 @@ Use the `new` command of the ABP CLI to create a new project:
abp new Acme.BookStore{{if UI == "NG"}} -u angular {{end}}{{if DB == "Mongo"}} -d mongodb{{end}}{{if Tiered == "Yes" && UI != "NG"}} --tiered {{else if Tiered == "Yes" && UI == "NG"}}--separate-identity-server{{end}}
````
> This command also creates a React Native mobile application inside the solution folder. If you don't want it, you can safely delete it or specify the `-m none` option to the `abp new` command to not include it in the solution at all.
{{ if UI == "NG" }}
* `-u` argument specifies the UI framework, `angular` in this case.
@ -126,7 +124,6 @@ There are three folders in the created solution:
* `angular` folder contains the Angular UI application.
* `aspnet-core` folder contains the backend solution.
* `react-native` folder contains the React Native UI application.
Open the `.sln` (Visual Studio solution) file under the `aspnet-core` folder:
@ -339,11 +336,7 @@ Enter **admin** as the username and **1q2w3E*** as the password to login to the
## Mobile Development
When you create a new application, the solution includes `react-native` folder by default. This is a basic [React Native](https://reactnative.dev/) startup template to develop mobile applications integrated to your ABP based backends.
If you don't plan to develop a mobile application with React Native, you can safely delete the `react-native` folder.
> You can specifying the `-m none` option to the ABP CLI to not create the `react-native` folder in the beginning.
If you want to include a [React Native](https://reactnative.dev/) project in your solution, add `-m react-native` (or `--mobile react-native`) argument to project creation command. This is a basic React Native startup template to develop mobile applications integrated to your ABP based backends.
See the "[Getting Started with the React Native](Getting-Started-React-Native.md)" document to learn how to configure and run the React Native application.

19
docs/en/Startup-Templates/Application.md

@ -54,6 +54,20 @@ Use `-d` (or `--database-provider`) option to specify the database provider:
abp new Acme.BookStore -d mongodb
````
### Specify the Mobile Application Framework
This template supports the following mobile application frameworks:
- `react-native`: React Native
Use `-m` (or `--mobile`) option to specify the mobile application framework:
````bash
abp new Acme.BookStore -m react-native
````
If not specified, no mobile application will be created.
## Solution Structure
Based on the options you've specified, you will get a slightly different solution structure.
@ -261,11 +275,10 @@ You should run the application with the given order:
### Angular UI
If you choose `Angular` as the UI framework (using the `-u angular` option), the solution is being separated into three folders:
If you choose `Angular` as the UI framework (using the `-u angular` option), the solution is being separated into two folders:
* `angular` folder contains the Angular UI application, the client-side code.
* `aspnet-core` folder contains the ASP.NET Core solution, the server-side code.
* `react-native` folder contains the React Native UI application, the client-side code for mobile.
The server-side is similar to the solution described above. `*.HttpApi.Host` project serves the API, so the `Angular` application consumes it.
@ -356,7 +369,7 @@ See the [testing document](https://angular.io/guide/testing).
### React Native
The solution includes the [React Native](https://reactnative.dev/) application in the `react-native` folder as default.
if `-m react-native` option is spesified in new project command, the solution includes the [React Native](https://reactnative.dev/) application in the `react-native` folder.
The server-side is similar to the solution described above. `*.HttpApi.Host` project serves the API, so the React Native application consumes it.

BIN
docs/en/images/solution-files-non-mvc.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

4
docs/zh-Hans/CLI.md

@ -79,7 +79,7 @@ abp new Acme.BookStore
* `--separate-identity-server`: 将Identity Server应用程序与API host应用程序分开. 如果未指定,则服务器端将只有一个端点.
* `none`: 无UI. 这个模板还有一些额外的选项:
* `--separate-identity-server`: 将Identity Server应用程序与API host应用程序分开. 如果未指定,则服务器端将只有一个端点.
* `--mobile` 或者 `-m`: 指定移动应用程序框架. 默认框架是 `react-native`. 其他选项:
* `--mobile` 或者 `-m`: 指定移动应用程序框架. 如果未指定,则不会创建任何移动应用程序,其他选项:
* `none`: 不包含移动应用程序.
* `react-native`: React Native.
* `--database-provider` 或者 `-d`: 指定数据库提供程序.默认是 `ef`.其他选项:
@ -251,4 +251,4 @@ abp help [命令名]
````bash
abp help # 显示常规帮助.
abp help new # 显示有关 "New" 命令的帮助.
````
````

4
docs/zh-Hans/Getting-Started-React-Native.md

@ -2,7 +2,7 @@
ABP平台提供了[React Native](https://reactnative.dev/)模板用于开发移动应用程序.
当你按照[入门文档](Getting-Started.md)中所述**创建新应用程序**时,解决方案默认将React Native应用程序包含在 `react-native` 文件夹中.
当你按照[入门文档](Getting-Started.md)中所述**创建新应用程序**时, 你应该使用`-m react-native`选项以在解决方案中包含`react-native`项目.
## 配置你的本地IP地址
@ -67,4 +67,4 @@ yarn start
输入用户名 **admin**,密码 **1q2w3E*** 登录到应用程序.
应用程序已经启动并执行,你可以基于该启动模板开发应用程序.
应用程序已经启动并执行,你可以基于该启动模板开发应用程序.

9
docs/zh-Hans/Getting-Started.md

@ -62,10 +62,10 @@ dotnet tool update -g Volo.Abp.Cli
使用ABP CLI的 `new` 命令创建新项目:
````shell
abp new Acme.BookStore{{if UI == "NG"}} -u angular {{end}}{{if DB == "Mongo"}} -d mongodb{{end}}{{if Tiered == "Yes" && UI != "NG"}} --tiered {{else if Tiered == "Yes" && UI == "NG"}}--separate-identity-server{{end}}
abp new Acme.BookStore{{if UI == "NG"}} -u angular {{end}}{{if DB == "Mongo"}} -d mongodb{{end}}{{if Tiered == "Yes" && UI != "NG"}} --tiered {{else if Tiered == "Yes" && UI == "NG"}}--separate-identity-server{{end}} --mobile react-native
````
* 此命令还会在解决方案文件夹内创建一个React Native移动应用程序. 如果你不想要它,可以安全地删除它,或者在 `abp new` 命令中指定 `-m none` 选项,以使其完全不包含在解决方案中.
* 此命令还会在解决方案文件夹内创建一个React Native移动应用程序. 如果你不想要它,可以安全地删除它或从`abp new`命令中删除`--mobile react-native`选项, 以使其完全不包含在解决方案中.
{{ if UI == "NG" }}
@ -351,11 +351,8 @@ yarn start
#### 移动开发
当你创建一个新的应用程序时.该解决方案默认包含 `react-native`文件夹. 这是一个基础的[React Native](https://reactnative.dev/)启动模板,用于开发与基于ABP的后端集成的移动应用程序.
当你创建一个新的应用程序时. 可以添加`-m react-native`选项以在解决方案中包含 `react-native`项目. 这是一个基础的[React Native](https://reactnative.dev/)启动模板,用于开发与基于ABP的后端集成的移动应用程序.
如果你不计划使用React Native开发移动应用程序,你可以忽略并删除 `react-native` 文件夹.
> 你可以在ABP CLI中指定 `-m none` 选项,以使 `react-native` 目录完全不包含在解决方案中
请参阅"[React Native入门](Getting-Started-React-Native.md)"文档了解如何配置和运行React Native应用程序.

16
docs/zh-Hans/Startup-Templates/Application.md

@ -57,6 +57,20 @@ abp new Acme.BookStore -u angular
abp new Acme.BookStore -d mongodb
````
### 指定移动应用程序框架
该模板支持以下移动应用程序框架:
- `react-native`: React Native
使用 `-m` (or `--mobile`) 选项来指定移动应用程序框架:
````bash
abp new Acme.BookStore -m react-native
````
如果未指定, 则不会创建任何移动应用程序.
## 解决方案结构
根据命令的选项,会创建略有不同的解决方案结构.
@ -342,7 +356,7 @@ Home模块是一个可延迟加载的模块, 它加载应用程序的根地址.
### React Native
解决方案将[React Native](https://reactnative.dev/)应用程序作为默认值包含在 `react-native` 文件夹中.
如果使用 `-m react-native` 选项解决方案将[React Native](https://reactnative.dev/)应用程序作为默认值包含在 `react-native` 文件夹中.
服务器端类似于上面描述的解决方案. `*.HttpApi.Host` 的项目提供 API, 所以 React 本机应用程序使用它.

4
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs

@ -294,7 +294,7 @@ namespace Volo.Abp.Cli.Commands
protected virtual MobileApp GetMobilePreference(CommandLineArgs commandLineArgs)
{
var optionValue = commandLineArgs.Options.GetOrNull(Options.Mobile.Short, Options.Mobile.Long);
var template = commandLineArgs.Options.GetOrNull(Options.Template.Short, Options.Template.Long);
switch (optionValue)
{
case "none":
@ -302,7 +302,7 @@ namespace Volo.Abp.Cli.Commands
case "react-native":
return MobileApp.ReactNative;
default:
return ConsoleTemplate.TemplateName == template ? MobileApp.None : MobileApp.ReactNative;
return MobileApp.None;
}
}

Loading…
Cancel
Save