diff --git a/docs/site/Writerside/redirection-rules.xml b/docs/site/Writerside/redirection-rules.xml index 1d71309..90cd8a1 100644 --- a/docs/site/Writerside/redirection-rules.xml +++ b/docs/site/Writerside/redirection-rules.xml @@ -6,4 +6,8 @@ page.html --> + + Created after removal of "Tutorials" from MasterCommander + Tutorials.html + diff --git a/docs/site/Writerside/topics/Create-a-Blazor-App.topic b/docs/site/Writerside/topics/Create-a-Blazor-App.topic new file mode 100644 index 0000000..59a442c --- /dev/null +++ b/docs/site/Writerside/topics/Create-a-Blazor-App.topic @@ -0,0 +1,98 @@ + + + + + [WIP] Create a Blazor App with MasterCommander + + +

Creating a Blazor app is an exciting and engaging experience. With the help of MasterCommander's InitializeBlazorAppAsync 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.

+
+ + +

Before you begin, ensure you have the following installed:

+ +
  • .NET 8 SDK or later
  • +
  • Git command line tool
  • +
  • Visual Studio Code or another code editor
  • +
  • A modern web browser (Chrome, Firefox, Edge, etc.)
  • +
    +
    + + +

    The InitializeBlazorAppAsync 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.

    +
    + + +

    The following sequence diagram illustrates the process executed by the InitializeBlazorAppAsync method:

    + + @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 + +

    This diagram provides a visual representation of the interactions between the developer, MasterCommander API, and other components during Blazor app initialization.

    +
    + + +

    The following C# code snippet shows a practical implementation of the InitializeBlazorAppAsync method:

    + + 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(); + } + +
    + + +

    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 official Blazor documentation for more information and best practices.

    +
    + +
    diff --git a/docs/site/Writerside/topics/Tutorials.topic b/docs/site/Writerside/topics/Tutorials.topic deleted file mode 100644 index 201807c..0000000 --- a/docs/site/Writerside/topics/Tutorials.topic +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - Tutorials - -

    Start typing here...

    - -
    diff --git a/docs/site/Writerside/web.tree b/docs/site/Writerside/web.tree index 922a62a..d0f35ee 100644 --- a/docs/site/Writerside/web.tree +++ b/docs/site/Writerside/web.tree @@ -7,16 +7,15 @@ start-page="MasterCommander.topic"> - - - + + + -