async function generateComponent({ name, memo }) {
  const targetFolder = 'components';
  const componentName = `${NAMESPACE}Component${name}`;
  const relativePath = `${targetFolder}/${componentName}`;
  const component = `component/${memo ? 'Pure' : 'NotPure'}`;

  await componentGen
    .runActions({
      name: componentName,
      memo,
      wantMessages: true,
      wantLoadable: true,
    })
    .then(handleResult)
    .then(feedbackToUser(`Generated '${component}'`))
    .catch(reason => reportErrors(reason));
  await runLintingOnDirectory(relativePath)
    .then(reportSuccess(`Linting test passed for '${component}'`))
    .catch(reason => reportErrors(reason));
  await removeDir(relativePath)
    .then(feedbackToUser(`Cleanup '${component}'`))
    .catch(reason => reportErrors(reason));

  return component;
}
Test the component generator and rollback when successful
@param {string} name - Component name
@param {string} type - Plop Action type
@returns {Promise<string>} - Relative path to the generated component