Browse Source

Merge branch 'dev' of https://github.com/abpframework/abp into dev

pull/2299/head
mehmet-erim 7 years ago
parent
commit
6204c19ce1
  1. 8
      docs/cs/Getting-Started-Angular-Template.md
  2. 6
      docs/cs/Getting-Started-AspNetCore-MVC-Template.md
  3. 3
      docs/en/Entities.md
  4. 8
      docs/en/Getting-Started-Angular-Template.md
  5. 6
      docs/en/Getting-Started-AspNetCore-MVC-Template.md
  6. 8
      docs/pt-BR/Getting-Started-Angular-Template.md
  7. 6
      docs/pt-BR/Getting-Started-AspNetCore-MVC-Template.md
  8. 6
      docs/zh-Hans/Getting-Started-AspNetCore-MVC-Template.md
  9. 16
      framework/Volo.Abp.sln
  10. 1
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo.Abp.AspNetCore.Mvc.UI.Bundling.csproj
  11. 3
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/AbpAspNetCoreMvcUiBundlingModule.cs
  12. 2
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundlerBase.cs
  13. 2
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/Scripts/ScriptBundler.cs
  14. 2
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/Styles/StyleBundler.cs
  15. 4
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Application.cshtml
  16. 4
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ProxyScripting/ServiceProxyGenerationModel.cs
  17. 62
      framework/src/Volo.Abp.Http.Client/Microsoft/Extensions/DependencyInjection/ServiceCollectionDynamicHttpClientProxyExtensions.cs
  18. 1
      framework/src/Volo.Abp.Http/Volo.Abp.Http.csproj
  19. 2
      framework/src/Volo.Abp.Http/Volo/Abp/Http/AbpHttpModule.cs
  20. 9
      framework/src/Volo.Abp.Http/Volo/Abp/Http/ProxyScripting/ProxyScriptManager.cs
  21. 5
      framework/src/Volo.Abp.Http/Volo/Abp/Http/ProxyScripting/ProxyScriptingModel.cs
  22. 24
      framework/src/Volo.Abp.Minify/Volo.Abp.Minify.csproj
  23. 8
      framework/src/Volo.Abp.Minify/Volo/Abp/Minify/AbpMinifyModule.cs
  24. 7
      framework/src/Volo.Abp.Minify/Volo/Abp/Minify/Html/IHtmlMinifier.cs
  25. 2
      framework/src/Volo.Abp.Minify/Volo/Abp/Minify/IMinifier.cs
  26. 4
      framework/src/Volo.Abp.Minify/Volo/Abp/Minify/NUglify/NUglifyCssMinifier.cs
  27. 2
      framework/src/Volo.Abp.Minify/Volo/Abp/Minify/NUglify/NUglifyException.cs
  28. 13
      framework/src/Volo.Abp.Minify/Volo/Abp/Minify/NUglify/NUglifyHtmlMinifier.cs
  29. 6
      framework/src/Volo.Abp.Minify/Volo/Abp/Minify/NUglify/NUglifyJavascriptMinifier.cs
  30. 2
      framework/src/Volo.Abp.Minify/Volo/Abp/Minify/NUglify/NUglifyMinifierBase.cs
  31. 2
      framework/src/Volo.Abp.Minify/Volo/Abp/Minify/Scripts/IJavascriptMinifier.cs
  32. 2
      framework/src/Volo.Abp.Minify/Volo/Abp/Minify/Styles/ICssMinifier.cs
  33. 13
      framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/ProxyScripting/AbpServiceProxiesController_Tests.cs
  34. 26
      framework/test/Volo.Abp.AspNetCore.Mvc.UI.Tests/Volo/Abp/AspNetCore/Mvc/UI/Minification/NUglify/JavascriptMinifier_Tests.cs
  35. 16
      framework/test/Volo.Abp.Minify.Tests/Volo.Abp.Minify.Tests.csproj
  36. 11
      framework/test/Volo.Abp.Minify.Tests/Volo/Abp/Minify/AbpMinifyTestModule.cs
  37. 28
      framework/test/Volo.Abp.Minify.Tests/Volo/Abp/Minify/NUglify/CssMinifier_Tests.cs
  38. 27
      framework/test/Volo.Abp.Minify.Tests/Volo/Abp/Minify/NUglify/HtmlMinifier_Tests.cs
  39. 28
      framework/test/Volo.Abp.Minify.Tests/Volo/Abp/Minify/NUglify/JavascriptMinifier_Tests.cs
  40. 2
      npm/packs/anchor-js/package.json
  41. 4
      npm/packs/aspnetcore.mvc.ui/package.json
  42. 2
      npm/packs/chart.js/package.json
  43. 2
      npm/packs/codemirror/package.json
  44. 2
      npm/packs/flag-icon-css/package.json
  45. 2
      npm/packs/luxon/package.json
  46. 2
      npm/packs/markdown-it/package.json
  47. 2
      npm/packs/select2/package.json
  48. 2
      npm/packs/tui-editor/package.json
  49. 1
      nupkg/common.ps1

8
docs/cs/Getting-Started-Angular-Template.md

@ -26,10 +26,10 @@ abp new Acme.BookStore -u angular
Vytvořené řešení vyžaduje;
* [Visual Studio 2017 (v15.9.0+)](https://visualstudio.microsoft.com/tr/downloads/)
* [.NET Core 2.2+](https://www.microsoft.com/net/download/dotnet-core/)
* [Node v10.16+](https://nodejs.org)
* [Yarn v1.17+](https://yarnpkg.com/)
* [Visual Studio 2019 (v16.3+)](https://visualstudio.microsoft.com/vs/)
* [.NET Core 3.0+](https://www.microsoft.com/net/download/dotnet-core/)
* [Node v12+](https://nodejs.org)
* [Yarn v1.19+](https://yarnpkg.com/)
### Struktura řešení

6
docs/cs/Getting-Started-AspNetCore-MVC-Template.md

@ -26,8 +26,10 @@ Příkaz `new` vytvoří **vrstvenou MVC aplikaci** s **Entity Framework Core**
Vytvořené řešení vyžaduje;
* [Visual Studio 2017 (v15.9.0+)](https://visualstudio.microsoft.com/tr/downloads/)
* [.NET Core 2.2+](https://www.microsoft.com/net/download/dotnet-core/)
* [Visual Studio 2019 (v16.3+)](https://visualstudio.microsoft.com/vs/)
* [.NET Core 3.0+](https://www.microsoft.com/net/download/dotnet-core/)
* [Node v12+](https://nodejs.org)
* [Yarn v1.19+](https://yarnpkg.com/)
### Struktura řešení

3
docs/en/Entities.md

@ -59,7 +59,8 @@ Entities with composite keys should implement the `GetKeys()` method as shown ab
Notice that you also need to define keys of the entity in your **object-relational mapping** (ORM) configuration.
> Composite primary keys has a restriction with repositories. Since it has not known Id property, you can not use `IRepository<TEntity, TKey>` for these entities. However, you can always use `IRepository<TEntity>`. See [repositories documentation](Repositories.md) for more.
> Also note that Entities with Composite Primary Keys cannot utilize the `IRepository<TEntity, TKey>` interface since it requires a single unique Id property. However, you can always use `IRepository<TEntity>`. See [repositories documentation](Repositories.md) for more.
### AggregateRoot Class

8
docs/en/Getting-Started-Angular-Template.md

@ -26,10 +26,10 @@ abp new Acme.BookStore -u angular
The created solution requires;
* [Visual Studio 2017 (v15.9.0+)](https://visualstudio.microsoft.com/tr/downloads/)
* [.NET Core 2.2+](https://www.microsoft.com/net/download/dotnet-core/)
* [Node v10.16+](https://nodejs.org)
* [Yarn v1.17+](https://yarnpkg.com/)
* [Visual Studio 2019 (v16.3+)](https://visualstudio.microsoft.com/vs/)
* [.NET Core 3.0+](https://www.microsoft.com/net/download/dotnet-core/)
* [Node v12+](https://nodejs.org)
* [Yarn v1.19+](https://yarnpkg.com/)
### The Solution Structure

6
docs/en/Getting-Started-AspNetCore-MVC-Template.md

@ -26,8 +26,10 @@ abp new Acme.BookStore
The created solution requires;
* [Visual Studio 2017 (v15.9.0+)](https://visualstudio.microsoft.com/tr/downloads/)
* [.NET Core 2.2+](https://www.microsoft.com/net/download/dotnet-core/)
* [Visual Studio 2019 (v16.3+)](https://visualstudio.microsoft.com/vs/)
* [.NET Core 3.0+](https://www.microsoft.com/net/download/dotnet-core/)
* [Node v12+](https://nodejs.org)
* [Yarn v1.19+](https://yarnpkg.com/)
### The Solution Structure

8
docs/pt-BR/Getting-Started-Angular-Template.md

@ -26,10 +26,10 @@ abp new Acme.BookStore -u angular
A solução criada requer;
- [Visual Studio 2017 (v15.9.0 +)](https://visualstudio.microsoft.com/tr/downloads/)
- [.NET Core 2.2 ou superior](https://www.microsoft.com/net/download/dotnet-core/)
- [Node v10.16 +](https://nodejs.org/)
- [Yarn v1.17 +](https://yarnpkg.com/)
* [Visual Studio 2019 (v16.3+)](https://visualstudio.microsoft.com/vs/)
* [.NET Core 3.0+](https://www.microsoft.com/net/download/dotnet-core/)
* [Node v12+](https://nodejs.org)
* [Yarn v1.19+](https://yarnpkg.com/)
### A Estrutura da Solução

6
docs/pt-BR/Getting-Started-AspNetCore-MVC-Template.md

@ -26,8 +26,10 @@ abp new Acme.BookStore
A solução criada requer;
- [Visual Studio 2017 (v15.9.0 +)](https://visualstudio.microsoft.com/tr/downloads/)
- [.NET Core 2.2 ou superior](https://www.microsoft.com/net/download/dotnet-core/)
* [Visual Studio 2019 (v16.3+)](https://visualstudio.microsoft.com/vs/)
* [.NET Core 3.0+](https://www.microsoft.com/net/download/dotnet-core/)
* [Node v12+](https://nodejs.org)
* [Yarn v1.19+](https://yarnpkg.com/)
### A Estrutura da Solução

6
docs/zh-Hans/Getting-Started-AspNetCore-MVC-Template.md

@ -24,8 +24,10 @@ abp new Acme.BookStore
创建项目的要求:
* [Visual Studio 2017 (v15.9.0+)](https://visualstudio.microsoft.com/tr/downloads/)
* [.NET Core 2.2+](https://www.microsoft.com/net/download/dotnet-core/)
* [Visual Studio 2019 (v16.3+)](https://visualstudio.microsoft.com/vs/)
* [.NET Core 3.0+](https://www.microsoft.com/net/download/dotnet-core/)
* [Node v12+](https://nodejs.org)
* [Yarn v1.19+](https://yarnpkg.com/)
### 解决方案结构

16
framework/Volo.Abp.sln

@ -250,7 +250,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.MailKit.Tests", "t
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.ObjectMapping.Tests", "test\Volo.Abp.ObjectMapping.Tests\Volo.Abp.ObjectMapping.Tests.csproj", "{667F5544-C1EB-447C-96FD-9B757F04DE2B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.Ddd.Application.Contracts", "src\Volo.Abp.Ddd.Application.Contracts\Volo.Abp.Ddd.Application.Contracts.csproj", "{73559227-EBF0-475F-835B-1FF0CD9132AA}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Ddd.Application.Contracts", "src\Volo.Abp.Ddd.Application.Contracts\Volo.Abp.Ddd.Application.Contracts.csproj", "{73559227-EBF0-475F-835B-1FF0CD9132AA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.Minify", "src\Volo.Abp.Minify\Volo.Abp.Minify.csproj", "{928DC30D-C078-4BB4-A9F8-FE7252C67DC6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.Minify.Tests", "test\Volo.Abp.Minify.Tests\Volo.Abp.Minify.Tests.csproj", "{E69182B3-350A-43F5-A935-5EBBEBECEF97}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -750,6 +754,14 @@ Global
{73559227-EBF0-475F-835B-1FF0CD9132AA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{73559227-EBF0-475F-835B-1FF0CD9132AA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{73559227-EBF0-475F-835B-1FF0CD9132AA}.Release|Any CPU.Build.0 = Release|Any CPU
{928DC30D-C078-4BB4-A9F8-FE7252C67DC6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{928DC30D-C078-4BB4-A9F8-FE7252C67DC6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{928DC30D-C078-4BB4-A9F8-FE7252C67DC6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{928DC30D-C078-4BB4-A9F8-FE7252C67DC6}.Release|Any CPU.Build.0 = Release|Any CPU
{E69182B3-350A-43F5-A935-5EBBEBECEF97}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E69182B3-350A-43F5-A935-5EBBEBECEF97}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E69182B3-350A-43F5-A935-5EBBEBECEF97}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E69182B3-350A-43F5-A935-5EBBEBECEF97}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -878,6 +890,8 @@ Global
{70DD6E17-B98B-4B00-8F38-C489E291BB53} = {447C8A77-E5F0-4538-8687-7383196D04EA}
{667F5544-C1EB-447C-96FD-9B757F04DE2B} = {447C8A77-E5F0-4538-8687-7383196D04EA}
{73559227-EBF0-475F-835B-1FF0CD9132AA} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6}
{928DC30D-C078-4BB4-A9F8-FE7252C67DC6} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6}
{E69182B3-350A-43F5-A935-5EBBEBECEF97} = {447C8A77-E5F0-4538-8687-7383196D04EA}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {BB97ECF4-9A84-433F-A80B-2A3285BDD1D5}

1
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo.Abp.AspNetCore.Mvc.UI.Bundling.csproj

@ -13,6 +13,7 @@
<ItemGroup>
<ProjectReference Include="..\Volo.Abp.AspNetCore.Mvc.UI.Bootstrap\Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.csproj" />
<ProjectReference Include="..\Volo.Abp.Minify\Volo.Abp.Minify.csproj" />
</ItemGroup>
</Project>

3
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/AbpAspNetCoreMvcUiBundlingModule.cs

@ -1,9 +1,10 @@
using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap;
using Volo.Abp.Minify;
using Volo.Abp.Modularity;
namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling
{
[DependsOn(typeof(AbpAspNetCoreMvcUiBootstrapModule))]
[DependsOn(typeof(AbpAspNetCoreMvcUiBootstrapModule), typeof(AbpMinifyModule))]
public class AbpAspNetCoreMvcUiBundlingModule : AbpModule
{

2
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundlerBase.cs

@ -3,9 +3,9 @@ using System.Text;
using Microsoft.Extensions.FileProviders;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Volo.Abp.AspNetCore.Mvc.UI.Minification;
using Volo.Abp.AspNetCore.VirtualFileSystem;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Minify;
namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling
{

2
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/Scripts/ScriptBundler.cs

@ -1,6 +1,6 @@
using System;
using Volo.Abp.AspNetCore.Mvc.UI.Minification.Scripts;
using Volo.Abp.AspNetCore.VirtualFileSystem;
using Volo.Abp.Minify.Scripts;
namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling.Scripts
{

2
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/Styles/StyleBundler.cs

@ -1,8 +1,8 @@
using System;
using System.IO;
using Microsoft.AspNetCore.Hosting;
using Volo.Abp.AspNetCore.Mvc.UI.Minification.Styles;
using Volo.Abp.AspNetCore.VirtualFileSystem;
using Volo.Abp.Minify.Styles;
namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling.Styles
{

4
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Layouts/Application.cshtml

@ -57,7 +57,9 @@
<div class="@containerClass">
@(await Component.InvokeAsync<PageAlertsViewComponent>())
<div id="AbpContentToolbar">
@RenderSection("content_toolbar", false)
<div class="text-right mb-2">
@RenderSection("content_toolbar", false)
</div>
</div>
@RenderBody()
</div>

4
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ProxyScripting/ServiceProxyGenerationModel.cs

@ -11,6 +11,8 @@ namespace Volo.Abp.AspNetCore.Mvc.ProxyScripting
public bool UseCache { get; set; }
public bool Minify { get; set; }
public string Modules { get; set; }
public string Controllers { get; set; }
@ -32,7 +34,7 @@ namespace Volo.Abp.AspNetCore.Mvc.ProxyScripting
public ProxyScriptingModel CreateOptions()
{
var options = new ProxyScriptingModel(Type, UseCache);
var options = new ProxyScriptingModel(Type, UseCache, Minify);
if (!Modules.IsNullOrEmpty())
{

62
framework/src/Volo.Abp.Http.Client/Microsoft/Extensions/DependencyInjection/ServiceCollectionDynamicHttpClientProxyExtensions.cs

@ -41,6 +41,8 @@ namespace Microsoft.Extensions.DependencyInjection
{
Check.NotNull(services, nameof(assembly));
AddHttpClientFactoryAndPolicy(services, remoteServiceConfigurationName, configureHttpClientBuilder);
//TODO: Make a configuration option and add remoteServiceName inside it!
//TODO: Add option to change type filter
@ -53,9 +55,8 @@ namespace Microsoft.Extensions.DependencyInjection
services.AddHttpClientProxy(
serviceType,
remoteServiceConfigurationName,
asDefaultServices,
configureHttpClientBuilder
);
asDefaultServices
);
}
return services;
@ -82,14 +83,46 @@ namespace Microsoft.Extensions.DependencyInjection
bool asDefaultService = true,
Action<IHttpClientBuilder> configureHttpClientBuilder = null)
{
AddHttpClientFactoryAndPolicy(services, remoteServiceConfigurationName, configureHttpClientBuilder);
return services.AddHttpClientProxy(
typeof(T),
remoteServiceConfigurationName,
asDefaultService,
configureHttpClientBuilder
asDefaultService
);
}
/// <summary>
/// Use IHttpClientFactory and polly
/// </summary>
/// <param name="services">Service collection</param>
/// <param name="remoteServiceConfigurationName">
/// The name of the remote service configuration to be used by the HTTP Client proxies.
/// See <see cref="AbpRemoteServiceOptions"/>.
/// </param>
/// <param name="configureHttpClientBuilder">
/// A delegate that is used to configure an <see cref="T:Microsoft.Extensions.DependencyInjection.IHttpClientBuilder" />.
/// </param>
public static IServiceCollection AddHttpClientFactoryAndPolicy(
[NotNull] this IServiceCollection services,
[NotNull] string remoteServiceConfigurationName = RemoteServiceConfigurationDictionary.DefaultName,
Action<IHttpClientBuilder> configureHttpClientBuilder = null)
{
var httpClientBuilder = services.AddHttpClient(remoteServiceConfigurationName);
if (configureHttpClientBuilder == null)
{
httpClientBuilder.AddTransientHttpErrorPolicy(builder =>
// retry 3 times
builder.WaitAndRetryAsync(3, i => TimeSpan.FromSeconds(Math.Pow(2, i))));
}
else
{
configureHttpClientBuilder.Invoke(httpClientBuilder);
}
return services;
}
/// <summary>
/// Registers HTTP Client Proxy for given service <paramref name="type"/>.
/// </summary>
@ -102,15 +135,11 @@ namespace Microsoft.Extensions.DependencyInjection
/// <param name="asDefaultService">
/// True, to register the HTTP client proxy as the default implementation for the service <paramref name="type"/>.
/// </param>
/// <param name="configureHttpClientBuilder">
/// A delegate that is used to configure an <see cref="T:Microsoft.Extensions.DependencyInjection.IHttpClientBuilder" />.
/// </param>
public static IServiceCollection AddHttpClientProxy(
[NotNull] this IServiceCollection services,
[NotNull] Type type,
[NotNull] string remoteServiceConfigurationName = RemoteServiceConfigurationDictionary.DefaultName,
bool asDefaultService = true,
Action<IHttpClientBuilder> configureHttpClientBuilder = null)
bool asDefaultService = true)
{
Check.NotNull(services, nameof(services));
Check.NotNull(type, nameof(type));
@ -120,19 +149,6 @@ namespace Microsoft.Extensions.DependencyInjection
{
options.HttpClientProxies[type] = new DynamicHttpClientProxyConfig(type, remoteServiceConfigurationName);
});
//use IHttpClientFactory and polly
var httpClientBuilder = services.AddHttpClient(remoteServiceConfigurationName);
if (configureHttpClientBuilder == null)
{
httpClientBuilder.AddTransientHttpErrorPolicy(builder =>
// retry 3 times
builder.WaitAndRetryAsync(3, i => TimeSpan.FromSeconds(Math.Pow(2, i))));
}
else
{
configureHttpClientBuilder.Invoke(httpClientBuilder);
}
var interceptorType = typeof(DynamicHttpProxyInterceptor<>).MakeGenericType(type);
services.AddTransient(interceptorType);

1
framework/src/Volo.Abp.Http/Volo.Abp.Http.csproj

@ -16,6 +16,7 @@
<ItemGroup>
<ProjectReference Include="..\Volo.Abp.Http.Abstractions\Volo.Abp.Http.Abstractions.csproj" />
<ProjectReference Include="..\Volo.Abp.Json\Volo.Abp.Json.csproj" />
<ProjectReference Include="..\Volo.Abp.Minify\Volo.Abp.Minify.csproj" />
</ItemGroup>
</Project>

2
framework/src/Volo.Abp.Http/Volo/Abp/Http/AbpHttpModule.cs

@ -1,12 +1,14 @@
using Volo.Abp.Http.ProxyScripting.Configuration;
using Volo.Abp.Http.ProxyScripting.Generators.JQuery;
using Volo.Abp.Json;
using Volo.Abp.Minify;
using Volo.Abp.Modularity;
namespace Volo.Abp.Http
{
[DependsOn(typeof(AbpHttpAbstractionsModule))]
[DependsOn(typeof(AbpJsonModule))]
[DependsOn(typeof(AbpMinifyModule))]
public class AbpHttpModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)

9
framework/src/Volo.Abp.Http/Volo/Abp/Http/ProxyScripting/ProxyScriptManager.cs

@ -7,6 +7,7 @@ using Volo.Abp.Http.Modeling;
using Volo.Abp.Http.ProxyScripting.Configuration;
using Volo.Abp.Http.ProxyScripting.Generators;
using Volo.Abp.Json;
using Volo.Abp.Minify.Scripts;
namespace Volo.Abp.Http.ProxyScripting
{
@ -17,18 +18,21 @@ namespace Volo.Abp.Http.ProxyScripting
private readonly IJsonSerializer _jsonSerializer;
private readonly IProxyScriptManagerCache _cache;
private readonly AbpApiProxyScriptingOptions _options;
private readonly IJavascriptMinifier _javascriptMinifier;
public ProxyScriptManager(
IApiDescriptionModelProvider modelProvider,
IServiceProvider serviceProvider,
IJsonSerializer jsonSerializer,
IProxyScriptManagerCache cache,
IOptions<AbpApiProxyScriptingOptions> options)
IOptions<AbpApiProxyScriptingOptions> options,
IJavascriptMinifier javascriptMinifier)
{
_modelProvider = modelProvider;
_serviceProvider = serviceProvider;
_jsonSerializer = jsonSerializer;
_cache = cache;
_javascriptMinifier = javascriptMinifier;
_options = options.Value;
}
@ -63,7 +67,8 @@ namespace Volo.Abp.Http.ProxyScripting
using (var scope = _serviceProvider.CreateScope())
{
return scope.ServiceProvider.GetRequiredService(generatorType).As<IProxyScriptGenerator>().CreateScript(apiModel);
var script = scope.ServiceProvider.GetRequiredService(generatorType).As<IProxyScriptGenerator>().CreateScript(apiModel);
return scriptingModel.Minify ? _javascriptMinifier.Minify(script) : script;
}
}

5
framework/src/Volo.Abp.Http/Volo/Abp/Http/ProxyScripting/ProxyScriptingModel.cs

@ -8,6 +8,8 @@ namespace Volo.Abp.Http.ProxyScripting
public bool UseCache { get; set; }
public bool Minify { get; set; }
public string[] Modules { get; set; }
public string[] Controllers { get; set; }
@ -16,10 +18,11 @@ namespace Volo.Abp.Http.ProxyScripting
public IDictionary<string, string> Properties { get; set; }
public ProxyScriptingModel(string generatorType, bool useCache = true)
public ProxyScriptingModel(string generatorType, bool useCache = true, bool minify = false)
{
GeneratorType = generatorType;
UseCache = useCache;
Minify = minify;
Properties = new Dictionary<string, string>();
}

24
framework/src/Volo.Abp.Minify/Volo.Abp.Minify.csproj

@ -0,0 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<AssemblyName>Volo.Abp.Minify</AssemblyName>
<PackageId>Volo.Abp.Minify</PackageId>
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Volo.Abp.Core\Volo.Abp.Core.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="NUglify" Version="1.5.13" />
</ItemGroup>
</Project>

8
framework/src/Volo.Abp.Minify/Volo/Abp/Minify/AbpMinifyModule.cs

@ -0,0 +1,8 @@
using Volo.Abp.Modularity;
namespace Volo.Abp.Minify
{
public class AbpMinifyModule : AbpModule
{
}
}

7
framework/src/Volo.Abp.Minify/Volo/Abp/Minify/Html/IHtmlMinifier.cs

@ -0,0 +1,7 @@
namespace Volo.Abp.Minify.Html
{
public interface IHtmlMinifier : IMinifier
{
}
}

2
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Minification/IMinifier.cs → framework/src/Volo.Abp.Minify/Volo/Abp/Minify/IMinifier.cs

@ -1,4 +1,4 @@
namespace Volo.Abp.AspNetCore.Mvc.UI.Minification
namespace Volo.Abp.Minify
{
public interface IMinifier
{

4
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Minification/NUglify/NUglifyCssMinifier.cs → framework/src/Volo.Abp.Minify/Volo/Abp/Minify/NUglify/NUglifyCssMinifier.cs

@ -1,7 +1,7 @@
using NUglify;
using Volo.Abp.AspNetCore.Mvc.UI.Minification.Styles;
using Volo.Abp.Minify.Styles;
namespace Volo.Abp.AspNetCore.Mvc.UI.Minification.NUglify
namespace Volo.Abp.Minify.NUglify
{
public class NUglifyCssMinifier : NUglifyMinifierBase, ICssMinifier
{

2
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Minification/NUglify/NUglifyException.cs → framework/src/Volo.Abp.Minify/Volo/Abp/Minify/NUglify/NUglifyException.cs

@ -2,7 +2,7 @@ using System.Collections.Generic;
using System.Runtime.Serialization;
using NUglify;
namespace Volo.Abp.AspNetCore.Mvc.UI.Minification.NUglify
namespace Volo.Abp.Minify.NUglify
{
public class NUglifyException : AbpException
{

13
framework/src/Volo.Abp.Minify/Volo/Abp/Minify/NUglify/NUglifyHtmlMinifier.cs

@ -0,0 +1,13 @@
using NUglify;
using Volo.Abp.Minify.Html;
namespace Volo.Abp.Minify.NUglify
{
public class NUglifyHtmlMinifier : NUglifyMinifierBase, IHtmlMinifier
{
protected override UglifyResult UglifySource(string source, string fileName)
{
return Uglify.Html(source, sourceFileName: fileName);
}
}
}

6
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Minification/NUglify/NUglifyJavascriptMinifier.cs → framework/src/Volo.Abp.Minify/Volo/Abp/Minify/NUglify/NUglifyJavascriptMinifier.cs

@ -1,9 +1,7 @@
using NUglify;
using NUglify.JavaScript;
using Volo.Abp.AspNetCore.Mvc.UI.Minification.Scripts;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Minify.Scripts;
namespace Volo.Abp.AspNetCore.Mvc.UI.Minification.NUglify
namespace Volo.Abp.Minify.NUglify
{
public class NUglifyJavascriptMinifier : NUglifyMinifierBase, IJavascriptMinifier
{

2
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Minification/NUglify/NUglifyMinifierBase.cs → framework/src/Volo.Abp.Minify/Volo/Abp/Minify/NUglify/NUglifyMinifierBase.cs

@ -4,7 +4,7 @@ using System.Linq;
using NUglify;
using Volo.Abp.DependencyInjection;
namespace Volo.Abp.AspNetCore.Mvc.UI.Minification.NUglify
namespace Volo.Abp.Minify.NUglify
{
public abstract class NUglifyMinifierBase : IMinifier, ITransientDependency
{

2
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Minification/Scripts/IJavascriptMinifier.cs → framework/src/Volo.Abp.Minify/Volo/Abp/Minify/Scripts/IJavascriptMinifier.cs

@ -1,4 +1,4 @@
namespace Volo.Abp.AspNetCore.Mvc.UI.Minification.Scripts
namespace Volo.Abp.Minify.Scripts
{
public interface IJavascriptMinifier : IMinifier
{

2
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Minification/Styles/ICssMinifier.cs → framework/src/Volo.Abp.Minify/Volo/Abp/Minify/Styles/ICssMinifier.cs

@ -1,4 +1,4 @@
namespace Volo.Abp.AspNetCore.Mvc.UI.Minification.Styles
namespace Volo.Abp.Minify.Styles
{
public interface ICssMinifier : IMinifier
{

13
framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/ProxyScripting/AbpServiceProxiesController_Tests.cs

@ -9,8 +9,19 @@ namespace Volo.Abp.AspNetCore.Mvc.ProxyScripting
[Fact]
public async Task GetAll()
{
var script = await GetResponseAsStringAsync("/Abp/ServiceProxyScript/");
var script = await GetResponseAsStringAsync("/Abp/ServiceProxyScript?minify=true");
script.Length.ShouldBeGreaterThan(0);
}
[Fact]
public async Task GetAllWithMinify()
{
var script = await GetResponseAsStringAsync("/Abp/ServiceProxyScript");
var minifyScript = await GetResponseAsStringAsync("/Abp/ServiceProxyScript?minify=true");
script.Length.ShouldBeGreaterThan(0);
minifyScript.Length.ShouldBeGreaterThan(0);
minifyScript.Length.ShouldBeLessThan(script.Length);
}
}
}

26
framework/test/Volo.Abp.AspNetCore.Mvc.UI.Tests/Volo/Abp/AspNetCore/Mvc/UI/Minification/NUglify/JavascriptMinifier_Tests.cs

@ -1,26 +0,0 @@
using Shouldly;
using Xunit;
namespace Volo.Abp.AspNetCore.Mvc.UI.Minification.NUglify
{
public class NUglifyJavascriptMinifier_Tests : AbpAspNetCoreMvcUiTestBase
{
private readonly NUglifyJavascriptMinifier _nUglifyJavascriptMinifier;
public NUglifyJavascriptMinifier_Tests()
{
_nUglifyJavascriptMinifier = GetRequiredService<NUglifyJavascriptMinifier>();
}
[Fact]
public void Should_Minify_Simple_Code()
{
const string source = "var x = 5; var y = 6;";
var minified = _nUglifyJavascriptMinifier.Minify(source);
minified.Length.ShouldBeGreaterThan(0);
minified.Length.ShouldBeLessThan(source.Length);
}
}
}

16
framework/test/Volo.Abp.Minify.Tests/Volo.Abp.Minify.Tests.csproj

@ -0,0 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\common.test.props" />
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Volo.Abp.Minify\Volo.Abp.Minify.csproj" />
<ProjectReference Include="..\AbpTestBase\AbpTestBase.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
</ItemGroup>
</Project>

11
framework/test/Volo.Abp.Minify.Tests/Volo/Abp/Minify/AbpMinifyTestModule.cs

@ -0,0 +1,11 @@
using Volo.Abp.Modularity;
namespace Volo.Abp.Minify
{
[DependsOn(
typeof(AbpMinifyModule),
typeof(AbpTestBaseModule))]
public class AbpMinifyTestModule : AbpModule
{
}
}

28
framework/test/Volo.Abp.Minify.Tests/Volo/Abp/Minify/NUglify/CssMinifier_Tests.cs

@ -0,0 +1,28 @@
using Shouldly;
using Volo.Abp.Minify.Styles;
using Xunit;
namespace Volo.Abp.Minify.NUglify
{
public class CssMinifier_Tests : AbpIntegratedTest<AbpMinifyModule>
{
private readonly ICssMinifier _cssMinifier;
public CssMinifier_Tests()
{
_cssMinifier = GetRequiredService<ICssMinifier>();
}
[Fact]
public void Should_Minify_Simple_Code()
{
const string source = "div { color: #FFF; }";
var minified = _cssMinifier.Minify(source);
minified.Length.ShouldBeGreaterThan(0);
minified.Length.ShouldBeLessThan(source.Length);
}
}
}

27
framework/test/Volo.Abp.Minify.Tests/Volo/Abp/Minify/NUglify/HtmlMinifier_Tests.cs

@ -0,0 +1,27 @@
using Shouldly;
using Volo.Abp.Minify.Html;
using Xunit;
namespace Volo.Abp.Minify.NUglify
{
public class HtmlMinifier_Tests : AbpIntegratedTest<AbpMinifyModule>
{
private readonly IHtmlMinifier _htmlMinifier;
public HtmlMinifier_Tests()
{
_htmlMinifier = GetRequiredService<IHtmlMinifier>();
}
[Fact]
public void Should_Minify_Simple_Code()
{
const string source = "<div> <p>This is <em> a text </em></p> </div>";
var minified = _htmlMinifier.Minify(source);
minified.Length.ShouldBeGreaterThan(0);
minified.Length.ShouldBeLessThan(source.Length);
}
}
}

28
framework/test/Volo.Abp.Minify.Tests/Volo/Abp/Minify/NUglify/JavascriptMinifier_Tests.cs

@ -0,0 +1,28 @@
using Shouldly;
using Volo.Abp.Minify.Scripts;
using Xunit;
namespace Volo.Abp.Minify.NUglify
{
public class JavascriptMinifier_Tests : AbpIntegratedTest<AbpMinifyModule>
{
private readonly IJavascriptMinifier _javascriptMinifier;
public JavascriptMinifier_Tests()
{
_javascriptMinifier = GetRequiredService<IJavascriptMinifier>();
}
[Fact]
public void Should_Minify_Simple_Code()
{
const string source = "var x = 5; var y = 6;";
var minified = _javascriptMinifier.Minify(source);
minified.Length.ShouldBeGreaterThan(0);
minified.Length.ShouldBeLessThan(source.Length);
}
}
}

2
npm/packs/anchor-js/package.json

@ -6,7 +6,7 @@
},
"dependencies": {
"@abp/core": "^1.0.3",
"anchor-js": "^4.1.1"
"anchor-js": "^4.2.2"
},
"gitHead": "4d6791834b7723d8ad78ba4d23ae3425f170fdeb"
}

4
npm/packs/aspnetcore.mvc.ui/package.json

@ -5,12 +5,12 @@
"access": "public"
},
"dependencies": {
"ansi-colors": "^3.2.4",
"ansi-colors": "^4.1.1",
"extend-object": "^1.0.0",
"gulp": "^4.0.2",
"merge-stream": "^2.0.0",
"path": "^0.12.7",
"rimraf": "^2.6.3"
"rimraf": "^3.0.0"
},
"gitHead": "4d6791834b7723d8ad78ba4d23ae3425f170fdeb"
}

2
npm/packs/chart.js/package.json

@ -5,7 +5,7 @@
"access": "public"
},
"dependencies": {
"chart.js": "^2.8.0"
"chart.js": "^2.9.3"
},
"gitHead": "4d6791834b7723d8ad78ba4d23ae3425f170fdeb"
}

2
npm/packs/codemirror/package.json

@ -6,7 +6,7 @@
},
"dependencies": {
"@abp/core": "^1.0.3",
"codemirror": "^5.38.0"
"codemirror": "^5.49.2"
},
"gitHead": "4d6791834b7723d8ad78ba4d23ae3425f170fdeb"
}

2
npm/packs/flag-icon-css/package.json

@ -5,7 +5,7 @@
"access": "public"
},
"dependencies": {
"flag-icon-css": "^3.4.2"
"flag-icon-css": "^3.4.5"
},
"gitHead": "4d6791834b7723d8ad78ba4d23ae3425f170fdeb"
}

2
npm/packs/luxon/package.json

@ -5,7 +5,7 @@
"access": "public"
},
"dependencies": {
"luxon": "^1.17.3"
"luxon": "^1.21.3"
},
"gitHead": "4d6791834b7723d8ad78ba4d23ae3425f170fdeb"
}

2
npm/packs/markdown-it/package.json

@ -6,7 +6,7 @@
},
"dependencies": {
"@abp/core": "^1.0.3",
"markdown-it": "^8.4.1"
"markdown-it": "^10.0.0"
},
"gitHead": "4d6791834b7723d8ad78ba4d23ae3425f170fdeb"
}

2
npm/packs/select2/package.json

@ -6,7 +6,7 @@
},
"dependencies": {
"@abp/core": "^1.0.3",
"select2": "^4.0.11"
"select2": "^4.0.12"
},
"gitHead": "4d6791834b7723d8ad78ba4d23ae3425f170fdeb"
}

2
npm/packs/tui-editor/package.json

@ -9,7 +9,7 @@
"@abp/highlight.js": "^1.0.3",
"@abp/jquery": "^1.0.3",
"@abp/markdown-it": "^1.0.3",
"tui-editor": "^1.4.7"
"tui-editor": "^1.4.8"
},
"gitHead": "4d6791834b7723d8ad78ba4d23ae3425f170fdeb"
}

1
nupkg/common.ps1

@ -86,6 +86,7 @@ $projects = (
"framework/src/Volo.Abp.MemoryDb",
"framework/src/Volo.Abp.MongoDB",
"framework/src/Volo.Abp.MultiTenancy",
"framework/src/Volo.Abp.Minify",
"framework/src/Volo.Abp.ObjectMapping",
"framework/src/Volo.Abp.RabbitMQ",
"framework/src/Volo.Abp.Security",

Loading…
Cancel
Save