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

To help you get started, we’ve selected a few just-task 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-preset / src / outdatedTask.ts View on Github external
return async function outdated() {
    logger.info(`Fetching Outdated Dependency Versions`);

    if (options.versionSpec) {
      const versionInfo = await fetchVersions(options.versionSpec);
      const updateVersions = getUpdateVersions(options.versionSpec, versionInfo);
      const packageJsonFile = resolveCwd('./package.json', path.dirname(resolve('./just-task.js')!));

      console.log(packageJsonFile);

      if (packageJsonFile) {
        const packageJson = JSON.parse(fs.readFileSync(packageJsonFile).toString());

        if (Object.keys(updateVersions).length > 0) {
          Object.keys(updateVersions).forEach(name => {
            if (packageJson.devDependencies && packageJson.devDependencies[name]) {
              packageJson.devDependencies[name] = getPackageVersionSpec(packageJson.devDependencies[name], updateVersions[name]);
              logger.info(`  ${chalk.cyan(name)} updated to '${chalk.yellow(updateVersions[name])}' (devDependencies)`);
github microsoft / just / packages / just-scripts / src / tasks / eslintTask.ts View on Github external
const eslintIgnorePath = ignorePath || resolveCwd('.eslintignore');

      const eslintArgs = [
        eslintCmd,
        ...(files ? files : ['.']),
        ...['--ext', extensions ? extensions : '.js,.jsx,.ts,.tsx'],
        ...(noEslintRc ? '--no-eslintrc' : []),
        ...(eslintConfigPath ? ['--config', eslintConfigPath] : []),
        ...(eslintIgnorePath ? ['--ignore-path', eslintIgnorePath] : []),
        ...(resolvePluginsPath ? ['--resolve-plugins-relative-to', resolvePluginsPath] : []),
        ...(fix ? ['--fix'] : []),
        ...(maxWarnings !== undefined ? ['--max-warnings', `${maxWarnings}`] : []),
        '--color'
      ];

      logger.info(encodeArgs(eslintArgs).join(' '));
      return spawn(process.execPath, eslintArgs, { stdio: 'inherit' });
    } else {
      return Promise.resolve();
    }
  };
}
github microsoft / just / packages / just-scripts / src / tasks / webpackTask.ts View on Github external
fs.writeFileSync(statsFile, JSON.stringify(stats.toJson(), null, 2));
          }

          if (err || stats.hasErrors()) {
            const errorStats = stats.toJson('errors-only');
            errorStats.errors.forEach((error: any) => {
              logger.error(error);
            });
            reject(`Webpack failed with ${errorStats.errors.length} error(s).`);
          } else {
            resolve();
          }
        });
      });
    } else {
      logger.info('webpack.config.js not found, skipping webpack');
    }

    return;
  };
}
github microsoft / just / packages / just-scripts / src / tasks / tslintTask.ts View on Github external
return function tslint() {
    const tslintCmd = resolve('tslint/lib/tslintCli.js');

    if (projectFile && tslintCmd && fs.existsSync(projectFile)) {
      logger.info(`Running tslint`);

      const args = [
        '--project',
        projectFile,
        '-t',
        'stylish',
        '-r',
        path.dirname(resolve('tslint-microsoft-contrib') || '')
      ];

      if (options.fix) {
        args.push('--fix');
      }

      const cmd = encodeArgs([process.execPath, tslintCmd, ...args]).join(' ');
      logger.info(cmd);
github AgoraIO / Electron-SDK / scripts / synclib.js View on Github external
}).then(() => {
      logger.info("Success", "Unzip finished");
      if(os === "mac") {
        return globPromise(path.join(__dirname, '../tmp/Agora_Native_SDK_for_Mac_FULL/libs/AgoraRtcEngineKit.framework/'))
      } else {
        return globPromise(path.join(__dirname, '../tmp/Agora_Native_SDK_for_Windows*/'))
      }
    }).then(folder => {
      if(os === "mac") {
github microsoft / just / packages / just-scripts / src / tasks / jestTask.ts View on Github external
const cmd = process.execPath;
      const args = [
        ...(options.nodeArgs || []),
        jestCmd,
        '--config',
        configFile,
        ...(options.passWithNoTests ? ['--passWithNoTests'] : []),
        ...(options.colors !== false && supportsColor.stdout ? ['--colors'] : []),
        ...(options.runInBand ? ['--runInBand'] : []),
        ...(options.coverage ? ['--coverage'] : []),
        ...(options.watch ? ['--watch'] : []),
        ...(options.u || options.updateSnapshot ? ['--updateSnapshot'] : ['']),
        ...(options._ || [])
      ].filter(arg => !!arg) as Array;

      logger.info(cmd, encodeArgs(args).join(' '));

      return spawn(cmd, args, { stdio: 'inherit', env: options.env });
    } else {
      logger.warn('no jest configuration found, skipping jest');
      return Promise.resolve();
    }
  };
}
github OfficeDev / office-ui-fabric-react / scripts / just-task.js View on Github external
? () => {
          logger.info(`${name} task is disabled in package.json`);
        }
      : taskFunction
github AgoraIO / Electron-SDK / scripts / synclib.js View on Github external
}).then(() => {
      logger.info("Success", "Prepare finished");
      resolve()
    }).catch(err => {
      logger.error("Failed: ", err);
github microsoft / just / packages / just-scripts / src / tasks / jestTask.ts View on Github external
return function jest() {
    const jestCmd = resolve('jest/bin/jest.js');
    const configFile = options.config || jestConfigFile;

    if (configFile && jestCmd && existsSync(configFile)) {
      logger.info(`Running Jest`);
      const cmd = process.execPath;
      const args = [
        ...(options.nodeArgs || []),
        jestCmd,
        '--config',
        configFile,
        ...(options.passWithNoTests ? ['--passWithNoTests'] : []),
        ...(options.colors !== false && supportsColor.stdout ? ['--colors'] : []),
        ...(options.runInBand ? ['--runInBand'] : []),
        ...(options.coverage ? ['--coverage'] : []),
        ...(options.watch ? ['--watch'] : []),
        ...(options.u || options.updateSnapshot ? ['--updateSnapshot'] : ['']),
        ...(options._ || [])
      ].filter(arg => !!arg) as Array;

      logger.info(cmd, encodeArgs(args).join(' '));
github microsoft / just / packages / just-scripts / src / tasks / tscTask.ts View on Github external
const args = Object.keys(options).reduce(
        (args, option) => {
          if (typeof options[option] === 'string') {
            return args.concat(['--' + option, options[option] as string]);
          } else if (typeof options[option] === 'boolean') {
            return args.concat(['--' + option]);
          }

          return args;
        },
        [tscCmd]
      );

      const cmd = encodeArgs([process.execPath, ...args]).join(' ');
      logger.info(`Executing: ${cmd}`);
      return exec(cmd);
    } else {
      Promise.resolve();
    }
  };
}