From 96fcddcfbcda13d8c16245e5a4e5a96afc07a286 Mon Sep 17 00:00:00 2001 From: Sean Fisher Date: Mon, 10 Apr 2023 15:52:45 -0400 Subject: [PATCH 01/17] Add i18n_domain to the config --- config/app.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/config/app.php b/config/app.php index 03e197f..730d12f 100644 --- a/config/app.php +++ b/config/app.php @@ -77,4 +77,15 @@ | */ 'namespace' => environment( 'APP_NAMESPACE', 'App' ), + + /* + |-------------------------------------------------------------------------- + | Application Text Domain + |-------------------------------------------------------------------------- + | + | The text domain used by Mantle when scaffolding files with translatable + | strings. + | + */ + 'i18n_domain' => environment( 'APP_I18N_DOMAIN', 'mantle' ), ]; From 2a21094307d9c44d6c24854784447fb80427e164 Mon Sep 17 00:00:00 2001 From: Sean Fisher Date: Mon, 10 Apr 2023 16:18:30 -0400 Subject: [PATCH 02/17] Remove todo --- config/assets.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/assets.php b/config/assets.php index d225652..f78e2af 100644 --- a/config/assets.php +++ b/config/assets.php @@ -27,6 +27,6 @@ */ 'url' => env( 'ASSET_BUILD_URL', - function_exists( 'plugin_dir_url' ) ? \plugin_dir_url( __DIR__ ) . 'build' : '', // todo: replace with a framework helper method. + function_exists( 'plugin_dir_url' ) ? \plugin_dir_url( __DIR__ ) . 'build' : '', ), ]; From 4954f047ce30b8697ca481e2266917d62ec06ff6 Mon Sep 17 00:00:00 2001 From: Sean Fisher Date: Fri, 2 Jun 2023 15:03:11 -0400 Subject: [PATCH 03/17] Ensure views can be generated properly --- app/models/class-profile.php | 66 ++++++++++++++++++++++++++++++++++++ bin/mantle | 34 +++++-------------- composer.json | 8 ++++- mantle.php | 25 +++++++------- views/example.blade.php | 3 ++ 5 files changed, 96 insertions(+), 40 deletions(-) create mode 100644 app/models/class-profile.php create mode 100644 views/example.blade.php diff --git a/app/models/class-profile.php b/app/models/class-profile.php new file mode 100644 index 0000000..662b6f0 --- /dev/null +++ b/app/models/class-profile.php @@ -0,0 +1,66 @@ + true, + 'rest_base' => static::get_object_name(), + 'show_in_rest' => true, + 'supports' => [ 'author', 'title', 'editor', 'revisions', 'thumbnail', 'custom-fields', 'excerpt' ], + 'taxonomies' => [ 'category', 'post_tag' ], + 'labels' => [ + 'name' => __( 'Profiles', '' ), + 'singular_name' => __( 'Profile', '' ), + 'add_new' => __( 'Add New Profile', '' ), + 'add_new_item' => __( 'Add New Profile', '' ), + 'edit_item' => __( 'Edit Profile', '' ), + 'new_item' => __( 'New Profile', '' ), + 'view_item' => __( 'View Profile', '' ), + 'view_items' => __( 'View Profiles', '' ), + 'search_items' => __( 'Search Profiles', '' ), + 'not_found' => __( 'No Profiles found', '' ), + 'not_found_in_trash' => __( 'No Profiles found in Trash', '' ), + 'parent_item_colon' => __( 'Parent Profile:', '' ), + 'all_items' => __( 'All Profiles', '' ), + 'archives' => __( 'Profile Archives', '' ), + 'attributes' => __( 'Profile Attributes', '' ), + 'insert_into_item' => __( 'Insert into Profile', '' ), + 'uploaded_to_this_item' => __( 'Uploaded to this Profile', '' ), + 'featured_image' => __( 'Featured Image', '' ), + 'set_featured_image' => __( 'Set featured image', '' ), + 'remove_featured_image' => __( 'Remove featured image', '' ), + 'use_featured_image' => __( 'Use as featured image', '' ), + 'filter_items_list' => __( 'Filter Profiles list', '' ), + 'items_list_navigation' => __( 'Profiles list navigation', '' ), + 'items_list' => __( 'Profiles list', '' ), + 'item_published' => __( 'Profile published.', '' ), + 'item_published_privately' => __( 'Profile published privately.', '' ), + 'item_reverted_to_draft' => __( 'Profile reverted to draft.', '' ), + 'item_scheduled' => __( 'Profile scheduled.', '' ), + 'item_updated' => __( 'Profile updated.', '' ), + 'menu_name' => __( 'Profiles', '' ), + ], + ]; + } +} diff --git a/bin/mantle b/bin/mantle index 97a2195..9734c96 100755 --- a/bin/mantle +++ b/bin/mantle @@ -1,6 +1,8 @@ #!/usr/bin/env php make( Mantle\Contracts\Console\Kernel::class ); - -$status = $kernel->handle( - $input = new Symfony\Component\Console\Input\ArgvInput, - new Symfony\Component\Console\Output\ConsoleOutput(), -); - /* |-------------------------------------------------------------------------- -| Shutdown The Application +| Run the Mantle Console Application |-------------------------------------------------------------------------- | -| Once the application has finished running, we will fire off the shutdown -| events so that any final work may be done by the application before it -| is shut down gracefully. +| Load the application with the base configuration and boot it. Booting it will +| cause the console application to run and exit with the status code. | */ -$kernel->terminate( $input, $status ); - -exit( $status ); +Boot_Manager::instance() + ->set_base_path( MANTLE_BASE_DIR ) + ->boot(); diff --git a/composer.json b/composer.json index 315e021..18170cf 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ ], "require": { "alleyinteractive/composer-wordpress-autoloader": "^1.0", - "alleyinteractive/mantle-framework": "^0.10", + "alleyinteractive/mantle-framework": "*", "fakerphp/faker": "^1.9" }, "require-dev": { @@ -55,5 +55,11 @@ "@lint", "@phpunit" ] + }, + "repositories": { + "local": { + "type": "path", + "url": "../mantle-framework" + } } } diff --git a/mantle.php b/mantle.php index 0729b46..cc70dde 100644 --- a/mantle.php +++ b/mantle.php @@ -26,6 +26,7 @@ namespace App; use Mantle\Contracts; +use Mantle\Framework\Boot_Manager; use Mantle\Http\Request; /** @@ -44,7 +45,7 @@ | this block of code if Composer is being loaded outside of the plugin. | */ -if ( ! getenv( 'MANTLE_SKIP_COMPOSER_INSTALL' ) ) { +if ( ! class_exists( Boot_Manager::class ) ) { if ( ! file_exists( __DIR__ . '/vendor/wordpress-autoload.php' ) ) { add_action( 'admin_notices', @@ -67,25 +68,23 @@ function() { | Load the Application |-------------------------------------------------------------------------- | -| Load the Mantle application from the bootstrap file. +| Load the Mantle application from the bootstrap file. This step is actually +| optional as Mantle can operate without any application kernel or configuration. +| This will allow you greater control over the application and make it feel more +| like a Laravel-esque application. | */ + $app = require_once __DIR__ . '/bootstrap/app.php'; /* |-------------------------------------------------------------------------- -| Run the Mantle Application +| Boot the Mantle Application |-------------------------------------------------------------------------- | -| Once we have the application, we can handle the incoming request and send it -| the application's kernel (which depends on the context upon which it was -| called). For the console, the kernel's `handle` method is not called intentionally. +| Once we have the application, we can boot the application given the current +| context and let Mantle take it from here. | */ -if ( defined( 'WP_CLI' ) && \WP_CLI ) { - $app_kernel = $app->make( Contracts\Console\Kernel::class ); -} else { - // Boot up the HTTP Kernel. - $app_kernel = $app->make( Contracts\Http\Kernel::class ); - $app_kernel->handle( Request::capture() ); -} + +Boot_Manager::instance( $app )->boot(); diff --git a/views/example.blade.php b/views/example.blade.php new file mode 100644 index 0000000..75748ea --- /dev/null +++ b/views/example.blade.php @@ -0,0 +1,3 @@ +@foreach ($items as $item) +

This is item {{ $item->id }}

+@endforeach From 3cc983f0fa5b59fd3e854a9ca02e5e094163b56c Mon Sep 17 00:00:00 2001 From: Sean Fisher Date: Fri, 2 Jun 2023 16:11:12 -0400 Subject: [PATCH 04/17] Simplifying logic, reverting composer --- bin/mantle | 4 ++-- composer.json | 8 +------- mantle.php | 25 +++++++++++++++---------- views/example.blade.php | 3 --- 4 files changed, 18 insertions(+), 22 deletions(-) delete mode 100644 views/example.blade.php diff --git a/bin/mantle b/bin/mantle index 9734c96..68dc656 100755 --- a/bin/mantle +++ b/bin/mantle @@ -1,7 +1,7 @@ #!/usr/bin/env php set_base_path( MANTLE_BASE_DIR ) ->boot(); diff --git a/composer.json b/composer.json index 18170cf..c173bc5 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ ], "require": { "alleyinteractive/composer-wordpress-autoloader": "^1.0", - "alleyinteractive/mantle-framework": "*", + "alleyinteractive/mantle-framework": "^0.11", "fakerphp/faker": "^1.9" }, "require-dev": { @@ -55,11 +55,5 @@ "@lint", "@phpunit" ] - }, - "repositories": { - "local": { - "type": "path", - "url": "../mantle-framework" - } } } diff --git a/mantle.php b/mantle.php index cc70dde..ed52118 100644 --- a/mantle.php +++ b/mantle.php @@ -25,15 +25,20 @@ namespace App; -use Mantle\Contracts; -use Mantle\Framework\Boot_Manager; -use Mantle\Http\Request; +use Mantle\Framework\Bootloader; + +/* +|-------------------------------------------------------------------------- +| Mantle Application Base Directory +|-------------------------------------------------------------------------- +| +| This constant defines the base directory of the Mantle application. Mantle +| will use this location to base the storage and bootstrap paths for the +| application. By default, this will be `./storage/` and `./bootstrap/` but that +| can be configured. +| +*/ -/** - * Mantle Application Base Directory - * - * @var string - */ defined( 'MANTLE_BASE_DIR' ) || define( 'MANTLE_BASE_DIR', __DIR__ ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedConstantFound /* @@ -45,7 +50,7 @@ | this block of code if Composer is being loaded outside of the plugin. | */ -if ( ! class_exists( Boot_Manager::class ) ) { +if ( ! class_exists( Bootloader::class ) ) { if ( ! file_exists( __DIR__ . '/vendor/wordpress-autoload.php' ) ) { add_action( 'admin_notices', @@ -87,4 +92,4 @@ function() { | */ -Boot_Manager::instance( $app )->boot(); +bootloader( $app )->boot(); diff --git a/views/example.blade.php b/views/example.blade.php deleted file mode 100644 index 75748ea..0000000 --- a/views/example.blade.php +++ /dev/null @@ -1,3 +0,0 @@ -@foreach ($items as $item) -

This is item {{ $item->id }}

-@endforeach From ccd736340c2f895134dc8b81056a05296a58e089 Mon Sep 17 00:00:00 2001 From: Sean Fisher Date: Fri, 2 Jun 2023 16:16:26 -0400 Subject: [PATCH 05/17] Switching to 0.12 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index c173bc5..af085c4 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ ], "require": { "alleyinteractive/composer-wordpress-autoloader": "^1.0", - "alleyinteractive/mantle-framework": "^0.11", + "alleyinteractive/mantle-framework": "^0.12", "fakerphp/faker": "^1.9" }, "require-dev": { From f957cbcef818ce9724762b5508bc9884bbf2d49e Mon Sep 17 00:00:00 2001 From: Sean Fisher Date: Fri, 2 Jun 2023 16:16:58 -0400 Subject: [PATCH 06/17] Remove bad model example --- app/models/class-profile.php | 66 ------------------------------------ 1 file changed, 66 deletions(-) delete mode 100644 app/models/class-profile.php diff --git a/app/models/class-profile.php b/app/models/class-profile.php deleted file mode 100644 index 662b6f0..0000000 --- a/app/models/class-profile.php +++ /dev/null @@ -1,66 +0,0 @@ - true, - 'rest_base' => static::get_object_name(), - 'show_in_rest' => true, - 'supports' => [ 'author', 'title', 'editor', 'revisions', 'thumbnail', 'custom-fields', 'excerpt' ], - 'taxonomies' => [ 'category', 'post_tag' ], - 'labels' => [ - 'name' => __( 'Profiles', '' ), - 'singular_name' => __( 'Profile', '' ), - 'add_new' => __( 'Add New Profile', '' ), - 'add_new_item' => __( 'Add New Profile', '' ), - 'edit_item' => __( 'Edit Profile', '' ), - 'new_item' => __( 'New Profile', '' ), - 'view_item' => __( 'View Profile', '' ), - 'view_items' => __( 'View Profiles', '' ), - 'search_items' => __( 'Search Profiles', '' ), - 'not_found' => __( 'No Profiles found', '' ), - 'not_found_in_trash' => __( 'No Profiles found in Trash', '' ), - 'parent_item_colon' => __( 'Parent Profile:', '' ), - 'all_items' => __( 'All Profiles', '' ), - 'archives' => __( 'Profile Archives', '' ), - 'attributes' => __( 'Profile Attributes', '' ), - 'insert_into_item' => __( 'Insert into Profile', '' ), - 'uploaded_to_this_item' => __( 'Uploaded to this Profile', '' ), - 'featured_image' => __( 'Featured Image', '' ), - 'set_featured_image' => __( 'Set featured image', '' ), - 'remove_featured_image' => __( 'Remove featured image', '' ), - 'use_featured_image' => __( 'Use as featured image', '' ), - 'filter_items_list' => __( 'Filter Profiles list', '' ), - 'items_list_navigation' => __( 'Profiles list navigation', '' ), - 'items_list' => __( 'Profiles list', '' ), - 'item_published' => __( 'Profile published.', '' ), - 'item_published_privately' => __( 'Profile published privately.', '' ), - 'item_reverted_to_draft' => __( 'Profile reverted to draft.', '' ), - 'item_scheduled' => __( 'Profile scheduled.', '' ), - 'item_updated' => __( 'Profile updated.', '' ), - 'menu_name' => __( 'Profiles', '' ), - ], - ]; - } -} From e10770b097023220f44855d7d7fc75416c2b9b1a Mon Sep 17 00:00:00 2001 From: Sean Fisher Date: Mon, 31 Jul 2023 11:47:21 -0400 Subject: [PATCH 07/17] Upgrading to 8.0-2 testing --- .github/workflows/coding-standards.yml | 2 ++ .github/workflows/tests.yml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index c336407..7f21927 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -11,3 +11,5 @@ on: jobs: coding-standards: uses: alleyinteractive/.github/.github/workflows/php-coding-standards.yml@main + with: + php: '8.1' diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ad4056f..06a13b5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,7 +12,7 @@ jobs: php-tests: strategy: matrix: - php: [8.0] + php: [8.0, 8.1, 8.2] wordpress: ["latest"] multisite: [true, false] uses: alleyinteractive/.github/.github/workflows/php-tests.yml@main From 0d28e630c4472da93146e0fc7632b51b70270006 Mon Sep 17 00:00:00 2001 From: Sean Fisher Date: Wed, 2 Aug 2023 16:20:47 -0400 Subject: [PATCH 08/17] Updating the factories for 0.12 --- database/factories/.gitkeep | 0 database/factories/category-factory.php | 30 --------------- database/factories/post-factory.php | 30 --------------- database/factory/class-category-factory.php | 40 ++++++++++++++++++++ database/factory/class-post-factory.php | 41 +++++++++++++++++++++ database/factory/class-tag-factory.php | 40 ++++++++++++++++++++ database/seeds/class-database-seeder.php | 2 +- 7 files changed, 122 insertions(+), 61 deletions(-) delete mode 100644 database/factories/.gitkeep delete mode 100644 database/factories/category-factory.php delete mode 100644 database/factories/post-factory.php create mode 100644 database/factory/class-category-factory.php create mode 100644 database/factory/class-post-factory.php create mode 100644 database/factory/class-tag-factory.php diff --git a/database/factories/.gitkeep b/database/factories/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/database/factories/category-factory.php b/database/factories/category-factory.php deleted file mode 100644 index 5947ae6..0000000 --- a/database/factories/category-factory.php +++ /dev/null @@ -1,30 +0,0 @@ -define( - Term::class, // phpcs:ignore - function ( Faker $faker ) { - return [ - 'name' => $faker->sentence, - 'description' => $faker->paragraph, - 'taxonomy' => 'category', - 'object_type' => 'post', - ]; - } -); diff --git a/database/factories/post-factory.php b/database/factories/post-factory.php deleted file mode 100644 index 680ffca..0000000 --- a/database/factories/post-factory.php +++ /dev/null @@ -1,30 +0,0 @@ -define( - Post::class, // phpcs:ignore - function ( Faker $faker ) { - return [ - 'post_title' => $faker->sentence, - 'post_content' => $faker->paragraph, - 'post_status' => 'publish', - 'post_type' => 'post', - ]; - } -); diff --git a/database/factory/class-category-factory.php b/database/factory/class-category-factory.php new file mode 100644 index 0000000..ac37d4c --- /dev/null +++ b/database/factory/class-category-factory.php @@ -0,0 +1,40 @@ + + */ +class Category_Factory extends \Mantle\Database\Factory\Term_Factory { + /** + * Model to use when creating objects. + * + * @var class-string + */ + protected string $model = Category::class; + + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array { + return [ + 'name' => $this->faker->sentence, + 'description' => $this->faker->paragraph, + 'taxonomy' => 'category', + ]; + } +} diff --git a/database/factory/class-post-factory.php b/database/factory/class-post-factory.php new file mode 100644 index 0000000..b6f97a3 --- /dev/null +++ b/database/factory/class-post-factory.php @@ -0,0 +1,41 @@ + + */ +class Post_Factory extends \Mantle\Database\Factory\Post_Factory { + /** + * Model to use when creating objects. + * + * @var class-string + */ + protected string $model = Post::class; + + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array { + return [ + 'post_title' => $this->faker->sentence, + 'post_content' => $this->faker->paragraph, + 'post_status' => 'publish', + 'post_type' => 'post', + ]; + } +} diff --git a/database/factory/class-tag-factory.php b/database/factory/class-tag-factory.php new file mode 100644 index 0000000..8d0ccea --- /dev/null +++ b/database/factory/class-tag-factory.php @@ -0,0 +1,40 @@ + + */ +class Tag_Factory extends \Mantle\Database\Factory\Term_Factory { + /** + * Model to use when creating objects. + * + * @var class-string + */ + protected string $model = Tag::class; + + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array { + return [ + 'name' => $this->faker->sentence, + 'description' => $this->faker->paragraph, + 'taxonomy' => 'tag', + ]; + } +} diff --git a/database/seeds/class-database-seeder.php b/database/seeds/class-database-seeder.php index 5eb3d4e..305e762 100644 --- a/database/seeds/class-database-seeder.php +++ b/database/seeds/class-database-seeder.php @@ -8,7 +8,6 @@ namespace App\Database\Seeds; use Mantle\Database\Seeder; -use function Mantle\Support\Helpers\factory; /** * Application Seeder @@ -18,6 +17,7 @@ class Database_Seeder extends Seeder { * Run the seeder. */ public function run() { + dd('aad', \App\Models\Post::factory()); // Call additional seeders... } } From 03457ab98ca7fd03b82cf55f4c00ec6f7e939966 Mon Sep 17 00:00:00 2001 From: Sean Fisher Date: Wed, 2 Aug 2023 17:19:10 -0400 Subject: [PATCH 09/17] Use the application and helper method --- bin/mantle | 18 +++++++++++++++--- mantle.php | 5 +---- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/bin/mantle b/bin/mantle index 68dc656..aec4ed5 100755 --- a/bin/mantle +++ b/bin/mantle @@ -1,8 +1,6 @@ #!/usr/bin/env php set_base_path( MANTLE_BASE_DIR ) ->boot(); diff --git a/mantle.php b/mantle.php index ed52118..dd35abc 100644 --- a/mantle.php +++ b/mantle.php @@ -73,10 +73,7 @@ function() { | Load the Application |-------------------------------------------------------------------------- | -| Load the Mantle application from the bootstrap file. This step is actually -| optional as Mantle can operate without any application kernel or configuration. -| This will allow you greater control over the application and make it feel more -| like a Laravel-esque application. +| Load the Mantle application from the bootstrap file. | */ From 26996af6d3744ddc200e468c0d60c2b5490b0584 Mon Sep 17 00:00:00 2001 From: Sean Fisher Date: Wed, 2 Aug 2023 17:19:54 -0400 Subject: [PATCH 10/17] Move the comment to mantle.php --- bin/mantle | 5 +---- mantle.php | 5 ++++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/mantle b/bin/mantle index aec4ed5..d64576d 100755 --- a/bin/mantle +++ b/bin/mantle @@ -26,10 +26,7 @@ if ( file_exists( __DIR__ . '/../vendor/autoload.php' ) ) { | Load the Application |-------------------------------------------------------------------------- | -| Load the Mantle application from the bootstrap file. This step is actually -| optional as Mantle can operate without any application kernel or configuration. -| This will allow you greater control over the application and make it feel more -| like a Laravel-esque application. +| Load the Mantle application from the bootstrap file. | */ diff --git a/mantle.php b/mantle.php index dd35abc..ed52118 100644 --- a/mantle.php +++ b/mantle.php @@ -73,7 +73,10 @@ function() { | Load the Application |-------------------------------------------------------------------------- | -| Load the Mantle application from the bootstrap file. +| Load the Mantle application from the bootstrap file. This step is actually +| optional as Mantle can operate without any application kernel or configuration. +| This will allow you greater control over the application and make it feel more +| like a Laravel-esque application. | */ From ed4e7d0cb6d05d27fdb493d1115f4cbfd6ffd2dd Mon Sep 17 00:00:00 2001 From: Sean Fisher Date: Thu, 3 Aug 2023 14:46:36 -0400 Subject: [PATCH 11/17] Removing the dd --- database/seeds/class-database-seeder.php | 1 - 1 file changed, 1 deletion(-) diff --git a/database/seeds/class-database-seeder.php b/database/seeds/class-database-seeder.php index 305e762..aa8bea3 100644 --- a/database/seeds/class-database-seeder.php +++ b/database/seeds/class-database-seeder.php @@ -17,7 +17,6 @@ class Database_Seeder extends Seeder { * Run the seeder. */ public function run() { - dd('aad', \App\Models\Post::factory()); // Call additional seeders... } } From adafb6c0462747c5f52dcc19da8e82edcc61748a Mon Sep 17 00:00:00 2001 From: Sean Fisher Date: Thu, 3 Aug 2023 14:56:31 -0400 Subject: [PATCH 12/17] Upgrading to nunomaduro/collision 6 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index af085c4..91df858 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ }, "require-dev": { "alleyinteractive/alley-coding-standards": "^1.0", - "nunomaduro/collision": "^5.0", + "nunomaduro/collision": "^6.0", "phpunit/phpunit": "^9.3.3" }, "config": { From 6d72cb0d0bcebf821b62bd2c1b0ea4e2f3fae97e Mon Sep 17 00:00:00 2001 From: Sean Fisher Date: Thu, 3 Aug 2023 15:18:09 -0400 Subject: [PATCH 13/17] Use a working version of phpcs for 8.1+ --- composer.json | 9 ++++++++- tests/bootstrap.php | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 91df858..f46f616 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,8 @@ "require-dev": { "alleyinteractive/alley-coding-standards": "^1.0", "nunomaduro/collision": "^6.0", - "phpunit/phpunit": "^9.3.3" + "phpunit/phpunit": "^9.3.3", + "wp-coding-standards/wpcs": "dev-php-8-1 as 2.3.x-dev" }, "config": { "allow-plugins": { @@ -41,6 +42,12 @@ }, "minimum-stability": "dev", "prefer-stable": true, + "repositories": [ + { + "type": "vcs", + "url": "https://github.com/alleyinteractive/WordPress-Coding-Standards" + } + ], "scripts": { "post-autoload-dump": [ "bin/mantle package:discover", diff --git a/tests/bootstrap.php b/tests/bootstrap.php index b50f432..cee9d1b 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -9,5 +9,6 @@ // Install the Mantle Test Framework. \Mantle\Testing\manager() + ->with_sqlite() ->loaded( fn () => require_once __DIR__ . '/../mantle.php' ) ->install(); From 4c7acc1157bba815391257de9f29ac8461746c02 Mon Sep 17 00:00:00 2001 From: Sean Fisher Date: Thu, 3 Aug 2023 15:23:26 -0400 Subject: [PATCH 14/17] Testing CI From 2f99a28fe82e62f65619544940f78f953b2e7d93 Mon Sep 17 00:00:00 2001 From: Sean Fisher Date: Wed, 16 Aug 2023 17:07:26 -0400 Subject: [PATCH 15/17] Bump Composer --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index f46f616..3fa31b0 100644 --- a/composer.json +++ b/composer.json @@ -12,12 +12,12 @@ "require": { "alleyinteractive/composer-wordpress-autoloader": "^1.0", "alleyinteractive/mantle-framework": "^0.12", - "fakerphp/faker": "^1.9" + "fakerphp/faker": "^1.23" }, "require-dev": { "alleyinteractive/alley-coding-standards": "^1.0", - "nunomaduro/collision": "^6.0", - "phpunit/phpunit": "^9.3.3", + "nunomaduro/collision": "^6.4", + "phpunit/phpunit": "^9.6.10", "wp-coding-standards/wpcs": "dev-php-8-1 as 2.3.x-dev" }, "config": { From 2e49d39186a6d82157595a7edb0847a549f2ba63 Mon Sep 17 00:00:00 2001 From: Sean Fisher Date: Wed, 16 Aug 2023 17:10:57 -0400 Subject: [PATCH 16/17] Lower test frequency --- .github/workflows/tests.yml | 5 +++-- README.md | 6 +++--- mantle.php | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 06a13b5..0ebbce8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -4,9 +4,10 @@ on: push: branches: - main + - '*.*.x' pull_request: schedule: - - cron: '0 0 * * *' + - cron: '0 0 * * 0' jobs: php-tests: @@ -17,6 +18,6 @@ jobs: multisite: [true, false] uses: alleyinteractive/.github/.github/workflows/php-tests.yml@main with: + multisite: ${{ matrix.multisite }} php: ${{ matrix.php }} wordpress: ${{ matrix.wordpress }} - multisite: ${{ matrix.multisite }} diff --git a/README.md b/README.md index 308af21..a6d7f4d 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ and layout and leaving the rest of the functionality to be built within the Mantle plugin. For more information about the framework and how to get started using it, check -out the [Mantle Documentation Site](https://mantle.alley.co/). +out the [Mantle Documentation Site](https://mantle.alley.com/). ## Installation @@ -57,13 +57,13 @@ You can also use a our [create-mantle-app](https://github.com/alleyinteractive/create-mantle-app) starter kit to get a fully scaffolded `wp-content`-rooted WordPress project out of the box. For more information, see -[Installation](https://mantle.alley.co/getting-started/installation.html). +[Installation](https://mantle.alley.com/getting-started/installation.html). ## Maintainers This project is actively maintained by [Alley Interactive](https://github.com/alleyinteractive). Like what you see? [Come work -with us](https://alley.co/careers/). +with us](https://alley.com/careers/). ![Alley logo](https://avatars.githubusercontent.com/u/1733454?s=200&v=4) diff --git a/mantle.php b/mantle.php index ed52118..43d7e99 100644 --- a/mantle.php +++ b/mantle.php @@ -4,7 +4,7 @@ * Plugin URI: https://github.com/alleyinteractive/mantle * Description: A framework for powerful WordPress development * Author: Alley - * Author URI: https://alley.co/ + * Author URI: https://alley.com/ * Text Domain: mantle * Domain Path: /languages * Version: 0.1 From b3514db7d62b9c31299cf253da7b342d743ab02c Mon Sep 17 00:00:00 2001 From: Sean Fisher Date: Wed, 16 Aug 2023 17:12:23 -0400 Subject: [PATCH 17/17] Bump to 8.2, lower schedule --- .github/workflows/coding-standards.yml | 5 +++-- .github/workflows/node-tests.yml | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index 7f21927..87d307c 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -4,12 +4,13 @@ on: push: branches: - main + - '*.*.x' pull_request: schedule: - - cron: '0 0 * * *' + - cron: '0 0 * * 0' jobs: coding-standards: uses: alleyinteractive/.github/.github/workflows/php-coding-standards.yml@main with: - php: '8.1' + php: '8.2' diff --git a/.github/workflows/node-tests.yml b/.github/workflows/node-tests.yml index d6d6ccb..d693654 100644 --- a/.github/workflows/node-tests.yml +++ b/.github/workflows/node-tests.yml @@ -1,6 +1,10 @@ name: Node Tests on: + push: + branches: + - main + - '*.*.x' pull_request: jobs: