Add on/off weapon research dps and params tables feature

This commit is contained in:
anibus
2026-09-03 20:22:01 +03:00
parent 23bfad8956
commit fa0baa62c1
6 changed files with 264 additions and 34 deletions
+67
View File
@@ -0,0 +1,67 @@
# Скрипт сборки дистрибутива dow-wiki-frontend
# Запуск: .\build.ps1
# С шагами: .\build.ps1 -VerboseOutput
param(
[switch]$VerboseOutput
)
$ErrorActionPreference = "Stop"
$root = $PSScriptRoot
$deployDir = Join-Path $root "deploy"
$archive = Join-Path $root "dow-wiki-deploy.tar.gz"
# Файлы и папки, попадающие в дистрибутив
$artifacts = @(
".next",
"public",
"node_modules",
".env",
"next.config.mjs",
"package.json",
"package-lock.json",
"tsconfig.json",
"next-env.d.ts"
)
function Step($message) {
Write-Host "==> $message" -ForegroundColor Cyan
}
Set-Location $root
try {
# 1. Сборка Next.js
Step "Сборка Next.js (npm run build)"
npm run build
if ($LASTEXITCODE -ne 0) { throw "Сборка Next.js завершилась с ошибкой" }
# 2. Очистка папки deploy
Step "Очистка папки deploy"
if (Test-Path $deployDir) { Remove-Item $deployDir -Recurse -Force }
New-Item -ItemType Directory -Path $deployDir | Out-Null
# 3. Копирование артефактов
Step "Копирование артефактов в deploy"
Copy-Item -Path $artifacts -Destination $deployDir -Recurse -Force
# 4. Удаление старого архива
Step "Удаление старого архива"
if (Test-Path $archive) { Remove-Item $archive -Force }
# 5. Создание архива
Step "Создание архива dow-wiki-deploy.tar.gz"
tar -czf $archive -C $deployDir .
if ($LASTEXITCODE -ne 0) { throw "Ошибка при создании архива" }
# Итог
$size = "{0:N1} МБ" -f ((Get-Item $archive).Length / 1MB)
Write-Host ""
Write-Host "Сборка завершена успешно." -ForegroundColor Green
Write-Host "Дистрибутив: $archive ($size)"
}
catch {
Write-Host ""
Write-Host "ОШИБКА: $_" -ForegroundColor Red
exit 1
}