Outils de l'application web : image ustagammon/web, make web, lint
Image docker/web/ (Node 22.11) avec TypeScript 6.0.3, @types/node, Biome 2.5.15, @cucumber/cucumber 12.9.0 et dependency-cruiser 18.6.0, versions figées (ADR 0009). make web compile app/ dans build/web/ ; make lint passe Biome et tsc --noEmit, et vérifie à part que le domaine compile sans les types de Node ni du navigateur. make setup construit l'image ; CREDITS.md à jour. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
db76200c69
commit
54883f4ca3
@@ -20,17 +20,21 @@ 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
|
||||
|
||||
export SHELLCHECK_IMAGE GHERKIN_IMAGE BUILD_C_IMAGE WASM_IMAGE
|
||||
export SHELLCHECK_IMAGE GHERKIN_IMAGE BUILD_C_IMAGE WASM_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 clean reference-image reference
|
||||
.PHONY: help setup build engine engine-wasm web bench test lint deploy deploy-web clean reference-image reference
|
||||
|
||||
help: ## Liste les commandes disponibles
|
||||
@echo "Ustagammon : commandes disponibles"
|
||||
@@ -48,9 +52,11 @@ setup: ## Installe la chaîne d'outils (images Docker) ; sans effet si déjà fa
|
||||
|| docker build -t $(BUILD_C_IMAGE) docker/build-c
|
||||
@docker image inspect $(WASM_IMAGE) >/dev/null 2>&1 \
|
||||
|| docker pull $(WASM_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 \
|
||||
@@ -62,6 +68,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