scripts/incrementalBuild.js
async function getInvalidPackages() {
  const packages = (await new Project(__dirname).getPackages())
    .filter(p => p.scripts.build) // Only packages that have a build target
    .filter(p => isPf3
      ? p.location.indexOf('patternfly-3') !== -1 || commonPackages.indexOf(p.name) !== -1
      : true) // Based off argv
    .filter(p => isPf4
      ? p.location.indexOf('patternfly-4') !== -1 || commonPackages.indexOf(p.name) !== -1
      : true) // Based off argv

  for (let p of packages) {
    const watchDir = getDir(p.name);
    p.hash = (await hashElement(`${p.location}/${watchDir}`)).hash;
    p.valid = cache && cache[p.name] === p.hash;
    if (p.valid) {
      console.info('Skipping', p.name, '(already built).');
    }
  }

  return packages.filter(p => !p.valid);
}
async function getInvalidPackages() {
  const packages = (await new Project(__dirname).getPackages())
    .filter(p => p.scripts.build) // Only packages that have a build target
    .filter(p => isPf3
      ? p.location.indexOf('patternfly-3') !== -1 || commonPackages.indexOf(p.name) !== -1
      : true) // Based off argv
    .filter(p => isPf4
      ? p.location.indexOf('patternfly-4') !== -1 || commonPackages.indexOf(p.name) !== -1
      : true) // Based off argv

  for (let p of packages) {
    const watchDir = getDir(p.name);
    p.hash = (await hashElement(`${p.location}/${watchDir}`)).hash;
    p.valid = cache && cache[p.name] === p.hash;
    if (p.valid) {
      console.info('Skipping', p.name, '(already built).');
    }
  }

  return packages.filter(p => !p.valid);
}
async function getInvalidPackages ( ) { const packages = ( await new Project ( __dirname ) . getPackages ( ) ) . filter ( p => p . scripts . build ) // Only packages that have a build target . filter ( p => isPf3 ? p . location . indexOf ( 'patternfly-3' ) !== - 1 || commonPackages . indexOf ( p . name ) !== - 1 : true ) // Based off argv . filter ( p => isPf4 ? p . location . indexOf ( 'patternfly-4' ) !== - 1 || commonPackages . indexOf ( p . name ) !== - 1 : true ) // Based off argv for ( let p of packages ) { const watchDir = getDir ( p . name ) ; p . hash = ( await hashElement ( ` ${ p . location } ${ watchDir } ` ) ) . hash ; p . valid = cache && cache [ p . name ] === p . hash ; if ( p . valid ) { console . info ( 'Skipping' , p . name , '(already built).' ) ; } } return packages . filter ( p => ! p . valid ) ; }
These are packages we need to rebuild
These are packages we need to rebuild