Hello,

To avoid other people to lose time adding the libraries with composer, I suggest to add an example of code to copy past into the composer.json of the project the person is working on.

Here is the commit I made for the french Drupal association website: https://github.com/Drupal-FR/site-drupalfr/commit/f9e7a0f1c8674d99c5d8b2...

If you are interested in this idea, I will provide a patch.

And thanks for this module with all those (too many?) features.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Grimreaper created an issue. See original summary.

jrockowitz’s picture

@Grimreaper I always welcome help with documentation.

Over the past month, I significantly improved the Webform module's library management. There is now a drush webform-libraries-composer that generates the Webform module's composer repositories and requirement statements.

I think the next step would be to write a drush command that adds these repositories and requirements directly to a website's composer.json. I hesitating doing this because Drupal core needs to decided how best to handler external libraries.

For now I think we should update this documentation which is generated via WebformHelpManager::buildLibraries

Grimreaper’s picture

Hello @jrockowitz,

Thanks for your quick response.

Oh, I didn't know there is a command for that.

To be honest I didn't go to the documentation pages. I only focused on the warnings on the "status report" page. I saw "or use Drush to install this library" (which is broken by the way, at least on 5.0.0-beta12) but I supposed it was one shot installation and not adding the libraries in composer or make.

Maybe just adding "composer and make supported" or something like that would be enough.

I have just tested the composer command. Amazing!!! Very good work. Maybe in the examples it will be good to precise that the output must be redirected to a file "drush wflc > composer.json".

And thanks, I learned something on composer:

"extra": {
    "installer-name": "ckeditor"
},

I didn't know the option.

I agree that an automatic insertion in a project composer.json would be tricky. Maybe that's too much.

Thanks again for the module.

jrockowitz’s picture

Status: Active » Needs review
FileSize
1.04 KB

Here is a patch that fixes the broken link.

Status: Needs review » Needs work

The last submitted patch, 4: document_how_to_add_the-2876290-4.patch, failed testing.

jrockowitz’s picture

Status: Needs work » Needs review
FileSize
1.16 KB

  • jrockowitz committed 334f517 on 8.x-5.x
    Issue #2876290 by jrockowitz: Document how to add the libraries using...
jrockowitz’s picture

Status: Needs review » Fixed

I fixed the link and patches updating the documentation is welcomed. For now, I am going to close this ticket.

Grimreaper’s picture

Ok. Thanks for the discussion.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

ressa’s picture

@jrockowitz: I just want to thank you for making the download of external libraries so painless, with drush webform-libraries-download. It seems like almost everything has been thought of for this module -- small details like including a new field automatically in the results page, as a sortable column. Webform is truly a module done right.

selinav’s picture

I can't installed drush on windows, what is the command line with composer to install third libraries?

jrockowitz’s picture

Use `drush --filter=webform help` to see all available webform drush commands. You should use `webform-composer-update` to update your composer.json file.

$ drush  --filter=webform help
Webform commands: (webform)
 webform-composer-upd  Updates the Drupal installation's composer.json to include the Webform module's selected libraries as repositories. 
 ate (wfcu)                                                                                                                                
 webform-docs (wfd)    Generates HTML documentation.                                                                                       
 webform-export (wfx)  Exports webform submissions to a file.                                                                              
 webform-generate      Create submissions in specified webform.                                                                            
 (wfg)                                                                                                                                     
 webform-libraries-co  Generates the Webform module's composer.json with libraries as repositories.                                        
 mposer (wflc)                                                                                                                             
 webform-libraries-do  Download third party libraries required by the Webform module.                                                      
 wnload (wfld)                                                                                                                             
 webform-libraries-ma  Generates libraries YAML to be included in a drush.make.yml files.                                                  
 ke (wflm)                                                                                                                                 
 webform-libraries-re  Removes all downloaded third party libraries required by the Webform module.                                        
 move (wflr)                                                                                                                               
 webform-libraries-st  Displays the status of third party libraries required by the Webform module.                                        
 atus (wfls)                                                                                                                               
 webform-purge (wfp)   Purge webform submissions from the databases                                                                        
 webform-repair (wfr)  Makes sure all Webform admin settings and webforms are up-to-date.                                                  
 webform-tidy (wft)    Tidy export webform configuration files
13:50  /var/www/sites/d8_webform/modules/sandbox/webform  (2921547-display-signature)$ drush help webform-composer-update
Updates the Drupal installation's composer.json to include the Webform module's selected libraries as repositories.

Examples:
 webform-composer-update                   Updates the Drupal installation's composer.json to include the Webform module's selected libraries as repositories.

Aliases: wfcu
$