Skip to content

Commit f6d319d

Browse files
committed
feature #51845 [AssetMapper] Add outdated command (Maelan LE BORGNE)
This PR was squashed before being merged into the 6.4 branch. Discussion ---------- [AssetMapper] Add outdated command | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | | License | MIT As suggested by `@WebMamba`, I added a new command for the AssetMapper component to list outdated 3rd party packages. It is inspired by the `composer outdated` command so I tried to replicate its options as much as I could. It reads the importmap.php and extract packages version to query the https://registry.npmjs.org/%package% API and read the latest version from metadata. ![image](https://github.com/symfony/symfony/assets/11990607/189f66a0-dda0-4916-a91b-988ebe8f9fb3) :warning: The code is base on #51650 branch so it is not ready to be merged yet, but I'd be happy to get some reviews and feedback in the meantime. This is my first PR on symfony, so there will probably be a lot to say ! - [ ] gather feedback - [x] wait for #51650 to be merged and rebase - [ ] write documentation Commits ------- 4d32a35677 [AssetMapper] Add outdated command
2 parents 7b4d7c2 + 077f41d commit f6d319d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Resources/config/asset_mapper.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use Symfony\Component\AssetMapper\Command\DebugAssetMapperCommand;
2121
use Symfony\Component\AssetMapper\Command\ImportMapAuditCommand;
2222
use Symfony\Component\AssetMapper\Command\ImportMapInstallCommand;
23+
use Symfony\Component\AssetMapper\Command\ImportMapOutdatedCommand;
2324
use Symfony\Component\AssetMapper\Command\ImportMapRemoveCommand;
2425
use Symfony\Component\AssetMapper\Command\ImportMapRequireCommand;
2526
use Symfony\Component\AssetMapper\Command\ImportMapUpdateCommand;
@@ -32,6 +33,7 @@
3233
use Symfony\Component\AssetMapper\ImportMap\ImportMapConfigReader;
3334
use Symfony\Component\AssetMapper\ImportMap\ImportMapManager;
3435
use Symfony\Component\AssetMapper\ImportMap\ImportMapRenderer;
36+
use Symfony\Component\AssetMapper\ImportMap\ImportMapUpdateChecker;
3537
use Symfony\Component\AssetMapper\ImportMap\RemotePackageDownloader;
3638
use Symfony\Component\AssetMapper\ImportMap\Resolver\JsDelivrEsmResolver;
3739
use Symfony\Component\AssetMapper\MapperAwareAssetPackage;
@@ -179,6 +181,11 @@
179181
service('asset_mapper.importmap.config_reader'),
180182
service('http_client'),
181183
])
184+
->set('asset_mapper.importmap.update_checker', ImportMapUpdateChecker::class)
185+
->args([
186+
service('asset_mapper.importmap.config_reader'),
187+
service('http_client'),
188+
])
182189

183190
->set('asset_mapper.importmap.command.require', ImportMapRequireCommand::class)
184191
->args([
@@ -205,5 +212,9 @@
205212
->set('asset_mapper.importmap.command.audit', ImportMapAuditCommand::class)
206213
->args([service('asset_mapper.importmap.auditor')])
207214
->tag('console.command')
215+
216+
->set('asset_mapper.importmap.command.outdated', ImportMapOutdatedCommand::class)
217+
->args([service('asset_mapper.importmap.update_checker')])
218+
->tag('console.command')
208219
;
209220
};

0 commit comments

Comments
 (0)