#!/usr/bin/env bash # Compila o Small Mahjong (AGPL-3.0, de usumerican; js13kGames 2024) a partir do commit 548ed4d de # github.com/usumerican/smallmahjong, com o Node pinado e o package-lock.json do autor ("npm ci" e "vite build", como o # "npm run build" do repositorio). O motor do jogo e o src/bin/engine.wasm que o autor publica no repositorio, compilado # do src/engine*.zig do mesmo commit (o fonte vai junto, no tarball do commit). Sem mudancas; a pagina servida e en/. # # src/FredGames.Bundler/Builds/build-small-mahjong.sh # # Saida: artifacts/build/small-mahjong-548ed4d/small-mahjong-548ed4d-dist.tar.gz (igual em dois builds). set -euo pipefail COMMIT=548ed4d6caff300b5c9e37caec1b47c354473f03 SHA256=94508b7565abb16685837e0da26efdb177a173befa23015ef3f2c92f872668c2 here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" source "$here/touch-web/common.sh" tw_init small-mahjong "$COMMIT" tw_node tw_fetch "https://github.com/usumerican/smallmahjong/archive/$COMMIT.tar.gz" "smallmahjong-$short.tar.gz" "$SHA256" tw_untar "smallmahjong-$short.tar.gz" cd "$out/tree" npm ci --ignore-scripts --no-audit --no-fund > "$out/install.log" 2>&1 || { tail -20 "$out/install.log"; exit 1; } NO_COLOR=1 npm_package_version=0.5.0 npx vite build --outDir build --emptyOutDir > "$out/build.log" 2>&1 || { tail -30 "$out/build.log"; exit 1; } cp -R build/. "$out/dist/" tw_check_offline tw_pack