-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Mārtiņš Ručevskis
committed
Dec 18, 2023
1 parent
fea07f9
commit d0f9973
Showing
25 changed files
with
124 additions
and
17,854 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +0,0 @@ | ||
name: Code style | ||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
jobs: | ||
cs-fixer: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e | ||
with: | ||
php-version: '8.1' | ||
- uses: actions/checkout@v3 | ||
- name: Install Dependencies | ||
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist | ||
- name: Run php-cs-fixer | ||
run: ./vendor/bin/php-cs-fixer fix --config=phpCsFixerConfig.php --dry-run --diff | ||
|
||
|
||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +0,0 @@ | ||
name: Static analysis | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
PHP-Stan: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e | ||
with: | ||
php-version: '8.1' | ||
- name: Install Dependencies | ||
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist | ||
- name: Run PHPStan | ||
uses: php-actions/phpstan@v3 | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +0,0 @@ | ||
name: Tests | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
PHP-Unit: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e | ||
with: | ||
php-version: '8.1' | ||
- uses: actions/checkout@v3 | ||
- name: Install Dependencies | ||
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist | ||
- name: Execute tests | ||
run: ./vendor/bin/phpunit | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +0,0 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023 MartinsRucevskis | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +0,0 @@ | ||
# Composer constraint upgrader | ||
|
||
Helps You automatically resolve composer conflicts | ||
|
||
E.g. Need to upgrade your framework to the newest version? Just run | ||
```bash | ||
composer major-update --composer-json=composerPath --constraint=package/package:^10.0 --constraint=php:^8.1 | ||
``` | ||
Want to upgrade minor versions and also update your compose.json file to the up-to-date versions? Run | ||
``` | ||
composer minor-update --composer-json=composerPath | ||
``` | ||
|
||
## Installation | ||
|
||
Use composer to automatically add it Your project | ||
|
||
```bash | ||
composer require martinsr/constraint-updater | ||
``` | ||
|
||
## How to use | ||
|
||
- Add it to Your project | ||
- Specify your composer json/lock location when running any of the commands if needed | ||
```bash | ||
--composer-json=composer/json/path --composer-lock=composer/lock/path | ||
``` | ||
- Specify Your needed constraints when running `composer major-update` | ||
```bash | ||
--constraint=php:^8.1 --constraint=package/package:^10.0 | ||
``` | ||
- Run the either `composer major-update` or `composer minor-update` with your params. | ||
|
||
## How it works | ||
|
||
### major-update | ||
|
||
It will replace all your `composer.json` package versions with `*` except for packages You have added with `--constraint`. | ||
|
||
Versions you add for the packages will be taken literally. | ||
|
||
#### Examples: | ||
`constraint=laravel/framework:^10.0` will set the version to `^10.0` `constraint=laravel/framework:10.0` will set it to `10.0`. | ||
|
||
Would suggest to always add the `^` since composer will still keep the major version the same, while updating to the newest minor version other packages support. | ||
|
||
This will make composer install the most up-to-date versions possible, taken the constraints and there won't be any conflicts as long as there is a supported version'. | ||
|
||
After composer update has been run, it will fix your `composer.json` file from versions that were installed and specified in Your `composer.lock` | ||
|
||
## minor-update | ||
|
||
This will run `composer update` and after that fix the `composer.json` with the actual versions that were installed. | ||
|
||
#### Examples: | ||
|
||
Run | ||
```bash | ||
composer minor-update | ||
``` | ||
Will run composer update command, and rebuild composer.json file to have up-to-date dependencies with the lock file | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +0,0 @@ | ||
{ | ||
"name": "martinsr/constraint-updater", | ||
"type": "composer-plugin", | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "Martins Rucevskis" | ||
} | ||
], | ||
"require": { | ||
"php": "^8.1", | ||
"composer-plugin-api": "^2.3" | ||
}, | ||
"require-dev": { | ||
"composer/composer": "^2.0", | ||
"phpunit/phpunit": "10.4.2", | ||
"phpstan/phpstan": "^1.10", | ||
"friendsofphp/php-cs-fixer": "^3.38" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"MartinsR\\ComposerConstraintUpdater\\": "src/" | ||
} | ||
}, | ||
"extra": { | ||
"class": "MartinsR\\ComposerConstraintUpdater\\ComposerPlugin" | ||
} | ||
} | ||
Oops, something went wrong.