Files
Simon James b54a3139c7 Initial commit: Qortal Web Builder monorepo.
Includes QWB, Qortal Web, and Q-Shops Q-Apps with shared packages and build scripts.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-09 12:17:29 +00:00

34 lines
1.1 KiB
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
# Qortal Hub: one flat app root with a real production index.html (never the Vite dev /src/ entry).
# Stages the contents of dist/ first, then adds legacy app.js / style.css if present.
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
cd "$ROOT"
npm run build
T="$(mktemp -d "${TMPDIR:-/tmp}/qwb-portfolio-XXXX")"
trap 'rm -rf "$T"' EXIT
cp -a dist/. "$T"/
# dev.html in dist is a duplicate of the same bundle; drop so Hub only sees index.html + assets.
rm -f "$T"/dev.html
# Keep dist/site.html: the builders export + preview fetches it from the app root to build the visitor zip.
# Optional legacy site bundle (separate from React dist)
for f in app.js style.css; do
if [[ -f "$ROOT/$f" ]]; then
cp -a "$ROOT/$f" "$T"/
fi
done
# Root manifest can differ from public/; for Q-App, dist/manifest.json (main: index.html) is correct.
# Prefer dist copy in archive (already in $T from cp -a dist). Do not override.
DATE="$(date +%Y%m%d)"
OUT="${ROOT}/Portfolio-Q-App-v3-${DATE}.zip"
rm -f "$OUT"
( cd "$T" && zip -r -9 "$OUT" . )
echo "Created: $OUT"
ls -la "$OUT"