pull/1337/head
Alper Ebicoglu 6 years ago
commit b55bfab004

@ -4,8 +4,6 @@ var gulp = require("gulp"),
path = require('path'),
copyResources = require('./node_modules/@abp/aspnetcore.mvc.ui/gulp/copy-resources.js');
copyResources.init(path.resolve('./'));
gulp.task('default', [copyResources.taskName], function () {
});
exports.default = function(){
return copyResources(path.resolve('./'));
};

@ -3,7 +3,7 @@
"name": "volo.aspnetzero.support",
"private": true,
"dependencies": {
"@abp/aspnetcore.mvc.ui.theme.basic": "^0.4.9",
"@abp/aspnetcore.mvc.ui.theme.basic": "^0.6.4",
"@abp/blogging": "^0.4.9",
"@abp/docs": "^0.5.1"
}

@ -0,0 +1,52 @@
## Průvodce pro přispěvatele
ABP je [open source](https://github.com/abpframework) a komunitně řízený projekt. Tento průvodce má za cíl pomoci každému kdo chce do projektu nějak přispět.
### Příspěvek kódu
Vždy můžete zaslat pull request do Github repositáře.
- Naklonujte [ABP repozitář](https://github.com/abpframework/abp/) z Githubu.
- Učiňte potřebné změny.
- Zašlete pull request.
Než budete dělat nějaké změny, diskutujte o nich prosím na [Github problémy](https://github.com/abpframework/abp/issues). Díky tomu nebude žádný jiný vývojář pracovat na stejném problému a Váš PR má lepší šanci na to být přijat.
#### Opravy chyb a vylepšení
Pokud chcete opravit známou chybu nebo pracovat na plánovaném vylepšení podívejte se na [seznam problémů](https://github.com/abpframework/abp/issues) na Githubu.
#### Požadavky na funkce
Pokud máte nápad na funkci pro framework nebo modul [vytvořte problém](https://github.com/abpframework/abp/issues/new) na Githubu nebo se připojte ke stávající diskuzi. V případě přijetí komunitou ho pak můžete implementovat.
### Překlad dokumentů
Pokud chcete přeložit celou [dokumentaci](https://abp.io/documents/) (včetně této stránky) do Vašeho rodného jazyka, následujte tyto kroky:
* Naklonujte [ABP repozitář](https://github.com/abpframework/abp/) z Githubu.
* K přidání nového jazyka vytvořte novou složku v [docs](https://github.com/abpframework/abp/tree/master/docs). Název složky musí být "en", "es", "fr", "tr" atd. v závislosti na jazyku (navštivte [všechny jazykové kódy](https://msdn.microsoft.com/en-us/library/hh441729.aspx)).
* Pro referenci použijte ["en" složku](https://github.com/abpframework/abp/tree/master/docs/en) a její názvy souborů a strom složek. Při překladu této dokumentace zachovejte prosím tyto názvy stejné.
* Zašlete pull request (PR) po překladu jakéhokoliv dokumentu klidně i po jednom. Nečekejte až budete mít překlad všech dokumentů.
### Lokalizace zdrojů
ABP framework má flexibilní [lokalizační systém](../Localization.md). Můžete tak vytvořit lokalizované uživatelské prostředí pro svou vlastní aplikaci.
K tomu mají framework a vestavěné moduly již lokalizované texty. Například [lokalizační texty pro Volo.Abp.UI balík](https://github.com/abpframework/abp/blob/master/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/en.json). Můžete vytvořit nový soubor ve [stejné složce](https://github.com/abpframework/abp/tree/master/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi) k přidání překladu.
* Naklonujte [ABP repozitář](https://github.com/abpframework/abp/) z Githubu.
* Vytvořte nový soubor pro cílový jazyk pro lokalizační text v (json) souboru (u souboru en.json).
* Zkopírujte veškerý text ze souboru en.json.
* Přeložte texty.
* Zašlete pull request na Githubu.
ABP je modulářní framework, proto je zde mnoho zdrojů lokalizačních textů, jeden pro každý modul. K najití všech .json souborů, vyhledejte po naklonování repozitáře soubory "en.json". Můžete se taky podívat na [tento seznam](Localization-Text-Files.md) souborů lokalizačních textů.
### Příspevky do blogu a návody
Pokud se rozhodnete pro ABP vytvořit nějaké návody nebo příspěvky do blogu, dejte nám vědět (prostřednictvím [Github problémy](https://github.com/abpframework/abp/issues)), ať můžeme přidat odkaz na Váš návod/příspěvek v oficiální dokumentaci a oznámit na našem [Twitter účtu](https://twitter.com/abpframework).
### Zpráva o chybě
Pokud najdete chybu, [vytvořte prosím problém v Github repozitáři](https://github.com/abpframework/abp/issues/new).

@ -0,0 +1,40 @@
## Textové soubory pro lokalizaci
Toto je seznam lokalizačních textových souborů pro každého kdo chce přispět k překladu textů ve frameworku. Tento seznam budeme udržovat aktuální:
* https://github.com/abpframework/abp/tree/master/framework/src/Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy/Volo/Abp/AspNetCore/Mvc/UI/MultiTenancy/Localization/en.json
* https://github.com/abpframework/abp/tree/master/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/Resources/AbpValidation/en.json
* https://github.com/abpframework/abp/tree/master/framework/src/Volo.Abp.UI.Navigation/Volo/Abp/Ui/Navigation/Localization/Resource/en.json
* https://github.com/abpframework/abp/tree/master/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/en.json
* https://github.com/abpframework/abp/tree/master/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Localization/Resource/en.json
* https://github.com/abpframework/abp/tree/master/framework/test/Volo.Abp.Emailing.Tests/Volo/Abp/Emailing/Localization/en.json
* https://github.com/abpframework/abp/tree/master/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/CountryNames/en.json
* https://github.com/abpframework/abp/tree/master/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Base/Validation/en.json
* https://github.com/abpframework/abp/tree/master/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/Source/en.json
* https://github.com/abpframework/abp/tree/master/framework/test/Volo.Abp.Localization.Tests/Volo/Abp/Localization/TestResources/SourceExt/en.json
* https://github.com/abpframework/abp/tree/master/modules/account/src/Volo.Abp.Account.Web/Localization/Resources/AbpAccount/Web/en.json
* https://github.com/abpframework/abp/tree/master/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Localization/Resources/Blogging/ApplicationContracts/en.json
* https://github.com/abpframework/abp/tree/master/modules/blogging/src/Volo.Blogging.Web/Localization/Resources/Blogging/Web/en.json
* https://github.com/abpframework/abp/tree/master/modules/docs/app/VoloDocs.Web/Localization/Resources/VoloDocs/Web/en.json
* https://github.com/abpframework/abp/tree/master/modules/docs/src/Volo.Docs.Admin.Application.Contracts/Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts/en.json
* https://github.com/abpframework/abp/tree/master/modules/docs/src/Volo.Docs.Admin.Web/Localization/Resources/Docs/Web/en.json
* https://github.com/abpframework/abp/tree/master/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Localization/Domain/en.json
* https://github.com/abpframework/abp/tree/master/modules/feature-management/src/Volo.Abp.FeatureManagement.Application.Contracts/Volo/Abp/FeatureManagement/Localization/ApplicationContracts/en.json
* https://github.com/abpframework/abp/tree/master/modules/feature-management/src/Volo.Abp.FeatureManagement.Domain/Volo/Abp/FeatureManagement/Localization/Domain/en.json
* https://github.com/abpframework/abp/tree/master/modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Localization/Resources/FeatureManagement/en.json
* https://github.com/abpframework/abp/tree/master/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/Localization/ApplicationContracts/en.json
* https://github.com/abpframework/abp/tree/master/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/Localization/Domain/en.json
* https://github.com/abpframework/abp/tree/master/modules/identity/src/Volo.Abp.Identity.Web/Localization/Resources/AbpIdentity/en.json
* https://github.com/abpframework/abp/tree/master/modules/permission-management/src/Volo.Abp.PermissionManagement.Web/Localization/Resources/AbpPermissionManagement/en.json
* https://github.com/abpframework/abp/tree/master/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Localization/Resources/AbpSettingManagement/en.json
* https://github.com/abpframework/abp/tree/master/modules/tenant-management/src/Volo.Abp.TenantManagement.Application.Contracts/Volo/Abp/TenantManagement/Localization/ApplicationContracts/en.json
* https://github.com/abpframework/abp/tree/master/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Localization/Resources/AbpTenantManagement/Web/en.json
* https://github.com/abpframework/abp/tree/master/samples/BookStore/src/Acme.BookStore.Domain.Shared/Localization/BookStore/en.json
* https://github.com/abpframework/abp/tree/master/samples/DashboardDemo/src/DashboardDemo.Domain/Localization/DashboardDemo/en.json
* https://github.com/abpframework/abp/tree/master/samples/MicroserviceDemo/modules/product/src/ProductManagement.Application.Contracts/ProductManagement/Localization/ApplicationContracts/en.json
* https://github.com/abpframework/abp/tree/master/samples/MicroserviceDemo/modules/product/src/ProductManagement.Domain/ProductManagement/Localization/Domain/en.json
* https://github.com/abpframework/abp/tree/master/samples/MicroserviceDemo/modules/product/src/ProductManagement.Web/Localization/Resources/ProductManagement/en.json
* https://github.com/abpframework/abp/tree/master/templates/mvc-module/src/MyCompanyName.MyProjectName.Application.Contracts/Localization/MyProjectName/ApplicationContracts/en.json
* https://github.com/abpframework/abp/tree/master/templates/mvc-module/src/MyCompanyName.MyProjectName.Domain.Shared/Localization/MyProjectName/DomainShared/en.json
* https://github.com/abpframework/abp/tree/master/templates/mvc-module/src/MyCompanyName.MyProjectName.Web/Localization/MyProjectName/Web/en.json
* https://github.com/abpframework/abp/tree/master/templates/mvc/src/MyCompanyName.MyProjectName.Domain.Shared/Localization/MyProjectName/en.json

@ -218,7 +218,7 @@
},
{
"text": "Tag pomocníci",
"path": "Tag-Helpers.md"
"path": "AspNetCore/Tag-Helpers/Index.md"
},
{
"text": "Motivy",

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 153 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

@ -0,0 +1,88 @@
# ABP CLI, New Templates & Other Features with the v0.18 Release
ABP v0.18 has been released with [70+ issues](https://github.com/abpframework/abp/milestone/16?closed=1) resolved and [500+ commits](https://github.com/abpframework/abp/compare/0.17.0.0...0.18.0) pushed.
## Web Site Changes
[abp.io](https://abp.io) web site is **completely renewed** to highlight the goals and important features of the ABP framework. Document & blog URLs are also changed:
- `abp.io/documents` moved to [docs.abp.io](https://docs.abp.io).
- `abp.io/blog` moved to [blog.abp.io](https://blog.abp.io).
## ABP CLI
ABP CLI (Command Line Interface) is a new global command line tool to perform some common operations for ABP based solutions. Main functions are;
* **Creating a new application** or module project.
* **Adding a new module** to an application.
* **Updating** all ABP related packages in a solution.
ABP CLI is now the preferred way to create a new project, while you can still download a new project from the [get started](https://abp.io/get-started) page.
### Usage
Install the ABP CLI using a command line window:
````bash
dotnet tool install -g Volo.Abp.Cli
````
Create a new application:
````bash
abp new Acme.BookStore
````
Add a module to an application:
````bash
abp add-module Volo.Blogging
````
Update all ABP related packages in a solution:
````bash
abp update
````
See [ABP CLI documentation](https://docs.abp.io/en/abp/latest/CLI) for details.
## New Templates
In this release, we've renewed all startup templates. The main goal is to provide better startup templates based on Domain Driven Design layers those also allow to create tiered solutions (where Web and API layers can be physically separated). It also includes unit & integration test projects separated for different layers.
The image below shows the new startup project for an MVC application.
![mvc-template-solution](mvc-template-solution.png)
See the [startup templates document](https://docs.abp.io/en/abp/latest/Startup-Templates/Index) for details.
## Change Logs
Here are some other features and enhancements coming with this release:
* New data seed system with `IDataSeeder` service & `IDataSeedContributor` interface to allow a modular initial data seed system.
* New [Volo.Abp.Specifications](https://www.nuget.org/packages/Volo.Abp.Specifications) package.
* Improved MemoryDB implementation to serialize/deserialize objects stored in memory, so it provides more realistic infrastructure for mocking database in unit/integration tests.
* Added multi-language support for the docs module. Used it for the [ABP documentation](https://docs.abp.io).
See the [GitHub Release Notes](https://github.com/abpframework/abp/releases/tag/0.18.0) for all features, enhancements & bugfixes in this release.
## Road Map
One thing related to the ABP v1.0 release is .NET Core / ASP.NET Core 3.0 release. According to the [.NET Core road map](https://github.com/dotnet/core/blob/master/roadmap.md), 3.0 release has been scheduled for September 2019.
ASP.NET Core comes with big changes and features. As a big breaking change, it will [only run on .NET Core](https://github.com/aspnet/Announcements/issues/324) (dropping .net standard support), so it will not work with full .net framework anymore.
We had declared to release v1.0 in 2019 Q2. The main works we should do for v1.0 are;
* Fill the gaps in current features.
* Refactor & improve the current APIs.
* Fix known bugs.
* Complete the documentation & tutorials.
In addition to the work we should do, we are also considering to wait ASP.NET Core 3.0 release. Because, if we release ABP v1.0 before ASP.NET Core 3.0, we will have to release ABP v2.0 again in a short time and drop v1.0 support. So, we are considering to publish ABP v1.0 RC with ASP.NET Core 3.0 RC and align the final release date with Microsoft.
## Want to Contribute?
Thanks to the community for their support for ABP development. It is very appreciated. If you also want to contribute, see [this guide](https://github.com/abpframework/abp/blob/master/docs/en/Contribution/Index.md) as the beginning.

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

@ -103,7 +103,7 @@ abp add-module Volo.Blogging
### update
Updating all ABP related packages can be tedious since there are many packages of the framework and modules. This command automatically updates all ABP related packages in a solution or project to the latest versions.
Updating all ABP related packages can be tedious since there are many packages of the framework and modules. This command automatically updates all ABP NuGet related packages and NPM packages in a solution or project to the latest versions.
Usage:

@ -31,7 +31,7 @@ You may want to translate the complete [documentation](https://abp.io/documents/
### Resource Localization
ABP framework has a flexible [localization system](https://abp.io/documents/abp/latest/Localization). You can create localized user interfaces for your own application.
ABP framework has a flexible [localization system](../Localization.md). You can create localized user interfaces for your own application.
In addition to that, the framework and pre-build modules have already localized texts. As an example, see [the localization texts for the Volo.Abp.UI package](https://github.com/abpframework/abp/blob/master/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/en.json). You can create a new file in the [same folder](https://github.com/abpframework/abp/tree/master/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi) to translate it.

@ -31,7 +31,7 @@ ABP是[开源](https://github.com/abpframework)和社区驱动项目. 本指南
### 资源本地化
ABP框架具有灵活的[本地化系统](https://abp.io/documents/abp/latest/Localization). 你可以为自己的应用程序创建本地化用户界面.
ABP框架具有灵活的[本地化系统](../Localization.md). 你可以为自己的应用程序创建本地化用户界面.
除此之外,框架和预构建模块已经本地化了文本.请参阅[Volo.Abp.UI包的本地化文本](https://github.com/abpframework/abp/blob/master/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/en.json).你可以在[相同文件夹](https://github.com/abpframework/abp/tree/master/framework/src/Volo.Abp.UI/Localization/Resources/AbpUi)中创建一个新文件进行翻译.

@ -238,9 +238,13 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.AspNetCore.Mvc.UI.
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.AspNetCore.Mvc.UI.Dashboards", "src\Volo.Abp.AspNetCore.Mvc.UI.Dashboards\Volo.Abp.AspNetCore.Mvc.UI.Dashboards.csproj", "{054D766D-5992-460E-A4D8-936D80BE2C1A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.Ldap", "src\Volo.Abp.Ldap\Volo.Abp.Ldap.csproj", "{4DADBBD2-4C63-4C90-9661-EBF6252A7D6F}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Ldap", "src\Volo.Abp.Ldap\Volo.Abp.Ldap.csproj", "{4DADBBD2-4C63-4C90-9661-EBF6252A7D6F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.Ldap.Tests", "test\Volo.Abp.Ldap.Tests\Volo.Abp.Ldap.Tests.csproj", "{38FB8F75-426E-4265-8D0E-E121837B6FCC}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Ldap.Tests", "test\Volo.Abp.Ldap.Tests\Volo.Abp.Ldap.Tests.csproj", "{38FB8F75-426E-4265-8D0E-E121837B6FCC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.Dapper", "src\Volo.Abp.Dapper\Volo.Abp.Dapper.csproj", "{D863A3C3-CC1D-426F-BDD4-02E7AE2A3170}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.Dapper.Tests", "test\Volo.Abp.Dapper.Tests\Volo.Abp.Dapper.Tests.csproj", "{E026A085-D881-4AE0-9F08-422AC3903BD7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -720,6 +724,14 @@ Global
{38FB8F75-426E-4265-8D0E-E121837B6FCC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{38FB8F75-426E-4265-8D0E-E121837B6FCC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{38FB8F75-426E-4265-8D0E-E121837B6FCC}.Release|Any CPU.Build.0 = Release|Any CPU
{D863A3C3-CC1D-426F-BDD4-02E7AE2A3170}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D863A3C3-CC1D-426F-BDD4-02E7AE2A3170}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D863A3C3-CC1D-426F-BDD4-02E7AE2A3170}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D863A3C3-CC1D-426F-BDD4-02E7AE2A3170}.Release|Any CPU.Build.0 = Release|Any CPU
{E026A085-D881-4AE0-9F08-422AC3903BD7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E026A085-D881-4AE0-9F08-422AC3903BD7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E026A085-D881-4AE0-9F08-422AC3903BD7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E026A085-D881-4AE0-9F08-422AC3903BD7}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -843,6 +855,8 @@ Global
{054D766D-5992-460E-A4D8-936D80BE2C1A} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6}
{4DADBBD2-4C63-4C90-9661-EBF6252A7D6F} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6}
{38FB8F75-426E-4265-8D0E-E121837B6FCC} = {447C8A77-E5F0-4538-8687-7383196D04EA}
{D863A3C3-CC1D-426F-BDD4-02E7AE2A3170} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6}
{E026A085-D881-4AE0-9F08-422AC3903BD7} = {447C8A77-E5F0-4538-8687-7383196D04EA}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {BB97ECF4-9A84-433F-A80B-2A3285BDD1D5}

@ -0,0 +1,13 @@
using System.Collections.Generic;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
namespace Volo.Abp.AspNetCore.Mvc.UI.Packages.Core
{
public class CoreStyleContributor : BundleContributor
{
public override void ConfigureBundle(BundleConfigurationContext context)
{
context.Files.AddIfNotContains("/libs/abp/core/abp.css");
}
}
}

@ -1,16 +0,0 @@
using System.Collections.Generic;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.Core;
using Volo.Abp.Modularity;
namespace Volo.Abp.AspNetCore.Mvc.UI.Packages.FreezeUi
{
[DependsOn(typeof(CoreScriptContributor))]
public class FreezeUiScriptContributor : BundleContributor
{
public override void ConfigureBundle(BundleConfigurationContext context)
{
context.Files.AddIfNotContains("/libs/freeze-ui/freeze-ui.min.js");
}
}
}

@ -1,16 +0,0 @@
using System.Collections.Generic;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.Bootstrap;
using Volo.Abp.Modularity;
namespace Volo.Abp.AspNetCore.Mvc.UI.Packages.FreezeUi
{
[DependsOn(typeof(BootstrapStyleContributor))]
public class FreezeUiStyleContributor : BundleContributor
{
public override void ConfigureBundle(BundleConfigurationContext context)
{
context.Files.AddIfNotContains("/libs/freeze-ui/freeze-ui.min.css");
}
}
}

@ -1,15 +1,10 @@
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.Anchor;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.Bootstrap;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.Clipboard;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.DatatablesNetBs4;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.FreezeUi;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.JQuery;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.JQueryForm;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.JQueryValidationUnobtrusive;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.Lodash;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.MalihuCustomScrollbar;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.Popper;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.Select2;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.SweetAlert;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.Timeago;
@ -28,8 +23,8 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Bundling
typeof(DatatablesNetBs4ScriptContributor),
typeof(SweetalertScriptContributor),
typeof(ToastrScriptBundleContributor),
typeof(TimeagoScriptContributor),
typeof(FreezeUiScriptContributor))]
typeof(TimeagoScriptContributor)
)]
public class SharedThemeGlobalScriptContributor : BundleContributor
{
public override void ConfigureBundle(BundleConfigurationContext context)
@ -42,8 +37,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Bundling
"/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/modal-manager.js",
"/libs/abp/aspnetcore-mvc-ui-theme-shared/datatables/datatables-extensions.js",
"/libs/abp/aspnetcore-mvc-ui-theme-shared/sweetalert/abp-sweetalert.js",
"/libs/abp/aspnetcore-mvc-ui-theme-shared/toastr/abp-toastr.js",
"/libs/abp/aspnetcore-mvc-ui-theme-shared/freeze-ui/abp-freeze-ui.js"
"/libs/abp/aspnetcore-mvc-ui-theme-shared/toastr/abp-toastr.js"
});
}
}

@ -1,8 +1,8 @@
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.Bootstrap;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.Core;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.DatatablesNetBs4;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.FontAwesome;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.FreezeUi;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.Select2;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.Toastr;
using Volo.Abp.Modularity;
@ -10,12 +10,12 @@ using Volo.Abp.Modularity;
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Bundling
{
[DependsOn(
typeof(CoreStyleContributor),
typeof(BootstrapStyleContributor),
typeof(FontAwesomeStyleContributor),
typeof(ToastrStyleBundleContributor),
typeof(Select2StyleContributor),
typeof(DatatablesNetBs4StyleContributor),
typeof(FreezeUiStyleContributor)
typeof(DatatablesNetBs4StyleContributor)
)]
public class SharedThemeGlobalStyleContributor : BundleContributor
{

@ -1,71 +0,0 @@
var abp = abp || {};
(function ($) {
if (!window.FreezeUI || !$) {
return;
}
/* MESSAGE **************************************************/
/*Package from https://alexradulescu.github.io/freeze-ui/*/
abp.ui = abp.ui || {};
/* UI BLOCK */
abp.ui.block = function (elm) {
if (elm) {
window.FreezeUI({ selector: elm });
} else {
window.FreezeUI();
}
};
abp.ui.unblock = function () {
window.UnFreezeUI();
};
/* UI BUSY */
abp.ui.setBusy = function (element, text, freezeDelay) {
var opt = { text: text ? text : ' ' };
if (element) {
opt.element = element;
}
if (freezeDelay) {
opt.freezeDelay = freezeDelay;
}
window.FreezeUI(opt);
};
abp.ui.setBusy = function (options) {
options = $.extend({}, options || {
freezeDelay: 500
});
if (!options.text) {
options.text = " ";
}
window.FreezeUI(options);
if (options.promise) {
if (options.promise.always) {
options.promise.always(function () {
abp.ui.clearBusy(options.element);
});
} else if (options.promise['finally']) {
options.promise['finally'](function () {
abp.ui.clearBusy(options.element);
});
}
}
};
abp.ui.clearBusy = function () {
window.UnFreezeUI();
};
})(jQuery);

@ -10,8 +10,7 @@ namespace Volo.Abp.BackgroundJobs
public Guid Id { get; set; }
/// <summary>
/// Type of the job.
/// It's AssemblyQualifiedName of job type.
/// Name of the job.
/// </summary>
public virtual string JobName { get; set; }

@ -15,6 +15,7 @@
<PackageReference Include="Ionic.Zip" Version="1.9.1.8" />
<PackageReference Include="HtmlAgilityPack.NetCore" Version="1.5.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Hosting.Abstractions" Version="2.2.0" />
<PackageReference Include="NuGet.Versioning" Version="5.1.0" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.5.1" />
<PackageReference Include="System.Security.Permissions" Version="4.5.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.1.0" />

@ -1,12 +1,12 @@
using System;
using System.Diagnostics;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using NuGet.Versioning;
using System;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
using Microsoft.Extensions.DependencyInjection;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Volo.Abp.Cli.Args;
using Volo.Abp.Cli.Commands;
using Volo.Abp.Cli.NuGet;
@ -18,7 +18,6 @@ namespace Volo.Abp.Cli
public class CliService : ITransientDependency
{
public ILogger<CliService> Logger { get; set; }
protected ICommandLineArgumentParser CommandLineArgumentParser { get; }
protected ICommandSelector CommandSelector { get; }
protected IHybridServiceScopeFactory ServiceScopeFactory { get; }
@ -40,11 +39,9 @@ namespace Volo.Abp.Cli
public async Task RunAsync(string[] args)
{
Logger.LogInformation($"ABP CLI, version {GetCliVersion()}.");
Logger.LogInformation("https://abp.io");
await CheckForNewVersion();
Logger.LogInformation("ABP CLI (https://abp.io)");
await CheckCliVersionAsync();
CheckDependencies();
var commandLineArgs = CommandLineArgumentParser.Parse(args);
@ -71,8 +68,8 @@ namespace Volo.Abp.Cli
private void CheckDependencies()
{
var installedNpmPackages = GetInstalledNpmPackages();
var installedNpmPackages = CmdHelper.RunCmdAndGetOutput("npm list -g --depth 0");
if (!installedNpmPackages.Contains(" yarn@"))
{
InstallYarn();
@ -83,35 +80,6 @@ namespace Volo.Abp.Cli
}
}
private string GetInstalledNpmPackages()
{
var output = "";
using (var process = new Process())
{
process.StartInfo = new ProcessStartInfo(CmdHelper.GetFileName())
{
Arguments = CmdHelper.GetArguments("npm list -g --depth 0"),
UseShellExecute = false,
CreateNoWindow = true,
RedirectStandardOutput = true,
RedirectStandardError = true
};
process.Start();
using (var stdOut = process.StandardOutput)
{
using (var stdErr = process.StandardError)
{
output = stdOut.ReadToEnd();
output += stdErr.ReadToEnd();
}
}
}
return output;
}
private void InstallYarn()
{
Logger.LogInformation("Installing yarn...");
@ -124,47 +92,145 @@ namespace Volo.Abp.Cli
CmdHelper.RunCmd("npm install gulp -g");
}
private async Task CheckForNewVersion()
private async Task CheckCliVersionAsync()
{
var assembly = typeof(CliService).Assembly;
var toolPath = GetToolPath(assembly);
var currentCliVersion = await GetCurrentCliVersion(toolPath, assembly);
var updateChannel = GetUpdateChannel(currentCliVersion);
Logger.LogInformation($"Version {currentCliVersion} ({updateChannel} channel)");
try
{
var currentVersion = GetCliVersion();
var latestVersion = await NuGetService.GetLatestVersionOrNullAsync("Volo.Abp.Cli");
var latestVersion = await GetLatestVersion(updateChannel);
if (!latestVersion.IsNullOrEmpty() && currentVersion != latestVersion)
if (latestVersion != null && latestVersion > currentCliVersion)
{
Logger.LogInformation("");
Logger.LogWarning("ABP CLI has a newer version (" + latestVersion + "). Please update to get the latest features and fixes.");
Logger.LogWarning("");
Logger.LogWarning("Update Command: ");
Logger.LogWarning(" dotnet tool update -g Volo.Abp.Cli");
Logger.LogWarning("");
LogNewVersionInfo(updateChannel, latestVersion, toolPath);
}
}
catch (Exception e)
{
Logger.LogWarning("Could not get the latest version infom from NuGet.org:");
Logger.LogWarning("Unable to retrieve the latest version");
Logger.LogWarning(e.Message);
}
}
private static string GetCliVersion()
private static string GetToolPath(Assembly assembly)
{
if (!assembly.Location.Contains(".store"))
{
return null;
}
return assembly.Location.Substring(0, assembly.Location.IndexOf(".store", StringComparison.Ordinal));
}
private async Task<SemanticVersion> GetCurrentCliVersion(string toolPath, Assembly assembly)
{
SemanticVersion currentCliVersion = default;
if (!string.IsNullOrEmpty(toolPath))
{
var consoleOutput = new StringReader(CmdHelper.RunCmdAndGetOutput($"dotnet tool list --tool-path {toolPath}"));
string line;
while ((line = await consoleOutput.ReadLineAsync()) != null)
{
if (line.StartsWith("Volo.Abp.Cli", StringComparison.InvariantCultureIgnoreCase))
{
var version = line.Split(new char[0], StringSplitOptions.RemoveEmptyEntries)[1];
SemanticVersion.TryParse(version, out currentCliVersion);
break;
}
}
}
if (currentCliVersion == null)
{
// If not a tool executable, fallback to assembly version and treat as dev without updates
// Assembly revisions are not supported by SemVer scheme required for NuGet, trim to {major}.{minor}.{patch}
var assemblyVersion = string.Join(".", assembly.GetFileVersion().Split('.').Take(3));
return SemanticVersion.Parse(assemblyVersion + "-dev");
}
return currentCliVersion;
}
private static UpdateChannel GetUpdateChannel(SemanticVersion currentCliVersion)
{
if (!currentCliVersion.IsPrerelease)
{
return UpdateChannel.Stable;
}
if (currentCliVersion.Release.Contains("preview"))
{
return UpdateChannel.Nightly;
}
if (currentCliVersion.Release.Contains("dev"))
{
return UpdateChannel.Development;
}
return UpdateChannel.Prerelease;
}
private async Task<SemanticVersion> GetLatestVersion(UpdateChannel updateChannel)
{
var version = typeof(CliService)
.Assembly
.GetFileVersion();
switch (updateChannel)
{
case UpdateChannel.Stable:
return await NuGetService.GetLatestVersionOrNullAsync("Volo.Abp.Cli");
case UpdateChannel.Prerelease:
return await NuGetService.GetLatestVersionOrNullAsync("Volo.Abp.Cli", includePreviews: true);
/* Assembly versions are like "2.4.0.0", but NuGet removes the last "0" here,
* like "2.4.0".
* So, we need to remove it from the assembly version to match to the NuGet version.
*/
case UpdateChannel.Nightly:
return await NuGetService.GetLatestVersionOrNullAsync("Volo.Abp.Cli", includeNightly: true);
if (version.Split('.').Length == 4)
default:
return default;
}
}
private void LogNewVersionInfo(UpdateChannel updateChannel, SemanticVersion latestVersion, string toolPath)
{
Logger.LogWarning(
$"ABP CLI has a newer {updateChannel.ToString().ToLowerInvariant()} version {latestVersion}, please update to get the latest features and fixes.");
Logger.LogWarning("");
Logger.LogWarning("Update Command: ");
// Update command doesn't support prerelease versions https://github.com/dotnet/sdk/issues/2551 workaround is to uninstall & install
switch (updateChannel)
{
version = version.RemovePostFix(".0");
case UpdateChannel.Stable:
Logger.LogWarning($" dotnet tool update --tool-path {toolPath} Volo.Abp.Cli");
break;
case UpdateChannel.Prerelease:
Logger.LogWarning($" dotnet tool uninstall --tool-path {toolPath} Volo.Abp.Cli");
Logger.LogWarning($" dotnet tool install --tool-path {toolPath} --version {latestVersion} Volo.Abp.Cli");
break;
case UpdateChannel.Nightly:
Logger.LogWarning($" dotnet tool uninstall --tool-path {toolPath} Volo.Abp.Cli");
Logger.LogWarning(
$" dotnet tool install --tool-path {toolPath} --add-source https://www.myget.org/F/abp-nightly/api/v3/index.json --version {latestVersion} Volo.Abp.Cli");
break;
}
return version;
Logger.LogWarning("");
}
protected enum UpdateChannel
{
Development,
Stable,
Prerelease,
Nightly
}
}
}
}

@ -56,9 +56,9 @@ namespace Volo.Abp.Cli.Commands
sb.AppendLine(" --skip-db-migrations <boolean> Specify if a new migration will be added or not.");
sb.AppendLine("");
sb.AppendLine("Examples:");
sb.AppendLine(" abp add-module Volo.Blogging Adds the module to the current soluton.");
sb.AppendLine(" abp add-module Volo.Blogging -s Acme.BookStore Adds the module to the given soluton.");
sb.AppendLine(" abp add-module Volo.Blogging -s Acme.BookStore --skip-db-migrations false Adds the module to the given soluton but doesn't create a database migration.");
sb.AppendLine(" abp add-module Volo.Blogging Adds the module to the current solution.");
sb.AppendLine(" abp add-module Volo.Blogging -s Acme.BookStore Adds the module to the given solution.");
sb.AppendLine(" abp add-module Volo.Blogging -s Acme.BookStore --skip-db-migrations false Adds the module to the given solution but doesn't create a database migration.");
sb.AppendLine("");
return Task.FromResult(sb.ToString());
@ -93,7 +93,7 @@ namespace Volo.Abp.Cli.Commands
if (foundSolutionFiles.Length == 0)
{
throw new CliUsageException("'abp add-module' command should be used inside a folder contaning a .sln file!");
throw new CliUsageException("'abp add-module' command should be used inside a folder containing a .sln file!");
}
//foundSolutionFiles.Length > 1

@ -15,18 +15,32 @@ namespace Volo.Abp.Cli.Commands
{
public ILogger<UpdateCommand> Logger { get; set; }
private readonly VoloPackagesVersionUpdater _packagesVersionUpdater;
private readonly VoloNugetPackagesVersionUpdater _nugetPackagesVersionUpdater;
private readonly NpmPackagesUpdater _npmPackagesUpdater;
public UpdateCommand(VoloPackagesVersionUpdater packagesVersionUpdater)
public UpdateCommand(VoloNugetPackagesVersionUpdater nugetPackagesVersionUpdater, NpmPackagesUpdater npmPackagesUpdater)
{
_packagesVersionUpdater = packagesVersionUpdater;
_nugetPackagesVersionUpdater = nugetPackagesVersionUpdater;
_npmPackagesUpdater = npmPackagesUpdater;
Logger = NullLogger<UpdateCommand>.Instance;
}
public async Task ExecuteAsync(CommandLineArgs commandLineArgs)
{
var includePreviews = commandLineArgs.Options.GetOrNull(Options.IncludePreviews.Short, Options.IncludePreviews.Long) != null;
UpdateNugetPackages(commandLineArgs);
UpdateNpmPackages();
}
private void UpdateNpmPackages()
{
_npmPackagesUpdater.Update(Directory.GetCurrentDirectory());
}
private void UpdateNugetPackages(CommandLineArgs commandLineArgs)
{
var includePreviews =
commandLineArgs.Options.GetOrNull(Options.IncludePreviews.Short, Options.IncludePreviews.Long) != null;
var solution = Directory.GetFiles(Directory.GetCurrentDirectory(), "*.sln").FirstOrDefault();
@ -34,7 +48,7 @@ namespace Volo.Abp.Cli.Commands
{
var solutionName = Path.GetFileName(solution).RemovePostFix(".sln");
_packagesVersionUpdater.UpdateSolution(solution, includePreviews);
_nugetPackagesVersionUpdater.UpdateSolution(solution, includePreviews);
Logger.LogInformation($"Volo packages are updated in {solutionName} solution.");
return;
@ -46,13 +60,14 @@ namespace Volo.Abp.Cli.Commands
{
var projectName = Path.GetFileName(project).RemovePostFix(".csproj");
_packagesVersionUpdater.UpdateProject(project, includePreviews);
_nugetPackagesVersionUpdater.UpdateProject(project, includePreviews);
Logger.LogInformation($"Volo packages are updated in {projectName} project.");
return;
}
throw new CliUsageException("No solution or project found in this directory." + Environment.NewLine + Environment.NewLine + GetUsageInfo());
throw new CliUsageException("No solution or project found in this directory." + Environment.NewLine +
Environment.NewLine + GetUsageInfo());
}
public Task<string> GetUsageInfo()
@ -77,8 +92,8 @@ namespace Volo.Abp.Cli.Commands
public Task<string> GetShortDescriptionAsync()
{
return Task.FromResult("Automatically updates all ABP related packages in a" +
" solution or project to the latest versions.");
return Task.FromResult("Automatically updates all ABP related NuGet packages and NPM packages in a" +
" solution or project to the latest versions");
}
public static class Options

@ -1,4 +1,5 @@
using Newtonsoft.Json;
using NuGet.Versioning;
using System;
using System.Collections.Generic;
using System.Linq;
@ -23,16 +24,17 @@ namespace Volo.Abp.Cli.NuGet
CancellationTokenProvider = cancellationTokenProvider;
}
public async Task<string> GetLatestVersionOrNullAsync(string packageId, bool includePreviews = false)
public async Task<SemanticVersion> GetLatestVersionOrNullAsync(string packageId, bool includePreviews = false, bool includeNightly = false)
{
using (var client = new HttpClient())
{
client.Timeout = TimeSpan.FromSeconds(30);
var responseMessage = await client.GetAsync(
$"https://api.nuget.org/v3-flatcontainer/{packageId.ToLowerInvariant()}/index.json",
CancellationTokenProvider.Token
);
var url = includeNightly ?
$"https://www.myget.org/F/abp-nightly/api/v3/flatcontainer/{packageId.ToLowerInvariant()}/index.json" :
$"https://api.nuget.org/v3-flatcontainer/{packageId.ToLowerInvariant()}/index.json";
var responseMessage = await client.GetAsync(url, CancellationTokenProvider.Token);
if (!responseMessage.IsSuccessStatusCode)
{
@ -41,16 +43,14 @@ namespace Volo.Abp.Cli.NuGet
var result = await responseMessage.Content.ReadAsStringAsync();
var versions = JsonSerializer.Deserialize<NuGetVersionResultDto>(result).Versions;
var versions = JsonSerializer.Deserialize<NuGetVersionResultDto>(result).Versions.Select(x => SemanticVersion.Parse(x));
if (!includePreviews)
if (!includePreviews && !includeNightly)
{
versions = versions
.Where(x => !x.Contains("beta") && !x.Contains("preview") && !x.Contains("alpha") && !x.Contains("rc"))
.ToList();
versions = versions.Where(x => !x.IsPrerelease);
}
return versions.Count > 0 ? versions.Last() : null;
return versions.Any() ? versions.Max() : null;
}
}
@ -60,4 +60,4 @@ namespace Volo.Abp.Cli.NuGet
public List<string> Versions { get; set; }
}
}
}
}

@ -0,0 +1,122 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Volo.Abp.Cli.Utils;
using Volo.Abp.DependencyInjection;
namespace Volo.Abp.Cli.ProjectModification
{
public class NpmPackagesUpdater : ITransientDependency
{
public ILogger<NpmPackagesUpdater> Logger { get; set; }
private readonly PackageJsonFileFinder _packageJsonFileFinder;
private readonly Dictionary<string, string> _fileVersionStorage = new Dictionary<string, string>();
public NpmPackagesUpdater(PackageJsonFileFinder packageJsonFileFinder)
{
_packageJsonFileFinder = packageJsonFileFinder;
Logger = NullLogger<NpmPackagesUpdater>.Instance;
}
public void Update(string rootDirectory)
{
var fileList = _packageJsonFileFinder.Find(rootDirectory);
foreach (var file in fileList)
{
UpdatePackagesInFile(file);
RunYarnAndGulp(file);
}
}
protected virtual void UpdatePackagesInFile(string file)
{
var fileContent = File.ReadAllText(file);
var packageJson = JObject.Parse(fileContent);
var abpPackages = GetAbpPackagesFromPackageJson(packageJson);
if (!abpPackages.Any())
{
return;
}
foreach (var abpPackage in abpPackages)
{
UpdatePackage(file, abpPackage);
}
var modifiedFileContent = packageJson.ToString(Formatting.Indented);
File.WriteAllText(file, modifiedFileContent);
}
protected virtual void UpdatePackage(string file, JProperty package)
{
var version = GetLatestVersion(package);
var versionWithPrefix = $"^{version}";
if (versionWithPrefix == (string)package.Value)
{
return;
}
package.Value.Replace(versionWithPrefix);
Logger.LogInformation($"Updated {package.Name} to {version} in {file.Replace(Directory.GetCurrentDirectory(), "")}.");
}
protected virtual string GetLatestVersion(JProperty package)
{
if (_fileVersionStorage.ContainsKey(package.Name))
{
return _fileVersionStorage[package.Name];
}
var version = CmdHelper.RunCmdAndGetOutput($"npm show {package.Name} version");
_fileVersionStorage[package.Name] = version;
return version;
}
protected virtual List<JProperty> GetAbpPackagesFromPackageJson(JObject fileObject)
{
var dependencies = (JObject)fileObject["dependencies"];
var properties = dependencies.Properties().ToList();
var abpPackages = properties.Where(p => p.Name.StartsWith("@abp/") || p.Name.StartsWith("@volo/")).ToList();
return abpPackages;
}
protected virtual void RunYarnAndGulp(string file)
{
var fileDirectory = Path.GetDirectoryName(file).EnsureEndsWith(Path.DirectorySeparatorChar);
RunYarn(fileDirectory);
Thread.Sleep(500);
RunGulp(fileDirectory);
}
protected virtual void RunGulp(string fileDirectory)
{
Logger.LogInformation($"Running Gulp on {fileDirectory}");
CmdHelper.RunCmd($"cd {fileDirectory} && gulp");
}
protected virtual void RunYarn(string fileDirectory)
{
Logger.LogInformation($"Running Yarn on {fileDirectory}");
CmdHelper.RunCmd($"cd {fileDirectory} && yarn");
}
}
}

@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using Volo.Abp.DependencyInjection;
namespace Volo.Abp.Cli.ProjectModification
{
public class PackageJsonFileFinder : ITransientDependency
{
public List<string> Find(string rootDirectory)
{
var slash = Path.DirectorySeparatorChar;
return
Directory.GetFiles(rootDirectory.EnsureEndsWith(slash), "*package.json", SearchOption.AllDirectories)
.Where(f =>
!f.Contains(slash + "node_modules" + slash) &&
!f.Contains(slash + "Release" + slash) &&
!f.Contains(slash + "Debug" + slash) &&
IsWithProjectFile(f)
).ToList();
}
protected virtual bool IsWithProjectFile(string path)
{
var directory = Path.GetDirectoryName(path);
return Directory.GetFiles(directory, "*.csproj", searchOption: SearchOption.TopDirectoryOnly).Any();
}
}
}

@ -3,14 +3,15 @@ using System.IO;
using System.Text;
using Volo.Abp.Cli.NuGet;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Threading;
namespace Volo.Abp.Cli.ProjectModification
{
public class VoloPackagesVersionUpdater : ITransientDependency
public class VoloNugetPackagesVersionUpdater : ITransientDependency
{
private readonly NuGetService _nuGetService;
public VoloPackagesVersionUpdater(NuGetService nuGetService)
public VoloNugetPackagesVersionUpdater(NuGetService nuGetService)
{
_nuGetService = nuGetService;
}
@ -75,8 +76,8 @@ namespace Volo.Abp.Cli.ProjectModification
content = content.Substring(indexAfterSecondQuote);
var indexOfThirdQuote = content.IndexOf("\"", StringComparison.Ordinal);
var version = _nuGetService.GetLatestVersionOrNullAsync(packageId, includePreviews);
var version = AsyncHelper.RunSync(() => _nuGetService.GetLatestVersionOrNullAsync(packageId, includePreviews));
returningText.Append(version);
index = indexOfPackageReference + packageReferenceStartText.Length + indexAfterQuote + indexAfterSecondQuote + indexOfThirdQuote;

@ -17,6 +17,35 @@ namespace Volo.Abp.Cli.Utils
Process.Start(procStartInfo).WaitForExit();
}
public static string RunCmdAndGetOutput(string command)
{
var output = "";
using (var process = new Process())
{
process.StartInfo = new ProcessStartInfo(CmdHelper.GetFileName())
{
Arguments = CmdHelper.GetArguments(command),
UseShellExecute = false,
CreateNoWindow = true,
RedirectStandardOutput = true,
RedirectStandardError = true
};
process.Start();
using (var stdOut = process.StandardOutput)
{
using (var stdErr = process.StandardError)
{
output = stdOut.ReadToEnd();
output += stdErr.ReadToEnd();
}
}
}
return output.Trim();
}
public static string GetArguments(string command)
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX) || RuntimeInformation.IsOSPlatform(OSPlatform.Linux))

@ -0,0 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<AssemblyName>Volo.Abp.Dapper</AssemblyName>
<PackageId>Volo.Abp.Dapper</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.EntityFrameworkCore\Volo.Abp.EntityFrameworkCore.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Dapper" Version="1.60.6" />
</ItemGroup>
</Project>

@ -0,0 +1,13 @@
using Volo.Abp.Domain;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.Modularity;
namespace Volo.Abp.Dapper
{
[DependsOn(
typeof(AbpDddDomainModule),
typeof(AbpEntityFrameworkCoreModule))]
public class AbpDapperModule : AbpModule
{
}
}

@ -0,0 +1,23 @@
using System.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Storage;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.Uow;
namespace Volo.Abp.Domain.Repositories.Dapper
{
public class DapperRepository<TDbContext> : IDapperRepository, IUnitOfWorkEnabled
where TDbContext : IEfCoreDbContext
{
private readonly IDbContextProvider<TDbContext> _dbContextProvider;
public DapperRepository(IDbContextProvider<TDbContext> dbContextProvider)
{
_dbContextProvider = dbContextProvider;
}
public IDbConnection DbConnection => _dbContextProvider.GetDbContext().Database.GetDbConnection();
public IDbTransaction DbTransaction => _dbContextProvider.GetDbContext().Database.CurrentTransaction?.GetDbTransaction();
}
}

@ -0,0 +1,11 @@
using System.Data;
namespace Volo.Abp.Domain.Repositories.Dapper
{
public interface IDapperRepository
{
IDbConnection DbConnection { get; }
IDbTransaction DbTransaction { get; }
}
}

@ -25,6 +25,11 @@ namespace Volo.Abp.Emailing.Templates
Options = options.Value;
}
public async Task<EmailTemplate> GetAsync(string name)
{
return await GetAsync(name, CultureInfo.CurrentUICulture.Name);
}
public async Task<EmailTemplate> GetAsync(string name, string cultureName)
{
return await GetInternalAsync(name, cultureName);

@ -4,6 +4,8 @@ namespace Volo.Abp.Emailing.Templates
{
public interface IEmailTemplateProvider
{
Task<EmailTemplate> GetAsync(string name);
Task<EmailTemplate> GetAsync(string name, string cultureName);
}
}

@ -49,8 +49,6 @@ namespace Volo.Abp.EventBus.RabbitMq
HandlerFactories = new ConcurrentDictionary<Type, List<IEventHandlerFactory>>();
EventTypes = new ConcurrentDictionary<string, Type>();
Initialize();
}
public void Initialize()
@ -97,7 +95,12 @@ namespace Volo.Abp.EventBus.RabbitMq
public override IDisposable Subscribe(Type eventType, IEventHandlerFactory factory)
{
var handlerFactories = GetOrCreateHandlerFactories(eventType);
if (factory.IsInFactories(handlerFactories))
{
return NullDisposable.Instance;
}
handlerFactories.Add(factory);
if (handlerFactories.Count == 1) //TODO: Multi-threading!

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.Design;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;

@ -1,3 +1,5 @@
using System.Collections.Generic;
namespace Volo.Abp.EventBus
{
/// <summary>
@ -10,5 +12,7 @@ namespace Volo.Abp.EventBus
/// </summary>
/// <returns>The event handler</returns>
IEventHandlerDisposeWrapper GetHandler();
bool IsInFactories(List<IEventHandlerFactory> handlerFactories);
}
}

@ -1,4 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.DependencyInjection;
@ -33,6 +35,13 @@ namespace Volo.Abp.EventBus
);
}
public bool IsInFactories(List<IEventHandlerFactory> handlerFactories)
{
return handlerFactories
.OfType<IocEventHandlerFactory>()
.Any(f => f.HandlerType == HandlerType);
}
public void Dispose()
{

@ -49,7 +49,12 @@ namespace Volo.Abp.EventBus.Local
{
GetOrCreateHandlerFactories(eventType)
.Locking(factories =>
factories.Add(factory)
{
if (!factory.IsInFactories(factories))
{
factories.Add(factory);
}
}
);
return new EventHandlerFactoryUnregistrar(this, eventType, factory);

@ -1,3 +1,6 @@
using System.Collections.Generic;
using System.Linq;
namespace Volo.Abp.EventBus
{
/// <summary>
@ -27,5 +30,12 @@ namespace Volo.Abp.EventBus
{
return new EventHandlerDisposeWrapper(HandlerInstance);
}
public bool IsInFactories(List<IEventHandlerFactory> handlerFactories)
{
return handlerFactories
.OfType<SingleInstanceHandlerFactory>()
.Any(f => f.HandlerInstance == HandlerInstance);
}
}
}

@ -1,4 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
namespace Volo.Abp.EventBus
{
@ -7,22 +9,62 @@ namespace Volo.Abp.EventBus
/// by a transient instance object.
/// </summary>
/// <remarks>
/// This class always creates a new transient instance of handler.
/// This class always creates a new transient instance of the handler type.
/// </remarks>
public class TransientEventHandlerFactory<THandler> : IEventHandlerFactory
public class TransientEventHandlerFactory<THandler> : TransientEventHandlerFactory, IEventHandlerFactory
where THandler : IEventHandler, new()
{
public TransientEventHandlerFactory()
: base(typeof(THandler))
{
}
protected override IEventHandler CreateHandler()
{
return new THandler();
}
}
/// <summary>
/// This <see cref="IEventHandlerFactory"/> implementation is used to handle events
/// by a transient instance object.
/// </summary>
/// <remarks>
/// This class always creates a new transient instance of the handler type.
/// </remarks>
public class TransientEventHandlerFactory : IEventHandlerFactory
{
public Type HandlerType { get; }
public TransientEventHandlerFactory(Type handlerType)
{
HandlerType = handlerType;
}
/// <summary>
/// Creates a new instance of the handler object.
/// </summary>
/// <returns>The handler object</returns>
public IEventHandlerDisposeWrapper GetHandler()
public virtual IEventHandlerDisposeWrapper GetHandler()
{
var handler = new THandler();
var handler = CreateHandler();
return new EventHandlerDisposeWrapper(
handler,
() => (handler as IDisposable)?.Dispose()
);
}
public bool IsInFactories(List<IEventHandlerFactory> handlerFactories)
{
return handlerFactories
.OfType<TransientEventHandlerFactory>()
.Any(f => f.HandlerType == HandlerType);
}
protected virtual IEventHandler CreateHandler()
{
return (IEventHandler) Activator.CreateInstance(HandlerType);
}
}
}

@ -4,8 +4,6 @@ var gulp = require("gulp"),
path = require('path'),
copyResources = require('./node_modules/@abp/aspnetcore.mvc.ui/gulp/copy-resources.js');
copyResources.init(path.resolve('./'));
gulp.task('default', [copyResources.taskName], function () {
});
exports.default = function(){
return copyResources(path.resolve('./'));
};

@ -0,0 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<AssemblyName>Volo.Abp.Dapper.Tests</AssemblyName>
<PackageId>Volo.Abp.Dapper.Tests</PackageId>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Volo.Abp.Dapper\Volo.Abp.Dapper.csproj" />
<ProjectReference Include="..\Volo.Abp.EntityFrameworkCore.Tests\Volo.Abp.EntityFrameworkCore.Tests.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.4" />
</ItemGroup>
</Project>

@ -0,0 +1,17 @@
using Volo.Abp.Autofac;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.Modularity;
namespace Volo.Abp.Dapper
{
[DependsOn(
typeof(AbpEntityFrameworkCoreTestModule),
typeof(AbpDapperModule),
typeof(AbpAutofacModule))]
public class AbpDapperTestModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
}
}
}

@ -0,0 +1,10 @@
namespace Volo.Abp.Dapper
{
public abstract class DapperTestBase : AbpIntegratedTest<AbpDapperTestModule>
{
protected override void SetAbpApplicationCreationOptions(AbpApplicationCreationOptions options)
{
options.UseAutofac();
}
}
}

@ -0,0 +1,30 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Dapper;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Repositories.Dapper;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.TestApp.EntityFrameworkCore;
namespace Volo.Abp.Dapper.Repositories
{
public class PersonDapperRepository : DapperRepository<TestAppDbContext>, ITransientDependency
{
public PersonDapperRepository(IDbContextProvider<TestAppDbContext> dbContextProvider) : base(dbContextProvider)
{
}
public virtual async Task<List<string>> GetAllPersonNames()
{
return (await DbConnection.QueryAsync<string>("select Name from People", transaction: DbTransaction))
.ToList();
}
public virtual async Task<int> UpdatePersonNames(string name)
{
return await DbConnection.ExecuteAsync("update People set Name = @NewName", new {NewName = name},
DbTransaction);
}
}
}

@ -0,0 +1,52 @@
using System.Threading.Tasks;
using Shouldly;
using Volo.Abp.TestApp;
using Volo.Abp.Uow;
using Xunit;
namespace Volo.Abp.Dapper.Repositories
{
public class PersonDapperRepository_Tests : DapperTestBase
{
[Fact]
public async Task GetAllPersonNames_Test()
{
var allNames = await GetRequiredService<PersonDapperRepository>().GetAllPersonNames();
allNames.ShouldNotBeEmpty();
allNames.ShouldContain(x => x == "Douglas");
allNames.ShouldContain(x => x == "John-Deleted");
allNames.ShouldContain(x => x == $"{TestDataBuilder.TenantId1}-Person1");
allNames.ShouldContain(x => x == $"{TestDataBuilder.TenantId1}-Person2");
}
[Fact]
public async Task UpdatePersonNames_Test()
{
var personDapperRepository = GetRequiredService<PersonDapperRepository>();
await personDapperRepository.UpdatePersonNames("test");
var allNames = await personDapperRepository.GetAllPersonNames();
allNames.ShouldNotBeEmpty();
allNames.ShouldAllBe(x => x == "test");
}
[Fact]
public async Task Dapper_Transaction_Test()
{
var unitOfWorkManager = GetRequiredService<IUnitOfWorkManager>();
var personDapperRepository = GetRequiredService<PersonDapperRepository>();
using (var uow = unitOfWorkManager.Begin(new UnitOfWorkOptions
{
IsTransactional = true
}))
{
await personDapperRepository.UpdatePersonNames("test");
await uow.RollbackAsync();
}
var allNames = await personDapperRepository.GetAllPersonNames();
allNames.ShouldAllBe(x => x != "test");
}
}
}

@ -4,8 +4,6 @@ var gulp = require("gulp"),
path = require('path'),
copyResources = require('./node_modules/@abp/aspnetcore.mvc.ui/gulp/copy-resources.js');
copyResources.init(path.resolve('./'));
gulp.task('default', [copyResources.taskName], function () {
});
exports.default = function(){
return copyResources(path.resolve('./'));
};

@ -3,7 +3,7 @@
"name": "volo.blogtestapp",
"private": true,
"dependencies": {
"@abp/aspnetcore.mvc.ui.theme.basic": "^0.4.9",
"@abp/blogging": "^0.4.9"
"@abp/aspnetcore.mvc.ui.theme.basic": "^0.6.5",
"@abp/blogging": "^0.6.5"
}
}
}

@ -0,0 +1,56 @@
@keyframes spin {
0% {
transform: translateZ(0) rotate(0deg);
}
100% {
transform: translateZ(0) rotate(360deg);
}
}
.abp-block-area {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 999999999;
background-color: #fff;
opacity: .8;
transition: opacity .25s;
}
.abp-block-area.abp-block-area-disappearing {
opacity: 0;
}
.abp-block-area.abp-block-area-busy:after {
content: attr(data-text);
display: block;
max-width: 125px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 20px;
font-family: sans-serif;
color: #343a40;
text-align: center;
text-transform: uppercase;
}
.abp-block-area.abp-block-area-busy:before {
content: "";
display: block;
width: 150px;
height: 150px;
border-radius: 50%;
border-width: 2px;
border-style: solid;
border-color: transparent #228ae6 #228ae6 #228ae6;
position: absolute;
top: calc(50% - 75px);
left: calc(50% - 75px);
will-change: transform;
animation: spin .75s infinite ease-in-out;
}

@ -161,6 +161,25 @@ var abp = abp || {};
abp.auth.setToken();
}
/* SETTINGS *************************************************/
abp.setting = abp.setting || {};
abp.setting.values = abp.setting.values || {};
abp.setting.get = function (name) {
return abp.setting.values[name];
};
abp.setting.getBoolean = function (name) {
var value = abp.setting.get(name);
return value == 'true' || value == 'True';
};
abp.setting.getInt = function (name) {
return parseInt(abp.setting.values[name]);
};
/* NOTIFICATION *********************************************/
//Defines Notification API, not implements it
@ -227,25 +246,96 @@ var abp = abp || {};
abp.ui = abp.ui || {};
/* UI BLOCK */
//Defines UI Block API, not implements it
//Defines UI Block API and implements basically
var $abpBlockArea = document.createElement('div');
$abpBlockArea.classList.add('abp-block-area');
/* opts: { //Can be an object with options or a string for query a selector
* elm: a query selector (optional - default: document.body)
* busy: boolean (optional - default: false)
* promise: A promise with always or finally handler (optional - auto unblocks the ui if provided)
* }
*/
abp.ui.block = function (opts) {
if (!opts) {
opts = {};
} else if (typeof opts == 'string') {
opts = {
elm: opts
};
}
abp.ui.block = function (elm) {
abp.log.warn('abp.ui.block is not implemented!');
var $elm = document.querySelector(opts.elm) || document.body;
if (opts.busy) {
$abpBlockArea.classList.add('abp-block-area-busy');
} else {
$abpBlockArea.classList.remove('abp-block-area-busy');
}
if (document.querySelector(opts.elm)) {
$abpBlockArea.style.position = 'absolute';
} else {
$abpBlockArea.style.position = 'fixed';
}
$elm.appendChild($abpBlockArea);
if (opts.promise) {
if (opts.promise.always) { //jQuery.Deferred style
opts.promise.always(function () {
abp.ui.unblock({
$elm: opts.elm
});
});
} else if (opts.promise['finally']) { //Q style
opts.promise['finally'](function () {
abp.ui.unblock({
$elm: opts.elm
});
});
}
}
};
abp.ui.unblock = function (elm) {
abp.log.warn('abp.ui.unblock is not implemented!');
/* opts: {
*
* }
*/
abp.ui.unblock = function (opts) {
var element = document.querySelector('.abp-block-area');
if (element) {
element.classList.add('abp-block-area-disappearing');
setTimeout(function () {
if (element) {
element.classList.remove('abp-block-area-disappearing');
element.parentElement.removeChild(element);
}
}, 250);
}
};
/* UI BUSY */
//Defines UI Busy API, not implements it
abp.ui.setBusy = function (elm, optionsOrPromise) {
abp.log.warn('abp.ui.setBusy is not implemented!');
abp.ui.setBusy = function (opts) {
if (!opts) {
opts = {
busy: true
};
} else if (typeof opts == 'string') {
opts = {
elm: opts,
busy: true
};
}
abp.ui.block(opts);
};
abp.ui.clearBusy = function (elm) {
abp.log.warn('abp.ui.clearBusy is not implemented!');
abp.ui.clearBusy = function (opts) {
abp.ui.unblock(opts);
};
/* SIMPLE EVENT BUS *****************************************/

@ -4,6 +4,7 @@ table.dataTable {
margin-bottom: 6px !important;
max-width: none !important;
border-collapse: separate !important;
border-spacing: 0;
}
table.dataTable td,
table.dataTable th {
@ -25,7 +26,7 @@ div.dataTables_wrapper div.dataTables_length label {
white-space: nowrap;
}
div.dataTables_wrapper div.dataTables_length select {
width: 75px;
width: auto;
display: inline-block;
}
div.dataTables_wrapper div.dataTables_filter {
@ -132,6 +133,9 @@ div.dataTables_scrollBody table {
margin-top: 0 !important;
margin-bottom: 0 !important;
}
div.dataTables_scrollBody table thead .sorting:before,
div.dataTables_scrollBody table thead .sorting_asc:before,
div.dataTables_scrollBody table thead .sorting_desc:before,
div.dataTables_scrollBody table thead .sorting:after,
div.dataTables_scrollBody table thead .sorting_asc:after,
div.dataTables_scrollBody table thead .sorting_desc:after {

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save