Updated docs and minor cleanup
This commit is contained in:
parent
d6609fd335
commit
777b0fccc8
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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
|
0
MycroForge.PluginTemplate/readme.md
Normal file
0
MycroForge.PluginTemplate/readme.md
Normal file
@ -1,3 +1,7 @@
|
||||
---
|
||||
sidebar_position: 4
|
||||
---
|
||||
|
||||
# Commands
|
||||
|
||||
```
|
||||
|
5
docs/docs/command_plugins.md
Normal file
5
docs/docs/command_plugins.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
sidebar_position: 5
|
||||
---
|
||||
|
||||
# Command plugins
|
@ -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
|
||||
```
|
@ -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!
|
||||
## Test the API!
|
||||
|
||||
Go to http://localhost:5000/docs and test your Todo API!
|
Loading…
Reference in New Issue
Block a user