framework/php/tests/snapshot/ holds reference output for every shipped
maker (resource Todo, command MarkAllDone, window Todo). The
run.sh script:
- git-archives the skeleton into a temp dir
- composer-installs against the bundle's real path
- removes the existing maker outputs so the regenerators don't bail
- runs the three makers
- diffs each generated file against the matching baseline
CI / make quality fail on any drift; if a template change is intended,
the baselines must be regenerated in the same commit. Wired into:
- framework/skeleton/Makefile's `quality` target (local/dev runs)
- .gitea/workflows/ci.yml (CI runs after qmllint)
Plus a few hardenings discovered while wiring this up:
- The resource maker template now injects NormalizerInterface
(not SerializerInterface — that interface lacks ::normalize()).
All Todo controllers re-rendered to match.
- The command maker template emits a $this->em->flush() so the
injected EntityManager isn't a property.onlyWritten violation
in PHPStan after the user fills in the body.
- phpstan.neon and php-cs-fixer's Finder both exclude tests/snapshot
so the baselines aren't auto-rewritten or analysed as live code.
CI workflow now also installs FrankenPHP, builds the todo example, and
runs the bridge-integration test from Phase 3 sub-commit 4.
Phase 3 done. Outstanding follow-ups (deferred per spec): the
qmltestrunner-driven QML unit tests, make:bridge:event,
make:bridge:read-model, ReactiveObject pagination.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
44 lines
1.2 KiB
Makefile
44 lines
1.2 KiB
Makefile
# php-qml framework skeleton — Make targets.
|
|
|
|
.DEFAULT_GOAL := help
|
|
|
|
SYMFONY_DIR := symfony
|
|
QML_SRC_DIR := qml
|
|
BUILD_DIR := build/qml
|
|
QT_BIN := $(BUILD_DIR)/skeleton
|
|
|
|
.PHONY: help
|
|
help: ## Show available targets
|
|
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " %-12s %s\n", $$1, $$2}' $(MAKEFILE_LIST)
|
|
|
|
.PHONY: install
|
|
install: ## Install Composer dependencies for the Symfony app
|
|
cd $(SYMFONY_DIR) && composer install
|
|
|
|
.PHONY: build
|
|
build: ## Build the Qt host
|
|
cmake -S $(QML_SRC_DIR) -B $(BUILD_DIR) -DCMAKE_BUILD_TYPE=Debug
|
|
cmake --build $(BUILD_DIR) --parallel
|
|
|
|
.PHONY: dev
|
|
dev: build ## Run skeleton in dev mode (FrankenPHP --watch + Qt host)
|
|
./scripts/dev.sh
|
|
|
|
.PHONY: doctor
|
|
doctor: ## Run bridge:doctor inside the Symfony app
|
|
cd $(SYMFONY_DIR) && bin/console bridge:doctor
|
|
|
|
.PHONY: doctor-connect
|
|
doctor-connect: ## Run bridge:doctor with backend connectivity probe
|
|
cd $(SYMFONY_DIR) && bin/console bridge:doctor --connect
|
|
|
|
.PHONY: clean
|
|
clean: ## Remove build artefacts
|
|
rm -rf $(BUILD_DIR)
|
|
|
|
.PHONY: quality
|
|
quality: build ## Run PHPStan, php-cs-fixer (check), PHPUnit, qmllint, maker snapshots
|
|
cd ../php && composer quality
|
|
cmake --build $(BUILD_DIR) --target all_qmllint
|
|
../php/tests/snapshot/run.sh
|