// @ts-check

/**
 * Create readme file
 */
module.exports = function readme(callback) {
  const paths = require("../paths");
  const { getProjectTitle } = require("../utils");
  const { paramCase, sentenceCase } = require("change-case");
  const gulp = require("gulp");
  const template = require("gulp-template");
  const rename = require("gulp-rename");
  const title = getProjectTitle();

  return gulp
    .src(paths.join(paths.self.templates, "README.md"))
    .pipe(
      template({
        slug: paramCase(title),
        title: sentenceCase(title),
      })
    )
    .pipe(rename("README.md"))
    .pipe(gulp.dest(paths.root));
};
