From c53c666739e955a8144fa7577c0bd1529b38986d Mon Sep 17 00:00:00 2001 From: ai-chess Date: Thu, 14 May 2026 23:25:18 +0300 Subject: [PATCH] feat(vendor): fetch chessground/chess.js/xterm.js to public/vendor --- scripts/fetch-vendor.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 scripts/fetch-vendor.sh diff --git a/scripts/fetch-vendor.sh b/scripts/fetch-vendor.sh new file mode 100755 index 0000000..3c104af --- /dev/null +++ b/scripts/fetch-vendor.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash +# scripts/fetch-vendor.sh +set -euo pipefail + +ROOT="$(cd "$(dirname "$0")/.." && pwd)" +VENDOR="$ROOT/public/vendor" +mkdir -p "$VENDOR" + +fetch() { + local url="$1"; local out="$2" + if [ -f "$VENDOR/$out" ]; then return 0; fi + echo "[vendor] $url" + curl -fsSL "$url" -o "$VENDOR/$out" +} + +# chess.js 0.13.4 — last UMD release; provides global `Chess` constructor with +# snake_case API (load_pgn, history({verbose:true}), move, fen). +fetch "https://cdn.jsdelivr.net/npm/chess.js@0.13.4/chess.js" chess.min.js + +# chessground 9.2.1 +fetch "https://cdn.jsdelivr.net/npm/chessground@9.2.1/dist/chessground.min.js" chessground.min.js +fetch "https://cdn.jsdelivr.net/npm/chessground@9.2.1/assets/chessground.base.css" chessground.base.css +fetch "https://cdn.jsdelivr.net/npm/chessground@9.2.1/assets/chessground.brown.css" chessground.brown.css +fetch "https://cdn.jsdelivr.net/npm/chessground@9.2.1/assets/chessground.cburnett.css" chessground.cburnett.css + +# xterm.js 5.3.0 +fetch "https://cdn.jsdelivr.net/npm/xterm@5.3.0/lib/xterm.js" xterm.js +fetch "https://cdn.jsdelivr.net/npm/xterm@5.3.0/css/xterm.css" xterm.css +fetch "https://cdn.jsdelivr.net/npm/xterm-addon-fit@0.8.0/lib/xterm-addon-fit.js" xterm-addon-fit.js + +echo "[vendor] done"