From 90d1c5c20d9bc2954fb892fbbdfbff4a5ff99598 Mon Sep 17 00:00:00 2001 From: Roberto B Date: Sun, 11 Apr 2021 07:50:17 +0200 Subject: [PATCH 01/15] Upgrade PHP packages --- composer.lock | 160 +++++++++++++++++++------------------------------- 1 file changed, 62 insertions(+), 98 deletions(-) diff --git a/composer.lock b/composer.lock index 3a18a6c..21a87a5 100644 --- a/composer.lock +++ b/composer.lock @@ -172,43 +172,6 @@ ], "time": "2021-02-01T20:46:01+00:00" }, - { - "name": "dnoegel/php-xdg-base-dir", - "version": "v0.1.1", - "source": { - "type": "git", - "url": "https://github.com/dnoegel/php-xdg-base-dir.git", - "reference": "8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/dnoegel/php-xdg-base-dir/zipball/8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd", - "reference": "8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "require-dev": { - "phpunit/phpunit": "~7.0|~6.0|~5.0|~4.8.35" - }, - "type": "library", - "autoload": { - "psr-4": { - "XdgBaseDir\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "implementation of xdg base directory specification for php", - "support": { - "issues": "https://github.com/dnoegel/php-xdg-base-dir/issues", - "source": "https://github.com/dnoegel/php-xdg-base-dir/tree/v0.1.1" - }, - "time": "2019-12-04T15:06:13+00:00" - }, { "name": "doctrine/inflector", "version": "2.0.3", @@ -949,16 +912,16 @@ }, { "name": "hi-folks/lara-lens", - "version": "v0.2.2", + "version": "v0.2.3", "source": { "type": "git", "url": "https://github.com/Hi-Folks/lara-lens.git", - "reference": "a7b771f8eb51dd6d17a78a2dd74fa1599934e635" + "reference": "79e586045f874f6f8c27a5e8cfbe1de342c89724" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Hi-Folks/lara-lens/zipball/a7b771f8eb51dd6d17a78a2dd74fa1599934e635", - "reference": "a7b771f8eb51dd6d17a78a2dd74fa1599934e635", + "url": "https://api.github.com/repos/Hi-Folks/lara-lens/zipball/79e586045f874f6f8c27a5e8cfbe1de342c89724", + "reference": "79e586045f874f6f8c27a5e8cfbe1de342c89724", "shasum": "" }, "require": { @@ -968,8 +931,10 @@ "php": "^7.2|^8.0" }, "require-dev": { + "nunomaduro/larastan": "^0.7.2", "orchestra/testbench": "4.*|5.*|6.*", - "phpunit/phpunit": "^8.0|^9.3" + "phpunit/phpunit": "^8.0|^9.3", + "squizlabs/php_codesniffer": "^3.5" }, "type": "library", "extra": { @@ -1011,22 +976,22 @@ ], "support": { "issues": "https://github.com/Hi-Folks/lara-lens/issues", - "source": "https://github.com/Hi-Folks/lara-lens/tree/v0.2.2" + "source": "https://github.com/Hi-Folks/lara-lens/tree/v0.2.3" }, - "time": "2020-11-05T17:37:07+00:00" + "time": "2021-04-10T20:05:02+00:00" }, { "name": "laravel/framework", - "version": "v8.35.1", + "version": "v8.36.2", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "d118c0df39e7524131176aaf76493eae63a8a602" + "reference": "0debd8ad6b5aa1f61ccc73910adf049af4ca0444" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/d118c0df39e7524131176aaf76493eae63a8a602", - "reference": "d118c0df39e7524131176aaf76493eae63a8a602", + "url": "https://api.github.com/repos/laravel/framework/zipball/0debd8ad6b5aa1f61ccc73910adf049af4ca0444", + "reference": "0debd8ad6b5aa1f61ccc73910adf049af4ca0444", "shasum": "" }, "require": { @@ -1181,7 +1146,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2021-03-30T21:34:17+00:00" + "time": "2021-04-07T12:37:22+00:00" }, { "name": "laravel/tinker", @@ -1822,16 +1787,16 @@ }, { "name": "opis/closure", - "version": "3.6.1", + "version": "3.6.2", "source": { "type": "git", "url": "https://github.com/opis/closure.git", - "reference": "943b5d70cc5ae7483f6aff6ff43d7e34592ca0f5" + "reference": "06e2ebd25f2869e54a306dda991f7db58066f7f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opis/closure/zipball/943b5d70cc5ae7483f6aff6ff43d7e34592ca0f5", - "reference": "943b5d70cc5ae7483f6aff6ff43d7e34592ca0f5", + "url": "https://api.github.com/repos/opis/closure/zipball/06e2ebd25f2869e54a306dda991f7db58066f7f6", + "reference": "06e2ebd25f2869e54a306dda991f7db58066f7f6", "shasum": "" }, "require": { @@ -1881,9 +1846,9 @@ ], "support": { "issues": "https://github.com/opis/closure/issues", - "source": "https://github.com/opis/closure/tree/3.6.1" + "source": "https://github.com/opis/closure/tree/3.6.2" }, - "time": "2020-11-07T02:01:34+00:00" + "time": "2021-04-09T13:42:10+00:00" }, { "name": "phplang/scope-exit", @@ -2308,20 +2273,19 @@ }, { "name": "psy/psysh", - "version": "v0.10.7", + "version": "v0.10.8", "source": { "type": "git", "url": "https://github.com/bobthecow/psysh.git", - "reference": "a395af46999a12006213c0c8346c9445eb31640c" + "reference": "e4573f47750dd6c92dca5aee543fa77513cbd8d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bobthecow/psysh/zipball/a395af46999a12006213c0c8346c9445eb31640c", - "reference": "a395af46999a12006213c0c8346c9445eb31640c", + "url": "https://api.github.com/repos/bobthecow/psysh/zipball/e4573f47750dd6c92dca5aee543fa77513cbd8d3", + "reference": "e4573f47750dd6c92dca5aee543fa77513cbd8d3", "shasum": "" }, "require": { - "dnoegel/php-xdg-base-dir": "0.1.*", "ext-json": "*", "ext-tokenizer": "*", "nikic/php-parser": "~4.0|~3.0|~2.0|~1.3", @@ -2378,9 +2342,9 @@ ], "support": { "issues": "https://github.com/bobthecow/psysh/issues", - "source": "https://github.com/bobthecow/psysh/tree/v0.10.7" + "source": "https://github.com/bobthecow/psysh/tree/v0.10.8" }, - "time": "2021-03-14T02:14:56+00:00" + "time": "2021-04-10T16:23:39+00:00" }, { "name": "ralouphie/getallheaders", @@ -5824,16 +5788,16 @@ }, { "name": "facade/flare-client-php", - "version": "1.5.0", + "version": "1.6.1", "source": { "type": "git", "url": "https://github.com/facade/flare-client-php.git", - "reference": "9dd6f2b56486d939c4467b3f35475d44af57cf17" + "reference": "f2b0969f2d9594704be74dbeb25b201570a98098" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/facade/flare-client-php/zipball/9dd6f2b56486d939c4467b3f35475d44af57cf17", - "reference": "9dd6f2b56486d939c4467b3f35475d44af57cf17", + "url": "https://api.github.com/repos/facade/flare-client-php/zipball/f2b0969f2d9594704be74dbeb25b201570a98098", + "reference": "f2b0969f2d9594704be74dbeb25b201570a98098", "shasum": "" }, "require": { @@ -5877,7 +5841,7 @@ ], "support": { "issues": "https://github.com/facade/flare-client-php/issues", - "source": "https://github.com/facade/flare-client-php/tree/1.5.0" + "source": "https://github.com/facade/flare-client-php/tree/1.6.1" }, "funding": [ { @@ -5885,26 +5849,26 @@ "type": "github" } ], - "time": "2021-03-31T07:32:54+00:00" + "time": "2021-04-08T08:50:01+00:00" }, { "name": "facade/ignition", - "version": "2.7.0", + "version": "2.8.3", "source": { "type": "git", "url": "https://github.com/facade/ignition.git", - "reference": "bdc8b0b32c888f6edc838ca641358322b3d9506d" + "reference": "a8201d51aae83addceaef9344592a3b068b5d64d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/facade/ignition/zipball/bdc8b0b32c888f6edc838ca641358322b3d9506d", - "reference": "bdc8b0b32c888f6edc838ca641358322b3d9506d", + "url": "https://api.github.com/repos/facade/ignition/zipball/a8201d51aae83addceaef9344592a3b068b5d64d", + "reference": "a8201d51aae83addceaef9344592a3b068b5d64d", "shasum": "" }, "require": { "ext-json": "*", "ext-mbstring": "*", - "facade/flare-client-php": "^1.3.7", + "facade/flare-client-php": "^1.6", "facade/ignition-contracts": "^1.0.2", "filp/whoops": "^2.4", "illuminate/support": "^7.0|^8.0", @@ -5962,7 +5926,7 @@ "issues": "https://github.com/facade/ignition/issues", "source": "https://github.com/facade/ignition" }, - "time": "2021-03-30T15:55:38+00:00" + "time": "2021-04-09T20:45:59+00:00" }, { "name": "facade/ignition-contracts", @@ -6276,16 +6240,16 @@ }, { "name": "laravel/dusk", - "version": "v6.14.0", + "version": "v6.15.0", "source": { "type": "git", "url": "https://github.com/laravel/dusk.git", - "reference": "c0560c3b2ebcb491bf2b45d275817e80f1851f0b" + "reference": "45b55fa20321086c4f8cc4e712cbe54db644e21c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/dusk/zipball/c0560c3b2ebcb491bf2b45d275817e80f1851f0b", - "reference": "c0560c3b2ebcb491bf2b45d275817e80f1851f0b", + "url": "https://api.github.com/repos/laravel/dusk/zipball/45b55fa20321086c4f8cc4e712cbe54db644e21c", + "reference": "45b55fa20321086c4f8cc4e712cbe54db644e21c", "shasum": "" }, "require": { @@ -6343,9 +6307,9 @@ ], "support": { "issues": "https://github.com/laravel/dusk/issues", - "source": "https://github.com/laravel/dusk/tree/v6.14.0" + "source": "https://github.com/laravel/dusk/tree/v6.15.0" }, - "time": "2021-03-23T17:05:41+00:00" + "time": "2021-04-06T14:14:57+00:00" }, { "name": "laravel/sail", @@ -6538,16 +6502,16 @@ }, { "name": "nunomaduro/collision", - "version": "v5.3.0", + "version": "v5.4.0", "source": { "type": "git", "url": "https://github.com/nunomaduro/collision.git", - "reference": "aca63581f380f63a492b1e3114604e411e39133a" + "reference": "41b7e9999133d5082700d31a1d0977161df8322a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nunomaduro/collision/zipball/aca63581f380f63a492b1e3114604e411e39133a", - "reference": "aca63581f380f63a492b1e3114604e411e39133a", + "url": "https://api.github.com/repos/nunomaduro/collision/zipball/41b7e9999133d5082700d31a1d0977161df8322a", + "reference": "41b7e9999133d5082700d31a1d0977161df8322a", "shasum": "" }, "require": { @@ -6622,20 +6586,20 @@ "type": "patreon" } ], - "time": "2021-01-25T15:34:13+00:00" + "time": "2021-04-09T13:38:32+00:00" }, { "name": "nunomaduro/larastan", - "version": "v0.7.1", + "version": "v0.7.2", "source": { "type": "git", "url": "https://github.com/nunomaduro/larastan.git", - "reference": "bbbe09ec16a565e6423878bd17fc4355fa0d0a4c" + "reference": "cb7fa0b5af3738772e3568c0a0c7a080851e281d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nunomaduro/larastan/zipball/bbbe09ec16a565e6423878bd17fc4355fa0d0a4c", - "reference": "bbbe09ec16a565e6423878bd17fc4355fa0d0a4c", + "url": "https://api.github.com/repos/nunomaduro/larastan/zipball/cb7fa0b5af3738772e3568c0a0c7a080851e281d", + "reference": "cb7fa0b5af3738772e3568c0a0c7a080851e281d", "shasum": "" }, "require": { @@ -6650,7 +6614,7 @@ "illuminate/support": "^6.0 || ^7.0 || ^8.0 || ^9.0", "mockery/mockery": "^0.9 || ^1.0", "php": "^7.2 || ^8.0", - "phpstan/phpstan": "0.12.81", + "phpstan/phpstan": "^0.12.83", "symfony/process": "^4.3 || ^5.0" }, "require-dev": { @@ -6699,7 +6663,7 @@ ], "support": { "issues": "https://github.com/nunomaduro/larastan/issues", - "source": "https://github.com/nunomaduro/larastan/tree/v0.7.1" + "source": "https://github.com/nunomaduro/larastan/tree/v0.7.2" }, "funding": [ { @@ -6719,7 +6683,7 @@ "type": "patreon" } ], - "time": "2021-03-19T09:41:48+00:00" + "time": "2021-04-08T10:51:16+00:00" }, { "name": "phar-io/manifest", @@ -7130,16 +7094,16 @@ }, { "name": "phpstan/phpstan", - "version": "0.12.81", + "version": "0.12.83", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "0dd5b0ebeff568f7000022ea5f04aa86ad3124b8" + "reference": "4a967cec6efb46b500dd6d768657336a3ffe699f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/0dd5b0ebeff568f7000022ea5f04aa86ad3124b8", - "reference": "0dd5b0ebeff568f7000022ea5f04aa86ad3124b8", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/4a967cec6efb46b500dd6d768657336a3ffe699f", + "reference": "4a967cec6efb46b500dd6d768657336a3ffe699f", "shasum": "" }, "require": { @@ -7170,7 +7134,7 @@ "description": "PHPStan - PHP Static Analysis Tool", "support": { "issues": "https://github.com/phpstan/phpstan/issues", - "source": "https://github.com/phpstan/phpstan/tree/0.12.81" + "source": "https://github.com/phpstan/phpstan/tree/0.12.83" }, "funding": [ { @@ -7186,7 +7150,7 @@ "type": "tidelift" } ], - "time": "2021-03-08T22:03:02+00:00" + "time": "2021-04-03T15:35:45+00:00" }, { "name": "phpunit/php-code-coverage", From 4884c351064f4279b011843adae5a1d632e3ece4 Mon Sep 17 00:00:00 2001 From: Roberto B Date: Sun, 11 Apr 2021 07:51:15 +0200 Subject: [PATCH 02/15] Update CHANGELOG.md --- CHANGELOG.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 81fcd46..8cdeb09 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,14 @@ # Changelog -## 0.2.4 - WIP +## 0.2.5 - WIP +### Add +- + +### Change +- + + +## 0.2.4 - 2021-04-05 ### Add - Add Postgresql database From ac2b11be5903dce65a3baf62ef55d930a1b7735d Mon Sep 17 00:00:00 2001 From: Roberto B Date: Sun, 11 Apr 2021 15:15:56 +0200 Subject: [PATCH 03/15] addding parameters and setting for install phpcs and phpstan --- app/Http/Livewire/ConfiguratorForm.php | 27 ++++------- app/Traits/Form/CodeQuality.php | 47 ++++++++++++++++++ resources/views/action_yaml.blade.php | 41 +--------------- .../livewire/configurator-form.blade.php | 43 +---------------- .../livewire/form/code-quality.blade.php | 48 +++++++++++++++++++ resources/views/yaml/code_quality.blade.php | 45 +++++++++++++++++ 6 files changed, 152 insertions(+), 99 deletions(-) create mode 100644 app/Traits/Form/CodeQuality.php create mode 100644 resources/views/livewire/form/code-quality.blade.php create mode 100644 resources/views/yaml/code_quality.blade.php diff --git a/app/Http/Livewire/ConfiguratorForm.php b/app/Http/Livewire/ConfiguratorForm.php index c30f6cd..bac5086 100644 --- a/app/Http/Livewire/ConfiguratorForm.php +++ b/app/Http/Livewire/ConfiguratorForm.php @@ -3,6 +3,7 @@ namespace App\Http\Livewire; use App\Models\Configuration; +use App\Traits\Form\CodeQuality; use DanHarrin\LivewireRateLimiting\Exceptions\TooManyRequestsException; use DanHarrin\LivewireRateLimiting\WithRateLimiting; use Illuminate\Support\Facades\Cache; @@ -23,6 +24,7 @@ class ConfiguratorForm extends Component { use WithRateLimiting; + use CodeQuality; public $code = ""; @@ -33,7 +35,6 @@ class ConfiguratorForm extends Component public const DB_TYPE_SQLITE = "sqlite"; public const DB_TYPE_POSTGRESQL = "postgresql"; - public $name; public $onPush; public $onPushBranches; @@ -62,10 +63,7 @@ class ConfiguratorForm extends Component public $stepCacheNpmModules; // true public $stepFixStoragePermissions; //true public $stepRunMigrations; // true - public $stepExecutePhpunit; //true - public $stepExecuteCodeSniffer; //false - public $stepExecuteStaticAnalysis; // false - public $stepDusk; // false + public $matrixLaravel; // false public $matrixLaravelVersions; // [] public $matrixTestbenchDependencies; @@ -119,10 +117,7 @@ private function loadDefaults() $this->stepCacheNpmModules = true; $this->stepFixStoragePermissions = true; $this->stepRunMigrations = true; - $this->stepExecutePhpunit = true; - $this->stepExecuteCodeSniffer = false; - $this->stepExecuteStaticAnalysis = false; - $this->stepDusk = false; + $this->loadDefaultsCodeQuality(); $this->matrixLaravel = false; $this->matrixLaravelVersions = []; $this->matrixTestbenchDependencies = [ @@ -198,10 +193,9 @@ public function mount() $this->stepCacheNpmModules = $j->stepCacheNpmModules; $this->stepFixStoragePermissions = $j->stepFixStoragePermissions; $this->stepRunMigrations = $j->stepRunMigrations; - $this->stepExecutePhpunit = $j->stepExecutePhpunit; - $this->stepExecuteCodeSniffer = $j->stepExecuteCodeSniffer; - $this->stepExecuteStaticAnalysis = $j->stepExecuteStaticAnalysis; - $this->stepDusk = $j->stepDusk; + + $this->loadCodeQualityFromJson($j); + $this->matrixLaravel = $j->matrixLaravel; $this->matrixLaravelVersions = $j->matrixLaravelVersions; $this->matrixTestbenchDependencies = (array) $j->matrixTestbenchDependencies; @@ -327,14 +321,13 @@ public function submitForm() "stepCacheNpmModules", "stepFixStoragePermissions", "stepRunMigrations", - "stepExecutePhpunit", - "stepExecuteCodeSniffer", - "stepExecuteStaticAnalysis", - "stepDusk", + "matrixLaravel", "matrixLaravelVersions", "matrixTestbenchDependencies" ); + $data = $this->setDataCodeQuality($data); + $data["stepPhpVersionsString"] = self::arrayToString($this->stepPhpVersions); $data["on_pullrequest_branches"] = self::split($this->onPullrequestBranches); $data["on_push_branches"] = self::split($this->onPushBranches); diff --git a/app/Traits/Form/CodeQuality.php b/app/Traits/Form/CodeQuality.php new file mode 100644 index 0000000..9723c46 --- /dev/null +++ b/app/Traits/Form/CodeQuality.php @@ -0,0 +1,47 @@ +stepExecutePhpunit = true; + $this->stepExecuteCodeSniffer = false; + $this->stepInstallCodeSniffer = true; + $this->stepExecuteStaticAnalysis = false; + $this->stepInstallStaticAnalysis = true; + $this->stepDusk = false; + } + + public function loadCodeQualityFromJson($j) + { + + data_fill($j, "stepInstallCodeSniffer", true); + data_fill($j, "stepInstallStaticAnalysis", true); + $this->stepExecutePhpunit = $j->stepExecutePhpunit; + $this->stepExecuteCodeSniffer = $j->stepExecuteCodeSniffer; + $this->stepInstallCodeSniffer = $j->stepInstallCodeSniffer; + $this->stepExecuteStaticAnalysis = $j->stepExecuteStaticAnalysis; + $this->stepInstallStaticAnalysis = $j->stepInstallStaticAnalysis; + $this->stepDusk = $j->stepDusk; + } + + public function setDataCodeQuality($data) { + $data["stepExecutePhpunit"]= $this->stepExecutePhpunit; + $data["stepExecuteCodeSniffer"]= $this->stepExecuteCodeSniffer; + $data["stepInstallCodeSniffer"]= $this->stepInstallCodeSniffer; + $data["stepExecuteStaticAnalysis"]= $this->stepExecuteStaticAnalysis; + $data["stepInstallStaticAnalysis"]= $this->stepInstallStaticAnalysis; + $data["stepDusk"]= $this->stepDusk; + + return $data; + } +} diff --git a/resources/views/action_yaml.blade.php b/resources/views/action_yaml.blade.php index 2dd1939..e13f95b 100644 --- a/resources/views/action_yaml.blade.php +++ b/resources/views/action_yaml.blade.php @@ -110,43 +110,4 @@ - name: PHP Version run: php --version -@if ($stepExecutePhpunit) - - name: Execute tests (Unit and Feature tests) via PHPUnit -@include('yaml.set_env') - - run: vendor/bin/phpunit --testdox -@endif - -@if ($stepExecuteCodeSniffer) - - name: Execute Code Sniffer via phpcs - run: | - composer require --dev squizlabs/php_codesniffer - vendor/bin/phpcs --standard=PSR12 app -@endif - -@if ($stepExecuteStaticAnalysis) - - name: Execute Code Static Analysis (PHP Stan + Larastan) - run: | - composer require --dev nunomaduro/larastan - vendor/bin/phpstan analyse app -c ./vendor/nunomaduro/larastan/extension.neon --level=4 --no-progress -@endif - - - - -@if ($stepDusk) - - name: Browser Test - upgrade and start Chrome Driver - run: | - composer require --dev laravel/dusk - php artisan dusk:chrome-driver --detect - ./vendor/laravel/dusk/bin/chromedriver-linux > /dev/null 2>&1 & - - name: Run Dusk Tests - run: | - php artisan serve > /dev/null 2>&1 & - chmod -R 0755 vendor/laravel/dusk/bin/ -@if ( $stepRunMigrations ) - php artisan migrate -@endif - php artisan dusk -@include('yaml.set_env') -@endif +@include('yaml.code_quality') diff --git a/resources/views/livewire/configurator-form.blade.php b/resources/views/livewire/configurator-form.blade.php index 37c4c22..f8c5dc4 100644 --- a/resources/views/livewire/configurator-form.blade.php +++ b/resources/views/livewire/configurator-form.blade.php @@ -325,53 +325,12 @@ -
-
- - -
-
- -
-
- - -
-
-
-
- - -
-
-
-
- - -
-
- + @include('livewire.form.code-quality') diff --git a/resources/views/livewire/form/code-quality.blade.php b/resources/views/livewire/form/code-quality.blade.php new file mode 100644 index 0000000..eaf4718 --- /dev/null +++ b/resources/views/livewire/form/code-quality.blade.php @@ -0,0 +1,48 @@ +
+ Code Quality +
+
+
+ + +
+
+
+
+ + +
+
+ +
+
+ + +
+
+ + +
+
+ + +
+
+
+
diff --git a/resources/views/yaml/code_quality.blade.php b/resources/views/yaml/code_quality.blade.php new file mode 100644 index 0000000..b08a618 --- /dev/null +++ b/resources/views/yaml/code_quality.blade.php @@ -0,0 +1,45 @@ +# Code quality +@if ($stepExecutePhpunit) + - name: Execute tests (Unit and Feature tests) via PHPUnit +@include('yaml.set_env') + + run: vendor/bin/phpunit --testdox +@endif + +@if ($stepExecuteCodeSniffer) + - name: Execute Code Sniffer via phpcs + run: | +@if ($stepInstallCodeSniffer) + composer require --dev squizlabs/php_codesniffer +@endif + vendor/bin/phpcs --standard=PSR12 app +@endif + +@if ($stepExecuteStaticAnalysis) + - name: Execute Code Static Analysis (PHP Stan + Larastan) + run: | +@if ($stepInstallStaticAnalysis) + composer require --dev nunomaduro/larastan +@endif + vendor/bin/phpstan analyse app -c ./vendor/nunomaduro/larastan/extension.neon --level=4 --no-progress +@endif + + + + +@if ($stepDusk) + - name: Browser Test - upgrade and start Chrome Driver + run: | + composer require --dev laravel/dusk + php artisan dusk:chrome-driver --detect + ./vendor/laravel/dusk/bin/chromedriver-linux > /dev/null 2>&1 & + - name: Run Dusk Tests + run: | + php artisan serve > /dev/null 2>&1 & + chmod -R 0755 vendor/laravel/dusk/bin/ +@if ( $stepRunMigrations ) + php artisan migrate +@endif + php artisan dusk +@include('yaml.set_env') +@endif From d43741e47196af1eb146cad95a654e368ac966da Mon Sep 17 00:00:00 2001 From: Roberto B Date: Sun, 11 Apr 2021 15:43:49 +0200 Subject: [PATCH 04/15] Update psr12-phpstan.yml --- .github/workflows/psr12-phpstan.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/psr12-phpstan.yml b/.github/workflows/psr12-phpstan.yml index 077c80c..feb6fd8 100644 --- a/.github/workflows/psr12-phpstan.yml +++ b/.github/workflows/psr12-phpstan.yml @@ -64,12 +64,10 @@ jobs: - name: Execute Code Sniffer via phpcs run: | - composer require --dev squizlabs/php_codesniffer vendor/bin/phpcs --standard=PSR12 app - name: Execute Code Static Analysis (PHP Stan + Larastan) run: | - composer require --dev nunomaduro/larastan vendor/bin/phpstan analyse app -c ./vendor/nunomaduro/larastan/extension.neon --level=4 --no-progress From 0f3b0f4250ef9faf873bbd3562edcd5cd9c2a5b0 Mon Sep 17 00:00:00 2001 From: Roberto B Date: Sun, 11 Apr 2021 15:48:47 +0200 Subject: [PATCH 05/15] adding code sniffer (phpcs) --- composer.json | 5 +++-- composer.lock | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 60 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index a4cd196..3ca4151 100644 --- a/composer.json +++ b/composer.json @@ -32,8 +32,9 @@ "laravel/sail": "^0.0.5", "mockery/mockery": "^1.4.2", "nunomaduro/collision": "^5.0", - "nunomaduro/larastan": "^0.7.1", - "phpunit/phpunit": "^9.3.3" + "nunomaduro/larastan": "^0.7.2", + "phpunit/phpunit": "^9.3.3", + "squizlabs/php_codesniffer": "^3.6" }, "config": { "optimize-autoloader": true, diff --git a/composer.lock b/composer.lock index 21a87a5..2f47453 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "dce391128eb34e67a297951e74b3a6f9", + "content-hash": "2a7c3cbd4f702303a13a06699b81cafe", "packages": [ { "name": "asm89/stack-cors", @@ -8698,6 +8698,62 @@ }, "time": "2020-07-07T18:42:57+00:00" }, + { + "name": "squizlabs/php_codesniffer", + "version": "3.6.0", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "ffced0d2c8fa8e6cdc4d695a743271fab6c38625" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ffced0d2c8fa8e6cdc4d695a743271fab6c38625", + "reference": "ffced0d2c8fa8e6cdc4d695a743271fab6c38625", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + }, + "bin": [ + "bin/phpcs", + "bin/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", + "keywords": [ + "phpcs", + "standards" + ], + "support": { + "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", + "source": "https://github.com/squizlabs/PHP_CodeSniffer", + "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" + }, + "time": "2021-04-09T00:54:41+00:00" + }, { "name": "symfony/filesystem", "version": "v5.2.6", From c91a8047b9c3c5b88a68596c4344f1eb870228bd Mon Sep 17 00:00:00 2001 From: Roberto B Date: Sun, 11 Apr 2021 15:51:45 +0200 Subject: [PATCH 06/15] fix styles --- app/Http/Livewire/ConfiguratorForm.php | 1 - app/Traits/Form/CodeQuality.php | 15 ++++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/Http/Livewire/ConfiguratorForm.php b/app/Http/Livewire/ConfiguratorForm.php index bac5086..1b8d717 100644 --- a/app/Http/Livewire/ConfiguratorForm.php +++ b/app/Http/Livewire/ConfiguratorForm.php @@ -321,7 +321,6 @@ public function submitForm() "stepCacheNpmModules", "stepFixStoragePermissions", "stepRunMigrations", - "matrixLaravel", "matrixLaravelVersions", "matrixTestbenchDependencies" diff --git a/app/Traits/Form/CodeQuality.php b/app/Traits/Form/CodeQuality.php index 9723c46..d11f0d5 100644 --- a/app/Traits/Form/CodeQuality.php +++ b/app/Traits/Form/CodeQuality.php @@ -34,13 +34,14 @@ public function loadCodeQualityFromJson($j) $this->stepDusk = $j->stepDusk; } - public function setDataCodeQuality($data) { - $data["stepExecutePhpunit"]= $this->stepExecutePhpunit; - $data["stepExecuteCodeSniffer"]= $this->stepExecuteCodeSniffer; - $data["stepInstallCodeSniffer"]= $this->stepInstallCodeSniffer; - $data["stepExecuteStaticAnalysis"]= $this->stepExecuteStaticAnalysis; - $data["stepInstallStaticAnalysis"]= $this->stepInstallStaticAnalysis; - $data["stepDusk"]= $this->stepDusk; + public function setDataCodeQuality($data) + { + $data["stepExecutePhpunit"] = $this->stepExecutePhpunit; + $data["stepExecuteCodeSniffer"] = $this->stepExecuteCodeSniffer; + $data["stepInstallCodeSniffer"] = $this->stepInstallCodeSniffer; + $data["stepExecuteStaticAnalysis"] = $this->stepExecuteStaticAnalysis; + $data["stepInstallStaticAnalysis"] = $this->stepInstallStaticAnalysis; + $data["stepDusk"] = $this->stepDusk; return $data; } From 2e86d4d880255dc480add640fe4e4adbbf878a24 Mon Sep 17 00:00:00 2001 From: Roberto B Date: Sun, 11 Apr 2021 21:51:26 +0200 Subject: [PATCH 07/15] Conditional check boxes for execute/install phpstan and phpcs --- .../form/input-conditional-checkbox.blade.php | 8 ++-- .../livewire/configurator-form.blade.php | 2 + .../livewire/form/code-quality.blade.php | 40 +++++++++++++------ 3 files changed, 35 insertions(+), 15 deletions(-) diff --git a/resources/views/components/form/input-conditional-checkbox.blade.php b/resources/views/components/form/input-conditional-checkbox.blade.php index 973347c..1b01500 100644 --- a/resources/views/components/form/input-conditional-checkbox.blade.php +++ b/resources/views/components/form/input-conditional-checkbox.blade.php @@ -7,8 +7,9 @@ 'model' => '', ]) -
-
+
+ +
-
+ +
{{ $slot }}
diff --git a/resources/views/livewire/configurator-form.blade.php b/resources/views/livewire/configurator-form.blade.php index f8c5dc4..dad9d79 100644 --- a/resources/views/livewire/configurator-form.blade.php +++ b/resources/views/livewire/configurator-form.blade.php @@ -276,6 +276,7 @@ Laravel stuff
+ +
-
+ + model="stepInstallCodeSniffer" + name="stepInstallCodeSniffer" + label="Install Code Sniffer phpcs" + help="Install Code Sniffer phpcs"> -
+ +
-
+ + model="stepInstallStaticAnalysis" + name="stepInstallStaticAnalysis" + label="Install Phpstan" + help="Install Larastan and Phpstan"> -
+ +
From d15edb55d35e2b5cb101c6553cd873c8735d53e2 Mon Sep 17 00:00:00 2001 From: Roberto B Date: Sun, 11 Apr 2021 21:51:48 +0200 Subject: [PATCH 08/15] Adding test for phpstan and phpcs options --- tests/Feature/YamlFormTest.php | 34 +++++++++++++++++++ tests/Feature/mock-asserts/phpcs-install.yaml | 4 +++ .../Feature/mock-asserts/phpcs-noinstall.yaml | 3 ++ .../Feature/mock-asserts/phpstan-install.yaml | 4 +++ .../mock-asserts/phpstan-noinstall.yaml | 3 ++ 5 files changed, 48 insertions(+) create mode 100644 tests/Feature/mock-asserts/phpcs-install.yaml create mode 100644 tests/Feature/mock-asserts/phpcs-noinstall.yaml create mode 100644 tests/Feature/mock-asserts/phpstan-install.yaml create mode 100644 tests/Feature/mock-asserts/phpstan-noinstall.yaml diff --git a/tests/Feature/YamlFormTest.php b/tests/Feature/YamlFormTest.php index eef3c34..e4b1347 100644 --- a/tests/Feature/YamlFormTest.php +++ b/tests/Feature/YamlFormTest.php @@ -174,4 +174,38 @@ public function test_form_submit_test_matrix() } + /** + * Form Test: code quality section. + * + * @return void + */ + public function test_form_codequality_tests() + { + Livewire::test(ConfiguratorForm::class) + ->set("name", "Test") + ->set("stepExecuteStaticAnalysis", true) + ->set("stepInstallStaticAnalysis", false) + ->call('submitForm') + ->assertSee(file_get_contents(base_path(self::DIR_MOCK . "phpstan-noinstall.yaml"))); + Livewire::test(ConfiguratorForm::class) + ->set("name", "Test") + ->set("stepExecuteStaticAnalysis", true) + ->set("stepInstallStaticAnalysis", true) + ->call('submitForm') + ->assertSee(file_get_contents(base_path(self::DIR_MOCK . "phpstan-install.yaml"))); + Livewire::test(ConfiguratorForm::class) + ->set("name", "Test") + ->set("stepExecuteCodeSniffer", true) + ->set("stepInstallCodeSniffer", false) + ->call('submitForm') + ->assertSee(file_get_contents(base_path(self::DIR_MOCK . "phpcs-noinstall.yaml"))); + Livewire::test(ConfiguratorForm::class) + ->set("name", "Test") + ->set("stepExecuteCodeSniffer", true) + ->set("stepInstallCodeSniffer", true) + ->call('submitForm') + ->assertSee(file_get_contents(base_path(self::DIR_MOCK . "phpcs-install.yaml"))); + + } + } diff --git a/tests/Feature/mock-asserts/phpcs-install.yaml b/tests/Feature/mock-asserts/phpcs-install.yaml new file mode 100644 index 0000000..7c13410 --- /dev/null +++ b/tests/Feature/mock-asserts/phpcs-install.yaml @@ -0,0 +1,4 @@ + - name: Execute Code Sniffer via phpcs + run: | + composer require --dev squizlabs/php_codesniffer + vendor/bin/phpcs --standard=PSR12 app diff --git a/tests/Feature/mock-asserts/phpcs-noinstall.yaml b/tests/Feature/mock-asserts/phpcs-noinstall.yaml new file mode 100644 index 0000000..c5418d9 --- /dev/null +++ b/tests/Feature/mock-asserts/phpcs-noinstall.yaml @@ -0,0 +1,3 @@ + - name: Execute Code Sniffer via phpcs + run: | + vendor/bin/phpcs --standard=PSR12 app diff --git a/tests/Feature/mock-asserts/phpstan-install.yaml b/tests/Feature/mock-asserts/phpstan-install.yaml new file mode 100644 index 0000000..90e1506 --- /dev/null +++ b/tests/Feature/mock-asserts/phpstan-install.yaml @@ -0,0 +1,4 @@ + - name: Execute Code Static Analysis (PHP Stan + Larastan) + run: | + composer require --dev nunomaduro/larastan + vendor/bin/phpstan analyse app -c ./vendor/nunomaduro/larastan/extension.neon --level=4 --no-progress diff --git a/tests/Feature/mock-asserts/phpstan-noinstall.yaml b/tests/Feature/mock-asserts/phpstan-noinstall.yaml new file mode 100644 index 0000000..1f04ac4 --- /dev/null +++ b/tests/Feature/mock-asserts/phpstan-noinstall.yaml @@ -0,0 +1,3 @@ + - name: Execute Code Static Analysis (PHP Stan + Larastan) + run: | + vendor/bin/phpstan analyse app -c ./vendor/nunomaduro/larastan/extension.neon --level=4 --no-progress From a14f74c2ef6d2ebd84fe0f79b528a7ee29cfc7c2 Mon Sep 17 00:00:00 2001 From: Roberto B Date: Sun, 11 Apr 2021 22:42:33 +0200 Subject: [PATCH 09/15] dir for phpstan and phpcs close #56 --- app/Traits/Form/CodeQuality.php | 11 +++++- .../livewire/form/code-quality.blade.php | 34 +++++++++++++------ resources/views/yaml/code_quality.blade.php | 4 +-- tests/Feature/YamlFormTest.php | 8 +++++ tests/Feature/mock-asserts/phpcs-srcdir.yaml | 4 +++ 5 files changed, 48 insertions(+), 13 deletions(-) create mode 100644 tests/Feature/mock-asserts/phpcs-srcdir.yaml diff --git a/app/Traits/Form/CodeQuality.php b/app/Traits/Form/CodeQuality.php index d11f0d5..930b586 100644 --- a/app/Traits/Form/CodeQuality.php +++ b/app/Traits/Form/CodeQuality.php @@ -6,8 +6,10 @@ trait CodeQuality { public $stepExecutePhpunit; //true public $stepExecuteCodeSniffer; //false + public $stepDirCodeSniffer; // app public $stepInstallCodeSniffer; //true public $stepExecuteStaticAnalysis; // false + public $stepDirStaticAnalysis; // app public $stepInstallStaticAnalysis; //true public $stepDusk; // false @@ -15,21 +17,26 @@ public function loadDefaultsCodeQuality() { $this->stepExecutePhpunit = true; $this->stepExecuteCodeSniffer = false; + $this->stepDirCodeSniffer = "app"; $this->stepInstallCodeSniffer = true; $this->stepExecuteStaticAnalysis = false; + $this->stepDirStaticAnalysis = "app"; $this->stepInstallStaticAnalysis = true; $this->stepDusk = false; } public function loadCodeQualityFromJson($j) { - + data_fill($j, "stepDirCodeSniffer", "app"); data_fill($j, "stepInstallCodeSniffer", true); + data_fill($j, "stepDirStaticAnalysis", "app"); data_fill($j, "stepInstallStaticAnalysis", true); $this->stepExecutePhpunit = $j->stepExecutePhpunit; $this->stepExecuteCodeSniffer = $j->stepExecuteCodeSniffer; + $this->stepDirCodeSniffer = $j->stepDirCodeSniffer; $this->stepInstallCodeSniffer = $j->stepInstallCodeSniffer; $this->stepExecuteStaticAnalysis = $j->stepExecuteStaticAnalysis; + $this->stepDirStaticAnalysis = $j->stepDirStaticAnalysis; $this->stepInstallStaticAnalysis = $j->stepInstallStaticAnalysis; $this->stepDusk = $j->stepDusk; } @@ -38,8 +45,10 @@ public function setDataCodeQuality($data) { $data["stepExecutePhpunit"] = $this->stepExecutePhpunit; $data["stepExecuteCodeSniffer"] = $this->stepExecuteCodeSniffer; + $data["stepDirCodeSniffer"] = $this->stepDirCodeSniffer; $data["stepInstallCodeSniffer"] = $this->stepInstallCodeSniffer; $data["stepExecuteStaticAnalysis"] = $this->stepExecuteStaticAnalysis; + $data["stepDirStaticAnalysis"] = $this->stepDirStaticAnalysis; $data["stepInstallStaticAnalysis"] = $this->stepInstallStaticAnalysis; $data["stepDusk"] = $this->stepDusk; diff --git a/resources/views/livewire/form/code-quality.blade.php b/resources/views/livewire/form/code-quality.blade.php index eae526f..470646b 100644 --- a/resources/views/livewire/form/code-quality.blade.php +++ b/resources/views/livewire/form/code-quality.blade.php @@ -11,6 +11,16 @@
+
+
+ + +
+
+ + + + + -
-
- - -
-
+
diff --git a/resources/views/yaml/code_quality.blade.php b/resources/views/yaml/code_quality.blade.php index b08a618..83b9c19 100644 --- a/resources/views/yaml/code_quality.blade.php +++ b/resources/views/yaml/code_quality.blade.php @@ -12,7 +12,7 @@ @if ($stepInstallCodeSniffer) composer require --dev squizlabs/php_codesniffer @endif - vendor/bin/phpcs --standard=PSR12 app + vendor/bin/phpcs --standard=PSR12 {{ $stepDirCodeSniffer }} @endif @if ($stepExecuteStaticAnalysis) @@ -21,7 +21,7 @@ @if ($stepInstallStaticAnalysis) composer require --dev nunomaduro/larastan @endif - vendor/bin/phpstan analyse app -c ./vendor/nunomaduro/larastan/extension.neon --level=4 --no-progress + vendor/bin/phpstan analyse {{ $stepDirStaticAnalysis }} -c ./vendor/nunomaduro/larastan/extension.neon --level=4 --no-progress @endif diff --git a/tests/Feature/YamlFormTest.php b/tests/Feature/YamlFormTest.php index e4b1347..de34c3d 100644 --- a/tests/Feature/YamlFormTest.php +++ b/tests/Feature/YamlFormTest.php @@ -206,6 +206,14 @@ public function test_form_codequality_tests() ->call('submitForm') ->assertSee(file_get_contents(base_path(self::DIR_MOCK . "phpcs-install.yaml"))); + Livewire::test(ConfiguratorForm::class) + ->set("name", "Test") + ->set("stepExecuteCodeSniffer", true) + ->set("stepDirCodeSniffer", "src") + ->set("stepInstallCodeSniffer", true) + ->call('submitForm') + ->assertSee(file_get_contents(base_path(self::DIR_MOCK . "phpcs-srcdir.yaml"))); + } } diff --git a/tests/Feature/mock-asserts/phpcs-srcdir.yaml b/tests/Feature/mock-asserts/phpcs-srcdir.yaml new file mode 100644 index 0000000..fbf62c6 --- /dev/null +++ b/tests/Feature/mock-asserts/phpcs-srcdir.yaml @@ -0,0 +1,4 @@ + - name: Execute Code Sniffer via phpcs + run: | + composer require --dev squizlabs/php_codesniffer + vendor/bin/phpcs --standard=PSR12 src From 19edefcbbbc8a6be88010117164ea5f82ebfc61d Mon Sep 17 00:00:00 2001 From: Roberto B Date: Sun, 11 Apr 2021 22:45:38 +0200 Subject: [PATCH 10/15] Update CHANGELOG.md --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8cdeb09..30c8225 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,11 @@ ## 0.2.5 - WIP ### Add -- +- New option for installing phpstan in workflow +- New option for installing phpcs in workflow +- New option for defining directory to check for phpcs ("app" default ) +- New option for defining directory to check for phpstan ("app" default) + ### Change - From 6543023e4ea9e9485eaa788d1822daae76f40547 Mon Sep 17 00:00:00 2001 From: Roberto B Date: Sun, 11 Apr 2021 22:56:22 +0200 Subject: [PATCH 11/15] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9e7dc5d..8c5a025 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,9 @@ __Ghygen__ allows you creating your __Yaml__ file for __GitHub Actions__, for La - select __multiple Laravel__ versions (8, 7, 6), useful if you are developing a Laravel Package and you want to test it with multiple Laravel version; - select __Node__ version for NPM (npm run something); - caching node packages; -- setup __Mysql__ service; +- setup __Mysql__ Database service; +- setup __PostgreSQL__ Database service; +- setup __Sqlite__ in memory database; - run migrations; - __execute tests__ via phpunit; - static __code analysis__; From 9ffbe39b3f925ac1762d78024a95112d07cc58cd Mon Sep 17 00:00:00 2001 From: Roberto B Date: Mon, 12 Apr 2021 21:28:26 +0200 Subject: [PATCH 12/15] Generate Key --- CHANGELOG.md | 1 + app/Http/Livewire/ConfiguratorForm.php | 37 +++-------- app/Traits/Form/LaravelStuff.php | 52 +++++++++++++++ resources/views/action_yaml.blade.php | 2 + .../livewire/configurator-form.blade.php | 60 +---------------- .../livewire/form/laravel-stuff.blade.php | 65 +++++++++++++++++++ tests/Feature/YamlFormTest.php | 24 +++++++ tests/Feature/mock-asserts/generate-key.yaml | 2 + 8 files changed, 156 insertions(+), 87 deletions(-) create mode 100644 app/Traits/Form/LaravelStuff.php create mode 100644 resources/views/livewire/form/laravel-stuff.blade.php create mode 100644 tests/Feature/mock-asserts/generate-key.yaml diff --git a/CHANGELOG.md b/CHANGELOG.md index 30c8225..149f2bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - New option for installing phpcs in workflow - New option for defining directory to check for phpcs ("app" default ) - New option for defining directory to check for phpstan ("app" default) +- New option for execute (or not) 'php artisan key:generate' ### Change diff --git a/app/Http/Livewire/ConfiguratorForm.php b/app/Http/Livewire/ConfiguratorForm.php index 1b8d717..4db951f 100644 --- a/app/Http/Livewire/ConfiguratorForm.php +++ b/app/Http/Livewire/ConfiguratorForm.php @@ -4,6 +4,7 @@ use App\Models\Configuration; use App\Traits\Form\CodeQuality; +use App\Traits\Form\LaravelStuff; use DanHarrin\LivewireRateLimiting\Exceptions\TooManyRequestsException; use DanHarrin\LivewireRateLimiting\WithRateLimiting; use Illuminate\Support\Facades\Cache; @@ -25,6 +26,7 @@ class ConfiguratorForm extends Component { use WithRateLimiting; use CodeQuality; + use LaravelStuff; public $code = ""; @@ -61,12 +63,8 @@ class ConfiguratorForm extends Component public $stepCachePackages; //true public $stepCacheVendors; //true public $stepCacheNpmModules; // true - public $stepFixStoragePermissions; //true - public $stepRunMigrations; // true - public $matrixLaravel; // false - public $matrixLaravelVersions; // [] - public $matrixTestbenchDependencies; + public $result; public $errorGeneration; @@ -115,17 +113,9 @@ private function loadDefaults() $this->stepCachePackages = true; $this->stepCacheVendors = true; $this->stepCacheNpmModules = true; - $this->stepFixStoragePermissions = true; - $this->stepRunMigrations = true; + $this->loadDefaultsCodeQuality(); - $this->matrixLaravel = false; - $this->matrixLaravelVersions = []; - $this->matrixTestbenchDependencies = [ - "8.*" => "6.*", - "7.*" => "5.*", - "6.*" => "4.*" - ]; // mapping laravel versions with testbench version as dependency - // the key is the laravel ver, the value is the orchestratestbench version + $this->loadDefaultsLaravelStuff(); } public function mount() @@ -191,14 +181,9 @@ public function mount() $this->stepCachePackages = $j->stepCachePackages; $this->stepCacheVendors = $j->stepCacheVendors; $this->stepCacheNpmModules = $j->stepCacheNpmModules; - $this->stepFixStoragePermissions = $j->stepFixStoragePermissions; - $this->stepRunMigrations = $j->stepRunMigrations; $this->loadCodeQualityFromJson($j); - - $this->matrixLaravel = $j->matrixLaravel; - $this->matrixLaravelVersions = $j->matrixLaravelVersions; - $this->matrixTestbenchDependencies = (array) $j->matrixTestbenchDependencies; + $this->loadLaravelStuffFromJson($j); } else { $codeNotFound = true; } @@ -318,19 +303,15 @@ public function submitForm() "stepNodejsVersion", "stepCachePackages", "stepCacheVendors", - "stepCacheNpmModules", - "stepFixStoragePermissions", - "stepRunMigrations", - "matrixLaravel", - "matrixLaravelVersions", - "matrixTestbenchDependencies" + "stepCacheNpmModules" ); $data = $this->setDataCodeQuality($data); + $data = $this->setDataLaravelStuff($data); $data["stepPhpVersionsString"] = self::arrayToString($this->stepPhpVersions); $data["on_pullrequest_branches"] = self::split($this->onPullrequestBranches); $data["on_push_branches"] = self::split($this->onPushBranches); - $data["matrixLaravelVersionsString"] = self::arrayToString($this->matrixLaravelVersions); + $stringResult = view('action_yaml', $data)->render(); $this->errorGeneration = ""; diff --git a/app/Traits/Form/LaravelStuff.php b/app/Traits/Form/LaravelStuff.php new file mode 100644 index 0000000..b999758 --- /dev/null +++ b/app/Traits/Form/LaravelStuff.php @@ -0,0 +1,52 @@ +stepFixStoragePermissions = true; + $this->stepRunMigrations = true; + $this->stepGenerateKey = true; + $this->matrixLaravel = false; + $this->matrixLaravelVersions = []; + $this->matrixTestbenchDependencies = [ + "8.*" => "6.*", + "7.*" => "5.*", + "6.*" => "4.*" + ]; // mapping laravel versions with testbench version as dependency + // the key is the laravel ver, the value is the orchestratestbench version + } + + public function loadLaravelStuffFromJson($j) + { + data_fill($j, "stepGenerateKey", true); + $this->stepFixStoragePermissions = $j->stepFixStoragePermissions; + $this->stepRunMigrations = $j->stepRunMigrations; + $this->stepGenerateKey = $j->stepGenerateKey; + $this->matrixLaravel = $j->matrixLaravel; + $this->matrixLaravelVersions = $j->matrixLaravelVersions; + $this->matrixTestbenchDependencies = (array) $j->matrixTestbenchDependencies; + } + + public function setDataLaravelStuff($data) + { + $data["stepFixStoragePermissions"] = $this->stepFixStoragePermissions; + $data["stepRunMigrations"] = $this->stepRunMigrations; + $data["stepGenerateKey"] = $this->stepGenerateKey; + $data["matrixLaravel"] = $this->matrixLaravel; + $data["matrixLaravelVersions"] = $this->matrixLaravelVersions; + $data["matrixTestbenchDependencies"] = $this->matrixTestbenchDependencies; + $data["matrixLaravelVersionsString"] = self::arrayToString($this->matrixLaravelVersions); + + return $data; + } +} diff --git a/resources/views/action_yaml.blade.php b/resources/views/action_yaml.blade.php index e13f95b..70dc1d8 100644 --- a/resources/views/action_yaml.blade.php +++ b/resources/views/action_yaml.blade.php @@ -90,8 +90,10 @@ run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist @endif +@if ($stepGenerateKey) - name: Generate key run: php artisan key:generate +@endif @if ($stepFixStoragePermissions) - name: Directory Permissions run: chmod -R 777 storage bootstrap/cache diff --git a/resources/views/livewire/configurator-form.blade.php b/resources/views/livewire/configurator-form.blade.php index dad9d79..e8370bd 100644 --- a/resources/views/livewire/configurator-form.blade.php +++ b/resources/views/livewire/configurator-form.blade.php @@ -272,66 +272,8 @@
-
- Laravel stuff -
-
- - - - - - - -
-
- - -
-
-
- - -
-
-
-
- - -
-
- - - - - -
+ @include('livewire.form.laravel-stuff') @include('livewire.form.code-quality')
diff --git a/resources/views/livewire/form/laravel-stuff.blade.php b/resources/views/livewire/form/laravel-stuff.blade.php new file mode 100644 index 0000000..23ad998 --- /dev/null +++ b/resources/views/livewire/form/laravel-stuff.blade.php @@ -0,0 +1,65 @@ +
+ Laravel stuff +
+
+ + + + + + + +
+
+ + +
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
diff --git a/tests/Feature/YamlFormTest.php b/tests/Feature/YamlFormTest.php index de34c3d..374fea6 100644 --- a/tests/Feature/YamlFormTest.php +++ b/tests/Feature/YamlFormTest.php @@ -216,4 +216,28 @@ public function test_form_codequality_tests() } + /** + * Form Test: key generate. + * + * @return void + */ + public function test_form_keygenerate_tests() + { + Livewire::test(ConfiguratorForm::class) + ->set("name", "Test") + ->set("stepGenerateKey", true) + ->call('submitForm') + ->assertSee(file_get_contents(base_path(self::DIR_MOCK . "generate-key.yaml"))); + + + Livewire::test(ConfiguratorForm::class) + ->set("name", "Test") + ->set("stepGenerateKey", false) + ->call('submitForm') + ->assertDontSee("run: php artisan key:generate"); + + + + } + } diff --git a/tests/Feature/mock-asserts/generate-key.yaml b/tests/Feature/mock-asserts/generate-key.yaml new file mode 100644 index 0000000..21db4d4 --- /dev/null +++ b/tests/Feature/mock-asserts/generate-key.yaml @@ -0,0 +1,2 @@ + - name: Generate key + run: php artisan key:generate From a5827c3c15feac4858f85f462ee2bad6314b8dc6 Mon Sep 17 00:00:00 2001 From: Roberto B Date: Mon, 12 Apr 2021 22:00:45 +0200 Subject: [PATCH 13/15] Copy .env template file --- app/Http/Livewire/ConfiguratorForm.php | 4 --- app/Traits/Form/LaravelStuff.php | 9 +++++ resources/views/action_yaml.blade.php | 2 ++ .../livewire/form/laravel-stuff.blade.php | 21 ++++++++---- tests/Feature/YamlFormTest.php | 34 +++++++++++++++++++ tests/Feature/mock-asserts/copy-env.yaml | 2 ++ 6 files changed, 62 insertions(+), 10 deletions(-) create mode 100644 tests/Feature/mock-asserts/copy-env.yaml diff --git a/app/Http/Livewire/ConfiguratorForm.php b/app/Http/Livewire/ConfiguratorForm.php index 4db951f..fe5e981 100644 --- a/app/Http/Livewire/ConfiguratorForm.php +++ b/app/Http/Livewire/ConfiguratorForm.php @@ -56,7 +56,6 @@ class ConfiguratorForm extends Component public $postgresqlVersion; public $postgresqlDatabaseName; public $postgresqlDatabasePort; - public $stepEnvTemplateFile; // .env.ci public $stepPhpVersions; // 7.4 public $stepNodejs; // false public $stepNodejsVersion; // 12.x @@ -106,7 +105,6 @@ private function loadDefaults() $this->postgresqlVersion = "latest"; $this->postgresqlDatabaseName = "db_test_laravel"; $this->postgresqlDatabasePort = 55432; - $this->stepEnvTemplateFile = ".env.example"; $this->stepPhpVersions = ["8.0", "7.4"]; $this->stepNodejs = false; $this->stepNodejsVersion = "14.x"; @@ -174,7 +172,6 @@ public function mount() $j->postgresqlDatabasePort : $this->postgresqlDatabasePort; } - $this->stepEnvTemplateFile = $j->stepEnvTemplateFile; $this->stepPhpVersions = $j->stepPhpVersions; $this->stepNodejs = $j->stepNodejs; $this->stepNodejsVersion = $j->stepNodejsVersion; @@ -297,7 +294,6 @@ public function submitForm() "on_pullrequest", "on_pullrequest_branches", "manual_trigger", - "stepEnvTemplateFile", "stepPhpVersions", "stepNodejs", "stepNodejsVersion", diff --git a/app/Traits/Form/LaravelStuff.php b/app/Traits/Form/LaravelStuff.php index b999758..9fe87f4 100644 --- a/app/Traits/Form/LaravelStuff.php +++ b/app/Traits/Form/LaravelStuff.php @@ -7,6 +7,8 @@ trait LaravelStuff public $stepFixStoragePermissions; //true public $stepRunMigrations; // true public $stepGenerateKey; // true + public $stepEnvTemplateFile; // ".env.example" + public $stepCopyEnvTemplateFile; // true public $matrixLaravel; // false public $matrixLaravelVersions; // [] public $matrixTestbenchDependencies; @@ -16,6 +18,8 @@ public function loadDefaultsLaravelStuff() $this->stepFixStoragePermissions = true; $this->stepRunMigrations = true; $this->stepGenerateKey = true; + $this->stepEnvTemplateFile = ".env.example"; + $this->stepCopyEnvTemplateFile = true; $this->matrixLaravel = false; $this->matrixLaravelVersions = []; $this->matrixTestbenchDependencies = [ @@ -29,9 +33,12 @@ public function loadDefaultsLaravelStuff() public function loadLaravelStuffFromJson($j) { data_fill($j, "stepGenerateKey", true); + data_fill($j, "stepCopyEnvTemplateFile", true); $this->stepFixStoragePermissions = $j->stepFixStoragePermissions; $this->stepRunMigrations = $j->stepRunMigrations; $this->stepGenerateKey = $j->stepGenerateKey; + $this->stepEnvTemplateFile = $j->stepEnvTemplateFile; + $this->stepCopyEnvTemplateFile = $j->stepCopyEnvTemplateFile; $this->matrixLaravel = $j->matrixLaravel; $this->matrixLaravelVersions = $j->matrixLaravelVersions; $this->matrixTestbenchDependencies = (array) $j->matrixTestbenchDependencies; @@ -42,6 +49,8 @@ public function setDataLaravelStuff($data) $data["stepFixStoragePermissions"] = $this->stepFixStoragePermissions; $data["stepRunMigrations"] = $this->stepRunMigrations; $data["stepGenerateKey"] = $this->stepGenerateKey; + $data["stepEnvTemplateFile"] = $this->stepEnvTemplateFile; + $data["stepCopyEnvTemplateFile"] = $this->stepCopyEnvTemplateFile; $data["matrixLaravel"] = $this->matrixLaravel; $data["matrixLaravelVersions"] = $this->matrixLaravelVersions; $data["matrixTestbenchDependencies"] = $this->matrixTestbenchDependencies; diff --git a/resources/views/action_yaml.blade.php b/resources/views/action_yaml.blade.php index 70dc1d8..bdd2ac7 100644 --- a/resources/views/action_yaml.blade.php +++ b/resources/views/action_yaml.blade.php @@ -77,8 +77,10 @@ path: vendor key: $@{{ runner.OS }}-build-$@{{ hashFiles('**/composer.lock') }} @endif +@if ($stepCopyEnvTemplateFile) - name: Copy .env run: php -r "file_exists('.env') || copy('{{ $stepEnvTemplateFile }}', '.env');" +@endif @if ($matrixLaravel) - name: Install Laravel Dependencies run: | diff --git a/resources/views/livewire/form/laravel-stuff.blade.php b/resources/views/livewire/form/laravel-stuff.blade.php index 23ad998..d7a451a 100644 --- a/resources/views/livewire/form/laravel-stuff.blade.php +++ b/resources/views/livewire/form/laravel-stuff.blade.php @@ -24,12 +24,21 @@
- - + + + +
diff --git a/tests/Feature/YamlFormTest.php b/tests/Feature/YamlFormTest.php index 374fea6..e53a589 100644 --- a/tests/Feature/YamlFormTest.php +++ b/tests/Feature/YamlFormTest.php @@ -236,8 +236,42 @@ public function test_form_keygenerate_tests() ->call('submitForm') ->assertDontSee("run: php artisan key:generate"); + } + + /** + * Form Test: copyenv. + * + * @return void + */ + public function test_form_copyenv_tests() + { + Livewire::test(ConfiguratorForm::class) + ->set("name", "Test") + ->set("stepCopyEnvTemplateFile", true) + ->call('submitForm') + ->assertSee(file_get_contents(base_path(self::DIR_MOCK . "copy-env.yaml"))); + Livewire::test(ConfiguratorForm::class) + ->set("name", "Test") + ->set("stepCopyEnvTemplateFile", true) + ->set("stepEnvTemplateFile", ".env.ci") + ->call('submitForm') + ->assertSee( + str_replace( + ".env.example", + ".env.ci", + file_get_contents(base_path(self::DIR_MOCK . "copy-env.yaml")) + )); + + + Livewire::test(ConfiguratorForm::class) + ->set("name", "Test") + ->set("stepCopyEnvTemplateFile", false) + ->call('submitForm') + ->assertDontSee("- name: Copy .env"); } + + } diff --git a/tests/Feature/mock-asserts/copy-env.yaml b/tests/Feature/mock-asserts/copy-env.yaml new file mode 100644 index 0000000..eae9818 --- /dev/null +++ b/tests/Feature/mock-asserts/copy-env.yaml @@ -0,0 +1,2 @@ + - name: Copy .env + run: php -r "file_exists('.env') || copy('.env.example', '.env');" From ecaf543f9797c681a2f343fe15d7ec43992c1113 Mon Sep 17 00:00:00 2001 From: Roberto B Date: Mon, 12 Apr 2021 22:23:03 +0200 Subject: [PATCH 14/15] Update action_yaml.blade.php --- resources/views/action_yaml.blade.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/resources/views/action_yaml.blade.php b/resources/views/action_yaml.blade.php index bdd2ac7..f4e09aa 100644 --- a/resources/views/action_yaml.blade.php +++ b/resources/views/action_yaml.blade.php @@ -107,8 +107,6 @@ run: php artisan migrate @endif - - name: Show Laravel versions - run: php artisan --version - name: Show dir run: pwd - name: PHP Version From 35eb6157ecf418414c16f2f330f5e2f649325eff Mon Sep 17 00:00:00 2001 From: Roberto B Date: Mon, 12 Apr 2021 22:34:49 +0200 Subject: [PATCH 15/15] Upgrade packages --- CHANGELOG.md | 7 ++- composer.lock | 24 +++---- package-lock.json | 155 +++++++++++++++++++++++++++++++--------------- package.json | 6 +- 4 files changed, 124 insertions(+), 68 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 149f2bd..71696c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,16 +1,17 @@ # Changelog -## 0.2.5 - WIP +## 0.2.5 - 2021-04-12 ### Add - New option for installing phpstan in workflow - New option for installing phpcs in workflow - New option for defining directory to check for phpcs ("app" default ) - New option for defining directory to check for phpstan ("app" default) - New option for execute (or not) 'php artisan key:generate' - +- New option for copying .env template +- Install Phpstan and phpcs as composer dev ### Change -- +- Upgrade PHP packages ## 0.2.4 - 2021-04-05 diff --git a/composer.lock b/composer.lock index 2f47453..3328175 100644 --- a/composer.lock +++ b/composer.lock @@ -5788,16 +5788,16 @@ }, { "name": "facade/flare-client-php", - "version": "1.6.1", + "version": "1.7.0", "source": { "type": "git", "url": "https://github.com/facade/flare-client-php.git", - "reference": "f2b0969f2d9594704be74dbeb25b201570a98098" + "reference": "6bf380035890cb0a09b9628c491ae3866b858522" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/facade/flare-client-php/zipball/f2b0969f2d9594704be74dbeb25b201570a98098", - "reference": "f2b0969f2d9594704be74dbeb25b201570a98098", + "url": "https://api.github.com/repos/facade/flare-client-php/zipball/6bf380035890cb0a09b9628c491ae3866b858522", + "reference": "6bf380035890cb0a09b9628c491ae3866b858522", "shasum": "" }, "require": { @@ -5841,7 +5841,7 @@ ], "support": { "issues": "https://github.com/facade/flare-client-php/issues", - "source": "https://github.com/facade/flare-client-php/tree/1.6.1" + "source": "https://github.com/facade/flare-client-php/tree/1.7.0" }, "funding": [ { @@ -5849,7 +5849,7 @@ "type": "github" } ], - "time": "2021-04-08T08:50:01+00:00" + "time": "2021-04-12T09:30:36+00:00" }, { "name": "facade/ignition", @@ -6590,16 +6590,16 @@ }, { "name": "nunomaduro/larastan", - "version": "v0.7.2", + "version": "v0.7.3", "source": { "type": "git", "url": "https://github.com/nunomaduro/larastan.git", - "reference": "cb7fa0b5af3738772e3568c0a0c7a080851e281d" + "reference": "9c515d46851dca5a99fc82c0a69392c362b7affd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nunomaduro/larastan/zipball/cb7fa0b5af3738772e3568c0a0c7a080851e281d", - "reference": "cb7fa0b5af3738772e3568c0a0c7a080851e281d", + "url": "https://api.github.com/repos/nunomaduro/larastan/zipball/9c515d46851dca5a99fc82c0a69392c362b7affd", + "reference": "9c515d46851dca5a99fc82c0a69392c362b7affd", "shasum": "" }, "require": { @@ -6663,7 +6663,7 @@ ], "support": { "issues": "https://github.com/nunomaduro/larastan/issues", - "source": "https://github.com/nunomaduro/larastan/tree/v0.7.2" + "source": "https://github.com/nunomaduro/larastan/tree/v0.7.3" }, "funding": [ { @@ -6683,7 +6683,7 @@ "type": "patreon" } ], - "time": "2021-04-08T10:51:16+00:00" + "time": "2021-04-12T11:01:46+00:00" }, { "name": "phar-io/manifest", diff --git a/package-lock.json b/package-lock.json index 07203d8..b5894db 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1086,7 +1086,6 @@ "version": "2.1.4", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.4.tgz", "integrity": "sha512-33g3pMJk3bg5nXbL/+CY6I2eJDzZAni49PfJnL5fghPTggPvBd/pFNSgJsdAgWptuFu7qq/ERvOYFlhvsLTCKA==", - "dev": true, "requires": { "@nodelib/fs.stat": "2.0.4", "run-parallel": "^1.1.9" @@ -1095,14 +1094,12 @@ "@nodelib/fs.stat": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.4.tgz", - "integrity": "sha512-IYlHJA0clt2+Vg7bccq+TzRdJvv19c2INqBSsoOLp1je7xjtr7J26+WXR72MCdvU9q1qTzIWDfhMf+DRvQJK4Q==", - "dev": true + "integrity": "sha512-IYlHJA0clt2+Vg7bccq+TzRdJvv19c2INqBSsoOLp1je7xjtr7J26+WXR72MCdvU9q1qTzIWDfhMf+DRvQJK4Q==" }, "@nodelib/fs.walk": { "version": "1.2.6", "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.6.tgz", "integrity": "sha512-8Broas6vTtW4GIXTAHDoE32hnN2M5ykgCpWGbuXHQ15vEMqr23pB76e/GZcYsZCHALv50ktd24qhEyKr6wBtow==", - "dev": true, "requires": { "@nodelib/fs.scandir": "2.1.4", "fastq": "^1.6.0" @@ -2448,7 +2445,6 @@ "version": "3.5.1", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.1.tgz", "integrity": "sha512-9+s+Od+W0VJJzawDma/gvBNQqkTiqYTWLuZoyAsivsI4AaWTCzHG06/TMjsf1cYe9Cb97UCEhjz7HvnPk2p/tw==", - "dev": true, "requires": { "anymatch": "~3.1.1", "braces": "~3.0.2", @@ -2464,7 +2460,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", - "dev": true, "requires": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" @@ -2473,14 +2468,12 @@ "binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", - "dev": true + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==" }, "braces": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, "requires": { "fill-range": "^7.0.1" } @@ -2489,7 +2482,6 @@ "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, "requires": { "to-regex-range": "^5.0.1" } @@ -2498,14 +2490,12 @@ "version": "2.3.2", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, "optional": true }, "glob-parent": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, "requires": { "is-glob": "^4.0.1" } @@ -2514,7 +2504,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, "requires": { "binary-extensions": "^2.0.0" } @@ -2522,14 +2511,12 @@ "is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" }, "readdirp": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.5.0.tgz", "integrity": "sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ==", - "dev": true, "requires": { "picomatch": "^2.2.1" } @@ -2538,7 +2525,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, "requires": { "is-number": "^7.0.0" } @@ -3589,6 +3575,11 @@ "path-type": "^4.0.0" } }, + "dlv": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/dlv/-/dlv-1.1.3.tgz", + "integrity": "sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==" + }, "dns-equal": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/dns-equal/-/dns-equal-1.0.0.tgz", @@ -4206,7 +4197,6 @@ "version": "3.2.5", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.5.tgz", "integrity": "sha512-2DtFcgT68wiTTiwZ2hNdJfcHNke9XOfnwmBRWXhmeKM8rF0TGwmC/Qto3S7RoZKp5cilZbxzO5iTNTQsJ+EeDg==", - "dev": true, "requires": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -4220,7 +4210,6 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, "requires": { "fill-range": "^7.0.1" } @@ -4229,7 +4218,6 @@ "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, "requires": { "to-regex-range": "^5.0.1" } @@ -4238,7 +4226,6 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, "requires": { "is-glob": "^4.0.1" } @@ -4246,14 +4233,12 @@ "is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" }, "micromatch": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", - "dev": true, "requires": { "braces": "^3.0.1", "picomatch": "^2.0.5" @@ -4263,7 +4248,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, "requires": { "is-number": "^7.0.0" } @@ -4286,7 +4270,6 @@ "version": "1.11.0", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.11.0.tgz", "integrity": "sha512-7Eczs8gIPDrVzT+EksYBcupqMyxSHXXrHOLRRxU2/DicV8789MRBRR8+Hc2uWzUupOs4YS4JzBmBxjjCVBxD/g==", - "dev": true, "requires": { "reusify": "^1.0.4" } @@ -4562,6 +4545,38 @@ "path-is-absolute": "^1.0.0" } }, + "glob-base": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", + "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", + "requires": { + "glob-parent": "^2.0.0", + "is-glob": "^2.0.0" + }, + "dependencies": { + "glob-parent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", + "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "requires": { + "is-glob": "^2.0.0" + } + }, + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=" + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "requires": { + "is-extglob": "^1.0.0" + } + } + } + }, "glob-parent": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", @@ -4752,9 +4767,9 @@ "dev": true }, "highlight.js": { - "version": "10.7.1", - "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.1.tgz", - "integrity": "sha512-S6G97tHGqJ/U8DsXcEdnACbirtbx58Bx9CzIVeYli8OuswCfYI/LsXH2EiGcoGio1KAC3x4mmUwulOllJ2ZyRA==" + "version": "10.7.2", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.2.tgz", + "integrity": "sha512-oFLl873u4usRM9K63j4ME9u3etNF0PLiJhSQ8rdfuL51Wn3zkD6drf9ZW0dOzjnZI22YYG24z30JcmfCZjMgYg==" }, "highlightjs-line-numbers.js": { "version": "2.8.0", @@ -5405,6 +5420,11 @@ "integrity": "sha512-ZOoqiXfEwtGknTiuDEy8pN2CfE3TxMHprvNer1mXiqwkOT77Rw3YVrUQ52EqAOU3QAWDQ+bQdx7HJzrv7LS2Hw==", "dev": true }, + "is-dotfile": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", + "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=" + }, "is-extendable": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", @@ -5414,8 +5434,7 @@ "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" }, "is-fullwidth-code-point": { "version": "3.0.0", @@ -5433,7 +5452,6 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", - "dev": true, "requires": { "is-extglob": "^2.1.1" } @@ -5916,6 +5934,11 @@ "resolved": "https://registry.npmjs.org/lodash.toarray/-/lodash.toarray-4.4.0.tgz", "integrity": "sha1-JMS/zWsvuji/0FlNsRedjptlZWE=" }, + "lodash.topath": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/lodash.topath/-/lodash.topath-4.5.2.tgz", + "integrity": "sha1-NhY1Hzu6YZlKCTGYlmC9AyVP0Ak=" + }, "lodash.uniq": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", @@ -6056,8 +6079,7 @@ "merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==" }, "methods": { "version": "1.1.2", @@ -6395,8 +6417,7 @@ "normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" }, "normalize-range": { "version": "0.1.2", @@ -6731,6 +6752,32 @@ "safe-buffer": "^5.1.1" } }, + "parse-glob": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", + "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", + "requires": { + "glob-base": "^0.3.0", + "is-dotfile": "^1.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.0" + }, + "dependencies": { + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=" + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "requires": { + "is-extglob": "^1.0.0" + } + } + } + }, "parse-json": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", @@ -6825,8 +6872,7 @@ "picomatch": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", - "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", - "dev": true + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==" }, "pkg-dir": { "version": "4.2.0", @@ -6866,9 +6912,9 @@ "dev": true }, "postcss": { - "version": "8.2.9", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.2.9.tgz", - "integrity": "sha512-b+TmuIL4jGtCHtoLi+G/PisuIl9avxs8IZMSmlABRwNz5RLUUACrC+ws81dcomz1nRezm5YPdXiMEzBEKgYn+Q==", + "version": "8.2.10", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.2.10.tgz", + "integrity": "sha512-b/h7CPV7QEdrqIxtAf2j31U5ef05uBDuvoXv6L51Q4rcS1jdlXAVKJv+atCFdUXYl9dyTHGyoMzIepwowRJjFw==", "requires": { "colorette": "^1.2.2", "nanoid": "^3.1.22", @@ -8376,8 +8422,12 @@ "queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==" + }, + "quick-lru": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", + "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==" }, "randombytes": { "version": "2.1.0", @@ -8735,8 +8785,7 @@ "reusify": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==" }, "rework": { "version": "1.0.1", @@ -8797,7 +8846,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, "requires": { "queue-microtask": "^1.2.2" } @@ -9620,28 +9668,35 @@ } }, "tailwindcss": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-2.0.4.tgz", - "integrity": "sha512-WhgR0oiBxGOZ9jY0yVfaJCHnckR7U74Fs/BMsYxGdwGJQ5Hd/HlaKD26bEJFZOvYScJo0QcUj2ImldzedsG7Bw==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-2.1.1.tgz", + "integrity": "sha512-zZ6axGqpSZOCBS7wITm/WNHkBzDt5CIZlDlx0eCVldwTxFPELCVGbgh7Xpb3/kZp3cUxOmK7bZUjqhuMrbN6xQ==", "requires": { "@fullhuman/postcss-purgecss": "^3.1.3", "bytes": "^3.0.0", "chalk": "^4.1.0", + "chokidar": "^3.5.1", "color": "^3.1.3", "detective": "^5.2.0", "didyoumean": "^1.2.1", + "dlv": "^1.1.3", + "fast-glob": "^3.2.5", "fs-extra": "^9.1.0", "html-tags": "^3.1.0", "lodash": "^4.17.21", + "lodash.topath": "^4.5.2", "modern-normalize": "^1.0.0", "node-emoji": "^1.8.1", + "normalize-path": "^3.0.0", "object-hash": "^2.1.1", + "parse-glob": "^3.0.4", "postcss-functions": "^3", "postcss-js": "^3.0.3", - "postcss-nested": "^5.0.5", + "postcss-nested": "5.0.5", "postcss-selector-parser": "^6.0.4", "postcss-value-parser": "^4.1.0", "pretty-hrtime": "^1.0.3", + "quick-lru": "^5.1.1", "reduce-css-calc": "^2.1.8", "resolve": "^1.20.0" }, diff --git a/package.json b/package.json index a193932..ada94a4 100644 --- a/package.json +++ b/package.json @@ -24,9 +24,9 @@ "alpinejs": "^2.8.2", "autoprefixer": "^10.2.5", "clipboard": "^2.0.8", - "highlight.js": "^10.7.1", + "highlight.js": "^10.7.2", "highlightjs-line-numbers.js": "^2.8.0", - "postcss": "^8.2.9", - "tailwindcss": "^2.0.4" + "postcss": "^8.2.10", + "tailwindcss": "^2.1.1" } }