Skip to content

Commit

Permalink
Merge pull request #195 from alleyinteractive/0.12.x
Browse files Browse the repository at this point in the history
0.12.x
  • Loading branch information
srtfisher authored Aug 17, 2023
2 parents 37f2b9b + b3514db commit 8c36cb5
Show file tree
Hide file tree
Showing 17 changed files with 194 additions and 112 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +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.2'
4 changes: 4 additions & 0 deletions .github/workflows/node-tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Node Tests

on:
push:
branches:
- main
- '*.*.x'
pull_request:

jobs:
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,20 @@ on:
push:
branches:
- main
- '*.*.x'
pull_request:
schedule:
- cron: '0 0 * * *'
- cron: '0 0 * * 0'

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
with:
multisite: ${{ matrix.multisite }}
php: ${{ matrix.php }}
wordpress: ${{ matrix.wordpress }}
multisite: ${{ matrix.multisite }}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)

Expand Down
27 changes: 9 additions & 18 deletions bin/mantle
Original file line number Diff line number Diff line change
Expand Up @@ -21,36 +21,27 @@ if ( file_exists( __DIR__ . '/../vendor/autoload.php' ) ) {
exit( 1 );
}

$app = require_once __DIR__ . '/../bootstrap/app.php';

/*
|--------------------------------------------------------------------------
| Run the Console Mantle Application
| Load the Application
|--------------------------------------------------------------------------
|
| Load the Mantle application and run the console application. With isolation
| mode enabled, we shouldn't have a dependency on WordPress.
| Load the Mantle application from the bootstrap file.
|
*/

$kernel = $app->make( Mantle\Contracts\Console\Kernel::class );

$status = $kernel->handle(
$input = new Symfony\Component\Console\Input\ArgvInput,
new Symfony\Component\Console\Output\ConsoleOutput(),
);
$app = require_once MANTLE_BASE_DIR . '/bootstrap/app.php';

/*
|--------------------------------------------------------------------------
| 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 );
bootloader( $app )
->set_base_path( MANTLE_BASE_DIR )
->boot();
15 changes: 11 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@
],
"require": {
"alleyinteractive/composer-wordpress-autoloader": "^1.0",
"alleyinteractive/mantle-framework": "^0.11",
"fakerphp/faker": "^1.9"
"alleyinteractive/mantle-framework": "^0.12",
"fakerphp/faker": "^1.23"
},
"require-dev": {
"alleyinteractive/alley-coding-standards": "^1.0",
"nunomaduro/collision": "^5.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": {
"allow-plugins": {
Expand All @@ -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",
Expand Down
11 changes: 11 additions & 0 deletions config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' ),
];
2 changes: 1 addition & 1 deletion config/assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' : '',
),
];
Empty file removed database/factories/.gitkeep
Empty file.
30 changes: 0 additions & 30 deletions database/factories/category-factory.php

This file was deleted.

30 changes: 0 additions & 30 deletions database/factories/post-factory.php

This file was deleted.

40 changes: 40 additions & 0 deletions database/factory/class-category-factory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php
/**
* Category Factory
*
* @package Mantle
*/

// phpcs:disable Squiz.Commenting.FunctionComment.MissingParamComment

namespace App\Database\Factory;

use Mantle\Support\Str;
use App\Models\Category;

/**
* Category Factory
*
* @extends \Mantle\Database\Factory\Term_Factory<\App\Models\Category>
*/
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',
];
}
}
41 changes: 41 additions & 0 deletions database/factory/class-post-factory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php
/**
* Post Factory
*
* @package Mantle
*/

// phpcs:disable Squiz.Commenting.FunctionComment.MissingParamComment

namespace App\Database\Factory;

use Mantle\Support\Str;
use App\Models\Post;

/**
* Post Factory
*
* @extends \Mantle\Database\Factory\Post_Factory<\App\Models\Post>
*/
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',
];
}
}
40 changes: 40 additions & 0 deletions database/factory/class-tag-factory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php
/**
* Tag Factory
*
* @package Mantle
*/

// phpcs:disable Squiz.Commenting.FunctionComment.MissingParamComment

namespace App\Database\Factory;

use Mantle\Support\Str;
use App\Models\Tag;

/**
* Tag Factory
*
* @extends \Mantle\Database\Factory\Term_Factory<\App\Models\Tag>
*/
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',
];
}
}
1 change: 0 additions & 1 deletion database/seeds/class-database-seeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
namespace App\Database\Seeds;

use Mantle\Database\Seeder;
use function Mantle\Support\Helpers\factory;

/**
* Application Seeder
Expand Down
Loading

0 comments on commit 8c36cb5

Please sign in to comment.