Skip to content

Commit

Permalink
Release 4.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lcharette authored Jul 18, 2021
2 parents 3186e20 + 6b1b04f commit 4fa04a8
Show file tree
Hide file tree
Showing 58 changed files with 487 additions and 695 deletions.
60 changes: 44 additions & 16 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php_versions: ['7.2', '7.3', '7.4']
php_versions: ['7.3', '7.4', '8.0']

runs-on: ubuntu-latest
name: PHPUnit - PHP ${{ matrix.php_versions }} - MySQL
Expand Down Expand Up @@ -42,7 +42,7 @@ jobs:

- uses: actions/setup-node@v2
with:
node-version: 14
node-version: ^14.0.0

- name: Setup Redis-server
uses: supercharge/redis-github-action@1.1.0
Expand All @@ -56,7 +56,7 @@ jobs:
run: sudo service mysql stop # Shutdown the Default MySQL, "sudo" is necessary, please not remove it

- name: Set up MySQL (PHP <= 7.3 -> MySQL 5)
if: ${{ matrix.php_versions != 7.4 }}
if: ${{ matrix.php_versions == 7.3 }}
uses: mirromutth/mysql-action@v1.1
with:
mysql version: '5'
Expand All @@ -65,7 +65,7 @@ jobs:
mysql password: 'password'

- name: Set up MySQL (PHP >= 7.4 -> MySQL 8)
if: ${{ matrix.php_versions == 7.4 }}
if: ${{ matrix.php_versions != 7.3 }}
uses: mirromutth/mysql-action@v1.1
with:
mysql version: '8'
Expand Down Expand Up @@ -95,7 +95,9 @@ jobs:
run: php bakery build-assets

- name: Execute tests
run: app/vendor/bin/phpunit --coverage-clover=coverage.xml
run: |
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
app/vendor/bin/phpunit --coverage-clover=coverage.xml
- name: Upload coverage to Codecov
if: github.event_name != 'schedule'
Expand All @@ -109,7 +111,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php_versions: ['7.2', '7.3', '7.4']
php_versions: ['7.3', '7.4', '8.0']

runs-on: ubuntu-latest
name: PHPUnit - PHP ${{ matrix.php_versions }} - SQLite
Expand All @@ -133,7 +135,7 @@ jobs:

- uses: actions/setup-node@v2
with:
node-version: 14
node-version: ^14.0.0

- name: Setup Redis-server
uses: supercharge/redis-github-action@1.1.0
Expand Down Expand Up @@ -164,7 +166,9 @@ jobs:
run: php bakery build-assets

- name: Execute tests
run: app/vendor/bin/phpunit --coverage-clover=coverage.xml
run: |
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
app/vendor/bin/phpunit --coverage-clover=coverage.xml
- name: Upload coverage to Codecov
if: github.event_name != 'schedule'
Expand All @@ -178,7 +182,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php_versions: ['7.2', '7.3', '7.4']
php_versions: ['7.3', '7.4', '8.0']

runs-on: ubuntu-latest
name: PHPUnit - PHP ${{ matrix.php_versions }} - PostgreSQL
Expand Down Expand Up @@ -213,7 +217,7 @@ jobs:

- uses: actions/setup-node@v2
with:
node-version: 14
node-version: ^14.0.0

- name: Setup Redis-server
uses: supercharge/redis-github-action@1.1.0
Expand All @@ -239,7 +243,9 @@ jobs:
run: php bakery build-assets

- name: Execute tests
run: app/vendor/bin/phpunit --coverage-clover=coverage.xml
run: |
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
app/vendor/bin/phpunit --coverage-clover=coverage.xml
- name: Upload coverage to Codecov
if: github.event_name != 'schedule'
Expand All @@ -253,7 +259,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php_versions: ['7.2', '7.3', '7.4']
php_versions: ['7.3', '7.4', '8.0']

runs-on: windows-latest
name: PHPUnit - PHP ${{ matrix.php_versions }} - Windows
Expand Down Expand Up @@ -300,7 +306,9 @@ jobs:
run: php bakery build-assets

- name: Execute tests
run: app/vendor/bin/phpunit --coverage-clover=coverage.xml
run: |
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
app/vendor/bin/phpunit --coverage-clover=coverage.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
Expand All @@ -313,8 +321,8 @@ jobs:
strategy:
fail-fast: false
matrix:
php_versions: ['7.4']
node_versions: ['12.17.0', '14', '15']
php_versions: [ '8.0' ]
node_versions: [ ^12.17.0, ^14, ^15 ]
os: [ubuntu-latest, windows-latest]

runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -342,4 +350,24 @@ jobs:
run: composer install --prefer-dist --no-progress

- name: Execute build
run: php bakery build-assets
run: php bakery build-assets

Asset-Build-Inspect:

name: Assets Build Inspection
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v2
with:
node-version: ^14.0.0

- name: Install Dependencies
working-directory: build
run: npm i

- name: Type Validation
working-directory: build
run: node_modules/.bin/tsc -p ./tsconfig.json
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,27 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [v4.6.0]

### Changed Requirements
- Drop PHP 7.2 support. Gain PHP 8.0 support. PHP 8.0 is now recommended.

### Dependencies upgrade
- Replaced individual UserFrosting Assets, Cache, Config, Fortress, i18n, Session, Support and UniformResouceLocator repos with monolitic `userfrosting/framework` repo.
- Upgrade all Laravel packages to ^8.x from ^5.8.
- Upgrade `vlucas/phpdotenv`to ^5.3 from ^3.4.
- Upgrade `symfony/console` to ^5.1 from ^4.3.
- Upgrade `phpunit/phpunit` to ^9.5

### New Feature
- Added support for built-in PHP Server.

### Changes
- Per user theme (`$user->theme`) is now deprecated and disabled by default. To enable back, change `per_user_theme` config to `true` ([#1131](https://github.com/userfrosting/UserFrosting/issues/1131)). This feature will be removed in future version.
- Bakery command `execute` method now requires to return an int (Symfony 4.4 upgrade : https://symfony.com/blog/new-in-symfony-4-4-console-improvements).
- `UserFrosting\Sprinkle\Core\Database\EloquentBuilder` now uses `Illuminate\Database\Eloquent\Concerns\QueriesRelationships` Trait instead of manually implementing `withSum`, `withAvg`, `withMin`, `withMax` & `withAggregate`. See Laravel documentation for usage change.
- Migrate `uf-modal.js` to jQuery Boilerplate ([#740](https://github.com/userfrosting/UserFrosting/issues/740))

## [v4.5.1]

### Fixed
Expand Down Expand Up @@ -1076,3 +1097,4 @@ See [http://learn.userfrosting.com/upgrading/40-to-41](Upgrading 4.0.x to 4.1.x
[v4.4.5]: https://github.com/userfrosting/UserFrosting/compare/v4.4.4...v4.4.5
[v4.5.0]: https://github.com/userfrosting/UserFrosting/compare/v4.4.5...v4.5.0
[v4.5.1]: https://github.com/userfrosting/UserFrosting/compare/v4.5.0...v4.5.1
[v4.6.0]: https://github.com/userfrosting/UserFrosting/compare/v4.5.0...v4.6.0
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# UserFrosting 4.5
# UserFrosting 4.6

[![Latest Version](https://img.shields.io/github/release/userfrosting/UserFrosting.svg)](https://github.com/userfrosting/UserFrosting/releases)
![PHP Version](https://img.shields.io/packagist/php-v/userfrosting/userfrosting.svg?color=brightgreen)
![PHP Version](https://img.shields.io/badge/php-%5E7.4%20%7C%20%5E8.0-brightgreen)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](LICENSE.md)
[![Join the chat at https://chat.userfrosting.com/channel/support](https://chat.userfrosting.com/api/v1/shield.svg?name=UserFrosting)](https://chat.userfrosting.com/channel/support)
[![Backers on Open Collective](https://opencollective.com/userfrosting/backers/badge.svg)](#backers)
Expand Down
6 changes: 3 additions & 3 deletions app/defines.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
namespace UserFrosting;

// Some standard defines
define('UserFrosting\VERSION', '4.5.1');
define('UserFrosting\VERSION', '4.6.0');
define('UserFrosting\DS', '/');
define('UserFrosting\PHP_MIN_VERSION', '^7.2');
define('UserFrosting\PHP_RECOMMENDED_VERSION', '^7.4');
define('UserFrosting\PHP_MIN_VERSION', '^7.3 | ^8.0');
define('UserFrosting\PHP_RECOMMENDED_VERSION', '^8.0');
define('UserFrosting\NODE_MIN_VERSION', '^12.17.0 || >=14.0.0');
define('UserFrosting\NPM_MIN_VERSION', '>=6.14.4');

Expand Down
54 changes: 6 additions & 48 deletions app/sprinkles/account/asset-bundles.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,77 +3,35 @@
"js/pages/account-settings": {
"scripts": [
"userfrosting/js/pages/account-settings.js"
],
"options": {
"result": {
"type": {
"scripts": "plain"
}
}
}
]
},
"js/pages/forgot-password": {
"scripts": [
"userfrosting/js/pages/forgot-password.js"
],
"options": {
"result": {
"type": {
"scripts": "plain"
}
}
}
]
},
"js/pages/resend-verification": {
"scripts": [
"userfrosting/js/pages/resend-verification.js"
],
"options": {
"result": {
"type": {
"scripts": "plain"
}
}
}
]
},
"js/pages/set-or-reset-password": {
"scripts": [
"userfrosting/js/pages/set-or-reset-password.js"
],
"options": {
"result": {
"type": {
"scripts": "plain"
}
}
}
]
},
"js/pages/register": {
"scripts": [
"vendor/speakingurl/speakingurl.min.js",
"userfrosting/js/uf-captcha.js",
"userfrosting/js/pages/register.js"
],
"options": {
"result": {
"type": {
"scripts": "plain"
}
}
}
]
},
"js/pages/sign-in": {
"scripts": [
"vendor/urijs/src/URI.js",
"userfrosting/js/pages/sign-in.js"
],
"options": {
"result": {
"type": {
"scripts": "plain"
}
}
}
]
}
}
}
9 changes: 9 additions & 0 deletions app/sprinkles/account/config/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,4 +175,13 @@
'algorithm' => 'sha512',
'timeout' => 10800,
],

/*
* ----------------------------------------------------------------------
* Enable or disable per user theme defined in `$currentUser->theme`
* ----------------------------------------------------------------------
* @deprecated 4.6.0 Per user theme will be removed in future version
* This config disable the feature before it is removed
*/
'per_user_theme' => false,
];
3 changes: 2 additions & 1 deletion app/sprinkles/account/src/Authorize/AuthorizationManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

namespace UserFrosting\Sprinkle\Account\Authorize;

use Illuminate\Support\Arr;
use Psr\Container\ContainerInterface;
use UserFrosting\Sprinkle\Account\Database\Models\Interfaces\UserInterface;

Expand Down Expand Up @@ -158,7 +159,7 @@ protected function getPermissionsArrayDebugInfo($permissions)
{
$permissionsInfo = [];
foreach ($permissions as $permission) {
$permissionData = array_only($permission->toArray(), ['id', 'slug', 'name', 'conditions', 'description']);
$permissionData = Arr::only($permission->toArray(), ['id', 'slug', 'name', 'conditions', 'description']);
// Remove this until we can find an efficient way to only load these once during debugging
//$permissionData['roles_via'] = $permission->roles_via->pluck('id')->all();
$permissionsInfo[] = $permissionData;
Expand Down
2 changes: 2 additions & 0 deletions app/sprinkles/account/src/Bakery/CreateAdminUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ protected function execute(InputInterface $input, OutputInterface $output)

$this->io->success('Root user creation successful!');
}

return self::SUCCESS;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ public function register(ContainerInterface $container)
* @return \UserFrosting\Assets\Assets
*/
$container->extend('assets', function ($assets, $c) {

// Force load the current user to add it's theme assets resources
$currentUser = $c->currentUser;
if ($c->config['per_user_theme']) {
// Force load the current user to add it's theme assets resources
$c->currentUser;
}

return $assets;
});
Expand Down Expand Up @@ -318,7 +319,7 @@ public function register(ContainerInterface $container)
$currentUser = $authenticator->user();

// Add user theme sprinkles resources
if ($authenticator->check() && $currentUser->theme) {
if ($c->config['per_user_theme'] && $authenticator->check() && $currentUser->theme) {
$c->sprinkleManager->addSprinkleResources($currentUser->theme);
}

Expand Down
Loading

0 comments on commit 4fa04a8

Please sign in to comment.