How to use the just-task-logger.mark 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
function getDependentHashTimestamps() {
  mark('cache:getDependentHashTimestamps');
  const dependentPkgPaths = findDependents();

  const timestampsByPackage: { [pkgName: string]: number } = {};

  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();
    }
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;
}
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 / cache.ts View on Github external
function getHash(taskName: string): CacheHash | null {
  mark('cache:getHash');

  const { ...args } = argv();

  const packageRootPath = getPackageRootPath();

  const packageDeps = getPackageDeps(packageRootPath);

  const lockFileHashes = getLockFileHashes();

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

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

just-task-logger

Logger for Just scripts and tasks

MIT
Latest version published 1 year ago

Package Health Score

73 / 100
Full package analysis

Similar packages