How to use the just-scripts-utils.logger.error function in just-scripts-utils

To help you get started, we’ve selected a few just-scripts-utils 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-scripts / src / tasks / upgradeRepoTask.ts View on Github external
return async function upgradeRepo() {
    const rootPath = findMonoRepoRootPath();

    if (!rootPath) {
      logger.error('Could not find monorepo root path. Not upgrading anything.');
      return;
    }

    const resolveStacks = getResolvedStackVersions(path.join(rootPath, 'scripts'));
    const stackDiffs = await getStackDiffs(rootPath, resolveStacks);

    if (stackDiffs) {
      let didUpgradeProjects = false;

      // For each package, look for stacks that match, and apply upgrade for the project
      const rushConfig = readRushJson(rootPath);
      if (!rushConfig) {
        logger.error(`Could not read rush.json under ${rootPath}. Not upgrading anything.`);
        return;
      }
github microsoft / just / packages / just-scripts / src / tasks / upgradeRepoTask.ts View on Github external
if (!rootPath) {
      logger.error('Could not find monorepo root path. Not upgrading anything.');
      return;
    }

    const resolveStacks = getResolvedStackVersions(path.join(rootPath, 'scripts'));
    const stackDiffs = await getStackDiffs(rootPath, resolveStacks);

    if (stackDiffs) {
      let didUpgradeProjects = false;

      // For each package, look for stacks that match, and apply upgrade for the project
      const rushConfig = readRushJson(rootPath);
      if (!rushConfig) {
        logger.error(`Could not read rush.json under ${rootPath}. Not upgrading anything.`);
        return;
      }

      await rushConfig.projects.reduce(async (currentPromise, project) => {
        await currentPromise;

        if (project.projectFolder !== 'scripts') {
          const projPackageJson = readPackageJson(path.join(rootPath, project.projectFolder));

          if (projPackageJson && projPackageJson.just && projPackageJson.just.stack) {
            const diffInfo = stackDiffs[projPackageJson.just.stack];

            // no diff info means that there isn't any diffs to apply
            if (diffInfo) {
              logger.info(
                `Upgrading ${project.packageName} from ${projPackageJson.just.stack} v${diffInfo.fromVersion} to v${diffInfo.toVersion}`
github microsoft / just / packages / just-scripts / src / stack / getStackDiffs.ts View on Github external
if (!oldStacks) {
    logger.warn('Lock file not available');
    return null;
  }

  const stackDiffs: { [stack: string]: DiffInfo } = {};

  try {
    await Object.keys(oldStacks).reduce(async (currentPromise, stack) => {
      await currentPromise;
      if (oldStacks[stack] !== resolvedStacks[stack]) {
        stackDiffs[stack] = await getSingleStackDiffs(stack, oldStacks[stack], resolvedStacks[stack]);
      }
    }, Promise.resolve());
  } catch (e) {
    logger.error('Cannot figure out upgrades needed for this repo: ', e);
    return null;
  }

  return stackDiffs;
}