@ -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 |
|||
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 6.7 KiB |
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 35 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 58 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 153 KiB |
|
After Width: | Height: | Size: 146 KiB |
|
After Width: | Height: | Size: 144 KiB |
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 31 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 40 KiB |
|
After Width: | Height: | Size: 45 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 154 KiB |
|
After Width: | Height: | Size: 69 KiB |
|
After Width: | Height: | Size: 77 KiB |
|
After Width: | Height: | Size: 53 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 6.4 KiB |
|
After Width: | Height: | Size: 6.3 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 6.3 KiB |
|
After Width: | Height: | Size: 6.3 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
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. |
|||
|
|||
 |
|||
|
|||
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. |
|||
|
After Width: | Height: | Size: 13 KiB |
@ -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,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); |
|||
@ -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(); |
|||
} |
|||
} |
|||
} |
|||
@ -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; } |
|||
} |
|||
} |
|||
@ -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"); |
|||
} |
|||
} |
|||
} |
|||
@ -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; |
|||
} |
|||