Skip to content

Commit

Permalink
Merge pull request #83 from ayrtonandino/modeltyper-v3
Browse files Browse the repository at this point in the history
[3.x] Adds support for Laravel >=11.33.0, Fixes #81
  • Loading branch information
tcampbPPU authored Dec 16, 2024
2 parents eed2b2c + df5c282 commit 6675374
Show file tree
Hide file tree
Showing 128 changed files with 4,405 additions and 6,475 deletions.
18 changes: 18 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This file was partly modified by the lean package validator (http://git.io/lean-package-validator).

* text=auto eol=lf

.devcontainer/ export-ignore
.editorconfig export-ignore
.gitattributes export-ignore
.github/ export-ignore
.gitignore export-ignore
.vscode/ export-ignore
composer.lock export-ignore
LICENSE export-ignore
phpstan.neon.dist export-ignore
phpunit.xml export-ignore
pint.json export-ignore
readme.md export-ignore
test/ export-ignore
UPGRADE.md export-ignore
16 changes: 13 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,20 @@ on:

jobs:
lint:
name: lint
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
php: [8.3]

steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
php-version: ${{ matrix.php }}
extensions: json, dom, curl, libxml, mbstring
coverage: none

- name: Install composer dependencies
Expand All @@ -25,4 +30,9 @@ jobs:
dependency-versions: "highest"

- name: Run Pint
run: ./vendor/bin/pint --dirty
run: ./vendor/bin/pint

- name: Commit linted files
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Fixes coding style"
8 changes: 6 additions & 2 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,19 @@ on:

jobs:
phpstan:
name: phpstan
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
php: [8.3]

steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
php-version: ${{ matrix.php }}
coverage: none

- name: Install composer dependencies
Expand Down
24 changes: 11 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,20 @@ jobs:
runs-on: ubuntu-latest

strategy:
fail-fast: true
fail-fast: false
matrix:
os: [ubuntu-latest]
php: ['8.1', '8.2', '8.3']
laravel: ['10.*', '11.*']
php: ['8.2', '8.3', '8.4']
laravel: ['11.*']
stability: ['highest', 'lowest']
include:
- laravel: 10.*
testbench: 8.*
- laravel: 11.*
testbench: 9.*
exclude:
- laravel: 11.*
php: '8.1'

name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} ${{ matrix.stability }} stability
# include:
# - laravel: 11.*
# testbench: 9.*
# exclude:
# - laravel: 11.*
# php: '8.1'

name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - ${{ matrix.stability }} stability

steps:
- name: 🔨 Checkout code
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ vendor
notes.md
.phpunit.cache
phpstan.neon
resources
47 changes: 47 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Upgrade Guide

## Upgrading to `3.0` from `2.x`

This is a new major release with minor breaking changes.

### Dropped support for Laravel versions <11.33.0 and php versions <8.2
###### Likelihood Of Impact: High

Support begins from Laravel version 11.33.0 and onwards due to changes in the Laravel framework.

### Conflict with nesbot/carbon < 3.5
###### Likelihood Of Impact: Medium

In order to support php 8.4, this library requires nesbot/carbon >= 3.5

### New options where added to the config
###### Likelihood Of Impact: Low

We have introduced new configuration options, to ensure your configuration file includes these new options, delete your current `config/modeltyper.php` file, then publish the new config file using the following command.

```bash
php artisan vendor:publish --provider="FumeApp\ModelTyper\ModelTyperServiceProvider" --tag=config
```

### Removed `all` Option from `model:typer` command
###### Likelihood Of Impact: Low

use `--plurals --api-resources` instead, or set them in config

### Removed `resolve-abstract` and `throws-exceptions` Option from `model:typer` command
###### Likelihood Of Impact: Low

ModelTyper now only considers models that extends `Eloquent\Model`

### Remove ShowModelCommand command
###### Likelihood Of Impact: Very Low

`model:typer-show` command was removed and is no longer available.

### Remove Deprecated clases
###### Likelihood Of Impact: Very Low

`FumeApp\ModelTyper\ModelInterface` and `FumeApp\ModelTyper\TypescriptInterface` where removed and are no longer available.



60 changes: 37 additions & 23 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,23 @@
"tanner Campbell <[email protected]>"
],
"require": {
"php": "^8.1",
"illuminate/support": "^10.0.0|^11.0",
"illuminate/database": "^10.0.0|^11.0",
"illuminate/console": "^10.0.0|^11.0"
"php": "^8.2",
"illuminate/support": "^11.33.0",
"illuminate/database": "^11.33.0",
"illuminate/console": "^11.33.0"
},
"require-dev": {
"orchestra/testbench": "^8.0|^9.0",
"phpunit/phpunit": "^10.1",
"laravel/pint": "^1.7",
"larastan/larastan": "^2.2",
"consolidation/robo": "^4.0",
"totten/lurkerlite": "^1.3",
"doctrine/dbal": "^3.6",
"spatie/laravel-ray": "^1.32",
"phpstan/phpstan-deprecation-rules": "^1.2"
"consolidation/robo": "^5.1.0",
"larastan/larastan": "^3.0.2",
"laravel/pint": "^1.18.3",
"orchestra/testbench": "^9.6.1",
"phpstan/phpstan-deprecation-rules": "^2.0.1",
"phpunit/phpunit": "^11.4.4",
"totten/lurkerlite": "^1.3"
},
"conflict": {
"laravel/framework": "<10.43.0 || >=11.33.0"
"laravel/framework": "<11.33.0",
"nesbot/carbon": "<3.5.0"
},
"autoload": {
"psr-4": {
Expand All @@ -41,7 +40,9 @@
"autoload-dev": {
"psr-4": {
"Tests\\": "test/Tests/",
"App\\": "test/laravel-skeleton/app/"
"App\\": "test/laravel-skeleton/app/",
"Database\\Factories\\": "test/laravel-skeleton/database/factories/",
"Database\\Seeders\\": "test/laravel-skeleton/database/seeders/"
}
},
"extra": {
Expand All @@ -53,25 +54,38 @@
},
"scripts": {
"pint": [
"vendor/bin/pint"
"@php vendor/bin/pint --ansi"
],
"test": [
"vendor/bin/phpunit --colors --display-errors --testdox"
"@php vendor/bin/phpunit --colors --display-errors --testdox"
],
"test-watch": [
"vendor/bin/robo watch 'src, test/Tests' 'clear && composer test'"
"@php vendor/bin/robo watch 'src, test/Tests' 'clear && composer test'"
],
"test-coverage": [
"XDEBUG_MODE=coverage ./vendor/bin/phpunit --colors=always --testdox --coverage-text"
"@php XDEBUG_MODE=coverage ./vendor/bin/phpunit --colors=always --testdox --coverage-text"
],
"stan": [
"vendor/bin/phpstan analyse"
]
"@php vendor/bin/phpstan analyse --verbose --ansi"
],
"post-autoload-dump": [
"@clear",
"@prepare"
],
"clear": "@php vendor/bin/testbench package:purge-skeleton --ansi",
"prepare": "@php vendor/bin/testbench package:discover --ansi"
},
"scripts-descriptions": {
"pint": "Run the Pint Linter and Fixer.",
"test": "Run the PHPUnit tests.",
"test-coverage": "Run the PHPUnit tests with code coverage.",
"stan": "Run the PHPStan analyser."
}
"stan": "Run PHPStan analyzer."
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"minimum-stability": "stable",
"prefer-stable": true
}
Loading

0 comments on commit 6675374

Please sign in to comment.