- docs/ide/: 49 user pages grouped in toc.json (editing, languages, run / test / debug, Git, web sites and Symfony, databases, Docker and SSH, games, AI, team, settings); pages of features still being built are "coming soon" stubs with a TODO list; 15 pages translated into French; docs/ide.md and docs/ide.fr.md link to them. - The Doc button at the top right of the IDE, Help > Documentation, Search Everywhere "Documentation" and a "?" in each tool window's header open the Doc browser (ide/ui/js/docs-browser.js): table of contents, rendered pages (pictures, code, tables, links between pages and to headings), full-text search, back / forward, the IDE's language with English as the fallback. - ide/src/Docs/DocsLibrary.php (docs.index, docs.image): reads only the documentation folder (strict names, real path checked); the packaged copy ui/docs first, else the repository's docs/ide. - Packaging: tools/stage-game.sh copies docs/ide into the exported IDE (its *.md exclusion would drop them), overlay-build.php puts them in code updates, bin/jumphp ide syncs them. - Tests: docs-model.test.mjs (TOC, links, anchors, pictures, search; every page and picture of docs/ide exists), DocsLibraryTest (path traversal refused), the i18n test covers the new texts in 14 languages. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JkYTqsvYu6AYr9yQ3Q4Nt6
39 lines
3 KiB
Shell
Executable file
39 lines
3 KiB
Shell
Executable file
#!/usr/bin/env bash
|
|
# stage-game.sh <games/game folder> <destination>: the game as the desktop runs it, for a package that carries it
|
|
# (export:standalone, the Android app): its files and its vendor/ (the engine's symbolic link followed), without
|
|
# what only development needs (var/, dist/, tests/, site/, core dumps, the engine's tests / web / own vendor, the
|
|
# IDE package's own vendor (its dev tools: the game's vendor/ has what it needs), *.md, the films of assets/videos/
|
|
# (their pictures are there)).
|
|
# + cacert.pem: the CA certificates of HTTPS (Debian's, from the build image), for the phones and computers whose own
|
|
# are not where PHP's OpenSSL looks (the package points SSL_CERT_FILE at it). Prints the build: a hash of the files.
|
|
set -euo pipefail
|
|
# config/project.yaml, else the older config/game.yaml (both read)
|
|
project_yaml() { if [ -f "$1/config/project.yaml" ]; then echo "$1/config/project.yaml"; else echo "$1/config/game.yaml"; fi; }
|
|
src="$1"
|
|
dest="$2"
|
|
[ -f "$src/vendor/autoload.php" ] || { echo "$src has no vendor/ (bin/jumphp install)" >&2; exit 1; }
|
|
rm -rf "$dest" && mkdir -p "$dest"
|
|
(cd "$src" && tar -ch --exclude=./var --exclude=./dist --exclude=./tests --exclude=./site --exclude=./cache \
|
|
--exclude=./android --exclude=./.phpunit.cache --exclude='./core' --exclude='./core.[0-9]*' \
|
|
--exclude='./vendor/jumphp/engine/tests' --exclude='./vendor/jumphp/engine/web' \
|
|
--exclude='./vendor/jumphp/engine/vendor' --exclude='./vendor/jumphp/engine/.phpunit.cache' \
|
|
--exclude='./vendor/jumphp/ide/vendor' --exclude='./vendor/jumphp/ide/tests' --exclude='*.md' \
|
|
--exclude='./assets/videos/*.mp4' --exclude='./assets/videos/*.webm' --exclude='./assets/videos/*.mov' --exclude='./assets/videos/*.mkv' --exclude='./assets/videos/*.avi' --exclude='./assets/videos/*.m4v' . ) \
|
|
| tar -x -C "$dest"
|
|
mkdir -p "$dest/var"
|
|
# the JumPHP IDE: its documentation (docs/ide/, *.md left out above) into the IDE package's ui/docs, read by its Doc browser
|
|
repo="$(cd "$(dirname "$0")/.." && pwd)"
|
|
if [ -d "$dest/vendor/jumphp/ide/ui" ] && [ -f "$repo/docs/ide/toc.json" ]; then
|
|
rm -rf "$dest/vendor/jumphp/ide/ui/docs"
|
|
cp -R "$repo/docs/ide" "$dest/vendor/jumphp/ide/ui/docs"
|
|
fi
|
|
# desktop apps and hybrid games: JumPHP's own Tauri pages (the embedded game's), from the web/ left out above
|
|
if grep -qE '^[[:space:]]*ui:[[:space:]]*["'"'"']?(hybrid|webview)' "$(project_yaml "$src")" 2>/dev/null \
|
|
&& [ -d "$src/vendor/jumphp/engine/web/tauri" ]; then
|
|
mkdir -p "$dest/vendor/jumphp/engine/web"
|
|
cp -RL "$src/vendor/jumphp/engine/web/tauri" "$dest/vendor/jumphp/engine/web/"
|
|
fi
|
|
if [ -f /etc/ssl/certs/ca-certificates.crt ]; then cp /etc/ssl/certs/ca-certificates.crt "$dest/cacert.pem"
|
|
elif [ -f /etc/ssl/cert.pem ]; then cp /etc/ssl/cert.pem "$dest/cacert.pem"; fi # macOS (the Apple apps' build)
|
|
sha=(sha256sum); command -v sha256sum >/dev/null || sha=(shasum -a 256) # macOS
|
|
(cd "$dest" && find . -type f -print0 | LC_ALL=C sort -z | xargs -0 "${sha[@]}" | "${sha[@]}" | cut -c1-12)
|