diff --git a/LICENSE b/LICENSE.md similarity index 100% rename from LICENSE rename to LICENSE.md diff --git a/common.props b/common.props index b0b13025bb..4855f1cd9c 100644 --- a/common.props +++ b/common.props @@ -4,12 +4,13 @@ 3.1.0 $(NoWarn);CS1591 https://abp.io/assets/abp_nupkg.png - https://abp.io - https://github.com/abpframework/abp/blob/master/LICENSE + https://abp.io/ + LICENSE.md git https://github.com/abpframework/abp/ + \ No newline at end of file diff --git a/docs/en/Blog-Posts/2020-09-07 Angular-Service-Proxies/POST.md b/docs/en/Blog-Posts/2020-09-07 Angular-Service-Proxies/POST.md index e0543fb915..d16540872f 100644 --- a/docs/en/Blog-Posts/2020-09-07 Angular-Service-Proxies/POST.md +++ b/docs/en/Blog-Posts/2020-09-07 Angular-Service-Proxies/POST.md @@ -26,34 +26,34 @@ dotnet tool update -g Volo.Abp.Cli > If you've created your project with version 3.1 or later, you can skip this part since it will be already installed in your solution. -For the solution was created before v3.1, follow the steps below to configure your angular project: +For a solution that was created before v3.1, follow the steps below to configure the angular application: -* Add `@abp/ng.schematics` package to the `devDependencies` of the Angular project (run the following command in the root folder of the angular application): +* Add `@abp/ng.schematics` package to the `devDependencies` of the Angular project. Run the following command in the root folder of the angular application: ````bash npm install @abp/ng.schematics --save-dev ```` -- Add `rootNamespace` entry into the `/apis/default/` section in the `/src/environments/environment.ts`, as shown below: +- Add `rootNamespace` entry into the `apis/default` section in the `/src/environments/environment.ts`, as shown below: ```json apis: { default: { ... - rootNamespace: 'Acme.BookStore' //<-- ADD THIS + rootNamespace: 'Acme.BookStore' }, } ``` -`Acme.BookStore` should be replaced by the root namespace of your .NET project. This ensures to not create unnecessary nested folders while creating the service proxy code. +`Acme.BookStore` should be replaced by the root namespace of your .NET project. This ensures to not create unnecessary nested folders while creating the service proxy code. This value is `AngularProxyDemo` for the example solution explained below. ## Basic Usage ### Project Creation -Assuming you've created your project with the Angular UI. +> If you already have a solution, you can skip this section. -Example (using the [ABP CLI](https://docs.abp.io/en/abp/latest/CLI)): +You need to [create](https://abp.io/get-started) your solution with the Angular UI. You can use the [ABP CLI](https://docs.abp.io/en/abp/latest/CLI) to create a new solution: ````bash abp new AngularProxyDemo -u angular @@ -63,7 +63,7 @@ abp new AngularProxyDemo -u angular The backend application must be up and running to be able to use the service proxy code generation system. -> See the [getting started](https://docs.abp.io/en/abp/latest/Getting-Started?UI=NG&DB=EF&Tiered=No) guide if you don't know how create and to run the project. +> See the [getting started](https://docs.abp.io/en/abp/latest/Getting-Started?UI=NG&DB=EF&Tiered=No) guide if you don't know details of creating and running the solution. ### Backend @@ -124,13 +124,13 @@ It simply returns a list of books. You probably want to get the books from a dat ### HTTP API -Thanks to the conventional API controllers system of the ABP Framework, we don't have too develop API controllers manually. Just **run the backend (*HttpApi.Host*) application** that shows the [Swagger UI](https://swagger.io/tools/swagger-ui/) by default. You will see the GET API for the books: +Thanks to the [auto API controllers](https://docs.abp.io/en/abp/latest/API/Auto-API-Controllers) system of the ABP Framework, we don't have to develop API controllers manually. Just **run the backend (*HttpApi.Host*) application** that shows the [Swagger UI](https://swagger.io/tools/swagger-ui/) by default. You will see the **GET** API for the books: ![swagger-book-list](swagger-book-list.png) ### Service Proxy Generation -Open a command line in the root folder of the Angular application and execute the following command: +Open a **command line** in the **root folder of the Angular application** and execute the following command: ````bash abp generate-proxy diff --git a/docs/en/CLI.md b/docs/en/CLI.md index 99808c3ba5..91e7b6669d 100644 --- a/docs/en/CLI.md +++ b/docs/en/CLI.md @@ -16,6 +16,12 @@ To update an existing installation: dotnet tool update -g Volo.Abp.Cli ```` +## Global Options + +While each command may have a set of options, there are some global options those can be used with any command; + +* `--skip-cli-version-check`: Skips to check the latest version of the ABP CLI. If you don't specify, it will check the latest version and shows a warning message if there is a newer version of the ABP CLI. + ## Commands Here, the list of all available commands before explaining their details: @@ -181,6 +187,13 @@ Usage: abp generate-proxy ```` +#### Options + +* `--module` or `-m`: Specifies the name of the backend module you wish to generate proxies for. Default value: `app`. +* `--source` or `-s`: Specifies the Angular project name to resolve the root namespace & API definition URL from. Default value: `defaultProject`. +* `--target` or `-t`: Specifies the Angular project name to place generated code in. Default value: `defaultProject`. +* `--prompt` or `-p`: Asks the options from the command line prompt (for the unspecified options). + > See the [Angular Service Proxies document](UI/Angular/Service-Proxies.md) for more. @@ -196,7 +209,7 @@ abp switch-to-preview [options] #### Options -`--solution-directory` or `-sd`: Specifies the directory. The solution should be in that directory or in any of its sub directories. If not specified, default is the current directory. +* `--solution-directory` or `-sd`: Specifies the directory. The solution should be in that directory or in any of its sub directories. If not specified, default is the current directory. ### switch-to-nightly @@ -211,7 +224,7 @@ abp switch-to-nightly [options] #### Options -`--solution-directory` or `-sd`: Specifies the directory. The solution should be in that directory or in any of its sub directories. If not specified, default is the current directory. +* `--solution-directory` or `-sd`: Specifies the directory. The solution should be in that directory or in any of its sub directories. If not specified, default is the current directory. ### switch-to-stable @@ -224,7 +237,7 @@ abp switch-to-stable [options] ```` #### Options -`--solution-directory` or `-sd`: Specifies the directory. The solution should be in that directory or in any of its sub directories. If not specified, default is the current directory. +* `--solution-directory` or `-sd`: Specifies the directory. The solution should be in that directory or in any of its sub directories. If not specified, default is the current directory. ### translate diff --git a/docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/Using-DevExtreme-In-ABP-Based-Application.md b/docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/Using-DevExtreme-Components-With-The-ABP-Fremework.md similarity index 89% rename from docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/Using-DevExtreme-In-ABP-Based-Application.md rename to docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/Using-DevExtreme-Components-With-The-ABP-Fremework.md index 1b2c2b3e33..eb93041228 100644 --- a/docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/Using-DevExtreme-In-ABP-Based-Application.md +++ b/docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/Using-DevExtreme-Components-With-The-ABP-Fremework.md @@ -1,9 +1,11 @@ -## Using DevExtreme with ABP Based Applications +## Using DevExtreme Components With the ABP Fremework -Hi, in this step by step article, I will show you how to integrate DevExtreme components into ABP Framework based applications. +Hi, in this step by step article, I will show you how to integrate [DevExtreme](https://js.devexpress.com/) components into ABP Framework-based applications. ![both-example-result](both-example-result.png) +*(A screenshot from the example application developed in this article)* + ## Create the Project ABP Framework offers startup templates to get into the business faster. We can download a new startup template using [ABP CLI](https://docs.abp.io/en/abp/latest/CLI): @@ -151,7 +153,7 @@ namespace DevExtremeSample.Web.Bundling } ``` -As you see, the `DevExtremeScriptContributor` is depends on `JQueryScriptContributor` which adds JQuery related files before the DevExpress packages (see the [bundling system](https://docs.abp.io/en/abp/latest/UI/AspNetCore/Bundling-Minification) for details). +As you see, the `DevExtremeScriptContributor` depends on `JQueryScriptContributor` which adds JQuery related files before the DevExpress packages (see the [bundling system](https://docs.abp.io/en/abp/latest/UI/AspNetCore/Bundling-Minification) for details). #### Create DevExtremeJsViewComponent @@ -184,7 +186,7 @@ namespace DevExtremeSample.Web.Components.DevExtremeJs ``` -Your final Web project should be like as the following: +Your final Web project should be like the following: ![devextreme-js](devextreme-js.png) @@ -204,7 +206,7 @@ Configure(options => #### Known Issue: Uncaught TypeError: MutationObserver.observe: Argument 1 is not an object. -> This issue does exists in the ABP Framework v3.0 and earlier versions. If you are using ABP Framework v3.1 or a latter version, you can skip this section. +> This issue does exist in the ABP Framework v3.0 and earlier versions. If you are using ABP Framework v3.1 or a later version, you can skip this section. When you run your `*.Web` project, you will see an exception (`Uncaught TypeError: MutationObserver.observe: Argument 1 is not an object.`) at your console. @@ -265,7 +267,7 @@ I've used an in-memory list to store data for this example, instead of a real da #### JSON Serialization -You can see some `JsonProperty` attributes on the DTO properties. I uses these attributes because DevExtreme example expects `PascalCase` property names in the serialized JSON that is sent to the client. But ABP Framework & ASP.NET Core conventionally uses `camelCase` property names on JSON serialization. Adding these `JsonProperty` attributes ensures that the related properties are serialized as `PascalCase`. +You can see some `JsonProperty` attributes on the DTO properties. I use these attributes because DevExtreme example expects `PascalCase` property names in the serialized JSON that is sent to the client. But ABP Framework & ASP.NET Core conventionally uses `camelCase` property names on JSON serialization. Adding these `JsonProperty` attributes ensures that the related properties are serialized as `PascalCase`. #### DevExtreme Components vs Application Service Methods @@ -300,3 +302,7 @@ Html.DevExtreme().DataGrid() .Key("OrderID") ) ``` + +## Conclusion + +In this article, I've explained how to use [DevExtreme](https://js.devexpress.com/) components in your application. ABP Framework is designed so that it can work with any UI library/framework. diff --git a/docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/both-example-result.png b/docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/both-example-result.png similarity index 100% rename from docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/both-example-result.png rename to docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/both-example-result.png diff --git a/docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/data-grid-app-contract.png b/docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/data-grid-app-contract.png similarity index 100% rename from docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/data-grid-app-contract.png rename to docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/data-grid-app-contract.png diff --git a/docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/data-grid-application.png b/docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/data-grid-application.png similarity index 100% rename from docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/data-grid-application.png rename to docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/data-grid-application.png diff --git a/docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/data-grid-final.png b/docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/data-grid-final.png similarity index 100% rename from docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/data-grid-final.png rename to docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/data-grid-final.png diff --git a/docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/data-grid-web.png b/docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/data-grid-web.png similarity index 100% rename from docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/data-grid-web.png rename to docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/data-grid-web.png diff --git a/docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/devexp-result.gif b/docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/devexp-result.gif similarity index 100% rename from docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/devexp-result.gif rename to docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/devexp-result.gif diff --git a/docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/devextreme-js.png b/docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/devextreme-js.png similarity index 100% rename from docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/devextreme-js.png rename to docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/devextreme-js.png diff --git a/docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/gulp.png b/docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/gulp.png similarity index 100% rename from docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/gulp.png rename to docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/gulp.png diff --git a/docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/initial-project.png b/docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/initial-project.png similarity index 100% rename from docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/initial-project.png rename to docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/initial-project.png diff --git a/docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/tree-list-app-contract.png b/docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/tree-list-app-contract.png similarity index 100% rename from docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/tree-list-app-contract.png rename to docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/tree-list-app-contract.png diff --git a/docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/tree-list-application.png b/docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/tree-list-application.png similarity index 100% rename from docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/tree-list-application.png rename to docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/tree-list-application.png diff --git a/docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/tree-list-final.png b/docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/tree-list-final.png similarity index 100% rename from docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/tree-list-final.png rename to docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/tree-list-final.png diff --git a/docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/tree-list-web.png b/docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/tree-list-web.png similarity index 100% rename from docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/tree-list-web.png rename to docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/tree-list-web.png diff --git a/docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/wwwroot-lib.png b/docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/wwwroot-lib.png similarity index 100% rename from docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/wwwroot-lib.png rename to docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/wwwroot-lib.png diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/CropperJs/CropperJsScriptContributor.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/CropperJs/CropperJsScriptContributor.cs new file mode 100644 index 0000000000..fbfd19f765 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/CropperJs/CropperJsScriptContributor.cs @@ -0,0 +1,13 @@ +using Volo.Abp.AspNetCore.Mvc.UI.Bundling; +using System.Collections.Generic; + +namespace Volo.Abp.AspNetCore.Mvc.UI.Packages.CropperJs +{ + public class CropperJsScriptContributor : BundleContributor + { + public override void ConfigureBundle(BundleConfigurationContext context) + { + context.Files.AddIfNotContains("/libs/cropperjs/js/cropper.min.js"); + } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/CropperJs/CropperJsStyleContributor.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/CropperJs/CropperJsStyleContributor.cs new file mode 100644 index 0000000000..1e6f78ff3f --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/CropperJs/CropperJsStyleContributor.cs @@ -0,0 +1,13 @@ +using System.Collections.Generic; +using Volo.Abp.AspNetCore.Mvc.UI.Bundling; + +namespace Volo.Abp.AspNetCore.Mvc.UI.Packages.CropperJs +{ + public class CropperJsStyleContributor : BundleContributor + { + public override void ConfigureBundle(BundleConfigurationContext context) + { + context.Files.AddIfNotContains("/libs/cropperjs/css/cropper.min.css"); + } + } +} \ No newline at end of file diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/CliService.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/CliService.cs index 3918a18657..84643ed543 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/CliService.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/CliService.cs @@ -41,9 +41,13 @@ namespace Volo.Abp.Cli { Logger.LogInformation("ABP CLI (https://abp.io)"); - await CheckCliVersionAsync(); - var commandLineArgs = CommandLineArgumentParser.Parse(args); + + if (!commandLineArgs.Options.ContainsKey("skip-cli-version-check")) + { + await CheckCliVersionAsync(); + } + var commandType = CommandSelector.Select(commandLineArgs); using (var scope = ServiceScopeFactory.CreateScope()) @@ -72,7 +76,7 @@ namespace Volo.Abp.Cli var currentCliVersion = await GetCurrentCliVersion(assembly); var updateChannel = GetUpdateChannel(currentCliVersion); - Logger.LogInformation($"Version {currentCliVersion} ({updateChannel} channel)"); + Logger.LogInformation($"Version {currentCliVersion} ({updateChannel})"); try { diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/AddPackageCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/AddPackageCommand.cs index 7ea20eccf4..36530a7979 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/AddPackageCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/AddPackageCommand.cs @@ -115,7 +115,6 @@ namespace Volo.Abp.Cli.Commands throw new CliUsageException(sb.ToString()); } - public static class Options { public static class Project diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GenerateProxyCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GenerateProxyCommand.cs index ab680ce4b8..5e88417b4a 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GenerateProxyCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GenerateProxyCommand.cs @@ -2,7 +2,6 @@ using System; using System.IO; using System.Text; using System.Threading.Tasks; -using Newtonsoft.Json; using Newtonsoft.Json.Linq; using Volo.Abp.Cli.Args; using Volo.Abp.Cli.Utils; @@ -17,7 +16,31 @@ namespace Volo.Abp.Cli.Commands CheckAngularJsonFile(); CheckNgSchematics(); - CmdHelper.RunCmd("npx ng g @abp/ng.schematics:proxy"); + var prompt = commandLineArgs.Options.ContainsKey("p") || commandLineArgs.Options.ContainsKey("prompt"); + var defaultValue = prompt ? null : "__default"; + + var module = commandLineArgs.Options.GetOrNull(Options.Module.Short, Options.Module.Long) ?? defaultValue; + var source = commandLineArgs.Options.GetOrNull(Options.Source.Short, Options.Source.Long) ?? defaultValue; + var target = commandLineArgs.Options.GetOrNull(Options.Target.Short, Options.Target.Long) ?? defaultValue; + + var commandBuilder = new StringBuilder("npx ng g @abp/ng.schematics:proxy"); + + if (module != null) + { + commandBuilder.Append($" --module {module}"); + } + + if (source != null) + { + commandBuilder.Append($" --source {source}"); + } + + if (target != null) + { + commandBuilder.Append($" --target {target}"); + } + + CmdHelper.RunCmd(commandBuilder.ToString()); return Task.CompletedTask; } @@ -29,20 +52,21 @@ namespace Volo.Abp.Cli.Commands if (!File.Exists(packageJsonPath)) { throw new CliUsageException( - "package.json file not found" + - Environment.NewLine + - GetUsageInfo() + "package.json file not found" + + Environment.NewLine + + GetUsageInfo() ); } - var schematicsPackageNode = (string) JObject.Parse(File.ReadAllText(packageJsonPath))["devDependencies"]?["@abp/ng.schematics"]; + var schematicsPackageNode = + (string) JObject.Parse(File.ReadAllText(packageJsonPath))["devDependencies"]?["@abp/ng.schematics"]; if (schematicsPackageNode == null) { throw new CliUsageException( - "\"@abp/ng.schematics\" NPM package should be installed to the devDependencies before running this command!" + - Environment.NewLine + - GetUsageInfo() + "\"@abp/ng.schematics\" NPM package should be installed to the devDependencies before running this command!" + + Environment.NewLine + + GetUsageInfo() ); } } @@ -69,9 +93,12 @@ namespace Volo.Abp.Cli.Commands sb.AppendLine(""); sb.AppendLine(" abp generate-proxy"); sb.AppendLine(""); - sb.AppendLine("Examples:"); + sb.AppendLine("Options:"); sb.AppendLine(""); - sb.AppendLine(" abp generate-proxy"); + sb.AppendLine("-m|--module (default: 'app') The name of the backend module you wish to generate proxies for."); + sb.AppendLine("-s|--source (default: 'defaultProject') Angular project name to resolve the root namespace & API definition URL from."); + sb.AppendLine("-t|--target (default: 'defaultProject') Angular project name to place generated code in."); + sb.AppendLine("-p|--prompt Asks the options from the command line prompt (for the missing options)"); sb.AppendLine(""); sb.AppendLine("See the documentation for more info: https://docs.abp.io/en/abp/latest/CLI"); @@ -82,5 +109,32 @@ namespace Volo.Abp.Cli.Commands { return "Generates Angular service proxies and DTOs to consume HTTP APIs."; } + + public static class Options + { + public static class Module + { + public const string Short = "m"; + public const string Long = "module"; + } + + public static class Source + { + public const string Short = "s"; + public const string Long = "source"; + } + + public static class Target + { + public const string Short = "t"; + public const string Long = "target"; + } + + public static class Prompt + { + public const string Short = "p"; + public const string Long = "prompt"; + } + } } } diff --git a/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/en.json b/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/en.json index a4fdf7afbd..d6f24833a9 100644 --- a/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/en.json +++ b/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/en.json @@ -17,6 +17,7 @@ "Error": "Error", "AreYouSure": "Are you sure?", "Cancel": "Cancel", + "Clear": "Clear", "Yes": "Yes", "No": "No", "Ok": "Ok", diff --git a/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/tr.json b/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/tr.json index bf558bb763..f4fffd3f7f 100644 --- a/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/tr.json +++ b/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/tr.json @@ -17,6 +17,7 @@ "Error": "Hata", "AreYouSure": "Emin misiniz?", "Cancel": "Vazgeç", + "Clear": "Temizle", "Yes": "Evet", "No": "Hayır", "Ok": "Tamam", diff --git a/npm/ng-packs/packages/schematics/src/commands/api/index.ts b/npm/ng-packs/packages/schematics/src/commands/api/index.ts index 956e91e0b1..24e0f816af 100644 --- a/npm/ng-packs/packages/schematics/src/commands/api/index.ts +++ b/npm/ng-packs/packages/schematics/src/commands/api/index.ts @@ -23,13 +23,15 @@ import { getRootNamespace, interpolate, ModelGeneratorParams, + removeDefaultPlaceholders, resolveProject, serializeParameters, } from '../../utils'; import * as cases from '../../utils/text'; import { Schema as GenerateProxySchema } from './schema'; -export default function(params: GenerateProxySchema) { +export default function(schema: GenerateProxySchema) { + const params = removeDefaultPlaceholders(schema); const moduleName = strings.camelize(params.module || 'app'); return chain([ diff --git a/npm/ng-packs/packages/schematics/src/commands/proxy/index.ts b/npm/ng-packs/packages/schematics/src/commands/proxy/index.ts index d597f720cd..ddbbd68caa 100644 --- a/npm/ng-packs/packages/schematics/src/commands/proxy/index.ts +++ b/npm/ng-packs/packages/schematics/src/commands/proxy/index.ts @@ -13,11 +13,13 @@ import { createApiDefinitionSaver, getApiDefinition, getSourceUrl, + removeDefaultPlaceholders, resolveProject, } from '../../utils'; import { Schema as GenerateProxySchema } from './schema'; -export default function(params: GenerateProxySchema) { +export default function(schema: GenerateProxySchema) { + const params = removeDefaultPlaceholders(schema); const moduleName = strings.camelize(params.module || 'app'); return chain([ @@ -32,7 +34,7 @@ export default function(params: GenerateProxySchema) { data, `${targetPath}/shared/api-definition.json`, ); - const createApi = schematic('api', params); + const createApi = schematic('api', schema); return branchAndMerge(chain([saveApiDefinition, createApi])); }, diff --git a/npm/ng-packs/packages/schematics/src/utils/common.ts b/npm/ng-packs/packages/schematics/src/utils/common.ts index 8a5aa5fd93..ff01bd27c5 100644 --- a/npm/ng-packs/packages/schematics/src/utils/common.ts +++ b/npm/ng-packs/packages/schematics/src/utils/common.ts @@ -23,3 +23,13 @@ export function readFileInTree(tree: Tree, filePath: string): ts.SourceFile { const text = buffer.toString('utf-8'); return ts.createSourceFile(filePath, text, ts.ScriptTarget.Latest, true); } + +export function removeDefaultPlaceholders(oldParams: T) { + const newParams: Record = {}; + + Object.entries(oldParams).forEach(([key, value]) => { + newParams[key] = value === '__default' ? undefined : value; + }); + + return newParams as T; +} diff --git a/npm/packs/cropperjs/abp.resourcemapping.js b/npm/packs/cropperjs/abp.resourcemapping.js new file mode 100644 index 0000000000..0a2f369710 --- /dev/null +++ b/npm/packs/cropperjs/abp.resourcemapping.js @@ -0,0 +1,6 @@ +module.exports = { + mappings: { + "@node_modules/cropperjs/dist/cropper.min.js": "@libs/cropperjs/js/", + "@node_modules/cropperjs/dist/cropper.min.css": "@libs/cropperjs/css/", + }, +}; diff --git a/npm/packs/cropperjs/package.json b/npm/packs/cropperjs/package.json new file mode 100644 index 0000000000..9764f89545 --- /dev/null +++ b/npm/packs/cropperjs/package.json @@ -0,0 +1,12 @@ +{ + "version": "3.0.5", + "name": "@abp/cropperjs", + "publishConfig": { + "access": "public" + }, + "dependencies": { + "@abp/core": "~3.0.5", + "cropperjs": "^1.5.7" + }, + "gitHead": "bb4ea17d5996f01889134c138d00b6c8f858a431" +} diff --git a/npm/packs/luxon/package.json b/npm/packs/luxon/package.json index de348d7b21..b26f1b6ba6 100644 --- a/npm/packs/luxon/package.json +++ b/npm/packs/luxon/package.json @@ -5,7 +5,7 @@ "access": "public" }, "dependencies": { - "@abp/core": "~3.0.5", + "@abp/core": "~3.1.0-rc.2", "luxon": "^1.24.1" }, "gitHead": "bb4ea17d5996f01889134c138d00b6c8f858a431" diff --git a/nupkg/pack.ps1 b/nupkg/pack.ps1 index 925e697300..8b593dd2a2 100644 --- a/nupkg/pack.ps1 +++ b/nupkg/pack.ps1 @@ -11,6 +11,8 @@ foreach($solution in $solutions) { foreach($project in $projects) { $projectFolder = Join-Path $rootFolder $project + + Copy-Item (Join-Path $rootFolder "LICENSE.md") -Destination $projectFolder # Create nuget pack Set-Location $projectFolder @@ -26,7 +28,8 @@ foreach($project in $projects) { $projectName = $project.Substring($project.LastIndexOf("/") + 1) $projectPackPath = Join-Path $projectFolder ("/bin/Release/" + $projectName + ".*.nupkg") Move-Item $projectPackPath $packFolder - + + Remove-Item (Join-Path $projectFolder "LICENSE.md") } # Go back to the pack folder