feat: add stdlib and browser examples

- stdlib/html.lux: Type-safe HTML construction
- stdlib/browser.lux: Browser utilities
- examples/web/: Counter app with DOM manipulation
- examples/counter.lux: Simple counter example

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-15 03:54:17 -05:00
parent ccd335c80f
commit 634f665b1b
11 changed files with 1177 additions and 0 deletions

26
examples/web/serve.sh Executable file
View File

@@ -0,0 +1,26 @@
#!/usr/bin/env bash
# Simple HTTP server for testing Lux web examples
# Usage: ./serve.sh [port]
PORT=${1:-8080}
DIR="$(dirname "$0")"
echo "Serving Lux web examples at http://localhost:$PORT"
echo "Open http://localhost:$PORT/index.html in your browser"
echo "Press Ctrl+C to stop"
echo ""
cd "$DIR"
# Try python3 first, then python, then node
if command -v python3 &> /dev/null; then
python3 -m http.server $PORT
elif command -v python &> /dev/null; then
python -m SimpleHTTPServer $PORT
elif command -v npx &> /dev/null; then
npx serve -p $PORT .
else
echo "Error: No suitable HTTP server found."
echo "Install Python or Node.js to serve files."
exit 1
fi