Skip to content

Commit 5267545

Browse files
committed
[docs] add raise-to-installed
1 parent 1f289f8 commit 5267545

File tree

3 files changed

+42
-1
lines changed

3 files changed

+42
-1
lines changed

README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,4 +156,45 @@ vendor/bin/jack open-versions --dev
156156

157157
<br>
158158

159+
### 3. Raise to Installed Versions
160+
161+
Sometimes, we get to an opposite situation. Our dependencies are quite new, but our `composer.json` is a outdated. We can see this e.g. in PHPStorm:
162+
163+
<img src="/docs/composer-outdated-install.png" alt="Outdated composer.json" width="300" align="center">
164+
165+
Here we can see that:
166+
167+
* `illuminate/container` 12.0 is allowed, but we already use 12.4
168+
* `symfony/finder` 6.4 is allowed, but we already use 7.2
169+
170+
If someone runs `composer update`, they might get unnecessary older dependencies than we can handle. Instead, we should raise our `composer.json` to the installed versions:
171+
172+
```diff
173+
{
174+
"require": {
175+
"php": "^7.4",
176+
- "illuminate/container": "^12.0",
177+
+ "illuminate/container": "^12.4",
178+
// ...
179+
- "symfony/finder": "^6.4|^7.2",
180+
+ "symfony/finder": "^7.2",
181+
// ...
182+
}
183+
}
184+
```
185+
186+
That's exactly what following command does:
187+
188+
```bash
189+
vendor/bin/jack raise-to-installed
190+
```
191+
192+
To see changes first without applying, use again `--dry-run`:
193+
194+
```bash
195+
vendor/bin/jack raise-to-installed --dry-run
196+
```
197+
198+
<br>
199+
159200
Happy coding!

docs/composer-outdated-install.png

38.6 KB
Loading

src/Command/RaiseToInstalledCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function __construct(
2424

2525
protected function configure(): void
2626
{
27-
$this->setName('raise-to-lock');
27+
$this->setName('raise-to-installed');
2828

2929
$this->setDescription(
3030
'Raise your version in "composer.json" to installed one to get the latest version available in any composer update'

0 commit comments

Comments
 (0)