Skip to content

Commit

Permalink
Removing illuminate/view from the main framework's require (#633)
Browse files Browse the repository at this point in the history
* Prepare relasing mantle-framework/framework

* CHANGELOG

* Suggest the real package

* Validate the monorepo

* Introduce monorepo-validate

* Bump to symfony/console 7 fully

* LInt fixes

* Small bump

* Ensure prefer-lowest passes

* Remove prefer lowest from 8.4

* Fixing faker

* Require http

* Rephrase the changelog

* Suggest illuminate/view

* Testing CI

* Retry a leaky test

* Retry a leaky test

* Fixing another

* Fixing snap
  • Loading branch information
srtfisher authored Feb 6, 2025
1 parent f295306 commit f829560
Show file tree
Hide file tree
Showing 19 changed files with 93 additions and 57 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,24 @@ on:
- '*.*.x'

jobs:
monorepo-validate:
if: github.event.pull_request.draft == false
timeout-minutes: 10
runs-on: ubuntu-latest
name: "Lint Tests"
steps:
- uses: actions/checkout@v4

- name: Run General Tests
uses: alleyinteractive/action-test-general@develop

- name: Run Linter
uses: alleyinteractive/action-test-php@develop
with:
php-version: '8.4'
skip-services: 'true'
skip-wordpress-install: 'true'
test-command: 'composer monorepo-validate'
lint-tests:
if: github.event.pull_request.draft == false
timeout-minutes: 10
Expand Down Expand Up @@ -42,6 +60,9 @@ jobs:
multisite: [true, false]
php: [8.2, 8.3, 8.4]
wordpress: ["latest"]
exclude:
- php: 8.4
dependencies: "prefer-lowest"
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref }}-P${{ matrix.php }}-WP${{ matrix.wordpress }}-MS${{ matrix.multisite && '1' || '0' }}-D${{ matrix.dependencies }}
Expand All @@ -65,6 +86,7 @@ jobs:
all-pr-checks-passed:
name: All PR checks passed
needs:
- monorepo-validate
- lint-tests
- unit-tests
runs-on: ubuntu-latest
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## v1.5.0 - 2025-02-05

### Changed

- Dropped `illuminate/view` from the `alleyinteractive/mantle-framework`
package. There is a conflict between the dependent package
`illuminate/support` and `spatie/once`. `alleyinteractive/mantle` will be
updated to require `illuminate/view` directly.
- Upgraded `mantle-framework/testkit` to support `nunomaduro/collision` v8 (which requires PHP 8.2 and PHPUnit 10+).
- Drop support for `symfony/console` v6.2. All Symfony components are now at v7.0.

## v1.4.5 - 2025-02-03

### Fixed
Expand Down
44 changes: 24 additions & 20 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,38 +18,39 @@
"alleyinteractive/wp-filter-side-effects": "^1.0 || ^2.0",
"doctrine/inflector": "^2.0.8",
"dragonmantank/cron-expression": "^3.3.3",
"fakerphp/faker": "^1.23",
"illuminate/view": "^11.38",
"fakerphp/faker": "^1.24",
"laravel/serializable-closure": "^1.3.1",
"league/commonmark": "^2.6.0",
"league/flysystem": "^3.15",
"league/flysystem": "^3.29",
"monolog/monolog": "^2.9.1",
"nesbot/carbon": "^3.8.4",
"nette/php-generator": "^4.1",
"nunomaduro/collision": "^6.0 || ^7.0",
"nunomaduro/termwind": "^1.15.1",
"nunomaduro/collision": "^6.0 || ^7.0 || ^8.0",
"nunomaduro/termwind": "^1.15.1 || ^2.0",
"psr/container": "^1.1.1 || ^2.0.2",
"psr/log": "^1.0.1 || ^2.0 || ^3.0",
"psr/simple-cache": "^3.0",
"ramsey/uuid": "^4.7.4",
"spatie/phpunit-snapshot-assertions": "^4.2 || ^5.1",
"symfony/console": "^6.2 || ^7.0",
"symfony/css-selector": "^6.2 || ^7.0",
"symfony/finder": "^7.0",
"symfony/console": "^7.2",
"symfony/css-selector": "^7.2.0",
"symfony/finder": "^7.2.0",
"symfony/http-foundation": "^7.2.0",
"symfony/http-kernel": "^7.0",
"symfony/mime": "^7.0",
"symfony/routing": "^7.0",
"symfony/string": "^7.0",
"symfony/var-dumper": "^7.0",
"vlucas/phpdotenv": "^5.5",
"symfony/http-kernel": "^7.2.0",
"symfony/mime": "^7.2.0",
"symfony/routing": "^7.2.0",
"symfony/string": "^7.2.0",
"symfony/var-dumper": "^7.2.0",
"symfony/yaml": "^7.2.0",
"vlucas/phpdotenv": "^5.6.1",
"voku/portable-ascii": "^2.0.1"
},
"require-dev": {
"alleyinteractive/alley-coding-standards": "^2.0",
"alleyinteractive/wp-match-blocks": "^1.0 || ^2.0 || ^3.0",
"guzzlehttp/guzzle": "^7.7",
"league/flysystem-aws-s3-v3": "^3.15",
"illuminate/view": "^11.38",
"league/flysystem-aws-s3-v3": "^3.29",
"mockery/mockery": "^1.6.12",
"php-stubs/wp-cli-stubs": "^2.11",
"phpstan/extension-installer": "^1.4",
Expand All @@ -74,6 +75,7 @@
"mantle-framework/facade": "self.version",
"mantle-framework/faker": "self.version",
"mantle-framework/filesystem": "self.version",
"mantle-framework/framework": "self.version",
"mantle-framework/http": "self.version",
"mantle-framework/http-client": "self.version",
"mantle-framework/log": "self.version",
Expand Down Expand Up @@ -140,16 +142,17 @@
"@phpcbf"
],
"merge": "monorepo-builder merge",
"monorepo-validate": "monorepo-builder validate",
"phpcbf": "phpcbf --standard=./phpcs.xml .",
"phpcs": "phpcs --standard=./phpcs.xml .",
"phpcs-modified": "./bin/phpcs-modified-files.sh",
"phpcs": "phpcs --standard=./phpcs.xml .",
"phpstan": "phpstan --memory-limit=1536M",
"phpunit": "phpunit",
"phpunit:multisite": "WP_MULTISITE=1 phpunit",
"rector": "rector process --dry-run",
"phpunit": "phpunit",
"rector:fix": "rector process",
"release": "monorepo-builder release --ansi",
"rector": "rector process --dry-run",
"release:patch": "monorepo-builder release patch --ansi",
"release": "monorepo-builder release --ansi",
"test": [
"@phpcs",
"@phpstan",
Expand All @@ -158,6 +161,7 @@
]
},
"suggest": {
"brianium/paratest": "Run PHPUnit tests in parallel"
"brianium/paratest": "Run PHPUnit tests in parallel",
"illuminate/view": "For Blade templating"
}
}
2 changes: 1 addition & 1 deletion src/mantle/assets/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"require": {
"php": "^8.2",
"alleyinteractive/composer-wordpress-autoloader": "^1.0",
"alleyinteractive/wp-asset-manager": "^1.3.7",
"alleyinteractive/wp-asset-manager": "^1.4.0",
"mantle-framework/contracts": "^1.0",
"mantle-framework/support": "^1.0"
},
Expand Down
2 changes: 1 addition & 1 deletion src/mantle/auth/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"php": "^8.2",
"alleyinteractive/composer-wordpress-autoloader": "^1.0",
"mantle-framework/http": "^1.0",
"symfony/http-kernel": "^7.0"
"symfony/http-kernel": "^7.2.0"
},
"extra": {
"wordpress-autoloader": {
Expand Down
3 changes: 1 addition & 2 deletions src/mantle/console/class-command.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,8 @@ public function run( InputInterface $input, OutputInterface $output ): int {
*
* @param InputInterface $input
* @param OutputInterface $output
* @return int
*/
protected function execute( InputInterface $input, OutputInterface $output ) {
protected function execute( InputInterface $input, OutputInterface $output ): int {
$this->set_input( $input );
$this->set_output( $output );

Expand Down
8 changes: 4 additions & 4 deletions src/mantle/console/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
"alleyinteractive/composer-wordpress-autoloader": "^1.0",
"mantle-framework/contracts": "^1.0",
"mantle-framework/support": "^1.0",
"nette/php-generator": "^3.6.9",
"symfony/console": "^6.2 || ^7.0",
"symfony/finder": "^7.0",
"symfony/string": "^7.0"
"nette/php-generator": "^4.1",
"symfony/console": "^7.2",
"symfony/finder": "^7.2.0",
"symfony/string": "^7.2.0"
},
"extra": {
"wordpress-autoloader": {
Expand Down
4 changes: 2 additions & 2 deletions src/mantle/database/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
"require": {
"php": "^8.2",
"alleyinteractive/composer-wordpress-autoloader": "^1.0",
"alleyinteractive/wp-filter-side-effects": "^2.0",
"alleyinteractive/wp-filter-side-effects": "^1.0 || ^2.0",
"mantle-framework/contracts": "^1.0",
"mantle-framework/support": "^1.0",
"psr/container": "^1.1.1 || ^2.0.2",
"symfony/finder": "^7.0"
"symfony/finder": "^7.2.0"
},
"extra": {
"wordpress-autoloader": {
Expand Down
2 changes: 1 addition & 1 deletion src/mantle/events/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"mantle-framework/contracts": "^1.0",
"mantle-framework/support": "^1.0",
"psr/container": "^1.1.1 || ^2.0.2",
"symfony/finder": "^7.0"
"symfony/finder": "^7.2.0"
},
"extra": {
"wordpress-autoloader": {
Expand Down
2 changes: 1 addition & 1 deletion src/mantle/faker/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"require": {
"php": "^8.2",
"alleyinteractive/composer-wordpress-autoloader": "^1.0",
"fakerphp/faker": "^1.23"
"fakerphp/faker": "^1.24"
},
"extra": {
"wordpress-autoloader": {
Expand Down
7 changes: 3 additions & 4 deletions src/mantle/filesystem/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
"require": {
"php": "^8.2",
"alleyinteractive/composer-wordpress-autoloader": "^1.0",
"league/flysystem": "^1.1.10",
"league/flysystem-cached-adapter": "^1.1",
"league/flysystem": "^3.29",
"mantle-framework/contracts": "^1.0",
"mantle-framework/support": "^1.0",
"psr/container": "^1.1.1 || ^2.0.2",
"symfony/finder": "^7.0",
"symfony/http-foundation": "^7.0"
"symfony/finder": "^7.2.0",
"symfony/http-foundation": "^7.2.0"
},
"extra": {
"wordpress-autoloader": {
Expand Down
2 changes: 1 addition & 1 deletion src/mantle/framework/exceptions/class-handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public function render( $request, Throwable $e ) {
* @throws Throwable Thrown in debug mode to trigger Whoops.
*/
public function render_for_console( OutputInterface $output, Throwable $e ): void {
if ( config( 'app.debug' ) ) {
if ( config( 'app.debug' ) && class_exists( \NunoMaduro\Collision\Provider::class ) ) {
// Use collision to render the exception if we're in debug mode.
( new \NunoMaduro\Collision\Provider() )->register();

Expand Down
8 changes: 4 additions & 4 deletions src/mantle/http/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
"mantle-framework/filesystem": "^1.0",
"mantle-framework/support": "^1.0",
"symfony/http-foundation": "^7.2.0",
"symfony/http-kernel": "^7.0",
"symfony/mime": "^7.0",
"symfony/routing": "^7.0",
"symfony/var-dumper": "^7.0"
"symfony/http-kernel": "^7.2.0",
"symfony/mime": "^7.2.0",
"symfony/routing": "^7.2.0",
"symfony/var-dumper": "^7.2.0"
},
"extra": {
"wordpress-autoloader": {
Expand Down
4 changes: 2 additions & 2 deletions src/mantle/support/class-stringable.php
Original file line number Diff line number Diff line change
Expand Up @@ -1127,10 +1127,10 @@ public function to_boolean() {
*/
public function to_date( $format = null, $tz = null ) {
if ( is_null( $format ) ) {
return Date::parse( $this->value, $tz );
return Date::parse( $this->value, $tz ?: wp_timezone() );
}

return Date::createFromFormat( $format, $this->value, $tz );
return Date::createFromFormat( $format, $this->value, $tz ?: wp_timezone() );
}

/**
Expand Down
5 changes: 3 additions & 2 deletions src/mantle/support/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
"monolog/monolog": "^2.9.1",
"nesbot/carbon": "^3.8.4",
"ramsey/uuid": "^4.7.4",
"symfony/finder": "^7.0",
"symfony/var-dumper": "^7.0",
"symfony/finder": "^7.2.0",
"symfony/var-dumper": "^7.2.0",
"vlucas/phpdotenv": "^5.6.1",
"voku/portable-ascii": "^2.0.1"
},
"extra": {
Expand Down
4 changes: 2 additions & 2 deletions src/mantle/testing/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"mantle-framework/http-client": "^1.0",
"mantle-framework/http": "^1.0",
"mantle-framework/support": "^1.0",
"nunomaduro/termwind": "^1.15.1",
"symfony/css-selector": "^7.0",
"nunomaduro/termwind": "^1.15.1 || ^2.0",
"symfony/css-selector": "^7.2.0",
"spatie/phpunit-snapshot-assertions": "^4.2 || ^5.1"
},
"extra": {
Expand Down
4 changes: 2 additions & 2 deletions src/mantle/testkit/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
"mantle-framework/faker": "^1.0",
"mantle-framework/support": "^1.0",
"mantle-framework/testing": "^1.0",
"nunomaduro/collision": "^6.0 || ^7.0",
"nunomaduro/collision": "^6.0 || ^7.0 || ^8.0",
"phpunit/phpunit": "^9.6.22 || ^10.0.7 || ^11.0",
"symfony/http-foundation": "^7.0"
"symfony/http-foundation": "^7.2.0"
},
"extra": {
"wordpress-autoloader": {
Expand Down
13 changes: 8 additions & 5 deletions tests/Testing/Concerns/MakesHttpRequestsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use WP_REST_Response;

use function Mantle\Support\Helpers\collect;
use function Mantle\Support\Helpers\retry;

/**
* @group testing
Expand Down Expand Up @@ -457,8 +458,8 @@ public function test_experimental_redirect_to() {

public function test_multiple_requests() {
$methods = collect( get_class_methods( $this ) )
->filter( fn ( string $method ) => ! Str::contains( $method, [ 'experimental', '_snapshot_' ] ) && 0 === strpos( $method, 'test_' ) )
->shuffle()
->filter( fn ( string $method ) => ! Str::contains( $method, [ 'experimental', 'snapshot' ] ) && 0 === strpos( $method, 'test_' ) )
->sort()
->all();

// Re-run all test methods on this class in a single pass.
Expand All @@ -467,11 +468,13 @@ public function test_multiple_requests() {
continue;
}

$this->setUp();
retry( 3, function () use ( $method ) {
$this->setUp();

$this->$method();
$this->$method();

$this->tearDown();
$this->tearDown();
} );
}
}

Expand Down

This file was deleted.

0 comments on commit f829560

Please sign in to comment.