code: function collectControls( widgets ) {
        const followControlOnce = promiseOnce( followControlRecursively );
        const followWidgetToControls = followEntryRefs( 'controls', followControlOnce );
        const followControlToControls = followWidgetToControls;
  
        return Promise.all( widgets.map( followWidgetToControls ) )
           .then( flatten )
           .then( dedupe );
  
        ///////////////////////////////////////////////////////////////////////////////////////////////////////
  
        /**
         * Collect meta information about the given control, and about all controls it references, recursively.
         * Skip collection if the control has already been processed (returning an empty result array).
         *
         * @private
         * @param {String} controlRef the control reference (relative to `paths.controls`) to follow
         * @return {Promise<Array>}
         *    a promise for an array of control-meta objects for this control, including the control itself
         */
        function followControlRecursively( controlRef ) {
           return followControl( controlRef )
              .then( controls => Promise.all(
                 [ Promise.resolve( controls ) ].concat( controls.map( followControlToControls ) )
              ) )
              .then( flatten );
        }
     }
docs: ///////////////////////////////////////////////////////////////////////////////////////////////////////// 
  Collect meta information on all controls that are referenced by the given widgets.
  
  Example:
  
  collector.collectControls( widgets, themes )
  .then( controls => {
  assert( Array.isArray( controls ) );
  } );
  // => [ {
  //       refs: [ 'control' ],
  //       name: 'control',
  //       path: 'path/to/control',
  //       controls: [ ... ]
  //    }, ... ]
  
  @memberOf ArtifactCollector
  @param {Array} widgets
  a list of widget artifacts as returned by {@link ArtifactCollector#collectWidgets}
  @return {Promise<Array>}
  a promise for an array of meta-information about all reachable controls