Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ on:

jobs:
testsuite:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
php-version: ['8.1']
php-version: ['8.2', '8.3', '8.4']
db-type: ['sqlite', 'mysql', 'pgsql']
prefer-lowest: ['']
include:
- php-version: '8.1'
- php-version: '8.2'
db-type: 'sqlite'
prefer-lowest: 'prefer-lowest'

Expand Down Expand Up @@ -90,20 +90,20 @@ jobs:
run: if ${{ matrix.prefer-lowest == 'prefer-lowest' }}; then vendor/bin/validate-prefer-lowest -m; fi

- name: Code Coverage Report
if: success() && matrix.php-version == '8.1' && matrix.db-type == 'sqlite'
if: success() && matrix.php-version == '8.2' && matrix.db-type == 'sqlite'
uses: codecov/codecov-action@v1

validation:
name: Coding Standard & Static Analysis
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.4'
extensions: mbstring, intl
coverage: none

Expand Down
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
"license": "MIT",
"require": {
"php": ">=8.1",
"cakephp/cakephp": "^5.0"
"cakephp/cakephp": "5.3.0-RC2"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be reverted when CakePHP 5.3 released

},
"require-dev": {
"cakedc/cakephp-phpstan": "^3.0",
"cakedc/cakephp-phpstan": "^4.0",
"cakephp/cakephp-codesniffer": "^5.0.0",
"phpunit/phpunit": "^10.1.0"
"phpunit/phpunit": "^10.1.0 || ^11 || ^12"
},
"autoload": {
"psr-4": {
Expand All @@ -33,10 +33,10 @@
},
"scripts": {
"test": "phpunit",
"cs-check": "phpcs --colors --parallel=16 -p src/",
"cs-fix": "phpcbf --colors --parallel=16 -p src/",
"cs-check": "phpcs --colors --parallel=16 -p",
"cs-fix": "phpcbf --colors --parallel=16 -p",
"stan": "phpstan analyse",
"stan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan:^1.7.0 && mv composer.backup composer.json",
"stan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan:^2.1.0 && mv composer.backup composer.json",
"lowest-setup": "composer update --prefer-lowest --prefer-stable --prefer-dist --no-interaction && cp composer.json composer.backup && composer require --dev dereuromark/composer-prefer-lowest && mv composer.backup composer.json"
},
"prefer-stable": true
Expand Down
7 changes: 4 additions & 3 deletions phpcs.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?xml version="1.0"?>
<ruleset name="CakePHP DebugKit">
<config name="installed_paths" value="../../cakephp/cakephp-codesniffer" />

<ruleset name="CakePHP Vite">
<file>src/</file>
<rule ref="CakePHP" />
<arg value="s"/>

<rule ref="Generic.Files.LineLength">
<properties>
<property name="lineLimit" value="150"/>
Expand Down
9 changes: 5 additions & 4 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
parameters:
level: 6
checkMissingIterableValueType: false
checkGenericClassInNonGenericObjectType: false
paths:
- src
bootstrapFiles:
- tests/bootstrap.php
paths:
- src
ignoreErrors:
- identifier: missingType.generics
- identifier: missingType.iterableValue

includes:
- vendor/cakedc/cakephp-phpstan/extension.neon
19 changes: 2 additions & 17 deletions src/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,9 @@

namespace ViteHelper;

use Cake\Core\BasePlugin;
use Cake\Core\Configure;
use Cake\Core\PluginApplicationInterface;

/**
* Plugin for ViteHelper
* @deprecated 2.5.0 Use ViteHelperPlugin instead
*/
class Plugin extends BasePlugin
class Plugin extends ViteHelperPlugin
{
/**
* @inheritDoc
*/
public function bootstrap(PluginApplicationInterface $app): void
{
parent::bootstrap($app);

if (file_exists(ROOT . DS . 'config' . DS . 'app_vite.php')) {
Configure::load('app_vite');
}
}
}
2 changes: 1 addition & 1 deletion src/Utilities/ViteManifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public static function getRecords(ViteHelperConfig $config): ManifestRecords
"\u0000",
],
'',
$json
$json,
);

$manifest = json_decode($json, false, 512, JSON_THROW_ON_ERROR);
Expand Down
4 changes: 2 additions & 2 deletions src/View/Helper/ViteScriptsHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ private function devScript(array $options, ViteHelperConfig $config): void
[
'type' => 'module',
'block' => $options['cssBlock'],
]
],
);

$files = $this->getFilesForDevelopment($options, $config, 'scriptEntries');
Expand Down Expand Up @@ -289,7 +289,7 @@ private function getFilesForDevelopment(array $options, ViteHelperConfig $config
if (empty($files)) {
throw new ConfigurationException(
'There are no valid entry points for the dev server. '
. 'Be sure to set the ViteHelper.development.' . $configOption . ' config or pass entries to the helper.'
. 'Be sure to set the ViteHelper.development.' . $configOption . ' config or pass entries to the helper.',
);
}

Expand Down
26 changes: 26 additions & 0 deletions src/ViteHelperPlugin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php
declare(strict_types=1);

namespace ViteHelper;

use Cake\Core\BasePlugin;
use Cake\Core\Configure;
use Cake\Core\PluginApplicationInterface;

/**
* Plugin for ViteHelper
*/
class ViteHelperPlugin extends BasePlugin
{
/**
* @inheritDoc
*/
public function bootstrap(PluginApplicationInterface $app): void
{
parent::bootstrap($app);

if (file_exists(ROOT . DS . 'config' . DS . 'app_vite.php')) {
Configure::load('app_vite');
}
}
}