XS Blazor UI Components - Maintenance Guide
1. Synopsis
-
This document describes the process for maintaining the
XS.Lib.Blazor.UIComponentslibrary. -
Refer to the Developers Guide for usage.
2. Requirements
2.2. Visual Studio 2022
-
Refer to the Visual Studio Install doc.
2.3. Node.js
-
Download and install the latest node.js for Windows.
-
Open a cmd window to install jQuery:
npm i --save-dev @types/jquery (1) npm i --save-dev @types/bootstrap (2) npm install -g typescript npm install @types/blazor1 Install jQuery. 2 Bootstrap may not be needed.
3. Custom UI Component Library Project Setup
3.1. TypeScript (node.js)
3.1.2. Install
-
Install Node.js.
-
Install the
Microsoft.TypeScript.MSBuildpackage from NuGet:Install-Package Microsoft.TypeScript.MSBuild -
Create a tsconfig.json file which specifies the target version of JavaScript that the transpiler will compile to:
Expand for tsconfig.json source
{ "compilerOptions": { "target": "ES2018", "module": "ES2020", "sourceMap": true, "pretty": true, "esModuleInterop": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true }, "include": ["wwwroot/js/*.ts"], "compileOnSave": true, "$schema": "https://json.schemastore.org/tsconfig", "display": "Recommended" } -
Update the
.csprojfile with aTypeScriptCompiletag that will point to our .ts files:Expand for .csproj source
<ItemGroup> <None Include="compilerconfig.json" /> <None Include="tsconfig.json" /> <None Include="XS-icon-512x512.png"> <Pack>True</Pack> <PackagePath></PackagePath> </None> <PackageReference Include="BuildWebCompiler" Version="1.12.405" /> <PackageReference Include="ClosedXML" Version="0.105.0" /> <PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="9.0.5" /> <PackageReference Include="Microsoft.TypeScript.MSBuild" Version="5.8.3"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> </PackageReference> <PackageReference Include="System.Linq.Dynamic.Core" Version="1.6.5" /> <PackageReference Include="YamlDotNet" Version="16.3.0" /> <!--Points to our TypeScript files which will be compiled to Javascript--> <TypeScriptCompile Include="wwwroot/js/*.ts" /> (1) <Compile Remove="docs\**" /> <Compile Remove="Services\**" /> <Content Remove="docs\**" /> <Content Remove="Services\**" /> <EmbeddedResource Remove="docs\**" /> <EmbeddedResource Remove="Services\**" /> <None Remove="docs\**" /> <None Remove="Services\**" /> <TypeScriptCompile Remove="docs\**" /> <TypeScriptCompile Remove="Services\**" /> </ItemGroup>1 Points to our TypeScript files which will be compiled to Javascript. This is probably not needed since the tsconfig.json has an includekey.
3.2. SCSS (Web Compiler)
-
Install the
Web Compilerextension
-
Click on
-
Search for
Web Compiler 2022 -
Click on the Install button
-
Now close Visual Studio and wait for the installer to appear. Follow the steps to install the extension.
It can take a few seconds for the installer to appear. Wait for the installer to finish before re-opening Visual Studio.
-
Follow this link which contains instructions on how to set up Sass compilation for Blazor .
3.3. NuGet Setup
-
Source documentation can be found here
3.3.1. Private NuGet Server Setup
-
How to set up a Nuget Server on IIS .
3.3.2. Exclude Files from the NuGet Package
-
For files that should not be included in the package (e.g., the following files), change the Build Action from
ContenttoNone.-
compilerconfig.json
-
tsconfig.json
-
3.3.3. Create NuGet Package
General instructions can be found here.
Set Package Properties
-
Right mouse click on the
Com.XS.Lib.UI.Blazorproject and selectProperties. -
Select
Packagein the left menu. Alter package settings as needed using the following as a guide:Setting Value Package ID
XS.Lib.Blazor.UIComponents
Package Title
XS Blazor UI Component Library
Package Version
1.0.6
Authors
Codey Martinez
Company
Xackley! Studio, LLC
Product
XS Blazor UI Component Library
Description
A UI Component Library for Microsoft’s Blazor free and open-source web framework.
Build Package
-
Confirm that you are building a
Releasebuild. -
Right mouse click on the
Com.XS.Lib.UI.Blazorproject and selectPackwhich will build the NuGet Package.
Push Package to a NuGet Repo
| Currently hosting on MyGet. |
-
Right mouse click on the
Com.XS.Lib.UI.Blazorproject and select Open in Terminal. -
This will leave you in
…\Com.XS.Lib.UI.Blazor\Com.XS.Lib.UI.Blazor. -
Now go to
bin\Release:cd .\bin\Release\ -
This will leave you in
…\Com.XS.Lib.UI.Blazor\Com.XS.Lib.UI.Blazor\bin\Release. -
There should be packages named
XS.Lib.Blazor.UIComponents.x.x.x.nupkghere. -
Push the package to the appropriate repo:
-
MyGet
Command to Rundotnet nuget push XS.Lib.Blazor.UIComponents.1.0.1.nupkg --api-key 1cf63307-027a-4f3a-962e-30ab3ca8a29e --source https://www.myget.org/F/xs/api/v2/package (1)Sample OutputPushing XS.Lib.Blazor.UIComponents.0.0.1-rc.1.nupkg to 'https://www.myget.org/F/xs/api/v2/package'... (2) PUT https://www.myget.org/F/xs/api/v2/package/ Created https://www.myget.org/F/xs/api/v2/package/ 1244ms Your package was pushed. (3)1 Modify this command using the current package name e.g., XS.Lib.Blazor.UIComponents.1.0.17.nupkgand the actualAPI Access Token.2 Output 3 Confirmation -
GitHub
Not fully researched yet. This is incomplete! dotnet nuget push "bin/Release/XS.Lib.Blazor.UIComponents.0.0.1-rc.1.nupkg" --api-key YOUR_GITHUB_PAT --source "github" -
NuGet
TBA -
Private Xackley! Studio, LLC Nuget Server
dotnet nuget push XS.Lib.Blazor.UIComponents.0.0.1-rc.1.nupkg --api-key 0074340892234 --source https://nuget.xackleystudio.com/nuget
-
View a NuGet Package Repo
-
After pushing your package to MyGet (or one of the other package repos), it can be viewed via:
-
MyGet
-
NuGet
TBA -
Private
Xackley! Studio, LLCNuget Server
-
Delete a NuGet Package from Repo
-
To delete a package from a remote package repo
It may take a few minutes for a package to be deleted due to caching. -
MyGet
dotnet nuget delete XS.Lib.Blazor.UIComponents 0.0.1 --api-key 1cf63307-027a-4f3a-962e-30ab3ca8a29e --source https://www.myget.org/F/xs/api/v2/package
-
4. References
4.1. CSS Reference Material
4.1.1. CSS Functions
-
A Guide to CSS Functions.
4.1.2. Additional CSS
-
Add Light-Modal
4.2. Bootstrap
4.2.1. Bootstrap Themes can be found here
-
The following sites can be used for inspiration when creating custom themes:
4.2.3. Favicon Generator
-
While there are no favicons in this UI Library, they can be generated for the Blazor project that consumes this library.
-
Go to Favicon IO Generator.
5. To Do
5.1. Graphs
-
Research using Conic Gradients for Doughnut Charts.
-
Understand the JavaScript.
-
Wrap the JavaScript as a Blazor component.