AkurAI Build
Menu

Public repository / 5097caa5d055c8539c451aeda1036baafb1d495f

AkurAI-Framework / tests/test_client_package.sh

Latest change f184042cc47bae0fbed5f142af4a575b628cc28b - OLI-243: versioned installable @akurai/client package (signals/islands/spa/akurai-client) + test by Ólafur Búi Ólafsson

#!/usr/bin/env bash
# The client package must be versioned from VERSION, ship the four modules, and resolve its own imports.
set -eu
out=$(mktemp -d); trap 'rm -rf "$out"' EXIT
scripts/build-client-package.sh "$out" >/dev/null
v=$(cat VERSION)
grep -q "\"version\": \"$v\"" "$out/package.json" || { echo "FAIL: version != $v"; exit 1; }
for f in signals.js islands.js spa.js akurai-client.js; do
  [ -f "$out/$f" ] || { echo "FAIL: missing $f"; exit 1; }
done
node --input-type=module -e "
globalThis.document={readyState:'complete',addEventListener(){},querySelectorAll:()=>[],querySelector:()=>null,getElementById:()=>null};
globalThis.window=globalThis;globalThis.addEventListener=()=>{};
const p='$out/';
const m=await import(p+'islands.js'); if(typeof m.signal!=='function') throw new Error('islands/signals import');
const c=await import(p+'akurai-client.js'); if(typeof c.createClient!=='function') throw new Error('client');
await import(p+'spa.js');"
echo "PASS: client package v$v"