How to use the kyt-utils/logger.start function in kyt-utils

To help you get started, we’ve selected a few kyt-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 nytimes / kyt / packages / kyt-core / cli / actions / build.js View on Github external
module.exports = config => {
  logger.start('Starting production build...');

  let serverCompiler;

  const { clientConfig, serverConfig } = buildConfigs(config, 'production');

  // Clean the build directory.
  if (shell.rm('-rf', buildPath).code === 0) {
    shell.mkdir(buildPath);
    logger.task('Cleaned ./build');
  }

  // Copy public folder into build
  if (shell.test('-d', publicSrcPath)) {
    // Create build folder if it doesnt exist
    if (!shell.test('-d', buildPath)) {
      shell.mkdir(buildPath);
github nytimes / kyt / packages / kyt-core / cli / actions / proto.js View on Github external
let compiler = null;
    try {
      if (config.debug) logger.debug('Prototype Config', webpackConfig);
      compiler = webpack(webpackConfig);
    } catch (error) {
      logger.error('Webpack config is invalid\n', error);
      process.exit();
    }

    // Creates a webpack dev server at the specified port
    server = new WebpackDevServer(compiler, webpackConfig.devServer);
    server.listen(prototypeURL.port, prototypeURL.hostname, () => {
      logger.end(`webpack-dev-server ${prototypeURL.href}prototype`);
    });
  };
  logger.start('Configuring Prototype...');

  if (!shell.test('-f', userPrototypePath)) {
    logger.error('Prototype.js entry file does not exist.');
    logger.error('See the kyt Readme for details.');
    process.exit();
  }

  ifPortIsFreeDo(prototypeURL.port, startPrototype);
};
github nytimes / kyt / packages / kyt-core / cli / actions / dev.js View on Github external
module.exports = (config, flags) => {
  logger.start('Starting development build...');

  // Kill the server on exit.
  process.on('SIGINT', process.exit);

  let clientCompiler;
  let serverCompiler;
  const { clientConfig, serverConfig } = buildConfigs(config);
  const { clientURL, serverURL, reactHotLoader, hasServer } = config;

  const afterClientCompile = once(() => {
    if (reactHotLoader) logger.task('Setup React Hot Loader');
    if (!hasServer) logger.task(`Starting up server: ${clientCompiler.options.output.publicPath}`);
    else logger.task(`Client assets serving from ${clientCompiler.options.output.publicPath}`);
  });

  // Clean the build directory.
github olymp / olymp / kyt / kyt-cli-dev.js View on Github external
module.exports = (config, flags) => {
  logger.start('Starting development build...');

  // Kill the server on exit.
  process.on('SIGINT', process.exit);

  let clientCompiler;
  let serverCompiler;
  const { clientConfig, serverConfig } = buildConfigs(config);
  const { clientURL, serverURL, reactHotLoader, hasServer, additionalServerPaths } = config;

  const afterClientCompile = once(() => {
    if (reactHotLoader) logger.task('Setup React Hot Loader');
    if (!hasServer) logger.task(`Starting up server: ${clientCompiler.options.output.publicPath}`);
    else logger.task(`Client assets serving from ${clientCompiler.options.output.publicPath}`);
  });

  // Clean the build directory.
github nytimes / kyt / packages / kyt-cli / cli / actions / setup.js View on Github external
module.exports = (flags, args) => {
  logger.start("Let's set up your new kyt project...");
  logger.log('✨  Answer a few questions to get started  ✨ \n');
  // Selects package manager to use
  let ypm;
  // Comment the following to see verbose shell ouput.
  shell.config.silent = true;
  let paths = {};
  const date = Date.now();
  let tmpStarter;
  // For passed starter-kyts the root of the starter-kyt is the root of the repo
  let tmpDir;
  let repoURL = 'https://github.com/NYTimes/kyt.git';
  let { localPath } = args;
  let tempPackageJSON;
  let oldPackageJSON;
  const fakePackageJson = {
    name: '',
github nytimes / kyt / packages / kyt-cli / cli / actions / list.js View on Github external
module.exports = () => {
  logger.start('Listing starter-kyts');
  logger.task('kyt supported starter-kyts: \n');
  Object.keys(starterKyts.supported).forEach((starterName, index) => {
    const li = index + 1;
    printStarter(li, starterKyts.supported[starterName]);
  });
  logger.task('Recommended starter-kyts:\n');
  Object.keys(starterKyts.recommended).forEach((starterName, index) => {
    const li = index + 1;
    printStarter(li, starterKyts.recommended[starterName]);
  });
  logger.end('List complete');
};
github nytimes / kyt / packages / kyt-cli / cli / actions / setup.js View on Github external
const existingProjectSetup = () => {
    logger.start('Setting up kyt');
    updateUserPackageJSON(true);
    createEditorconfigLink();
    createESLintFile();
    createStylelintFile();
    createKytConfig();
    createGitignore();
    logger.end('Done setting up kyt');
  };

kyt-utils

A shared kyt utility library.

Apache-2.0
Latest version published 5 months ago

Package Health Score

74 / 100
Full package analysis

Similar packages