-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[AssetMapper] Add --dry-run option on importmap:require command
#59464
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[AssetMapper] Add --dry-run option on importmap:require command
#59464
Conversation
b4ec116 to
ed6a4d2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add an entry in the UPGRADE-7.3 file also
src/Symfony/Component/AssetMapper/Command/ImportMapRequireCommand.php
Outdated
Show resolved
Hide resolved
ed6a4d2 to
97354d5
Compare
src/Symfony/Component/AssetMapper/Command/ImportMapRequireCommand.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/AssetMapper/Command/ImportMapRequireCommand.php
Outdated
Show resolved
Hide resolved
467ac15 to
4ca59ff
Compare
|
Status: Needs Review |
4062322 to
e834020
Compare
|
I cannot see the images in the PR header |
|
@OskarStark thanks, it is ok now, it was a copy / paste from a private repository. I take note about that and the images ^^' |
e834020 to
4ce815f
Compare
4ce815f to
8537fff
Compare
|
Anything here to be added @chalasr ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
src/Symfony/Component/AssetMapper/Command/ImportMapRequireCommand.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/AssetMapper/Command/ImportMapRequireCommand.php
Outdated
Show resolved
Hide resolved
8537fff to
337c465
Compare
|
Thank you @chadyred. |

We are working with @smnandre on several ideas to improve AssetMapper DX, focusing here on the
importmap:requirecommand.Currently, there is no way to know in advance which dependent packages will be downloaded too, and the final output display lacks clarity.
This PR aims to solve both issues by adding a new
--dry-runflag and reworking the command output (with-vverbosity)Console output
New
--dry-runoptionThis flag allows developers to simulate the installation process, without any alteration:
importmap.phpfile;assetsandpublicdirectories.The
--dry-runflag allows developers to:bootrapinstead ofbootstrap, orjquery);bootstrapwill also install@popperjs/core);The console will display a line at start and end of execution to signal the dry-run mode.
Console output
php bin/console importmap:require bootstrap --dry-run [DRY-RUN] No changes will apply to the importmap configuration. [OK] 3 new items (bootstrap, @popperjs/core, bootstrap/dist/css/bootstrap.min.css) added to the importmap.php! [DRY-RUN] No changes applied to the importmap configuration.New
-vverbose outputThis PR also reworks the output for the
-v(verbose) flag to provide more clarity when running the command with additional verbosity.All feedback welcome!
Footnotes
AssetMapper recursively extracts the dependencies of JavaScript modules. Even with the
--dry-runoption, theimportmap:requirecommand requires a workingHttpClientto download metadata and JavaScript files from various registries/repositories (mainly JSDelivr for now). ↩