How to use the @nrwl/schematics/src/command-line/shared.parseFiles function in @nrwl/schematics

To help you get started, we’ve selected a few @nrwl/schematics examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github izifortune / nrwl-packagr / scripts / utils.js View on Github external
const getAffectedLibs = () => {
  const p = parseFiles(process.argv.slice(3));
  const touchedFiles = p.files;
  const config = JSON.parse(fs.readFileSync('.angular-cli.json', 'utf-8'));
  const projects = (config.apps ? config.apps : []).map(function (p) {
    return {
      name: p.name,
      isApp: p.root.startsWith('libs/'),
      files: allFilesInDir(path.dirname(p.root))
    };
  });
  if (!config.project.npmScope) {
    throw new Error(".angular-cli.json must define the npmScope property.");
  }
  return affectedApps(config.project.npmScope, projects, function (f) { return fs.readFileSync(f, 'utf-8'); }, touchedFiles);
}