code: function collectWidgets( pages ) {
        const followWidgetOnce = promiseOnce( followWidget );
        const followPageToWidgets = followEntryRefs( 'widgets', followWidgetOnce );
  
        return Promise.all( pages.map( followPageToWidgets ) )
           .then( flatten )
           .then( dedupe );
     }
docs: //////////////////////////////////////////////////////////////////////////////////////////////////////// 
  Collect meta information on all widget that are referenced from the given pages.
  
  Example:
  
  collector.collectWidgets( pages )
  .then( widgets => {
  assert( Array.isArray( widgets ) );
  } );
  // => [ {
  //       refs: [ 'widget' ],
  //       name: 'widget',
  //       path: 'path/to/widget',
  //       controls: [ ... ]
  //    }, ... ]
  
  @memberOf ArtifactCollector
  @param {Array} pages
  a list of page artifacts as returned by {@link ArtifactCollector#collectPages}
  @return {Promise<Array>}
  a promise for an array of meta-information about all reachable widgets