feat: add shadcn admin workspace

This commit is contained in:
2026-03-28 17:56:36 +08:00
parent ec96d91548
commit 178434d63e
41 changed files with 6153 additions and 16 deletions

33
start-admin.ps1 Normal file
View File

@@ -0,0 +1,33 @@
param(
[switch]$Install
)
$ErrorActionPreference = "Stop"
$repoRoot = Split-Path -Parent $MyInvocation.MyCommand.Path
$adminDir = Join-Path $repoRoot "admin"
if (-not (Test-Path $adminDir)) {
throw "Admin directory not found: $adminDir"
}
Push-Location $adminDir
try {
if ($Install -or -not (Test-Path (Join-Path $adminDir "node_modules"))) {
Write-Host "[admin] Installing dependencies..." -ForegroundColor Cyan
npm install
if ($LASTEXITCODE -ne 0) {
throw "npm install failed"
}
}
Write-Host "[admin] Starting Vite admin workspace..." -ForegroundColor Green
npm run dev
if ($LASTEXITCODE -ne 0) {
throw "npm run dev failed"
}
}
finally {
Pop-Location
}