Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[AssetMapper] Add--dry-run option onimportmap: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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

chadyred
Copy link
Contributor

@chadyredchadyred commentedJan 10, 2025
edited
Loading

QA
Branch?7.3
Bug fix?no
New feature?yes
Deprecations?no
LicenseMIT

We are working with@smnandre on several ideas toimprove AssetMapper DX, focusing here on theimportmap:require command.

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-run flag and reworking the command output (with-v verbosity)

1
Console output
php bin/console importmap:require bootstrap --dry-run -v[DRY-RUN] No changes will apply to the importmap configuration. -------------------------------------- --------- ----------------------------------------------------  Package                                Version   Path -------------------------------------- --------- ----------------------------------------------------  bootstrap                              5.3.3     assets/vendor/bootstrap/bootstrap.index.js  @popperjs/core                         2.11.8    assets/vendor/@popperjs/core/core.index.js  bootstrap/dist/css/bootstrap.min.css   5.3.3     assets/vendor/bootstrap/dist/css/bootstrap.min.css -------------------------------------- --------- ---------------------------------------------------- [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--dry-run option

This flag allows developers to simulate the installation process, without any alteration:

  • no modification ofimportmap.php file;
  • no file added or updated in theassets andpublic directories.

The--dry-run flag allows developers to:

  • check commands formistakes (e.g., typingbootrap instead ofbootstrap, orjquery);
  • list dependentpackages that will be installed (e.g., requiringbootstrap will also install@popperjs/core);
  • test for potential issues whiledownloading1 files.

The console will display a line at start and end of execution to signal the dry-run mode.

2
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-v verbose output

This PR also reworks the output for the-v (verbose) flag to provide more clarity when running the command with additional verbosity.

3

All feedback welcome!

Footnotes

  1. AssetMapper recursively extracts the dependencies of JavaScript modules. Even with the--dry-run option, theimportmap:require command requires a workingHttpClient to download metadata and JavaScript files from various registries/repositories (mainly JSDelivr for now).

smnandre, Kocal, Spomky, and antoniovj1 reacted with thumbs up emoji
@carsonbotcarsonbot added this to the7.3 milestoneJan 10, 2025
@chadyredchadyredforce-pushed thefeat/command-importmap-require-details-2 branch fromb4ec116 toed6a4d2CompareJanuary 10, 2025 13:28
Copy link
Member

@chalasrchalasr left a 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

@chadyredchadyredforce-pushed thefeat/command-importmap-require-details-2 branch fromed6a4d2 to97354d5CompareJanuary 27, 2025 08:46
@chadyredchadyredforce-pushed thefeat/command-importmap-require-details-2 branch from467ac15 to4ca59ffCompareJanuary 27, 2025 11:00
@chadyred
Copy link
ContributorAuthor

Status: Needs Review

@chadyredchadyredforce-pushed thefeat/command-importmap-require-details-2 branch 3 times, most recently from4062322 toe834020CompareFebruary 3, 2025 14:48
@OskarStark
Copy link
Contributor

I cannot see the images in the PR header

chadyred reacted with eyes emoji

@chadyred
Copy link
ContributorAuthor

chadyred commentedFeb 3, 2025
edited
Loading

@OskarStark thanks, it is ok now, it was a copy / paste from a private repository. I take note about that and the images ^^'

@smnandre
Copy link
Member

I cannot see the images in the PR header

@OskarStark

capture
OskarStark reacted with thumbs up emoji

@chadyredchadyredforce-pushed thefeat/command-importmap-require-details-2 branch frome834020 to4ce815fCompareFebruary 4, 2025 14:14
@chadyredchadyredforce-pushed thefeat/command-importmap-require-details-2 branch from4ce815f to8537fffCompareFebruary 20, 2025 12:11
@smnandre
Copy link
Member

Anything here to be added@chalasr ?

Copy link
Member

@fabpotfabpot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM

@chadyredchadyredforce-pushed thefeat/command-importmap-require-details-2 branch from8537fff to337c465CompareMarch 7, 2025 07:36
@chadyredchadyred requested a review fromfabpotMarch 10, 2025 15:23
@fabpot
Copy link
Member

Thank you@chadyred.

@fabpotfabpot merged commitc11abf2 intosymfony:7.3Mar 10, 2025
10 of 11 checks passed
@fabpotfabpot mentioned this pull requestMay 2, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@stofstofstof left review comments

@fabpotfabpotfabpot approved these changes

@chalasrchalasrAwaiting requested review from chalasr

Assignees
No one assigned
Projects
None yet
Milestone
7.3
Development

Successfully merging this pull request may close these issues.

7 participants
@chadyred@OskarStark@smnandre@fabpot@stof@chalasr@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp