Skip to content

Commit fedd173

Browse files
authored
Make Composer packages installable (#486)
## Summary Makes the PHP packages ready for Composer installation and discovery. The changes provide these outcomes: - **Declare runtime requirements and autoloading** for MySQL on SQLite. - **Make the MySQL proxy installable independently**, with the SQLite driver available as an optional backend and development dependency. - **Complete package metadata and licensing** for MySQL on SQLite, the MySQL parser, and the MySQL proxy. - **Prepare standalone package subtree archives** that retain each package manifest while excluding tests and generated test data. - **Document and validate standalone installation paths** in package documentation and CI. - **Run workflows on the repository’s `trunk` branch.** ## Why The package manifests did not fully declare their runtime requirements, autoloading, relationships, or distribution metadata. The proxy also depended on a repository-local loader path, which prevented standalone Composer use.
1 parent fc3a703 commit fedd173

24 files changed

Lines changed: 1190 additions & 44 deletions

‎.gitattributes‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
.editorconfig export-ignore
33
.gitattributes export-ignore
44
.gitignore export-ignore
5-
composer.json export-ignore
5+
/composer.json export-ignore
66
phpcs.xml.dist export-ignore
77
phpunit.xml.dist export-ignore
88
wp-setup.sh export-ignore

‎.github/workflows/cs.yml‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
name: CS
22

33
on:
4-
# Run on all relevant pushes (except to main) and on all relevant pull requests.
4+
# Run on all relevant pushes and pull requests.
55
push:
66
paths:
77
- '**.php'
88
- 'composer.json'
9+
- 'packages/*/composer.json'
910
- 'composer.lock'
1011
- '.phpcs.xml.dist'
1112
- 'phpcs.xml.dist'
@@ -14,6 +15,7 @@ on:
1415
paths:
1516
- '**.php'
1617
- 'composer.json'
18+
- 'packages/*/composer.json'
1719
- 'composer.lock'
1820
- '.phpcs.xml.dist'
1921
- 'phpcs.xml.dist'
@@ -41,7 +43,7 @@ jobs:
4143

4244
steps:
4345
- name: Checkout code
44-
uses: actions/checkout@main
46+
uses: actions/checkout@v4
4547

4648
- name: Install PHP
4749
uses: shivammathur/setup-php@v2
@@ -55,6 +57,12 @@ jobs:
5557
- name: Validate Composer installation
5658
run: composer validate --no-check-all
5759

60+
- name: Validate Composer packages
61+
run: |
62+
for manifest in packages/*/composer.json; do
63+
composer --working-dir="${manifest%/composer.json}" validate --strict --no-check-lock
64+
done
65+
5866
# Install dependencies and handle caching in one go.
5967
# @link https://github.com/marketplace/actions/install-composer-dependencies
6068
- name: Install Composer dependencies

‎.github/workflows/end-to-end-tests.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: End-to-end Tests
33
on:
44
push:
55
branches:
6-
- main
6+
- trunk
77
pull_request:
88

99
# Disable permissions for all available scopes by default.

‎.github/workflows/mysql-proxy-tests.yml‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: MySQL Proxy Tests
33
on:
44
push:
55
branches:
6-
- main
6+
- trunk
77
pull_request:
88

99
# Disable permissions for all available scopes by default.
@@ -25,9 +25,13 @@ jobs:
2525
- name: Set up PHP
2626
uses: shivammathur/setup-php@v2
2727
with:
28-
php-version: '7.4'
28+
php-version: '7.2'
2929
coverage: none
3030

31+
- name: Configure monorepo package repository
32+
run: composer config repositories.mysql-on-sqlite path ../mysql-on-sqlite
33+
working-directory: packages/mysql-proxy
34+
3135
- name: Install Composer dependencies
3236
uses: ramsey/composer-install@v3
3337
with:

‎.github/workflows/wasm-spike.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: WASM extension build
33
on:
44
push:
55
branches:
6-
- main
6+
- trunk
77
paths:
88
- 'packages/php-ext-wp-mysql-parser/**'
99
- '.github/workflows/wasm-spike.yml'

‎.github/workflows/wp-tests-end-to-end.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: WordPress End-to-end Tests
33
on:
44
push:
55
branches:
6-
- main
6+
- trunk
77
pull_request:
88

99
# Disable permissions for all available scopes by default.

‎.github/workflows/wp-tests-phpunit.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: WordPress PHPUnit Tests
33
on:
44
push:
55
branches:
6-
- main
6+
- trunk
77
pull_request:
88

99
# Disable permissions for all available scopes by default.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/.gitattributes export-ignore
2+
/phpunit.xml.dist export-ignore
3+
/tests export-ignore

0 commit comments

Comments
 (0)