Switch site build to shared GameCult-Quartz
This commit is contained in:
parent
3c979e6f3f
commit
3c5a6545c3
211 changed files with 85 additions and 33309 deletions
|
|
@ -6,35 +6,48 @@ param(
|
|||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$repoRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot)
|
||||
$quartzRoot = Join-Path $repoRoot "quartz-site"
|
||||
$sharedQuartzRoot = if ($env:GAMECULT_QUARTZ_ROOT) {
|
||||
$env:GAMECULT_QUARTZ_ROOT
|
||||
} else {
|
||||
Join-Path (Split-Path -Parent $repoRoot) "GameCult-Quartz"
|
||||
}
|
||||
$portableNodeRoot = Join-Path $repoRoot ".tools\node-v24.15.0-win-x64"
|
||||
$portableNpm = Join-Path $portableNodeRoot "npm.cmd"
|
||||
$portableNode = Join-Path $portableNodeRoot "node.exe"
|
||||
|
||||
# Prefer the bundled Windows runtime so contributors can work without
|
||||
# a machine-wide Node install. If it is absent, fall back to npm on PATH.
|
||||
if (Test-Path $portableNpm) {
|
||||
$npm = $portableNpm
|
||||
# a machine-wide Node install. If it is absent, fall back to node on PATH.
|
||||
if (Test-Path $portableNode) {
|
||||
$node = $portableNode
|
||||
$env:PATH = "$portableNodeRoot;$env:PATH"
|
||||
} else {
|
||||
$npmCommand = Get-Command npm -ErrorAction SilentlyContinue
|
||||
if (-not $npmCommand) {
|
||||
throw "npm was not found. Install Node.js or restore the portable runtime under .tools."
|
||||
$nodeCommand = Get-Command node -ErrorAction SilentlyContinue
|
||||
if (-not $nodeCommand) {
|
||||
throw "node was not found. Install Node.js or restore the portable runtime under .tools."
|
||||
}
|
||||
|
||||
$npm = $npmCommand.Source
|
||||
$node = $nodeCommand.Source
|
||||
}
|
||||
|
||||
# Keep npm's cache inside the repo so local runs stay reproducible.
|
||||
# Keep npm's cache inside the repo so local dependency installs stay reproducible.
|
||||
$env:npm_config_cache = Join-Path $repoRoot ".npm-cache"
|
||||
|
||||
$scriptArgs = switch ($Command) {
|
||||
"build" { @("run", "build") }
|
||||
"dev" { @("run", "dev") }
|
||||
if (-not (Test-Path $sharedQuartzRoot)) {
|
||||
throw "GameCult-Quartz was not found at '$sharedQuartzRoot'. Clone it beside this repo or set GAMECULT_QUARTZ_ROOT."
|
||||
}
|
||||
|
||||
Push-Location $quartzRoot
|
||||
try {
|
||||
& $npm @scriptArgs
|
||||
} finally {
|
||||
Pop-Location
|
||||
$buildScript = Join-Path $sharedQuartzRoot "scripts\build-site.mjs"
|
||||
|
||||
if (-not (Test-Path $buildScript)) {
|
||||
throw "GameCult-Quartz build script was not found at '$buildScript'."
|
||||
}
|
||||
|
||||
$scriptArgs = @(
|
||||
$buildScript,
|
||||
$Command,
|
||||
"--siteRoot", $repoRoot,
|
||||
"--overlayDir", "site",
|
||||
"--contentDir", "GameCult",
|
||||
"--outputDir", "quartz-site/public"
|
||||
)
|
||||
|
||||
& $node @scriptArgs
|
||||
|
|
|
|||
Loading…
Reference in a new issue