From 9599239f22f57c9e9767f188ef3b18cc1e5c2829 Mon Sep 17 00:00:00 2001 From: StardustDL <34736356+StardustDL@users.noreply.github.com> Date: Sun, 30 May 2021 13:46:09 +0800 Subject: [PATCH] update documents, add readme for packages (#54) #45 #47 --- .github/workflows/ci.yml | 2 +- .github/workflows/release.yml | 2 +- README.md | 38 +++++++++++++++---- ...ight.Modules.Client.RazorComponents.csproj | 6 +++ .../README.md | 2 + .../Modulight.Modules.Core.csproj | 6 +++ src/Modulight.Modules.Core/README.md | 2 + .../Modulight.Modules.Server.AspNet.csproj | 6 +++ src/Modulight.Modules.Server.AspNet/README.md | 2 + .../Modulight.Modules.Server.GraphQL.csproj | 6 +++ .../README.md | 2 + .../Modulight.UI.Blazor.Hosting.csproj | 8 +++- src/Modulight.UI.Blazor.Hosting/README.md | 2 + .../Modulight.UI.Blazor.csproj | 6 +++ src/Modulight.UI.Blazor/README.md | 2 + 15 files changed, 81 insertions(+), 11 deletions(-) create mode 100644 src/Modulight.Modules.Client.RazorComponents/README.md create mode 100644 src/Modulight.Modules.Core/README.md create mode 100644 src/Modulight.Modules.Server.AspNet/README.md create mode 100644 src/Modulight.Modules.Server.GraphQL/README.md create mode 100644 src/Modulight.UI.Blazor.Hosting/README.md create mode 100644 src/Modulight.UI.Blazor/README.md diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b59b43a..7ea8aaa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,7 +50,7 @@ jobs: NUGET_AUTH_TOKEN: ${{ secrets.NUGET_TOKEN }} run: ./build.ps1 -e -t Deploy-Packages - name: Deploy documents - uses: JamesIves/github-pages-deploy-action@4.1.1 + uses: JamesIves/github-pages-deploy-action@4.1.3 with: token: ${{ secrets.PA_TOKEN }} branch: gh-pages diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 26c3a1b..13fe988 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,7 +41,7 @@ jobs: name: artifacts path: ./dist - name: Deploy documents - uses: JamesIves/github-pages-deploy-action@4.1.1 + uses: JamesIves/github-pages-deploy-action@4.1.3 with: token: ${{ secrets.PA_TOKEN }} branch: gh-pages diff --git a/README.md b/README.md index 3203471..354e144 100644 --- a/README.md +++ b/README.md @@ -130,9 +130,11 @@ app.UseEndpoints(endpoints => Modulight provide a template project for Blazor hosting with Razor Component Client modules. -Use package [Modulight.UI.Blazor ![](https://buildstats.info/nuget/Modulight.UI.Blazor?includePreReleases=true)](https://www.nuget.org/packages/Modulight.UI.Blazor/) and [Modulight.UI.Blazor.Hosting ![](https://buildstats.info/nuget/Modulight.UI.Blazor.Hosting?includePreReleases=true)](https://www.nuget.org/packages/Modulight.UI.Blazor.Hosting/) to try it. +Use the package [Modulight.UI.Blazor ![](https://buildstats.info/nuget/Modulight.UI.Blazor?includePreReleases=true)](https://www.nuget.org/packages/Modulight.UI.Blazor/) to try it. -It provides a navigation layout generated by client modules, and supports prerendering. +It provides a navigation layout generated by client modules. + +First implement a custom Blazor UI provider. ```cs class CustomBlazorUIProvider : BlazorUIProvider @@ -141,12 +143,32 @@ class CustomBlazorUIProvider : BlazorUIProvider { } } +``` + +Then use the provider. + +#### In WebAssembly +```cs +builder.Services.AddModules(builder => +{ + builder.UseRazorComponentClientModules().AddBlazorUI(); +}); +``` + +A [Sample startup](https://github.com/StardustDL/modulight/blob/master/test/Test.Modulights.UI.Wasm/Program.cs). + +#### In ASP.NET Hosting + +It needs the package [Modulight.UI.Blazor.Hosting ![](https://buildstats.info/nuget/Modulight.UI.Blazor.Hosting?includePreReleases=true)](https://www.nuget.org/packages/Modulight.UI.Blazor.Hosting/) to support prerendering. + +```cs // void ConfigureServices(IServiceCollection services) services.AddModules(builder => { builder.UseRazorComponentClientModules().AddServerSideBlazorUI(); + // builder.UseRazorComponentClientModules().AddClientSideBlazorUI(); }); // void Configure(IApplicationBuilder app, IWebHostEnvironment env) @@ -182,13 +204,13 @@ They are based on nightly build package at: ### Use a client module in Blazor websites -- [ModulePageLayout.razor](https://github.com/StardustDL/delights/blob/master/src/Delights.UI/Shared/ModulePageLayout.razor) Layout and container for module pages. -- [App.razor](https://github.com/StardustDL/delights/blob/master/src/Delights.UI/App.razor) Lazy loading for js/css/sassemblies when routing. -- [UIModule.cs](https://github.com/StardustDL/delights/blob/master/src/Delights.UI/UIModule.cs) Definition of JS/CSS resources. +- [ModulePageLayout.razor](https://github.com/StardustDL/modulight/blob/master/src/Modulight.UI.Blazor/Layouts/ModulePageLayout.razor) Layout and container for module pages. +- [App.razor](https://github.com/StardustDL/modulight/blob/master/src/Modulight.UI.Blazor/App.razor) Lazy loading for js/css/sassemblies when routing. +- [AntDesignModule.cs](https://github.com/StardustDL/razorcomponents/blob/master/src/AntDesigns/AntDesignModule.cs) Definition of JS/CSS resources. - [ModuleSetup.cs](https://github.com/StardustDL/delights/blob/master/src/Delights.Client.Shared/ModuleSetup.cs) Use modules in client. -- [Startup.cs](https://github.com/StardustDL/delights/blob/master/src/Delights.Client/Startup.cs) Blazor Server hosting. -- [Program.cs](https://github.com/StardustDL/delights/blob/master/src/Delights.Client.WebAssembly/Program.cs) Blazor WebAssembly hosting. -- [index.html](https://github.com/StardustDL/delights/blob/master/src/Delights.Client.WebAssembly/wwwroot/index.html) Clean index.html. +- [Startup.cs](https://github.com/StardustDL/modulight/blob/master/test/Test.Modulights.UI/Startup.cs) Blazor Server hosting. +- [Program.cs](https://github.com/StardustDL/modulight/blob/master/test/Test.Modulights.UI.Wasm/Program.cs) Blazor WebAssembly hosting. +- [index.html](https://github.com/StardustDL/modulight/blob/master/test/Test.Modulights.UI.Wasm/wwwroot/index.html) Clean index.html. ### Use a GraphQL server module diff --git a/src/Modulight.Modules.Client.RazorComponents/Modulight.Modules.Client.RazorComponents.csproj b/src/Modulight.Modules.Client.RazorComponents/Modulight.Modules.Client.RazorComponents.csproj index 4f7294c..c0254d2 100644 --- a/src/Modulight.Modules.Client.RazorComponents/Modulight.Modules.Client.RazorComponents.csproj +++ b/src/Modulight.Modules.Client.RazorComponents/Modulight.Modules.Client.RazorComponents.csproj @@ -12,6 +12,8 @@ https://github.com/StardustDL/modulight https://github.com/StardustDL/modulight Git + README.md + blazor;razor-components;razor;modular @@ -26,4 +28,8 @@ + + + + diff --git a/src/Modulight.Modules.Client.RazorComponents/README.md b/src/Modulight.Modules.Client.RazorComponents/README.md new file mode 100644 index 0000000..07432c7 --- /dev/null +++ b/src/Modulight.Modules.Client.RazorComponents/README.md @@ -0,0 +1,2 @@ +# Modulight.Modules.RazorComponents + diff --git a/src/Modulight.Modules.Core/Modulight.Modules.Core.csproj b/src/Modulight.Modules.Core/Modulight.Modules.Core.csproj index a2bb46d..d12f6ad 100644 --- a/src/Modulight.Modules.Core/Modulight.Modules.Core.csproj +++ b/src/Modulight.Modules.Core/Modulight.Modules.Core.csproj @@ -13,6 +13,8 @@ https://github.com/StardustDL/modulight https://github.com/StardustDL/modulight Git + README.md + modular @@ -21,6 +23,10 @@ + + + + diff --git a/src/Modulight.Modules.Core/README.md b/src/Modulight.Modules.Core/README.md new file mode 100644 index 0000000..6c48e79 --- /dev/null +++ b/src/Modulight.Modules.Core/README.md @@ -0,0 +1,2 @@ +# Modulight.Modules.Core + diff --git a/src/Modulight.Modules.Server.AspNet/Modulight.Modules.Server.AspNet.csproj b/src/Modulight.Modules.Server.AspNet/Modulight.Modules.Server.AspNet.csproj index d572bd3..58c1426 100644 --- a/src/Modulight.Modules.Server.AspNet/Modulight.Modules.Server.AspNet.csproj +++ b/src/Modulight.Modules.Server.AspNet/Modulight.Modules.Server.AspNet.csproj @@ -12,6 +12,8 @@ https://github.com/StardustDL/modulight https://github.com/StardustDL/modulight Git + README.md + aspnet;modular @@ -22,4 +24,8 @@ + + + + diff --git a/src/Modulight.Modules.Server.AspNet/README.md b/src/Modulight.Modules.Server.AspNet/README.md new file mode 100644 index 0000000..89dc701 --- /dev/null +++ b/src/Modulight.Modules.Server.AspNet/README.md @@ -0,0 +1,2 @@ +# Modulight.Modules.Server.AspNet + diff --git a/src/Modulight.Modules.Server.GraphQL/Modulight.Modules.Server.GraphQL.csproj b/src/Modulight.Modules.Server.GraphQL/Modulight.Modules.Server.GraphQL.csproj index 03f37ac..cd6ad35 100644 --- a/src/Modulight.Modules.Server.GraphQL/Modulight.Modules.Server.GraphQL.csproj +++ b/src/Modulight.Modules.Server.GraphQL/Modulight.Modules.Server.GraphQL.csproj @@ -12,6 +12,8 @@ https://github.com/StardustDL/modulight https://github.com/StardustDL/modulight Git + README.md + graphql;modular @@ -23,4 +25,8 @@ + + + + diff --git a/src/Modulight.Modules.Server.GraphQL/README.md b/src/Modulight.Modules.Server.GraphQL/README.md new file mode 100644 index 0000000..7bb015f --- /dev/null +++ b/src/Modulight.Modules.Server.GraphQL/README.md @@ -0,0 +1,2 @@ +# Modulight.Modules.GraphQL + diff --git a/src/Modulight.UI.Blazor.Hosting/Modulight.UI.Blazor.Hosting.csproj b/src/Modulight.UI.Blazor.Hosting/Modulight.UI.Blazor.Hosting.csproj index 325ff64..0ce244d 100644 --- a/src/Modulight.UI.Blazor.Hosting/Modulight.UI.Blazor.Hosting.csproj +++ b/src/Modulight.UI.Blazor.Hosting/Modulight.UI.Blazor.Hosting.csproj @@ -1,4 +1,4 @@ - + net5.0 @@ -14,6 +14,8 @@ Git true Support ASP.NET hosting for Modulight.UI.Blazor. + README.md + blazor;razor-components;razor;aspnet;modular @@ -31,4 +33,8 @@ + + + + diff --git a/src/Modulight.UI.Blazor.Hosting/README.md b/src/Modulight.UI.Blazor.Hosting/README.md new file mode 100644 index 0000000..0feeed0 --- /dev/null +++ b/src/Modulight.UI.Blazor.Hosting/README.md @@ -0,0 +1,2 @@ +# Modulight.UI.Blazor.Hosting + diff --git a/src/Modulight.UI.Blazor/Modulight.UI.Blazor.csproj b/src/Modulight.UI.Blazor/Modulight.UI.Blazor.csproj index be29bb0..c6a5956 100644 --- a/src/Modulight.UI.Blazor/Modulight.UI.Blazor.csproj +++ b/src/Modulight.UI.Blazor/Modulight.UI.Blazor.csproj @@ -13,6 +13,8 @@ Git true Provide user interfaces for blazor client module hosting. + README.md + blazor;razor-components;razor;modular @@ -27,4 +29,8 @@ + + + + diff --git a/src/Modulight.UI.Blazor/README.md b/src/Modulight.UI.Blazor/README.md new file mode 100644 index 0000000..f119122 --- /dev/null +++ b/src/Modulight.UI.Blazor/README.md @@ -0,0 +1,2 @@ +# Modulight.UI.Blazor +