Skip to content

Commit

Permalink
Blend value (#12)
Browse files Browse the repository at this point in the history
* blend value

* test: fix tests
  • Loading branch information
soyuka authored Oct 3, 2024
1 parent a378102 commit 3e16514
Show file tree
Hide file tree
Showing 8 changed files with 269 additions and 217 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ vendor
tests/monorepo/packages/A/composer.lock
tests/monorepo/packages/B/composer.lock
tests/monorepo/packages/C/composer.lock
tests/monorepo/packages/D/composer.lock
tests/replace/composer.lock
tests/monorepo/composer.lock
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ composer all config extra.branch-alias.dev-main 3.3.x-dev -vvv
Blend your root `composer.json` constraints in each of the projects.

```
composer blend [--dev] [--all] [--self] [project-name]
composer blend [--dev] [--all] [--self] [--json-path=JSON-PATH] [--value=VALUE] [project-name]
```

Note: there's no dry mode on this command, use a VCS to rollback on unwanted changes.
Expand All @@ -76,6 +76,12 @@ Blend can also transfer any json path:
composer blend --json-path=extra.branch-alias.dev-main --force
```

Or blend a given value:

```
composer blend --json-path=extra.branch-alias.dev-main --force --value=4.x
```

Where `force` will write even if the value is not present in the project's `composer.json`.

When you want to bump all your mono-repository's dependencies and ignore the rest use `--self`, this is quite handy with the `--all` option, on API Platform we use this to align every dependency of our mono-repository (eg: set every version to the ones defined on our root composer.json):
Expand Down
14 changes: 12 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,26 @@
"symfony/var-dumper": "^7.0",
"phpstan/phpstan": "^1.10",
"friendsofphp/php-cs-fixer": "^3.50",
"phpunit/phpunit": "^11.0"
"phpunit/phpunit": "^11.0",
"symfony/thanks": "^1.4"
},
"extra": {
"class": "Pmu\\Composer\\Plugin",
"plugin-optional": true
"plugin-optional": true,
"thanks": {
"name": "soyuka/pmu",
"url": "https://github.com/soyuka/pmu"
}
},
"scripts": {
"functional": "./vendor/bin/phpunit --bootstrap ./vendor/autoload.php tests/functional",
"unit": "/vendor/bin/phpunit --bootstrap ./vendor/autoload.php tests/unit",
"cs": "./vendor/bin/php-cs-fixer fix",
"phpstan": "./vendor/bin/phpstan analyse"
},
"config": {
"allow-plugins": {
"symfony/thanks": true
}
}
}
Loading

0 comments on commit 3e16514

Please sign in to comment.