-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
105 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE topic SYSTEM "https://resources.jetbrains.com/writerside/1.0/xhtml-entities.dtd"> | ||
<topic xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="https://resources.jetbrains.com/writerside/1.0/topic.v2.xsd" | ||
id="Create-a-Blazor-App" title="Create a Blazor App with MasterCommander"> | ||
|
||
<title>[WIP] Create a Blazor App with MasterCommander</title> | ||
|
||
<chapter id="Overview" title="Overview"> | ||
<p>Creating a Blazor app is an exciting and engaging experience. With the help of MasterCommander's <code>InitializeBlazorAppAsync</code> method, you can streamline the process and get started even faster. This documentation outlines how to use this method to create a new Blazor app and configure it for development.</p> | ||
</chapter> | ||
|
||
<chapter id="Prerequisites" title="Prerequisites"> | ||
<p>Before you begin, ensure you have the following installed:</p> | ||
<list type="decimal"> | ||
<li>.NET 8 SDK or later</li> | ||
<li>Git command line tool</li> | ||
<li>Visual Studio Code or another code editor</li> | ||
<li>A modern web browser (Chrome, Firefox, Edge, etc.)</li> | ||
</list> | ||
</chapter> | ||
|
||
<chapter id="Process-Description" title="Step-by-Step Process"> | ||
<p>The <code>InitializeBlazorAppAsync</code> method automates the creation of a new Blazor app, configures it within a solution, and prepares it for development. It simplifies several steps into a single asynchronous operation, improving developer productivity.</p> | ||
</chapter> | ||
|
||
<chapter id="Sequence-Diagram" title="Sequence Diagram"> | ||
<p>The following sequence diagram illustrates the process executed by the <code>InitializeBlazorAppAsync</code> method:</p> | ||
<code-block lang="plantuml"> | ||
@startuml | ||
actor Developer | ||
participant "MasterCommander API" as API | ||
participant "Git CLI" as Git | ||
participant "Dotnet CLI" as Dotnet | ||
participant "FileSystem" as FS | ||
|
||
Developer -> API: Initialize Blazor App Async | ||
API -> FS : Set Working Directory | ||
API -> API: Display Startup Message Async | ||
API -> Git: git init Async | ||
Git -> API: Repo Initialized | ||
API -> Dotnet: dotnet new gitignore Async | ||
API -> Dotnet: dotnet new editorconfig Async | ||
API -> Dotnet: dotnet new nugetconfig Async | ||
API -> Dotnet: dotnet new globaljson\n(SdkVersion = "8.0.101") Async | ||
API -> Dotnet: dotnet new blazorwebassembly\n(OutputName = "BlazorAppDemo") Async | ||
API -> Dotnet: dotnet sln\n(OutputName = "BlazorAppDemo") Async | ||
API -> Dotnet: dotnet sln add "BlazorAppDemo.csproj" Async | ||
API -> Git: git add "*" Async | ||
API -> Git: git commit "Initial commit" Async | ||
API -> Dotnet: dotnet build Async | ||
API -> Dotnet: dotnet build\n(Configuration = "Release") Async | ||
API -> Dotnet: dotnet run\n(Project = "BlazorAppDemo.csproj", Configuration = "Release") Async | ||
API -> FS: Open Browser | ||
|
||
note right of API: Asynchronous operations are denoted\nby "Async" for clarity. | ||
note right of API: Open Browser step matches the C# method's action. | ||
@enduml | ||
</code-block> | ||
<p>This diagram provides a visual representation of the interactions between the developer, MasterCommander API, and other components during Blazor app initialization.</p> | ||
</chapter> | ||
|
||
<chapter id="Example-Implementation" title="Example Implementation"> | ||
<p>The following C# code snippet shows a practical implementation of the <code>InitializeBlazorAppAsync</code> method:</p> | ||
<code-block lang="c#"> | ||
public async Task InitializeBlazorAppAsync() | ||
{ | ||
SetWorkingDirectory(); | ||
|
||
console.WriteStartupMessage(); | ||
|
||
await git.InitAsync(); | ||
|
||
await dotnet.NewAsync(new DotnetNewGitignoreOptions()); | ||
await dotnet.NewAsync(new DotnetNewEditorConfigOptions()); | ||
await dotnet.NewAsync(new DotnetNewNuGetConfigOptions()); | ||
await dotnet.NewAsync(new DotnetNewGlobalJsonOptions { SdkVersion = SdkVersion }); | ||
await dotnet.NewAsync(new DotnetNewBlazorWebAssemblyOptions { OutputName = BlazorAppName }); | ||
await dotnet.NewAsync(new DotnetNewSolutionOptions { OutputName = BlazorAppName }); | ||
await dotnet.SlnAddAsync(BlazorAppCsproj); | ||
|
||
await git.AddAsync("*"); | ||
await git.CommitAsync("Initial commit"); | ||
|
||
await dotnet.BuildAsync(); | ||
await dotnet.BuildAsync(new DotnetBuildOptions { Configuration = "Release" }); | ||
await dotnet.RunAsync(new DotnetRunOptions { Project = BlazorAppCsproj, Configuration = "Release" }); | ||
|
||
OpenBrowser(); | ||
} | ||
</code-block> | ||
</chapter> | ||
|
||
<chapter id="Conclusion-and-Next-Steps" title="Conclusion and Next Steps"> | ||
<p>By following the steps outlined in this documentation, you have successfully created a Blazor app using an efficient and streamlined process. Explore further by adding more features to your app or integrating it with other services. Don't forget to check out the <a href="https://docs.microsoft.com/en-us/aspnet/core/blazor/?view=aspnetcore-8.0">official Blazor documentation</a> for more information and best practices.</p> | ||
</chapter> | ||
|
||
</topic> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters