Browse Source

Merge branch 'dev' into EngincanV/cmskit-rating

pull/5216/head
EngincanV 6 years ago
parent
commit
d254fd331c
  1. 0
      LICENSE.md
  2. 5
      common.props
  3. 20
      docs/en/Blog-Posts/2020-09-07 Angular-Service-Proxies/POST.md
  4. 19
      docs/en/CLI.md
  5. 18
      docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/Using-DevExtreme-Components-With-The-ABP-Fremework.md
  6. 0
      docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/both-example-result.png
  7. 0
      docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/data-grid-app-contract.png
  8. 0
      docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/data-grid-application.png
  9. 0
      docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/data-grid-final.png
  10. 0
      docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/data-grid-web.png
  11. 0
      docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/devexp-result.gif
  12. 0
      docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/devextreme-js.png
  13. 0
      docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/gulp.png
  14. 0
      docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/initial-project.png
  15. 0
      docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/tree-list-app-contract.png
  16. 0
      docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/tree-list-application.png
  17. 0
      docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/tree-list-final.png
  18. 0
      docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/tree-list-web.png
  19. 0
      docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/wwwroot-lib.png
  20. 13
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/CropperJs/CropperJsScriptContributor.cs
  21. 13
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/CropperJs/CropperJsStyleContributor.cs
  22. 10
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/CliService.cs
  23. 1
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/AddPackageCommand.cs
  24. 76
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GenerateProxyCommand.cs
  25. 1
      framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/en.json
  26. 1
      framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/tr.json
  27. 4
      npm/ng-packs/packages/schematics/src/commands/api/index.ts
  28. 6
      npm/ng-packs/packages/schematics/src/commands/proxy/index.ts
  29. 10
      npm/ng-packs/packages/schematics/src/utils/common.ts
  30. 6
      npm/packs/cropperjs/abp.resourcemapping.js
  31. 12
      npm/packs/cropperjs/package.json
  32. 2
      npm/packs/luxon/package.json
  33. 5
      nupkg/pack.ps1

0
LICENSE → LICENSE.md

5
common.props

@ -4,12 +4,13 @@
<Version>3.1.0</Version> <Version>3.1.0</Version>
<NoWarn>$(NoWarn);CS1591</NoWarn> <NoWarn>$(NoWarn);CS1591</NoWarn>
<PackageIconUrl>https://abp.io/assets/abp_nupkg.png</PackageIconUrl> <PackageIconUrl>https://abp.io/assets/abp_nupkg.png</PackageIconUrl>
<PackageProjectUrl>https://abp.io</PackageProjectUrl> <PackageProjectUrl>https://abp.io/</PackageProjectUrl>
<PackageLicenseUrl>https://github.com/abpframework/abp/blob/master/LICENSE</PackageLicenseUrl> <PackageLicenseFile>LICENSE.md</PackageLicenseFile>
<RepositoryType>git</RepositoryType> <RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/abpframework/abp/</RepositoryUrl> <RepositoryUrl>https://github.com/abpframework/abp/</RepositoryUrl>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="SourceLink.Create.CommandLine" Version="2.8.3" PrivateAssets="All" /> <PackageReference Include="SourceLink.Create.CommandLine" Version="2.8.3" PrivateAssets="All" />
<None Include="LICENSE.md" Pack="true" PackagePath=""/>
</ItemGroup> </ItemGroup>
</Project> </Project>

20
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. > 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 ````bash
npm install @abp/ng.schematics --save-dev 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 ```json
apis: { apis: {
default: { 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 ## Basic Usage
### Project Creation ### 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 ````bash
abp new AngularProxyDemo -u angular 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. 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 ### Backend
@ -124,13 +124,13 @@ It simply returns a list of books. You probably want to get the books from a dat
### HTTP API ### 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) ![swagger-book-list](swagger-book-list.png)
### Service Proxy Generation ### 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 ````bash
abp generate-proxy abp generate-proxy

19
docs/en/CLI.md

@ -16,6 +16,12 @@ To update an existing installation:
dotnet tool update -g Volo.Abp.Cli 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 ## Commands
Here, the list of all available commands before explaining their details: Here, the list of all available commands before explaining their details:
@ -181,6 +187,13 @@ Usage:
abp generate-proxy 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. > See the [Angular Service Proxies document](UI/Angular/Service-Proxies.md) for more.
@ -196,7 +209,7 @@ abp switch-to-preview [options]
#### 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 ### switch-to-nightly
@ -211,7 +224,7 @@ abp switch-to-nightly [options]
#### 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 ### switch-to-stable
@ -224,7 +237,7 @@ abp switch-to-stable [options]
```` ````
#### 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 ### translate

18
docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/Using-DevExtreme-In-ABP-Based-Application.md → 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) ![both-example-result](both-example-result.png)
*(A screenshot from the example application developed in this article)*
## Create the Project ## 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): 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 #### Create DevExtremeJsViewComponent
@ -184,7 +186,7 @@ namespace DevExtremeSample.Web.Components.DevExtremeJs
<abp-script type="typeof(DevExtremeScriptContributor)" /> <abp-script type="typeof(DevExtremeScriptContributor)" />
``` ```
Your final Web project should be like as the following: Your final Web project should be like the following:
![devextreme-js](devextreme-js.png) ![devextreme-js](devextreme-js.png)
@ -204,7 +206,7 @@ Configure<AbpLayoutHookOptions>(options =>
#### Known Issue: Uncaught TypeError: MutationObserver.observe: Argument 1 is not an object. #### 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. 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 #### 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 #### DevExtreme Components vs Application Service Methods
@ -300,3 +302,7 @@ Html.DevExtreme().DataGrid<Order>()
.Key("OrderID") .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.

0
docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/both-example-result.png → docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/both-example-result.png

Before

Width:  |  Height:  |  Size: 123 KiB

After

Width:  |  Height:  |  Size: 123 KiB

0
docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/data-grid-app-contract.png → docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/data-grid-app-contract.png

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

0
docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/data-grid-application.png → docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/data-grid-application.png

Before

Width:  |  Height:  |  Size: 8.4 KiB

After

Width:  |  Height:  |  Size: 8.4 KiB

0
docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/data-grid-final.png → docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/data-grid-final.png

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 44 KiB

0
docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/data-grid-web.png → docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/data-grid-web.png

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

0
docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/devexp-result.gif → docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/devexp-result.gif

Before

Width:  |  Height:  |  Size: 106 KiB

After

Width:  |  Height:  |  Size: 106 KiB

0
docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/devextreme-js.png → docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/devextreme-js.png

Before

Width:  |  Height:  |  Size: 7.9 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

0
docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/gulp.png → docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/gulp.png

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

0
docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/initial-project.png → docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/initial-project.png

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

0
docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/tree-list-app-contract.png → docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/tree-list-app-contract.png

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

0
docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/tree-list-application.png → docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/tree-list-application.png

Before

Width:  |  Height:  |  Size: 8.5 KiB

After

Width:  |  Height:  |  Size: 8.5 KiB

0
docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/tree-list-final.png → docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/tree-list-final.png

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 68 KiB

0
docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/tree-list-web.png → docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/tree-list-web.png

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

0
docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/wwwroot-lib.png → docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/wwwroot-lib.png

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

13
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");
}
}
}

13
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");
}
}
}

10
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)"); Logger.LogInformation("ABP CLI (https://abp.io)");
await CheckCliVersionAsync();
var commandLineArgs = CommandLineArgumentParser.Parse(args); var commandLineArgs = CommandLineArgumentParser.Parse(args);
if (!commandLineArgs.Options.ContainsKey("skip-cli-version-check"))
{
await CheckCliVersionAsync();
}
var commandType = CommandSelector.Select(commandLineArgs); var commandType = CommandSelector.Select(commandLineArgs);
using (var scope = ServiceScopeFactory.CreateScope()) using (var scope = ServiceScopeFactory.CreateScope())
@ -72,7 +76,7 @@ namespace Volo.Abp.Cli
var currentCliVersion = await GetCurrentCliVersion(assembly); var currentCliVersion = await GetCurrentCliVersion(assembly);
var updateChannel = GetUpdateChannel(currentCliVersion); var updateChannel = GetUpdateChannel(currentCliVersion);
Logger.LogInformation($"Version {currentCliVersion} ({updateChannel} channel)"); Logger.LogInformation($"Version {currentCliVersion} ({updateChannel})");
try try
{ {

1
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()); throw new CliUsageException(sb.ToString());
} }
public static class Options public static class Options
{ {
public static class Project public static class Project

76
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GenerateProxyCommand.cs

@ -2,7 +2,6 @@ using System;
using System.IO; using System.IO;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using Volo.Abp.Cli.Args; using Volo.Abp.Cli.Args;
using Volo.Abp.Cli.Utils; using Volo.Abp.Cli.Utils;
@ -17,7 +16,31 @@ namespace Volo.Abp.Cli.Commands
CheckAngularJsonFile(); CheckAngularJsonFile();
CheckNgSchematics(); 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; return Task.CompletedTask;
} }
@ -29,20 +52,21 @@ namespace Volo.Abp.Cli.Commands
if (!File.Exists(packageJsonPath)) if (!File.Exists(packageJsonPath))
{ {
throw new CliUsageException( throw new CliUsageException(
"package.json file not found" + "package.json file not found" +
Environment.NewLine + Environment.NewLine +
GetUsageInfo() 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) if (schematicsPackageNode == null)
{ {
throw new CliUsageException( throw new CliUsageException(
"\"@abp/ng.schematics\" NPM package should be installed to the devDependencies before running this command!" + "\"@abp/ng.schematics\" NPM package should be installed to the devDependencies before running this command!" +
Environment.NewLine + Environment.NewLine +
GetUsageInfo() GetUsageInfo()
); );
} }
} }
@ -69,9 +93,12 @@ namespace Volo.Abp.Cli.Commands
sb.AppendLine(""); sb.AppendLine("");
sb.AppendLine(" abp generate-proxy"); sb.AppendLine(" abp generate-proxy");
sb.AppendLine(""); sb.AppendLine("");
sb.AppendLine("Examples:"); sb.AppendLine("Options:");
sb.AppendLine(""); sb.AppendLine("");
sb.AppendLine(" abp generate-proxy"); sb.AppendLine("-m|--module <module-name> (default: 'app') The name of the backend module you wish to generate proxies for.");
sb.AppendLine("-s|--source <source-name> (default: 'defaultProject') Angular project name to resolve the root namespace & API definition URL from.");
sb.AppendLine("-t|--target <target-name> (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("");
sb.AppendLine("See the documentation for more info: https://docs.abp.io/en/abp/latest/CLI"); 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."; 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";
}
}
} }
} }

1
framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/en.json

@ -17,6 +17,7 @@
"Error": "Error", "Error": "Error",
"AreYouSure": "Are you sure?", "AreYouSure": "Are you sure?",
"Cancel": "Cancel", "Cancel": "Cancel",
"Clear": "Clear",
"Yes": "Yes", "Yes": "Yes",
"No": "No", "No": "No",
"Ok": "Ok", "Ok": "Ok",

1
framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/tr.json

@ -17,6 +17,7 @@
"Error": "Hata", "Error": "Hata",
"AreYouSure": "Emin misiniz?", "AreYouSure": "Emin misiniz?",
"Cancel": "Vazgeç", "Cancel": "Vazgeç",
"Clear": "Temizle",
"Yes": "Evet", "Yes": "Evet",
"No": "Hayır", "No": "Hayır",
"Ok": "Tamam", "Ok": "Tamam",

4
npm/ng-packs/packages/schematics/src/commands/api/index.ts

@ -23,13 +23,15 @@ import {
getRootNamespace, getRootNamespace,
interpolate, interpolate,
ModelGeneratorParams, ModelGeneratorParams,
removeDefaultPlaceholders,
resolveProject, resolveProject,
serializeParameters, serializeParameters,
} from '../../utils'; } from '../../utils';
import * as cases from '../../utils/text'; import * as cases from '../../utils/text';
import { Schema as GenerateProxySchema } from './schema'; 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'); const moduleName = strings.camelize(params.module || 'app');
return chain([ return chain([

6
npm/ng-packs/packages/schematics/src/commands/proxy/index.ts

@ -13,11 +13,13 @@ import {
createApiDefinitionSaver, createApiDefinitionSaver,
getApiDefinition, getApiDefinition,
getSourceUrl, getSourceUrl,
removeDefaultPlaceholders,
resolveProject, resolveProject,
} from '../../utils'; } from '../../utils';
import { Schema as GenerateProxySchema } from './schema'; 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'); const moduleName = strings.camelize(params.module || 'app');
return chain([ return chain([
@ -32,7 +34,7 @@ export default function(params: GenerateProxySchema) {
data, data,
`${targetPath}/shared/api-definition.json`, `${targetPath}/shared/api-definition.json`,
); );
const createApi = schematic('api', params); const createApi = schematic('api', schema);
return branchAndMerge(chain([saveApiDefinition, createApi])); return branchAndMerge(chain([saveApiDefinition, createApi]));
}, },

10
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'); const text = buffer.toString('utf-8');
return ts.createSourceFile(filePath, text, ts.ScriptTarget.Latest, true); return ts.createSourceFile(filePath, text, ts.ScriptTarget.Latest, true);
} }
export function removeDefaultPlaceholders<T>(oldParams: T) {
const newParams: Record<string, any> = {};
Object.entries(oldParams).forEach(([key, value]) => {
newParams[key] = value === '__default' ? undefined : value;
});
return newParams as T;
}

6
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/",
},
};

12
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"
}

2
npm/packs/luxon/package.json

@ -5,7 +5,7 @@
"access": "public" "access": "public"
}, },
"dependencies": { "dependencies": {
"@abp/core": "~3.0.5", "@abp/core": "~3.1.0-rc.2",
"luxon": "^1.24.1" "luxon": "^1.24.1"
}, },
"gitHead": "bb4ea17d5996f01889134c138d00b6c8f858a431" "gitHead": "bb4ea17d5996f01889134c138d00b6c8f858a431"

5
nupkg/pack.ps1

@ -11,6 +11,8 @@ foreach($solution in $solutions) {
foreach($project in $projects) { foreach($project in $projects) {
$projectFolder = Join-Path $rootFolder $project $projectFolder = Join-Path $rootFolder $project
Copy-Item (Join-Path $rootFolder "LICENSE.md") -Destination $projectFolder
# Create nuget pack # Create nuget pack
Set-Location $projectFolder Set-Location $projectFolder
@ -26,7 +28,8 @@ foreach($project in $projects) {
$projectName = $project.Substring($project.LastIndexOf("/") + 1) $projectName = $project.Substring($project.LastIndexOf("/") + 1)
$projectPackPath = Join-Path $projectFolder ("/bin/Release/" + $projectName + ".*.nupkg") $projectPackPath = Join-Path $projectFolder ("/bin/Release/" + $projectName + ".*.nupkg")
Move-Item $projectPackPath $packFolder Move-Item $projectPackPath $packFolder
Remove-Item (Join-Path $projectFolder "LICENSE.md")
} }
# Go back to the pack folder # Go back to the pack folder

Loading…
Cancel
Save