diff --git a/docs/en/CLI.md b/docs/en/CLI.md index b8ab602c3b..7f7b6b2f5e 100644 --- a/docs/en/CLI.md +++ b/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. diff --git a/docs/en/Getting-Started-React-Native.md b/docs/en/Getting-Started-React-Native.md index d591c93956..ec27d09463 100644 --- a/docs/en/Getting-Started-React-Native.md +++ b/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 diff --git a/docs/en/Getting-Started.md b/docs/en/Getting-Started.md index 57981d3233..8f4111bc31 100644 --- a/docs/en/Getting-Started.md +++ b/docs/en/Getting-Started.md @@ -62,10 +62,10 @@ dotnet tool update -g Volo.Abp.Cli Use the `new` command of the ABP CLI to create a new project: ````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 ```` -> 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. +> 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 remove `--mobile react-native` option from the `abp new` command to not include it in the solution at all. {{ if UI == "NG" }} @@ -339,11 +339,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. +When you create a new application, you have to add `-m react-native` option to include `react-native` project in your solution. This is a basic [React Native](https://reactnative.dev/) 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. diff --git a/docs/en/Startup-Templates/Application.md b/docs/en/Startup-Templates/Application.md index 7495b8f006..4e9bd63371 100644 --- a/docs/en/Startup-Templates/Application.md +++ b/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. diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs index 4a713ceb9e..d5ece4361f 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs +++ b/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; } }