diff --git a/MycroForge.CLI/CodeGen/MainModifier.cs b/MycroForge.CLI/CodeGen/MainModifier.cs index 082b781..20e8435 100644 --- a/MycroForge.CLI/CodeGen/MainModifier.cs +++ b/MycroForge.CLI/CodeGen/MainModifier.cs @@ -38,7 +38,7 @@ public class MainModifier public MainModifier IncludeRouter(string prefix, string router) { - _routerIncludeBuffer.Add($"\napp.include_router(prefix=\"/{prefix}\", router={router}.router)\n"); + _routerIncludeBuffer.Add($"\napp.include_router(prefix=\"/{prefix}\", router={router}.router)"); return this; } diff --git a/MycroForge.CLI/Commands/MycroForge.Db.Stop.cs b/MycroForge.CLI/Commands/MycroForge.Db.Stop.cs index 4677569..51a88f5 100644 --- a/MycroForge.CLI/Commands/MycroForge.Db.Stop.cs +++ b/MycroForge.CLI/Commands/MycroForge.Db.Stop.cs @@ -21,9 +21,9 @@ public partial class MycroForge private async Task ExecuteAsync() { - var config = await _context.LoadConfig(); - var env = $"DB_PORT={config.Db.DbhPort} PMA_PORT={config.Db.DbuPort}"; - await _context.Bash($"{env} docker compose -f {Features.Db.FeatureName}.docker-compose.yml down"); + await _context.Bash( + $"docker --log-level ERROR compose -f {Features.Db.FeatureName}.docker-compose.yml down" + ); } } } diff --git a/MycroForge.Core/CodeGen/Source.cs b/MycroForge.Core/CodeGen/Source.cs index f4e4f23..629aa4a 100644 --- a/MycroForge.Core/CodeGen/Source.cs +++ b/MycroForge.Core/CodeGen/Source.cs @@ -48,7 +48,7 @@ public class Source public Source InsertMultiLineAtEnd(params string[] text) { - _text += (string.Join('\n', text)); + _text += string.Join('\n', text); return this; } diff --git a/MycroForge.Core/README.md b/MycroForge.Core/readme.md similarity index 100% rename from MycroForge.Core/README.md rename to MycroForge.Core/readme.md diff --git a/MycroForge.PluginTemplate.Package/README.md b/MycroForge.PluginTemplate.Package/readme.md similarity index 94% rename from MycroForge.PluginTemplate.Package/README.md rename to MycroForge.PluginTemplate.Package/readme.md index 2b652bd..d511b70 100644 --- a/MycroForge.PluginTemplate.Package/README.md +++ b/MycroForge.PluginTemplate.Package/readme.md @@ -8,7 +8,7 @@ https://learn.microsoft.com/en-us/dotnet/core/tutorials/cli-templates-create-tem ### Build the package `dotnet pack` -### Push to local nuget +### Push to devdisciples nuget `dotnet nuget push bin/Release/MycroForge.PluginTemplate.Package.1.0.0.nupkg --source devdisciples` ### Install template package from local nuget diff --git a/MycroForge.PluginTemplate/readme.md b/MycroForge.PluginTemplate/readme.md new file mode 100644 index 0000000..e69de29 diff --git a/docs/docs/Commands/index.md b/docs/docs/Commands/index.md index ff6c86d..830f089 100644 --- a/docs/docs/Commands/index.md +++ b/docs/docs/Commands/index.md @@ -1,3 +1,7 @@ +--- +sidebar_position: 4 +--- + # Commands ``` diff --git a/docs/docs/command_plugins.md b/docs/docs/command_plugins.md new file mode 100644 index 0000000..b04466f --- /dev/null +++ b/docs/docs/command_plugins.md @@ -0,0 +1,5 @@ +--- +sidebar_position: 5 +--- + +# Command plugins \ No newline at end of file diff --git a/docs/docs/install.md b/docs/docs/getting_started.md similarity index 85% rename from docs/docs/install.md rename to docs/docs/getting_started.md index 553f2d0..af08b39 100644 --- a/docs/docs/install.md +++ b/docs/docs/getting_started.md @@ -1,21 +1,28 @@ ---- -sidebar_position: 2 ---- - -# Install - -## Requirements - -MycroForge has the following dependencies. - -- bash -- git -- Python3 (3.10) -- Docker -- .NET 8 - -### Windows - -To simplify the implementation of this tool, it assumes that it's running in a POSIX compliant environment. -MycroForge has been developed and tested on Windows in WSL2 Ubuntu 22.04.03. -So when running on Windows, it's recommended to run MycroForge in the same environment or atleast in a similar WSL2 distro. +--- +sidebar_position: 2 +--- + +# Getting started + +## Requirements + +MycroForge has the following dependencies. + +- bash +- git +- Python3 (3.10) +- Docker +- .NET 8 + +### Windows + +To simplify the implementation of this tool, it assumes that it's running in a POSIX compliant environment. +MycroForge has been developed and tested on Windows in WSL2 Ubuntu 22.04.03. +So when running on Windows, it's recommended to run MycroForge in the same environment or atleast in a similar WSL2 distro. + + +### Install + +``` +dotnet tool install -g MycroForge.CLI +``` diff --git a/docs/docs/tutorial.md b/docs/docs/tutorial.md index 978ec80..d434ca4 100644 --- a/docs/docs/tutorial.md +++ b/docs/docs/tutorial.md @@ -167,16 +167,18 @@ Modify `TodoService.list` ```python # Before - async with async_session() as session: - stmt = select(Todo) - results = (await session.scalars(stmt)).all() - return results + async def list(self) -> List[Todo]: + async with async_session() as session: + stmt = select(Todo) + results = (await session.scalars(stmt)).all() + return results # After - async with async_session() as session: - stmt = select(Todo).options(selectinload(Todo.tags)) - results = (await session.scalars(stmt)).all() - return results + async def list(self) -> List[Todo]: + async with async_session() as session: + stmt = select(Todo).options(selectinload(Todo.tags)) + results = (await session.scalars(stmt)).all() + return results ``` Modify `TodoService.get_by_id` @@ -279,5 +281,6 @@ Modify `TodoService.update` return True ``` -At this point, the app should be ready to test. -TODO: Elaborate! \ No newline at end of file +## Test the API! + +Go to http://localhost:5000/docs and test your Todo API! \ No newline at end of file