Skip to content

Commit

Permalink
update documents, add readme for packages (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
StardustDL authored May 30, 2021
1 parent 58bbe8e commit 9599239
Show file tree
Hide file tree
Showing 15 changed files with 81 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
38 changes: 30 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -141,12 +143,32 @@ class CustomBlazorUIProvider : BlazorUIProvider
{
}
}
```

Then use the provider.

#### In WebAssembly

```cs
builder.Services.AddModules(builder =>
{
builder.UseRazorComponentClientModules().AddBlazorUI<CustomBlazorUIProvider>();
});
```

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<CustomBlazorUIProvider>();
// builder.UseRazorComponentClientModules().AddClientSideBlazorUI<CustomBlazorUIProvider>();
});

// void Configure(IApplicationBuilder app, IWebHostEnvironment env)
Expand Down Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
<PackageProjectUrl>https://github.com/StardustDL/modulight</PackageProjectUrl>
<RepositoryUrl>https://github.com/StardustDL/modulight</RepositoryUrl>
<RepositoryType>Git</RepositoryType>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageTags>blazor;razor-components;razor;modular</PackageTags>
</PropertyGroup>

<ItemGroup>
Expand All @@ -26,4 +28,8 @@
<ProjectReference Include="..\Modulight.Modules.Core\Modulight.Modules.Core.csproj" />
</ItemGroup>

<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="\" />
</ItemGroup>

</Project>
2 changes: 2 additions & 0 deletions src/Modulight.Modules.Client.RazorComponents/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Modulight.Modules.RazorComponents

6 changes: 6 additions & 0 deletions src/Modulight.Modules.Core/Modulight.Modules.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
<PackageProjectUrl>https://github.com/StardustDL/modulight</PackageProjectUrl>
<RepositoryUrl>https://github.com/StardustDL/modulight</RepositoryUrl>
<RepositoryType>Git</RepositoryType>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageTags>modular</PackageTags>
</PropertyGroup>

<ItemGroup>
Expand All @@ -21,6 +23,10 @@
<PackageReference Include="Microsoft.Extensions.Options" Version="5.0.0" />
</ItemGroup>

<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="\"/>
</ItemGroup>

<ItemGroup>
<SupportedPlatform Include="browser" />
</ItemGroup>
Expand Down
2 changes: 2 additions & 0 deletions src/Modulight.Modules.Core/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Modulight.Modules.Core

Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
<PackageProjectUrl>https://github.com/StardustDL/modulight</PackageProjectUrl>
<RepositoryUrl>https://github.com/StardustDL/modulight</RepositoryUrl>
<RepositoryType>Git</RepositoryType>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageTags>aspnet;modular</PackageTags>
</PropertyGroup>

<ItemGroup>
Expand All @@ -22,4 +24,8 @@
<ProjectReference Include="..\Modulight.Modules.Core\Modulight.Modules.Core.csproj" />
</ItemGroup>

<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="\"/>
</ItemGroup>

</Project>
2 changes: 2 additions & 0 deletions src/Modulight.Modules.Server.AspNet/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Modulight.Modules.Server.AspNet

Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
<PackageProjectUrl>https://github.com/StardustDL/modulight</PackageProjectUrl>
<RepositoryUrl>https://github.com/StardustDL/modulight</RepositoryUrl>
<RepositoryType>Git</RepositoryType>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageTags>graphql;modular</PackageTags>
</PropertyGroup>

<ItemGroup>
Expand All @@ -23,4 +25,8 @@
<ProjectReference Include="..\Modulight.Modules.Core\Modulight.Modules.Core.csproj" />
</ItemGroup>

<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="\"/>
</ItemGroup>

</Project>
2 changes: 2 additions & 0 deletions src/Modulight.Modules.Server.GraphQL/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Modulight.Modules.GraphQL

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
Expand All @@ -14,6 +14,8 @@
<RepositoryType>Git</RepositoryType>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Description>Support ASP.NET hosting for Modulight.UI.Blazor.</Description>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageTags>blazor;razor-components;razor;aspnet;modular</PackageTags>
</PropertyGroup>

<ItemGroup>
Expand All @@ -31,4 +33,8 @@
<ProjectReference Include="..\Modulight.UI.Blazor\Modulight.UI.Blazor.csproj" />
</ItemGroup>

<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="\"/>
</ItemGroup>

</Project>
2 changes: 2 additions & 0 deletions src/Modulight.UI.Blazor.Hosting/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Modulight.UI.Blazor.Hosting

6 changes: 6 additions & 0 deletions src/Modulight.UI.Blazor/Modulight.UI.Blazor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
<RepositoryType>Git</RepositoryType>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Description>Provide user interfaces for blazor client module hosting.</Description>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageTags>blazor;razor-components;razor;modular</PackageTags>
</PropertyGroup>

<ItemGroup>
Expand All @@ -27,4 +29,8 @@
<PackageReference Include="Microsoft.AspNetCore.Components.Web.Extensions" Version="5.0.0-preview9.20513.1" />
</ItemGroup>

<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="\"/>
</ItemGroup>

</Project>
2 changes: 2 additions & 0 deletions src/Modulight.UI.Blazor/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Modulight.UI.Blazor

0 comments on commit 9599239

Please sign in to comment.