feat: complete dropship palletization workflow
This commit is contained in:
@@ -2,7 +2,8 @@
|
||||
param(
|
||||
[switch]$DryRun,
|
||||
[switch]$SkipAdmin,
|
||||
[switch]$SkipClient
|
||||
[switch]$SkipClient,
|
||||
[switch]$SkipPda
|
||||
)
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
@@ -17,8 +18,22 @@ function Invoke-FrontendStep {
|
||||
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
|
||||
}
|
||||
|
||||
if ($SkipAdmin -and $SkipClient) { Write-Error 'At least one of Admin or Client must be selected.'; exit 2 }
|
||||
if (-not (Get-Command pnpm -ErrorAction SilentlyContinue)) { Write-Error 'pnpm was not found on PATH.'; exit 2 }
|
||||
function Invoke-PdaTests {
|
||||
param([string]$Directory)
|
||||
$pattern = Join-Path $Directory 'tests/*.test.mjs'
|
||||
Write-Host " [test] node --test `"$pattern`""
|
||||
if ($DryRun) { return }
|
||||
& node --test $pattern
|
||||
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
|
||||
}
|
||||
|
||||
if ($SkipAdmin -and $SkipClient -and $SkipPda) { Write-Error 'At least one of Admin, Client or PDA must be selected.'; exit 2 }
|
||||
if ((-not $SkipAdmin -or -not $SkipClient) -and -not (Get-Command pnpm -ErrorAction SilentlyContinue)) {
|
||||
Write-Error 'pnpm was not found on PATH.'; exit 2
|
||||
}
|
||||
if (-not $SkipPda -and -not (Get-Command node -ErrorAction SilentlyContinue)) {
|
||||
Write-Error 'node was not found on PATH.'; exit 2
|
||||
}
|
||||
|
||||
$targets = @()
|
||||
if (-not $SkipAdmin) { $targets += @{ Name = 'Admin'; Directory = Join-Path $repoRoot 'apps/admin-web' } }
|
||||
@@ -37,4 +52,13 @@ foreach ($target in $targets) {
|
||||
Invoke-FrontendStep 'typecheck' $target.Directory 'typecheck'
|
||||
}
|
||||
|
||||
if (-not $SkipPda) {
|
||||
$pdaDirectory = Join-Path $repoRoot 'apps/pda-uniapp'
|
||||
if (-not (Test-Path -LiteralPath (Join-Path $pdaDirectory 'tests'))) {
|
||||
Write-Error "PDA tests directory not found: $pdaDirectory"; exit 2
|
||||
}
|
||||
Write-Host '[PDA]'
|
||||
Invoke-PdaTests $pdaDirectory
|
||||
}
|
||||
|
||||
Write-Host 'Frontend regression completed.'
|
||||
|
||||
Reference in New Issue
Block a user