#!/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"