From 9001386f9245e4c0ceae63c3d464b53e4ab8e11f Mon Sep 17 00:00:00 2001 From: magdev Date: Sat, 2 May 2026 00:59:06 +0200 Subject: [PATCH] Phase 1 sub-commit 1: scaffold framework, skeleton, CI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Stands up the directory structure Phase 1 fills in over subsequent sub-commits: framework/php (Composer package php-qml/bridge), framework/qml (Qt module placeholder), framework/skeleton (Caddyfile + Makefile stubs), and .gitea/workflows/ci.yml. Root .gitignore covers the build/composer/Symfony/Qt/CMake/IDE artefacts the rest of Phase 1 will produce. No bundle code, no Qt module sources, no working dev mode yet — those land in sub-commits 2-7. Spike still in place. Co-Authored-By: Claude Opus 4.7 (1M context) --- .gitea/workflows/ci.yml | 20 ++++++++++++++++++++ .gitignore | 36 ++++++++++++++++++++++++++++++++++++ framework/php/composer.json | 28 ++++++++++++++++++++++++++++ framework/qml/CMakeLists.txt | 17 +++++++++++++++++ framework/skeleton/Caddyfile | 3 +++ framework/skeleton/Makefile | 23 +++++++++++++++++++++++ 6 files changed, 127 insertions(+) create mode 100644 .gitea/workflows/ci.yml create mode 100644 .gitignore create mode 100644 framework/php/composer.json create mode 100644 framework/qml/CMakeLists.txt create mode 100644 framework/skeleton/Caddyfile create mode 100644 framework/skeleton/Makefile diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 0000000..423902c --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,20 @@ +name: CI + +on: + push: + branches: [dev, main] + pull_request: + branches: [dev, main] + +jobs: + quality: + name: Quality + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Quality (placeholder) + run: | + echo "quality job — populated in Phase 1 sub-commit 7" + echo "will run: PHPStan, php-cs-fixer (check), PHPUnit, qmllint" diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b3f0f76 --- /dev/null +++ b/.gitignore @@ -0,0 +1,36 @@ +# Build artefacts +build/ +**/build/ + +# Composer +vendor/ +composer.phar + +# PHPUnit +.phpunit.cache/ +.phpunit.result.cache + +# PHP CS Fixer +.php-cs-fixer.cache + +# Symfony / app data +**/var/ +.env.local +.env.*.local +.env.local.php + +# Qt / CMake intermediates +CMakeCache.txt +CMakeFiles/ +*.pro.user +.qt/ +.rcc/ +.qmlls.ini +moc_*.cpp +moc_*.h +qrc_*.cpp +ui_*.h + +# OS / editor +.DS_Store +*.swp diff --git a/framework/php/composer.json b/framework/php/composer.json new file mode 100644 index 0000000..98c5fdf --- /dev/null +++ b/framework/php/composer.json @@ -0,0 +1,28 @@ +{ + "name": "php-qml/bridge", + "description": "Symfony bundle bridging PHP applications to a Qt/QML host (part of the php-qml framework).", + "type": "symfony-bundle", + "license": "proprietary", + "require": { + "php": "^8.3", + "symfony/framework-bundle": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^11", + "phpstan/phpstan": "^2", + "phpstan/phpstan-symfony": "^2", + "friendsofphp/php-cs-fixer": "^3", + "symfony/phpunit-bridge": "^7.1" + }, + "autoload": { + "psr-4": { + "PhpQml\\Bridge\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "PhpQml\\Bridge\\Tests\\": "tests/" + } + }, + "minimum-stability": "stable" +} diff --git a/framework/qml/CMakeLists.txt b/framework/qml/CMakeLists.txt new file mode 100644 index 0000000..0568dab --- /dev/null +++ b/framework/qml/CMakeLists.txt @@ -0,0 +1,17 @@ +# php-qml framework — Qt module (PhpQml.Bridge). +# +# Consumed by the application's top-level CMakeLists.txt +# (see framework/skeleton/qml/CMakeLists.txt) via add_subdirectory. +# +# Module sources arrive in: +# - Phase 1 sub-commit 4: BackendConnection, SingleInstance +# - Phase 1 sub-commit 5: MercureClient, RestClient (QML/JS) +# +# Until then this file is a placeholder so the directory is tracked in +# git and find_package picks up the right Qt before subsequent commits. + +cmake_minimum_required(VERSION 3.21) + +if(NOT TARGET Qt6::Core) + find_package(Qt6 6.5 REQUIRED COMPONENTS Core Gui Quick Qml Network) +endif() diff --git a/framework/skeleton/Caddyfile b/framework/skeleton/Caddyfile new file mode 100644 index 0000000..dcf74cd --- /dev/null +++ b/framework/skeleton/Caddyfile @@ -0,0 +1,3 @@ +# Placeholder Caddyfile. Populated in Phase 1 sub-commit 6 alongside +# the Symfony app at framework/skeleton/symfony/. See PLAN.md §13, +# Phase 1, "Skeleton wiring". diff --git a/framework/skeleton/Makefile b/framework/skeleton/Makefile new file mode 100644 index 0000000..4548d53 --- /dev/null +++ b/framework/skeleton/Makefile @@ -0,0 +1,23 @@ +# php-qml framework skeleton — Make targets. +# Filled in across Phase 1 sub-commits 3, 6, and 7. + +.DEFAULT_GOAL := help + +.PHONY: help +help: ## Show available targets + @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " %-12s %s\n", $$1, $$2}' $(MAKEFILE_LIST) + +.PHONY: dev +dev: ## (TBD) Run the skeleton in dev mode (FrankenPHP --watch + Qt host) + @echo "dev: not yet implemented (Phase 1 sub-commit 6)" + @exit 1 + +.PHONY: doctor +doctor: ## (TBD) Run bridge:doctor against the running backend + @echo "doctor: not yet implemented (Phase 1 sub-commit 3)" + @exit 1 + +.PHONY: quality +quality: ## (TBD) Run PHPStan, php-cs-fixer (check), PHPUnit, qmllint + @echo "quality: not yet implemented (Phase 1 sub-commit 7)" + @exit 1