How to use the just-task-logger.logger.perf function in just-task-logger

To help you get started, we’ve selected a few just-task-logger 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 microsoft / just / packages / just-task / src / cache.ts View on Github external
for (const pkgDepInfo of dependentPkgPaths) {
    const pkgPath = pkgDepInfo.path;
    const depHashFile = path.join(pkgPath, 'node_modules/.just', CacheFileName);
    const depPackageJson = JSON.parse(fs.readFileSync(path.join(pkgPath, 'package.json'), 'utf-8'));

    if (fs.existsSync(depHashFile)) {
      const stat = fs.statSync(depHashFile);
      timestampsByPackage[pkgDepInfo.name] = stat.mtimeMs;
    } else if (depPackageJson.scripts) {
      // always updated if no hash file is found for dependants
      timestampsByPackage[pkgDepInfo.name] = new Date().getTime();
    }
  }

  logger.perf('cache:getDependentHashTimestamps');

  return timestampsByPackage;
}
github microsoft / just / packages / just-task / src / cache.ts View on Github external
const packageRootPath = getPackageRootPath();

  const packageDeps = getPackageDeps(packageRootPath);

  const lockFileHashes = getLockFileHashes();

  packageDeps.files = { ...packageDeps.files, ...lockFileHashes };

  const hash = {
    args,
    taskName,
    hash: packageDeps,
    dependentHashTimestamps: getDependentHashTimestamps()
  };

  logger.perf('cache:getHash');

  return hash;
}
github microsoft / just / packages / just-task / src / package / findDependents.ts View on Github external
function collectAllDependentPaths(pkgPath: string, collected: Set = new Set()) {
  mark(`collectAllDependentPaths:${pkgPath}`);

  const depPaths = getDepsPaths(pkgPath);
  depPaths.forEach(depPath => collected.add(depPath));

  for (const depPath of depPaths) {
    if (!collected.has(depPath)) {
      collectAllDependentPaths(depPath.path, collected);
    }
  }

  logger.perf(`collectAllDependentPaths:${pkgPath}`);

  return collected;
}
github microsoft / just / packages / just-task / src / package / findDependents.ts View on Github external
export function findDependents() {
  mark('cache:findDependents');
  const results = collectAllDependentPaths(findPackageRoot());
  logger.perf('cache:findDependents');
  return results;
}

just-task-logger

Logger for Just scripts and tasks

MIT
Latest version published 2 years ago

Package Health Score

69 / 100
Full package analysis

Similar packages