Étape 0d.1 : domaine « partie » en TypeScript, scénario exécuté, garde-fous
Fusion du travail du sous-agent (branche plateau-domaine-travail) ; plan supprimé à la clôture, son résultat est repris dans la merge request. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -20,19 +20,23 @@ REFERENCE_IMAGE := ustagammon/gnubg-reference:14b6798
|
||||
BUILD_C_IMAGE := ustagammon/build-c:2
|
||||
# Emscripten (compilation WebAssembly ; contient aussi Node et Python 3).
|
||||
WASM_IMAGE := emscripten/emsdk:3.1.64
|
||||
# Outils de l'application web (docker/web/) : TypeScript, Biome, Cucumber,
|
||||
# dependency-cruiser. Changer l'étiquette à chaque modification du Dockerfile.
|
||||
WEB_IMAGE := ustagammon/web:1
|
||||
# Port de la page de test servie sur le réseau local (make deploy-web).
|
||||
WEB_PORT := 8080
|
||||
# Serveur statique de production (deploy/Dockerfile) : même version ici.
|
||||
CADDY_IMAGE := caddy:2.8.4-alpine
|
||||
|
||||
export SHELLCHECK_IMAGE GHERKIN_IMAGE BUILD_C_IMAGE WASM_IMAGE CADDY_IMAGE
|
||||
export SHELLCHECK_IMAGE GHERKIN_IMAGE BUILD_C_IMAGE WASM_IMAGE CADDY_IMAGE WEB_IMAGE
|
||||
|
||||
# Lance une commande dans la chaîne C, sous l'utilisateur courant pour que
|
||||
# build/ lui appartienne.
|
||||
DOCKER_C := docker run --rm --user "$$(id -u):$$(id -g)" -v "$(CURDIR):/src" -w /src $(BUILD_C_IMAGE)
|
||||
DOCKER_WASM := docker run --rm --user "$$(id -u):$$(id -g)" -e HOME=/tmp -v "$(CURDIR):/src" -w /src $(WASM_IMAGE)
|
||||
DOCKER_WEB := docker run --rm --user "$$(id -u):$$(id -g)" -v "$(CURDIR):/src" -w /src $(WEB_IMAGE)
|
||||
|
||||
.PHONY: help setup build engine engine-wasm bench test lint deploy deploy-web site package deploy-prod clean reference-image reference
|
||||
.PHONY: help setup build engine engine-wasm web bench test lint deploy deploy-web site package deploy-prod clean reference-image reference
|
||||
|
||||
help: ## Liste les commandes disponibles
|
||||
@echo "Ustagammon : commandes disponibles"
|
||||
@@ -52,9 +56,11 @@ setup: ## Installe la chaîne d'outils (images Docker) ; sans effet si déjà fa
|
||||
|| docker pull $(WASM_IMAGE)
|
||||
@docker image inspect $(CADDY_IMAGE) >/dev/null 2>&1 \
|
||||
|| docker pull $(CADDY_IMAGE)
|
||||
@docker image inspect $(WEB_IMAGE) >/dev/null 2>&1 \
|
||||
|| docker build -t $(WEB_IMAGE) docker/web
|
||||
@echo "Chaîne d'outils prête."
|
||||
|
||||
build: engine ## Compile le moteur (si nécessaire) puis l'application
|
||||
build: engine-wasm web ## Compile le moteur (si nécessaire) puis l'application
|
||||
|
||||
engine: ## Compile le moteur, ses données et build/engine-cli (dans Docker)
|
||||
@docker image inspect $(BUILD_C_IMAGE) >/dev/null 2>&1 \
|
||||
@@ -66,6 +72,16 @@ engine-wasm: engine ## Compile le moteur en WebAssembly dans build/wasm/ (dans D
|
||||
|| { echo "Emscripten absent : lancer d'abord make setup"; exit 1; }
|
||||
@$(DOCKER_WASM) make -f engine-wasm/wasm.mk -j2 --no-print-directory
|
||||
|
||||
# L'application est recompilée entièrement (quelques secondes) : build/web/
|
||||
# ne garde ainsi aucun fichier dont la source a disparu. Le package.json
|
||||
# indique à Node que les .js produits sont des modules ES.
|
||||
web: ## Compile l'application TypeScript (app/) dans build/web/ (dans Docker)
|
||||
@docker image inspect $(WEB_IMAGE) >/dev/null 2>&1 \
|
||||
|| { echo "Outils web absents : lancer d'abord make setup"; exit 1; }
|
||||
@rm -rf $(BUILD_DIR)/web
|
||||
@$(DOCKER_WEB) tsc -p app/tsconfig.json
|
||||
@cp app/package.json $(BUILD_DIR)/web/package.json
|
||||
|
||||
bench: engine-wasm ## Mesure le moteur WebAssembly sous Node, sur ce PC (rapport texte)
|
||||
@$(DOCKER_WASM) node engine-wasm/bench.mjs
|
||||
|
||||
|
||||
Reference in New Issue
Block a user