Updated docs and minor cleanup

This commit is contained in:
mdnapo 2024-07-15 22:49:31 +02:00
parent d6609fd335
commit 777b0fccc8
10 changed files with 56 additions and 37 deletions

View File

@ -38,7 +38,7 @@ public class MainModifier
public MainModifier IncludeRouter(string prefix, string router) 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; return this;
} }

View File

@ -21,9 +21,9 @@ public partial class MycroForge
private async Task ExecuteAsync() private async Task ExecuteAsync()
{ {
var config = await _context.LoadConfig(); await _context.Bash(
var env = $"DB_PORT={config.Db.DbhPort} PMA_PORT={config.Db.DbuPort}"; $"docker --log-level ERROR compose -f {Features.Db.FeatureName}.docker-compose.yml down"
await _context.Bash($"{env} docker compose -f {Features.Db.FeatureName}.docker-compose.yml down"); );
} }
} }
} }

View File

@ -48,7 +48,7 @@ public class Source
public Source InsertMultiLineAtEnd(params string[] text) public Source InsertMultiLineAtEnd(params string[] text)
{ {
_text += (string.Join('\n', text)); _text += string.Join('\n', text);
return this; return this;
} }

View File

@ -8,7 +8,7 @@ https://learn.microsoft.com/en-us/dotnet/core/tutorials/cli-templates-create-tem
### Build the package ### Build the package
`dotnet pack` `dotnet pack`
### Push to local nuget ### Push to devdisciples nuget
`dotnet nuget push bin/Release/MycroForge.PluginTemplate.Package.1.0.0.nupkg --source devdisciples` `dotnet nuget push bin/Release/MycroForge.PluginTemplate.Package.1.0.0.nupkg --source devdisciples`
### Install template package from local nuget ### Install template package from local nuget

View File

View File

@ -1,3 +1,7 @@
---
sidebar_position: 4
---
# Commands # Commands
``` ```

View File

@ -0,0 +1,5 @@
---
sidebar_position: 5
---
# Command plugins

View File

@ -2,7 +2,7 @@
sidebar_position: 2 sidebar_position: 2
--- ---
# Install # Getting started
## Requirements ## Requirements
@ -19,3 +19,10 @@ MycroForge has the following dependencies.
To simplify the implementation of this tool, it assumes that it's running in a POSIX compliant environment. 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. 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. 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
```

View File

@ -167,12 +167,14 @@ Modify `TodoService.list`
```python ```python
# Before # Before
async def list(self) -> List[Todo]:
async with async_session() as session: async with async_session() as session:
stmt = select(Todo) stmt = select(Todo)
results = (await session.scalars(stmt)).all() results = (await session.scalars(stmt)).all()
return results return results
# After # After
async def list(self) -> List[Todo]:
async with async_session() as session: async with async_session() as session:
stmt = select(Todo).options(selectinload(Todo.tags)) stmt = select(Todo).options(selectinload(Todo.tags))
results = (await session.scalars(stmt)).all() results = (await session.scalars(stmt)).all()
@ -279,5 +281,6 @@ Modify `TodoService.update`
return True return True
``` ```
At this point, the app should be ready to test. ## Test the API!
TODO: Elaborate!
Go to http://localhost:5000/docs and test your Todo API!