Skip to content

[AssetMapper] Add link to jsdelivr in debug:asset-mapper #52302

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

Closed
tacman opened this issue Oct 26, 2023 · 5 comments
Closed

[AssetMapper] Add link to jsdelivr in debug:asset-mapper #52302

tacman opened this issue Oct 26, 2023 · 5 comments

Comments

@tacman
Copy link
Contributor

tacman commented Oct 26, 2023

Description

Sometimes I'm missing css or plugins that aren't included in the default download of an asset from jsdelivr. I'd like an easy way to go to the package itself on jsdelivr, see the version and other details.

Expanding debug:asset-map with a --jsdelivr option to provide urls instead of simply the names?

Example

bin/console debug:asset-map

Asset Mapper Paths
------------------

 ---------------------------------------------- ---------------------------- 
  Path                                           Namespace prefix            
 ---------------------------------------------- ---------------------------- 
  vendor/symfony/stimulus-bundle/assets/dist     @symfony/stimulus-bundle    
  vendor/symfony/ux-live-component/assets/dist   @symfony/ux-live-component  
  assets                                                                     
 ---------------------------------------------- ---------------------------- 

Mapped Assets
-------------

 --------------------------------------------------- ---------------------------------------------------- 
  Logical Path                                        Filesystem Path                                     
 --------------------------------------------------- ---------------------------------------------------- 
  @symfony/stimulus-bundle/loader.js                  vendor/symfony/stimulus...e/assets/dist/loader.js   
  @symfony/stimulus-bundle/controllers.js             vendor/symfony/stimulus...ets/dist/controllers.js   
  @symfony/ux-live-component/live_controller.js       vendor/symfony/ux-live-...dist/live_controller.js   
  @symfony/ux-live-component/live.min.css             vendor/symfony/ux-live-...ssets/dist/live.min.css   
  js/doclinks.js                                      assets/js/doclinks.js                               
  js/highlight.js                                     assets/js/highlight.js                              
  js/flatpicker.js                                    assets/js/flatpicker.js                             
  webpack_admin.js                                    assets/webpack_admin.js                             
  bootstrap-stimulus-bundle.js                        assets/bootstrap-stimulus-bundle.js                 
  vendor/bootstrap/bootstrap.index.js                 assets/vendor/bootstrap/bootstrap.index.js          
  vendor/bootstrap/dist/css/bootstrap.min.css         assets/vendor/bootstrap/dist/css/bootstrap.min.css  
  vendor/@popperjs/core/core.index.js                 assets/vendor/@popperjs/core/core.index.js          
  vendor/highlight.js/lib/core.js                     assets/vendor/highlight.js/lib/core.js              
  vendor/highlight.js/lib/languages/php.js            assets/vendor/highlight.js/lib/languages/php.js     
  vendor/highlight.js/lib/languages/twig.js           assets/vendor/highlight.js/lib/languages/twig.js    
  vendor/flatpickr/flatpickr.index.js                 assets/vendor/flatpickr/flatpickr.index.js          
  vendor/flatpickr/dist/flatpickr.min.css             assets/vendor/flatpickr/dist/flatpickr.min.css      
  vendor/flatpickr/dist/l10n.js                       assets/vendor/flatpickr/dist/l10n.js                
  vendor/jquery/jquery.index.js                       assets/vendor/jquery/jquery.index.js                
  vendor/@hotwired/stimulus/stimulus.index.js         assets/vendor/@hotwired/stimulus/stimulus.index.js  
  vendor/highlightjs/highlightjs.index.js             assets/vendor/highlightjs/highlightjs.index.js      
  vendor/highlightjs/styles/monokai-sublime.min.css   assets/vendor/highlight...monokai-sublime.min.css   
  admin.js                                            assets/admin.js                                     
  styles/_variables.scss                              assets/styles/_variables.scss                       
  styles/bootstrap-tagsinput.scss                     assets/styles/bootstrap-tagsinput.scss              
  styles/admin.scss                                   assets/styles/admin.scss                            
  styles/app.css                                      assets/styles/app.css                               
  styles/app.scss                                     assets/styles/app.scss                              
  bootstrap.js                                        assets/bootstrap.js                                 
  app.js                                              assets/app.js                                       
  controllers/login-controller.js                     assets/controllers/login-controller.js              
  controllers/.gitignore                              assets/controllers/.gitignore                       
  controllers/hello_controller.js                     assets/controllers/hello_controller.js              
  webpack_app.js                                      assets/webpack_app.js              

While the debug displays the map between logical name and local path, for the assets that were installed via jsdelivr, I'd like the option to see the exact path that was used. Right now, so see that, I simply re-install with -vv

 bin/console importmap:require flatpickr -vv
10:59:15 INFO      [http_client] Request: "GET https://data.jsdelivr.com/v1/packages/npm/flatpickr/resolved"
10:59:15 INFO      [http_client] Response: "200 https://data.jsdelivr.com/v1/packages/npm/flatpickr/resolved"
10:59:16 INFO      [http_client] Request: "GET https://cdn.jsdelivr.net/npm/flatpickr@4.6.13/+esm"
10:59:16 INFO      [http_client] Request: "GET https://data.jsdelivr.com/v1/packages/npm/flatpickr@4.6.13/entrypoints"
10:59:16 INFO      [http_client] Response: "200 https://cdn.jsdelivr.net/npm/flatpickr@4.6.13/+esm"
10:59:16 INFO      [http_client] Response: "200 https://data.jsdelivr.com/v1/packages/npm/flatpickr@4.6.13/entrypoints"
10:59:16 INFO      [http_client] Request: "GET https://data.jsdelivr.com/v1/packages/npm/flatpickr/resolved?specifier=4.6.13"
10:59:16 INFO      [http_client] Response: "200 https://data.jsdelivr.com/v1/packages/npm/flatpickr/resolved?specifier=4.6.13"
10:59:16 INFO      [http_client] Request: "GET https://cdn.jsdelivr.net/npm/flatpickr@4.6.13/dist/flatpickr.min.css"
10:59:16 INFO      [http_client] Response: "200 https://cdn.jsdelivr.net/npm/flatpickr@4.6.13/dist/flatpickr.min.css"

Of course, those go to the downloaded file, which is nice, but somewhere I'd like to simply go to the package itself, e.g.

https://www.jsdelivr.com/package/npm/flatpickr

@tacman
Copy link
Contributor Author

tacman commented Oct 26, 2023

Move to #52304 per stof's request.

@stof
Copy link
Member

stof commented Oct 26, 2023

@tacman please open separate issues for each feature request, so that they can be discussed (and accepted or rejected) separately.

@OskarStark OskarStark changed the title [AssetMapper] Add link to jsdelivr in debug:asset-mapper [AssetMapper] Add link to jsdelivr in debug:asset-mapper Oct 30, 2023
@carsonbot
Copy link

Thank you for this issue.
There has not been a lot of activity here for a while. Has this been resolved?

@carsonbot
Copy link

Hello? This issue is about to be closed if nobody replies.

@carsonbot
Copy link

Hey,

I didn't hear anything so I'm going to close it. Feel free to comment if this is still relevant, I can always reopen!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants