How to use the just-scripts-utils.paths.projectPath 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 / create-just / src / commands / initCommand.ts View on Github external
const stackName = getStackName(stackPath!);
  const generator = await getPlopGenerator(stackPath!, paths.projectPath, stackName);

  logger.info(`Running "${stackName}" code generation actions inside: ${paths.projectPath}`);

  await runGenerator(generator, argv);

  logger.info(`Initializing the repo in ${paths.projectPath}`);

  pkg.install(argv.registry, paths.projectPath);

  try {
    execSync('git init', { cwd: paths.projectPath });
    execSync('git add .', { cwd: paths.projectPath });
    execSync('git commit -m "initial commit"', { cwd: paths.projectPath });
  } catch (e) {
    logger.warn('Looks like you may not have git installed or there was some sort of error initializing the git repo');
    logger.info(`
Please make sure you have git installed and then issue the following:

    cd ${paths.projectPath}
    git init
    git add .
    git commit -m "initial commit"

`);
    process.exit(1);
  }

  logger.info('All Set!');
github microsoft / just / packages / create-just / src / commands / initCommand.ts View on Github external
});
    argv.stack = stack;
  }

  let name = '';
  if (!argv.name && !checkEmptyRepo(paths.projectPath)) {
    const response = await prompts({
      type: 'text',
      name: 'name',
      message: 'What is the name of the repo to create?',
      validate: name => (!name ? false : true)
    });
    name = response.name;
    paths.projectPath = path.join(paths.projectPath, name);
  } else if (!argv.name) {
    name = path.basename(paths.projectPath);
  } else {
    name = argv.name;
    paths.projectPath = path.join(paths.projectPath, name);
  }

  argv.name = name;

  const stackPath = await getStackPath(argv.stack, argv.registry);

  logger.info(`Installing stack dependencies in ${stackPath}`);
  pkg.ensureNpmrcIfRequired(argv.registry, stackPath!);
  pkg.install(argv.registry, stackPath!);

  const stackName = getStackName(stackPath!);
  const generator = await getPlopGenerator(stackPath!, paths.projectPath, stackName);
github microsoft / just / packages / create-just / src / commands / initCommand.ts View on Github external
const nextStepsMd = existsSync(postInitPath)
    ? readFileSync(postInitPath, 'utf-8').toString()
    : `
You have successfully created a new repo based on the '${argv.stack}' template!

## Keeping Up-to-date
You can keep your build tools up-to-date by updating these two devDependencies:

* ${stackName}
* just-scripts

## Next Steps

To start developing code, you can start the innerloop dev server:

    cd ${paths.projectPath}
    ${pkg.getYarn() ? 'yarn' : 'npm'} start

You can build your project in production mode with these commands:

    cd ${paths.projectPath}
    ${pkg.getYarn() ? 'yarn' : 'npm run'} build

${existsSync(path.join(paths.projectPath, 'plopfile.js')) &&
  `
This repository contains code generators that can be triggered by:

    cd ${paths.projectPath}
    ${pkg.getYarn() ? 'yarn' : 'npm run'} gen

`}`;
github microsoft / just / packages / create-just / src / commands / initCommand.ts View on Github external
* ${stackName}
* just-scripts

## Next Steps

To start developing code, you can start the innerloop dev server:

    cd ${paths.projectPath}
    ${pkg.getYarn() ? 'yarn' : 'npm'} start

You can build your project in production mode with these commands:

    cd ${paths.projectPath}
    ${pkg.getYarn() ? 'yarn' : 'npm run'} build

${existsSync(path.join(paths.projectPath, 'plopfile.js')) &&
  `
This repository contains code generators that can be triggered by:

    cd ${paths.projectPath}
    ${pkg.getYarn() ? 'yarn' : 'npm run'} gen

`}`;

  logger.info(prettyPrintMarkdown(nextStepsMd));
}
github microsoft / just / packages / create-just / src / commands / initCommand.ts View on Github external
const { stack } = await prompts({
      type: 'select',
      name: 'stack',
      message: 'What type of repo to create?',
      choices: [
        { title: 'React App', value: 'just-stack-react' },
        { title: 'UI Fabric (React)', value: 'just-stack-uifabric' },
        { title: 'Basic TypeScript', value: 'just-stack-single-lib' },
        ...(pkg.getYarn() ? [{ title: 'Monorepo', value: 'just-stack-monorepo' }] : [])
      ]
    });
    argv.stack = stack;
  }

  let name = '';
  if (!argv.name && !checkEmptyRepo(paths.projectPath)) {
    const response = await prompts({
      type: 'text',
      name: 'name',
      message: 'What is the name of the repo to create?',
      validate: name => (!name ? false : true)
    });
    name = response.name;
    paths.projectPath = path.join(paths.projectPath, name);
  } else if (!argv.name) {
    name = path.basename(paths.projectPath);
  } else {
    name = argv.name;
    paths.projectPath = path.join(paths.projectPath, name);
  }

  argv.name = name;