From df2fe1e8bcf5a3c41fb3b478597a69c41b01986a Mon Sep 17 00:00:00 2001 From: kimchanhyung98 Date: Tue, 21 May 2024 09:20:16 +0900 Subject: [PATCH] Update v0.1.1 (#7) * Update v0.1.1 (#6) * Update composer.json * Update dependabot.yml * Update phpstan.yml * Update default stub dir * Update stub dir, base path * Fix typo * Update Pest(TestCase) * Update GitHub Actions * Update run-tests.yml * Fix typo * Fix versions * Update run-tests.yml * Remove php 8.1 testing * Fix typo * Fix typo * Update composer.json * Update run-tests.yml * Update run-tests.yml * Fix typo * Fix typo * Bump ramsey/composer-install from 2 to 3 (#2) Bumps [ramsey/composer-install](https://github.com/ramsey/composer-install) from 2 to 3. - [Release notes](https://github.com/ramsey/composer-install/releases) - [Commits](https://github.com/ramsey/composer-install/compare/v2...v3) --- updated-dependencies: - dependency-name: ramsey/composer-install dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: kimchanhyung98 * Bump aglipanci/laravel-pint-action from 2.3.1 to 2.4 (#4) Bumps [aglipanci/laravel-pint-action](https://github.com/aglipanci/laravel-pint-action) from 2.3.1 to 2.4. - [Release notes](https://github.com/aglipanci/laravel-pint-action/releases) - [Commits](https://github.com/aglipanci/laravel-pint-action/compare/2.3.1...2.4) --- updated-dependencies: - dependency-name: aglipanci/laravel-pint-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: kimchanhyung98 * Bump dependabot/fetch-metadata from 1.6.0 to 2.1.0 (#5) Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 1.6.0 to 2.1.0. - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](https://github.com/dependabot/fetch-metadata/compare/v1.6.0...v2.1.0) --- updated-dependencies: - dependency-name: dependabot/fetch-metadata dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: kimchanhyung98 --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/dependabot.yml | 5 ++- .github/workflows/dependabot-auto-merge.yml | 2 +- .../workflows/fix-php-code-style-issues.yml | 2 +- .github/workflows/phpstan.yml | 3 +- .github/workflows/run-tests.yml | 18 +++++----- .github/workflows/update-changelog.yml | 2 +- .gitignore | 1 - composer.json | 11 +++---- config/maker.php | 5 +-- phpstan-baseline.neon | 0 phpstan.neon | 9 +++++ tests/MakeTest.php | 33 +++++-------------- tests/Pest.php | 5 +++ tests/TestCase.php | 16 +++++++++ 14 files changed, 62 insertions(+), 50 deletions(-) delete mode 100644 phpstan-baseline.neon create mode 100644 phpstan.neon create mode 100644 tests/Pest.php create mode 100644 tests/TestCase.php diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 39b1580..04be47d 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,17 +3,16 @@ version: 2 updates: - - package-ecosystem: "github-actions" directory: "/" schedule: - interval: "weekly" + interval: "monthly" labels: - "dependencies" - package-ecosystem: "composer" directory: "/" schedule: - interval: "weekly" + interval: "monthly" labels: - "dependencies" diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml index 70d8e7b..056063f 100644 --- a/.github/workflows/dependabot-auto-merge.yml +++ b/.github/workflows/dependabot-auto-merge.yml @@ -14,7 +14,7 @@ jobs: - name: Dependabot metadata id: metadata - uses: dependabot/fetch-metadata@v1.6.0 + uses: dependabot/fetch-metadata@v2.1.0 with: github-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/fix-php-code-style-issues.yml b/.github/workflows/fix-php-code-style-issues.yml index cd4239c..56d54d3 100644 --- a/.github/workflows/fix-php-code-style-issues.yml +++ b/.github/workflows/fix-php-code-style-issues.yml @@ -20,7 +20,7 @@ jobs: ref: ${{ github.head_ref }} - name: Fix PHP code style issues - uses: aglipanci/laravel-pint-action@2.3.1 + uses: aglipanci/laravel-pint-action@2.4 - name: Commit changes uses: stefanzweifel/git-auto-commit-action@v5 diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index af21e45..8ec322f 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -5,7 +5,6 @@ on: paths: - '**.php' - 'phpstan.neon.dist' - - '.github/workflows/phpstan.yml' jobs: phpstan: @@ -22,7 +21,7 @@ jobs: coverage: none - name: Install composer dependencies - uses: ramsey/composer-install@v2 + uses: ramsey/composer-install@v3 - name: Run PHPStan run: ./vendor/bin/phpstan --error-format=github diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index f7492c5..d578a3d 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -16,14 +16,14 @@ jobs: strategy: fail-fast: true matrix: - os: [ubuntu-latest, windows-latest] - php: [8.3, 8.2, 8.1] - laravel: [10.*] - stability: [prefer-lowest, prefer-stable] - include: - - laravel: 10.* - testbench: 8.* - carbon: ^2.63 + os: [ ubuntu-latest, macos-latest ] + stability: [ prefer-stable ] + php: [ 8.1, 8.2, 8.3 ] + laravel: [ 10.*, 11.* ] + carbon: [ '^2.67' ] + exclude: + - php: 8.1 + laravel: 11.* name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} @@ -45,7 +45,7 @@ jobs: - name: Install dependencies run: | - composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "nesbot/carbon:${{ matrix.carbon }}" --no-interaction --no-update + composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.laravel == '11.*' && '9.*' || '8.*' }}" "nesbot/carbon:${{ matrix.carbon }}" --no-interaction --no-update composer update --${{ matrix.stability }} --prefer-dist --no-interaction - name: List Installed Dependencies diff --git a/.github/workflows/update-changelog.yml b/.github/workflows/update-changelog.yml index 39de30d..5f593b5 100644 --- a/.github/workflows/update-changelog.yml +++ b/.github/workflows/update-changelog.yml @@ -2,7 +2,7 @@ name: "Update Changelog" on: release: - types: [released] + types: [ released ] permissions: contents: write diff --git a/.gitignore b/.gitignore index 6ac545f..08fa528 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,6 @@ composer.lock coverage docs phpunit.xml -phpstan.neon testbench.yaml vendor node_modules diff --git a/composer.json b/composer.json index 98a70b8..a270705 100644 --- a/composer.json +++ b/composer.json @@ -17,21 +17,20 @@ ], "require": { "php": "^8.1", - "spatie/laravel-package-tools": "^1.14.0", - "illuminate/contracts": "^10.0" + "spatie/laravel-package-tools": "^1.14.0" }, "require-dev": { - "roave/security-advisories": "dev-latest", - "laravel/pint": "^1.0", - "nunomaduro/collision": "^7.8", "larastan/larastan": "^2.0.1", - "orchestra/testbench": "^8.8", + "laravel/pint": "^1.0", + "nunomaduro/collision": "^7.0|^8.0", + "orchestra/testbench": "^8.0|^9.0", "pestphp/pest": "^2.20", "pestphp/pest-plugin-arch": "^2.0", "pestphp/pest-plugin-laravel": "^2.0", "phpstan/extension-installer": "^1.1", "phpstan/phpstan-deprecation-rules": "^1.0", "phpstan/phpstan-phpunit": "^1.0", + "roave/security-advisories": "dev-latest", "spatie/laravel-ray": "^1.26" }, "autoload": { diff --git a/config/maker.php b/config/maker.php index 0c59eae..1551844 100644 --- a/config/maker.php +++ b/config/maker.php @@ -4,10 +4,11 @@ return [ 'action' => [ 'namespace' => 'App\Actions', - 'stub' => __DIR__.'/../stubs/action.stub', + 'stub' => __DIR__.'/../src/Stubs/action.stub', ], 'service' => [ 'namespace' => 'App\Services', - 'stub' => __DIR__.'/../stubs/service.stub', + 'stub' => __DIR__.'/../src/Stubs/service.stub', + // 'stub' => __DIR__.'/../Stubs/service.stub', ], ]; diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon deleted file mode 100644 index e69de29..0000000 diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..ef64d30 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,9 @@ +parameters: + level: 5 + paths: + - src + - config + tmpDir: build/phpstan + checkOctaneCompatibility: true + checkModelProperties: true + checkMissingIterableValueType: false diff --git a/tests/MakeTest.php b/tests/MakeTest.php index 05d42fe..a06b896 100644 --- a/tests/MakeTest.php +++ b/tests/MakeTest.php @@ -1,28 +1,13 @@ 'SampleAction'])->assertExitCode(0); + expect(file_exists(app_path('Actions/SampleAction.php')))->toBeTrue(); +}); -class MakeTest extends Orchestra -{ - protected function getPackageProviders($app): array - { - return [ - MakerServiceProvider::class, - ]; - } - - public function test_artisan_make_action_command(): void - { - $this->artisan('make:action SampleAction')->assertSuccessful(); - $this->assertFileExists(app_path('Actions/SampleAction.php')); - } - - public function test_artisan_make_service_command(): void - { - $this->artisan('make:service SampleService')->assertSuccessful(); - $this->assertFileExists(app_path('Services/SampleService.php')); - } -} +it('executed artisan make:service command', function () { + artisan('make:service', ['name' => 'SampleService'])->assertExitCode(0); + expect(file_exists(app_path('Services/SampleService.php')))->toBeTrue(); +}); diff --git a/tests/Pest.php b/tests/Pest.php new file mode 100644 index 0000000..9500729 --- /dev/null +++ b/tests/Pest.php @@ -0,0 +1,5 @@ +in(__DIR__); diff --git a/tests/TestCase.php b/tests/TestCase.php new file mode 100644 index 0000000..fb98ffd --- /dev/null +++ b/tests/TestCase.php @@ -0,0 +1,16 @@ +