packages/build-tools/tasks/static-tasks.js
async function getPages(srcDir) {
  config = config || (await asyncConfig());
  /** @type Array<String> */
  const allPaths = await globby([
    path.join(srcDir, '**/*.{md,html}'),
    '!**/_*/**/*.{md,html}',
    '!**/pattern-lab/**/*',
    '!**/_*.{md,html}',
  ]);

  return Promise.all(allPaths.map(getPage)).then(pages => {
    if (config.verbosity > 4) {
      log.dim('All data for Static pages:');
      console.log(pages);
      log.dim('END: All data for Static pages.');
    }
    return pages;
  });
}
async function getPages(srcDir) {
  config = config || (await asyncConfig());
  /** @type Array<String> */
  const allPaths = await globby([
    path.join(srcDir, '**/*.{md,html}'),
    '!**/_*/**/*.{md,html}',
    '!**/pattern-lab/**/*',
    '!**/_*.{md,html}',
  ]);

  return Promise.all(allPaths.map(getPage)).then(pages => {
    if (config.verbosity > 4) {
      log.dim('All data for Static pages:');
      console.log(pages);
      log.dim('END: All data for Static pages.');
    }
    return pages;
  });
}
async function getPages ( srcDir ) { config = config || ( await asyncConfig ( ) ) ; /** @type Array<String> */ const allPaths = await globby ( [ path . join ( srcDir , '**/*.{md,html}' ) , '!**/_*/**/*.{md,html}' , '!**/pattern-lab/**/*' , '!**/_*.{md,html}' , ] ) ; return Promise . all ( allPaths . map ( getPage ) ) . then ( pages => { if ( config . verbosity > 4 ) { log . dim ( 'All data for Static pages:' ) ; console . log ( pages ) ; log . dim ( 'END: All data for Static pages.' ) ; } return pages ; } ) ; }
Get data for all pages
@param {string} files - Source directory
@see getPage
@returns {Promise<object[]>} - An array of page data objects
Get data for all pages