T-001: 初始化 Wagtail 项目骨架

This commit is contained in:
ila
2026-07-06 17:30:34 +08:00
parent abfe00103c
commit feb662da67
42 changed files with 997 additions and 76 deletions
+3 -22
View File
@@ -4,32 +4,13 @@
# - Windows 原生 PowerShell:用本文件 ./init.ps1
# - WSL / Git Bash / macOS / Linux:用 ./init.sh
# 一条命令完成:依赖安装 -> 基础验证 -> 打印启动命令。
# 复制到新项目后,必须先替换下面三个命令,让每轮会话用同一条路径启动,不靠记忆。
# 本文件不绑定任何技术栈;换技术栈时只替换这三个命令,脚本结构不用动。
$ErrorActionPreference = "Stop"
Set-Location -Path $PSScriptRoot
# 按你的项目实际情况替换这三个命令。未替换前脚本会主动失败。
$InstallCmd = "__REPLACE_INSTALL_CMD__" # 依赖安装,如 uv sync / poetry install / npm install
$VerifyCmd = "__REPLACE_VERIFY_CMD__" # 基础验证 / smoke,如 python -m pytest / go test ./...
$StartCmd = "__REPLACE_START_CMD__" # 开发启动,如 uvicorn app:app --reload / npm run dev
function Assert-Configured {
param(
[string]$Name,
[string]$Value
)
if ($Value -like "__REPLACE_*") {
Write-Error "请先在 init.ps1 中替换 $Name。同步更新 docs/03-tech-stack.md、docs/00-ai-start-here.md 和 docs/current-state.md 中的命令。"
exit 2
}
}
Assert-Configured -Name "InstallCmd" -Value $InstallCmd
Assert-Configured -Name "VerifyCmd" -Value $VerifyCmd
Assert-Configured -Name "StartCmd" -Value $StartCmd
$InstallCmd = ".venv/bin/pip install -r requirements.txt"
$VerifyCmd = ".venv/bin/python manage.py check"
$StartCmd = ".venv/bin/python manage.py runserver"
Write-Host "==> 当前目录: $($PWD.Path)"