feat: add shadcn admin workspace
This commit is contained in:
21
dev.ps1
21
dev.ps1
@@ -1,6 +1,7 @@
|
||||
param(
|
||||
[switch]$FrontendOnly,
|
||||
[switch]$BackendOnly,
|
||||
[switch]$AdminOnly,
|
||||
[switch]$McpOnly,
|
||||
[switch]$WithMcp,
|
||||
[string]$DatabaseUrl = "postgres://postgres:postgres%402025%21@10.0.0.2:5432/termi-api_development"
|
||||
@@ -11,10 +12,11 @@ $ErrorActionPreference = "Stop"
|
||||
$repoRoot = Split-Path -Parent $MyInvocation.MyCommand.Path
|
||||
$frontendScript = Join-Path $repoRoot "start-frontend.ps1"
|
||||
$backendScript = Join-Path $repoRoot "start-backend.ps1"
|
||||
$adminScript = Join-Path $repoRoot "start-admin.ps1"
|
||||
$mcpScript = Join-Path $repoRoot "start-mcp.ps1"
|
||||
|
||||
if (@($FrontendOnly, $BackendOnly, $McpOnly).Where({ $_ }).Count -gt 1) {
|
||||
throw "Use only one of -FrontendOnly, -BackendOnly, or -McpOnly."
|
||||
if (@($FrontendOnly, $BackendOnly, $AdminOnly, $McpOnly).Where({ $_ }).Count -gt 1) {
|
||||
throw "Use only one of -FrontendOnly, -BackendOnly, -AdminOnly, or -McpOnly."
|
||||
}
|
||||
|
||||
if ($FrontendOnly) {
|
||||
@@ -27,12 +29,17 @@ if ($BackendOnly) {
|
||||
exit $LASTEXITCODE
|
||||
}
|
||||
|
||||
if ($AdminOnly) {
|
||||
& $adminScript
|
||||
exit $LASTEXITCODE
|
||||
}
|
||||
|
||||
if ($McpOnly) {
|
||||
& $mcpScript
|
||||
exit $LASTEXITCODE
|
||||
}
|
||||
|
||||
$services = if ($WithMcp) { "frontend, backend, and MCP" } else { "frontend and backend" }
|
||||
$services = if ($WithMcp) { "frontend, admin, backend, and MCP" } else { "frontend, admin, and backend" }
|
||||
Write-Host "[monorepo] Starting $services in separate PowerShell windows..." -ForegroundColor Cyan
|
||||
|
||||
Start-Process powershell -ArgumentList @(
|
||||
@@ -48,6 +55,12 @@ Start-Process powershell -ArgumentList @(
|
||||
"-DatabaseUrl", $DatabaseUrl
|
||||
)
|
||||
|
||||
Start-Process powershell -ArgumentList @(
|
||||
"-NoExit",
|
||||
"-ExecutionPolicy", "Bypass",
|
||||
"-File", $adminScript
|
||||
)
|
||||
|
||||
if ($WithMcp) {
|
||||
Start-Process powershell -ArgumentList @(
|
||||
"-NoExit",
|
||||
@@ -56,5 +69,5 @@ if ($WithMcp) {
|
||||
)
|
||||
}
|
||||
|
||||
$servicesStarted = if ($WithMcp) { "Frontend, backend, and MCP windows started." } else { "Frontend window and backend window started." }
|
||||
$servicesStarted = if ($WithMcp) { "Frontend, admin, backend, and MCP windows started." } else { "Frontend, admin, and backend windows started." }
|
||||
Write-Host "[monorepo] $servicesStarted" -ForegroundColor Green
|
||||
|
||||
Reference in New Issue
Block a user