[
  {
    "path": ".editorconfig",
    "content": "root = true\n\n[*]\ncharset = utf-8\nindent_style = space\nindent_size = 2\nend_of_line = lf\ninsert_final_newline = true\ntrim_trailing_whitespace = true\n"
  },
  {
    "path": ".gitignore",
    "content": "\n# See https://help.github.com/ignore-files/ for more about ignoring files.\n\n# dependencies\nnode_modules\n\n# builds\nbuild\ndist\n.rpt2_cache\n\n# misc\n.DS_Store\n.env\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n\npackage-lock.json\n"
  },
  {
    "path": ".npmrc",
    "content": "package-lock=false\n"
  },
  {
    "path": ".travis.yml",
    "content": "language: node_js\nnode_js:\n  - 'stable'\nbefore_install:\n  - curl -o- -L https://yarnpkg.com/install.sh | bash\ninstall:\n  - 'yarn install --immutable'\nscript:\n  - 'yarn lint'\n  - 'yarn test'\n"
  },
  {
    "path": "cli/index.js",
    "content": "#!/usr/bin/env node\n\nconst program = require('commander')\nconst create = require('./scripts/create')\nconst log = require('./scripts/log')\nconst { version } = require('../package.json')\n\nlet appName\n\nprogram\n  .version(version)\n  .arguments('<appName>')\n  .option('-v, --version', 'version')\n  .option('-t, --typescript', 'use typescript')\n  .action((_appName) => {\n    appName = _appName\n  })\n  .parse(process.argv)\n\nif (appName) {\n  create(appName, program.typescript)\n} else {\n  log('Please, choose a name for your project ;)')\n}\n"
  },
  {
    "path": "cli/scripts/create.js",
    "content": "const fs = require('fs')\nconst path = require('path').join\nconst fullPath = require('path')\nconst wrench = require('wrench')\nconst runPath = process.cwd()\nconst template = require('./template')\nconst log = require('./log')\n\nconst isFolderExistsSync = dir => {\n  try {\n    fs.accessSync(dir)\n    return true\n  } catch (e) {\n    return false\n  }\n}\n\nasync function create (app, ts) {\n  const fullPathFolder = path(runPath, app)\n  const fullPathTemplate = path(\n    fullPath.resolve(__dirname),\n    `../../templates/${ts ? 'ts' : 'js'}`\n  )\n\n  if (isFolderExistsSync(fullPathFolder)) {\n    log(`Folder \"${app}\" already exists`, 'error')\n  } else {\n    const filesToRename = ['_babelrc', '_editorconfig', '_gitignore', '_npmrc', '_package']\n    const filesFinal = ['.babelrc', '.editorconfig', '.gitignore', '.npmrc', 'package.json']\n\n    await wrench.copyDirSyncRecursive(fullPathTemplate, fullPathFolder, {\n      excludeHiddenUnix: false\n    })\n\n    filesToRename.map((item, index) => {\n      fs.renameSync(\n        fullPath.resolve(fullPathFolder, item),\n        fullPath.resolve(fullPathFolder, filesFinal[index])\n      )\n    })\n\n    log(`Project folder \"${app}\" was created =]`, 'success')\n    template(app)\n  }\n}\n\nmodule.exports = create\n"
  },
  {
    "path": "cli/scripts/log.js",
    "content": "const chalk = require('chalk')\n\nconst log = (msg, type) => {\n  const prefix = chalk.hex('#fef30a').bold('🐗  Javali ')\n  let typeMessage = chalk.hex('#f5f5f5').bold(`➜ ${msg}`)\n\n  if (type === 'success') {\n    typeMessage = chalk.green.bold(`✔︎ ${msg}`)\n  } else if (type === 'error') {\n    typeMessage = chalk.red.bold(`✖ ${msg}`)\n  }\n\n  return console.log(`${prefix}${typeMessage}`)\n}\n\nmodule.exports = log\n"
  },
  {
    "path": "cli/scripts/manager.js",
    "content": "const shell = require('shelljs')\nconst checkManager = () => shell.which('yarn') ? 'yarn' : 'npm'\nmodule.exports = checkManager\n"
  },
  {
    "path": "cli/scripts/template.js",
    "content": "const _ = require('lodash')\nconst recursive = require('recursive-readdir')\nconst fs = require('fs')\nconst log = require('./log')\nconst manager = require('./manager')\nconst path = require('path').join\nconst runPath = process.cwd()\n\n_.templateSettings = {\n  evaluate: /{{([\\s\\S]+?)}}/g,\n  interpolate: /{{=([\\s\\S]+?)}}/g,\n  escape: /{{-([\\s\\S]+?)}}/g\n}\n\nasync function run (app) {\n  await recursive(path(runPath, app), ['.DS_Store'], (err, files) => {\n    if (!err) {\n      const managerType = manager()\n      const cmdRun = (managerType === 'yarn') ? 'yarn' : 'npm run'\n      const cmdInstall = (managerType === 'yarn') ? 'yarn' : 'npm install'\n\n      files.forEach(file => {\n        const fileContent = fs.readFileSync(file, 'utf8')\n        const compiled = _.template(fileContent)\n        const metadata = {\n          appName: _.kebabCase(app),\n          appManager: managerType,\n          appCmd: cmdRun\n        }\n\n        try {\n          fs.writeFileSync(file, compiled(metadata))\n        } catch (err) {\n          log(err, 'error')\n        }\n      })\n      log(`To get started, run: \"cd ${app} && ${cmdInstall} && ${cmdRun} start\"`)\n    }\n  })\n}\n\nmodule.exports = run\n"
  },
  {
    "path": "docs/CNAME",
    "content": "javali.js.org\n"
  },
  {
    "path": "docs/assets/css/main.css",
    "content": ":root {\n  --main-color: #fef30a;\n  --text-color: #232020;\n  --font-title: 'Archivo', sans-serif;\n  --font-code: 'PT Mono', monospace;\n}\n\n::selection {\n  background: var(--main-color);\n  color: var(--text-color);\n}\n\n::-moz-selection {\n  background: var(--main-color);\n  color: var(--text-color);\n}\n\n* {\n  box-sizing: inherit;\n}\n\nhtml {\n  font-size: 10px;\n  box-sizing: border-box;\n  scroll-behavior: smooth;\n  height: 100%;\n}\n\nbody {\n  margin: 0;\n  padding: 0;\n  font-size: 1rem;\n  background: #fff;\n  height: 100%;\n  color: var(--text-color);\n  cursor: default;\n  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;\n}\n\n.fork-button {\n  display: block;\n  position: absolute;\n  width: 30em;\n  padding: .5em 0;\n  text-align: center;\n  text-transform: uppercase;\n  text-decoration: none;\n  font-size: 1.2em;\n  font-weight: bold;\n  color: var(--text-color);\n  background: var(--main-color);\n  transform: rotate(45deg);\n  top: 5em;\n  right: -9em;\n  z-index: 10;\n}\n\n/* Header */\n.header {\n  position: relative;\n  display: flex;\n  flex-direction: column;\n  width: 100%;\n  height: 100%;\n  overflow: hidden;\n  border-top: 5px solid var(--main-color);\n  padding: 1em 2em 0;\n}\n\n.header-top {\n  display: flex;\n  max-width: 1040px;\n  margin: 0 auto;\n  width: 100%;\n}\n\n.header-column {\n  flex: 1;\n}\n\n.header-column--menu {\n  display: flex;\n  justify-content: flex-end;\n  align-items: center;\n}\n\n.header-logo img {\n  max-width: 200px;\n}\n\n/* Menu */\n.header-menu-list {\n  list-style: none;\n  margin: 0;\n  padding: 1.2em 0 0 0;\n  display: flex;\n}\n\n.header-menu-list li:not(:first-child) {\n  margin-left: 5em;\n}\n\n.header-menu-list a {\n  position: relative;\n  font-family: var(--font-title);\n  font-size: 1.4rem;\n  font-weight: 600;\n  text-transform: uppercase;\n  text-decoration: none;\n  color: var(--text-color);\n  padding: .6em 0;\n  border-radius: 3px;\n  transition: background .5s ease;\n}\n\n.header-menu-list a:after {\n  content: \"\";\n  bottom: 0;\n  display: block;\n  height: 2px;\n  left: 50%;\n  position: absolute;\n  background: var(--main-color);\n  transition: width .3s ease 0s, left .3s ease 0s;\n  width: 0;\n}\n\n.header-menu-list a:hover:after {\n  width: 100%;\n  left: 0;\n}\n\n.header-main {\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  height: 100%;\n}\n\n.header-main-content {\n  max-width: 800px;\n  margin: -6em auto 0;\n  text-align: center;\n}\n\n.header-main-title {\n  font-family: var(--font-title);\n  font-size: 4.3rem;\n  color: #222;\n  line-height: 1.3;\n}\n\ncode {\n  font-family: var(--font-code);\n  font-size: 1.8rem;\n  display: inline-block;\n  border: 2px solid var(--main-color);\n  padding: 1em 2em;\n}\n\n#scroll-indicator {\n  position: absolute;\n  margin-left: auto;\n  margin-right: auto;\n  left: 0;\n  right: 0;\n  height: 50px;\n  width: 30px;\n  bottom: 40px;\n  border: 2px solid var(--text-color);\n  border-radius: 20px;\n  opacity: .2;\n  transition: opacity 1s ease;\n}\n\n#scroll-indicator:before {\n  content: '';\n  position: absolute;\n  top: 10px;\n  left: 50%;\n  width: 6px;\n  height: 6px;\n  margin-left: -3px;\n  background-color: var(--text-color);\n  border-radius: 100%;\n  animation: scroll-down 2s infinite;\n}\n\n#scroll-indicator.hide {\n  opacity: 0;\n}\n\n/* Section: Features */\n.section-features-content {\n  margin: 0 auto;\n  max-width: 1040px;\n  padding: 0 2em 10em;\n}\n\n.section-features-content-item {\n  display: flex;\n  padding: 5em 0 10em;\n}\n\n.section-features-column__image {\n  position: relative;\n  text-align: right;\n}\n\n.section-features-column__image:before {\n  content: '';\n  display: block;\n  width: 50%;\n  height: 100px;\n  position: absolute;\n  left: 5em;\n  top: 50%;\n  margin-top: -50px;\n  background: var(--main-color);\n  z-index: -1;\n}\n\n.section-features-content-item:last-child .section-features-column__image:before {\n  width: 60%;\n  left: 0;\n}\n\n.section-features-content-item:last-child .section-features-column__text {\n  text-align: right;\n}\n\n.section-features-content-item:last-child .section-feature-description {\n  padding-right: 0;\n  padding-left: 5em;\n}\n\n.section-features-column__image img {\n  max-width: 85%;\n  mix-blend-mode: darken;\n}\n\n.section-features-column__text {\n  flex: 1;\n}\n\n.section-feature-title {\n  font-size: 3rem;\n  color: var(--text-color);\n  margin: 0;\n  padding: 1em 0 .8em;\n  font-family: var(--font-title);\n}\n\n.section-feature-description {\n  margin: 0;\n  padding: 0;\n  font-size: 1.6rem;\n  color: #333;\n  line-height: 2;\n  padding-right: 5em;\n}\n\n.section-feature-description a {\n  position: relative;\n  display: inline-block;\n  white-space: nowrap;\n  text-decoration: none;\n  color: inherit;\n  padding: 0 2px;\n  font-weight: bold;\n}\n\n.section-feature-description a:before {\n  content: '';\n  position: absolute;\n  left: 0;\n  right: 0;\n  width: 100%;\n  height: 3px;\n  bottom: 3px;\n  background: var(--main-color);\n  z-index: -1;\n  transition: height .3s cubic-bezier(0.67, 0.04, 0, 1.21);\n}\n\n.section-feature-description a:hover:before  {\n  height: 78%;\n}\n\n/* Section: Get Started */\n.section-started {\n  background: var(--main-color);\n  overflow: hidden;\n}\n\n.get-started-image {\n  position: absolute;\n  right: 0;\n  top: 10em;\n  max-width: 420px;\n  mix-blend-mode: darken;\n  transform: rotate(-15deg);\n}\n\n.section-started-content {\n  position: relative;\n  max-width: 1040px;\n  margin: 0 auto;\n  padding: 8em 2em 2em 2em;\n}\n\n.section-started-title {\n  font-family: var(--font-title);\n  font-size: 4.3rem;\n  margin: 0;\n  padding: 0 0 1.3em 0;\n}\n\n.section-started-subtitle {\n  font-family: var(--font-title);\n  font-size: 2.4rem;\n  margin: 0;\n  padding: 0 0 1em 0;\n}\n\n.started-steps {\n  list-style: none;\n  margin: 0;\n  padding: 1em 0 5em 0;\n}\n\n.started-steps li {\n  font-size: 1.8rem;\n  margin-bottom: 1.4em;\n  line-height: 1.6;\n}\n\n.started-steps li p {\n  margin: 0 0 1.2em 0;\n  padding: 0;\n}\n\n.started-steps li span {\n  padding: 0 1em;\n}\n\n.started-steps li code {\n  background: #fff;\n  font-size: 1.6rem;\n  padding: 1em 1.2em;\n  margin-bottom: .5em;\n}\n\n/* Footer */\n.footer {\n  background: var(--text-color);\n  padding: 4em 0;\n}\n\n.footer-content {\n  position: relative;\n  max-width: 1040px;\n  margin: 0 auto;\n  padding: 0 2em;\n}\n\n.footer-content p {\n  color: #eee;\n  margin: 0;\n  padding: 0;\n  font-size: 1.4rem;\n}\n\n.footer-content p a {\n  color: inherit;\n  text-decoration: none;\n  padding-bottom: 2px;\n  border-bottom: 2px solid #333;\n  transition: border .5s ease;\n}\n\n.footer-content p a:hover {\n  color: #fff;\n  border-bottom-color: var(--main-color);\n}\n\n.footer-content p img {\n  max-width: 18px;\n  display: inline-block;\n  vertical-align: middle;\n  margin: -3px .3em 0;\n}\n\n.footer-image {\n  position: absolute;\n  max-width: 80px;\n  top: -.8em;\n  right: 2em;\n}\n\n/* Breakpoints */\n@media (max-width: 1200px) {\n  .header-menu {\n    padding-right: 10em;\n  }\n}\n\n@media (max-width: 800px) {\n  .fork-button {\n    display: none;\n  }\n\n  .header-menu {\n    padding-right: 0;\n  }\n\n  .section-features-content {\n    padding-bottom: 0;\n  }\n\n  .section-features-content-item {\n    flex-direction: column;\n  }\n\n  .section-features-content-item:first-child {\n    flex-direction: column-reverse;\n  }\n\n  .section-features-column__image {\n    text-align: left;\n  }\n\n  .section-features-column__image img {\n    max-width: 100%;\n  }\n\n  .section-features-column__image:before {\n    left: 0;\n  }\n\n  .section-feature-description {\n    padding-right: 1em;\n  }\n\n  .section-features-content-item:last-child .section-features-column__text {\n    text-align: left;\n  }\n\n  .section-features-content-item:last-child .section-feature-description {\n    padding-left: 0;\n    padding-right: 1em;\n  }\n}\n\n@media (max-width: 580px) {\n  .header-menu,\n  .get-started-image,\n  #scroll-indicator {\n    display: none;\n  }\n\n  .fork-button {\n    display: block;\n    top: 4em;\n    right: -10em;\n    font-size: 1em;\n    font-weight: bold;\n    padding: .7em 0;\n  }\n\n  .header {\n    height: 550px;\n  }\n\n  .header-logo {\n    margin-left: -5px;\n  }\n\n  .header-main-content {\n    text-align: left;\n  }\n\n  .header-main-title {\n    font-size: 3.5rem;\n  }\n\n  .section-started-content {\n    padding-top: 6em;\n  }\n}\n\n/* Animations */\n@keyframes scroll-down {\n  0% {\n    transform: translate(0, 0);\n    opacity: 0;\n  }\n  40% {\n    opacity: 1;\n  }\n  80% {\n    transform: translate(0, 20px);\n    opacity: 0;\n  }\n  100% {\n    opacity: 0;\n  }\n}\n"
  },
  {
    "path": "docs/assets/favicons/browserconfig.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<browserconfig>\n    <msapplication>\n        <tile>\n            <square150x150logo src=\"assets/favicons/mstile-150x150.png\"/>\n            <TileColor>#ffc40d</TileColor>\n        </tile>\n    </msapplication>\n</browserconfig>\n"
  },
  {
    "path": "docs/assets/favicons/site.webmanifest",
    "content": "{\n    \"name\": \"\",\n    \"short_name\": \"\",\n    \"icons\": [\n        {\n            \"src\": \"android-chrome-192x192.png\",\n            \"sizes\": \"192x192\",\n            \"type\": \"image/png\"\n        },\n        {\n            \"src\": \"android-chrome-256x256.png\",\n            \"sizes\": \"256x256\",\n            \"type\": \"image/png\"\n        }\n    ],\n    \"theme_color\": \"#ffffff\",\n    \"background_color\": \"#ffffff\",\n    \"display\": \"standalone\"\n}\n"
  },
  {
    "path": "docs/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\">\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n  <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n\n  <title>Javali • Create a modern JavaScript library that uses ES6 + Jest</title>\n\n  <link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"assets/favicons/apple-touch-icon.png\">\n  <link rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"assets/favicons/favicon-32x32.png\">\n  <link rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"assets/favicons/favicon-16x16.png\">\n  <link rel=\"manifest\" href=\"assets/favicons/site.webmanifest\">\n  <link rel=\"mask-icon\" href=\"assets/favicons/safari-pinned-tab.svg\" color=\"#5bbad5\">\n  <link rel=\"shortcut icon\" href=\"assets/favicons/favicon.ico\">\n  <meta name=\"msapplication-TileColor\" content=\"#ffc40d\">\n  <meta name=\"msapplication-config\" content=\"assets/favicons/browserconfig.xml\">\n  <meta name=\"theme-color\" content=\"#ffffff\">\n\n  <meta property=\"og:title\" content=\"Javali\">\n  <meta property=\"og:description\" content=\"Create a modern JavaScript library that uses ES6 + Jest\">\n  <meta property=\"og:image\" content=\"https://javali.js.org/assets/img/social.jpg\">\n  <meta property=\"og:url\" content=\"https://javali.js.org\">\n\n  <meta name=\"twitter:title\" content=\"Javali\">\n  <meta name=\"twitter:description\" content=\"Create a modern JavaScript library that uses ES6 + Jest\">\n  <meta name=\"twitter:image\" content=\"https://javali.js.org/assets/img/social.jpg\">\n  <meta name=\"twitter:card\" content=\"summary_large_image\">\n\n  <link href=\"//fonts.googleapis.com/css?family=Archivo:400,600,700\" rel=\"stylesheet\">\n  <link href=\"//fonts.googleapis.com/css?family=PT+Mono\" rel=\"stylesheet\">\n  <link href=\"./assets/css/main.css\" rel=\"stylesheet\">\n</head>\n<body>\n\n  <header class=\"header\">\n    <a href=\"https://github.com/diogomoretti/javali\" class=\"fork-button\">View on github</a>\n\n    <div class=\"header-top\">\n      <div class=\"header-column\">\n        <h1 class=\"header-logo\">\n          <img src=\"assets/img/logo.png\" alt=\"Javali logo\" />\n        </h1>\n      </div>\n      <div class=\"header-column header-column--menu\">\n        <nav class=\"header-menu\">\n          <ul class=\"header-menu-list\">\n            <li>\n              <a href=\"#features\">Features</a>\n            </li>\n            <li>\n              <a href=\"#get-started\">Get started</a>\n            </li>\n          </ul>\n        </nav>\n      </div>\n    </div>\n\n    <div class=\"header-main\">\n      <div class=\"header-main-content\">\n        <h2 class=\"header-main-title\">\n          Create a modern JavaScript library that uses ES6 + Jest\n        </h2>\n        <code>\n          npx javali my-lib\n        </code>\n      </div>\n    </div>\n\n    <span id=\"scroll-indicator\"></span>\n  </header>\n\n  <section id=\"features\" class=\"section-features\">\n    <div class=\"section-features-content\">\n      <div class=\"section-features-content-item\">\n        <div class=\"section-features-column__text\">\n          <h3 class=\"section-feature-title\">\n            Simple, fast and efficient\n          </h3>\n          <p class=\"section-feature-description\">\n            Javali is a CLI similar to <a href=\"#\">Create React App</a>. With a simple command you can easily generate your <strong>JavaScript library</strong>. Without questions and complicated settings, you simply pass the name of your project and the magic happens.\n          </p>\n        </div>\n        <div class=\"section-features-column__image\">\n          <img src=\"assets/img/feat-01.jpg\" />\n        </div>\n      </div>\n\n      <div class=\"section-features-content-item\">\n        <div class=\"section-features-column__image\">\n          <img src=\"assets/img/feat-02.jpg\" />\n        </div>\n        <div class=\"section-features-column__text\">\n          <h3 class=\"section-feature-title\">\n            Modern: ES6 and Jest\n          </h3>\n          <p class=\"section-feature-description\">\n            The generated library has all the newest features from the front-end development. You write ES6 and your library is compiled to ES5 (UMD and CJS). Besides that, the lib has <a href=\"https://jestjs.io\">Jest</a> for tests, <a href=\"https://rollupjs.org\">Rollup</a> as bundler, <a href=\"https://github.com/tapio/live-server\">Live Server</a> to run locally and much more.\n          </p>\n        </div>\n      </div>\n    </div>\n  </section>\n\n  <section id=\"get-started\" class=\"section-started\">\n    <div class=\"section-started-content\">\n      <img class=\"get-started-image\" src=\"assets/img/get-started.jpg\" />\n\n      <h1 class=\"section-started-title\">Get started</h1>\n\n      <h2 class=\"section-started-subtitle\">Using npx</h2>\n      <ul class=\"started-steps\">\n        <li>\n          <p><strong>1.</strong> Install and create your library immediately:</p>\n          <code>\n            npx javali my-lib\n          </code>\n        </li>\n        <li><strong>2.</strong> Enjoy</li>\n      </ul>\n\n      <h2 class=\"section-started-subtitle\">Using global cli</h2>\n      <ul class=\"started-steps\">\n        <li>\n          <p><strong>1.</strong> Install Javali globally:</p>\n          <code>\n            yarn global add javali\n          </code>\n          <span>or</span>\n          <code>\n            npm install -g javali\n          </code>\n        </li>\n        <li>\n          <p><strong>2.</strong> Create your library:</p>\n          <code>\n            javali my-lib\n          </code>\n        </li>\n        <li><strong>3.</strong> Enjoy</li>\n      </ul>\n    </div>\n  </section>\n\n  <footer class=\"footer\">\n    <div class=\"footer-content\">\n      <p>\n        Made with <img src=\"assets/img/heart.svg\" /> by <a href=\"http://github.com/diogomoretti\">Diogo Moretti</a>\n      </p>\n      <img class=\"footer-image\" src=\"assets/img/footer.png\" />\n    </div>\n  </footer>\n\n  <script>\n    const scrollIndicator = document.getElementById('scroll-indicator')\n\n    document.addEventListener('scroll', () => {\n      if (window.scrollY > 20) {\n        scrollIndicator.classList.add('hide')\n      }\n    })\n  </script>\n</body>\n</html>\n"
  },
  {
    "path": "license.md",
    "content": "# The MIT License (MIT)\n\nCopyright (c) 2019 – Diogo Moretti\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"javali\",\n  \"version\": \"1.1.0\",\n  \"description\": \"Create a modern JavaScript library that uses ES6 + Jest\",\n  \"main\": \"./cli/index.js\",\n  \"bin\": {\n    \"javali\": \"./cli/index.js\"\n  },\n  \"scripts\": {\n    \"site:server\": \"live-server ./docs --port=7001 -q --no-browser\",\n    \"lint\": \"standard\",\n    \"test\": \"jest\"\n  },\n  \"jest\": {\n    \"testPathIgnorePatterns\": [\n      \"<rootDir>/templates/\"\n    ]\n  },\n  \"keywords\": [\n    \"cli\",\n    \"generator\",\n    \"javascript\",\n    \"library\",\n    \"es6\",\n    \"jest\"\n  ],\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/diogomoretti/javali\"\n  },\n  \"standard\": {\n    \"ignore\": [\n      \"/templates/\",\n      \"/docs/\",\n      \"/tests/\"\n    ]\n  },\n  \"author\": \"Diogo Moretti <diogo.pearljam@gmail.com>\",\n  \"license\": \"MIT\",\n  \"devDependencies\": {\n    \"jest\": \"^24.7.1\",\n    \"live-server\": \"^1.2.1\",\n    \"rimraf\": \"^2.6.3\",\n    \"standard\": \"^12.0.1\"\n  },\n  \"dependencies\": {\n    \"chalk\": \"^2.4.2\",\n    \"commander\": \"^2.19.0\",\n    \"lodash\": \"^4.17.11\",\n    \"recursive-readdir\": \"^2.2.2\",\n    \"shelljs\": \"^0.8.3\",\n    \"wrench\": \"^1.5.9\"\n  }\n}\n"
  },
  {
    "path": "readme.md",
    "content": "<p align=\"center\">\n<img src=\"https://user-images.githubusercontent.com/2853428/54870888-3b2b5800-4d8b-11e9-8e3d-f56fd7692117.png\" alt=\"Javali\" width=\"430\">\n<p align=\"center\">\n  <a href=\"https://www.npmjs.com/package/javali\"><img alt=\"NPM\" src=\"https://img.shields.io/npm/v/javali.svg?style=flat-square\"></a> <a href=\"https://standardjs.com\"><img src=\"https://img.shields.io/badge/code_style-standard-brightgreen.svg?style=flat-square\" alt=\"JavaScript Style Guide\" /></a>\n</p>\n<h3 align=\"center\"><strong>⁓ <a href=\"https://javali.js.org\">javali.js.org</a> ⁓</strong></h3>\n</p>\n<br>\n\n## 🐗 About\n\n**[Javali](https://javali.js.org/)** (aka **JAVA***Script* **LI***brary*) is a CLI like [Create React App](https://github.com/facebook/create-react-app), but for creating JavaScript libraries. Below, some features:\n\n- **Simple command** to create a library\n- **Fully ES6** that compiles to UMD and CommonJS\n- **Supports Typescript**\n- **[Jest](https://jestjs.io/)** for tests\n- **[Rollup](https://rollupjs.org)** as bundler\n- **[Live Server](https://github.com/tapio/live-server)** to run locally\n\n<br>\n\n## 🐗 Get started\n\n### Using `npx`\n\n**1** ⁓ Install and create your library immediately:\n\n\n```shell\nnpx javali my-lib\n```\n\n**2** ⁓ Enjoy!\n\n### Using global cli\n\n**1** ⁓ Install **[Javali](https://javali.js.org/)** globally:\n\n```shell\nyarn global add javali\n\nor\n\nnpm install -g javali\n```\n\n**2** ⁓ Create your library:\n\n```shell\njavali my-lib\n```\n\nOr using TypeScript:\n\n```shell\njavali my-lib --typescript\n```\n\n**3** ⁓ Enjoy!\n\n\n\n✅ A folder and library called `my-lib` will be created in this case.\n\n<br>\n\n## 🐗 Contributing\n\n1. Fork this repository\n2. `git checkout -b my-feature`\n3. `git add --all`\n4. `git commit -m \"My commit message about my-feature\"`\n5. `git push origin my-feature`\n6. Open a Pull Request =]\n\n<br>\n\n## 🐗 License\n\n[MIT](./license.md) © [Diogo Moretti](https://github.com/diogomoretti)\n"
  },
  {
    "path": "templates/js/_babelrc",
    "content": "{\n  \"presets\": [\n    [\"@babel/preset-env\", {\n      \"modules\": false,\n      \"targets\": {\n        \"browsers\": \"ie >= 11\"\n      }\n    }]\n  ],\n  \"env\": {\n    \"test\": {\n      \"presets\": [[\"@babel/preset-env\"]]\n    }\n  }\n}\n"
  },
  {
    "path": "templates/js/_editorconfig",
    "content": "root = true\n\n[*]\ncharset = utf-8\nindent_style = space\nindent_size = 2\nend_of_line = lf\ninsert_final_newline = true\ntrim_trailing_whitespace = true\n"
  },
  {
    "path": "templates/js/_gitignore",
    "content": "node_modules/\ndist/\nnpm-debug.log\nyarn-error.log\npackage-lock.json\n"
  },
  {
    "path": "templates/js/_npmrc",
    "content": "package-lock=false\n"
  },
  {
    "path": "templates/js/_package",
    "content": "{\n  \"name\": \"{{= appName }}\",\n  \"version\": \"0.1.0\",\n  \"main\": \"dist/{{= appName }}.cjs.js\",\n  \"module\": \"dist/{{= appName }}.esm.js\",\n  \"browser\": \"dist/{{= appName }}.umd.js\",\n  \"license\": \"MIT\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"\"\n  },\n  \"devDependencies\": {\n    \"@babel/core\": \"7.4.0\",\n    \"@babel/preset-env\": \"7.4.2\",\n    \"babel-core\": \"7.0.0-bridge.0\",\n    \"babel-jest\": \"24.5.0\",\n    \"jest\": \"24.5.0\",\n    \"live-server\": \"^1.2.1\",\n    \"rollup\": \"1.7.0\",\n    \"rollup-plugin-babel\": \"4.3.2\",\n    \"rollup-plugin-commonjs\": \"9.2.1\",\n    \"rollup-plugin-node-resolve\": \"4.0.1\",\n    \"concurrently\": \"^4.1.0\"\n  },\n  \"scripts\": {\n    \"prepare\": \"{{= appCmd }} build\",\n    \"build\": \"rollup -c\",\n    \"watch\": \"rollup -c -w\",\n    \"server\": \"live-server --port=7000 -q --open=./example\",\n    \"start\": \"concurrently \\\"{{= appManager }}:watch\\\" \\\"{{= appManager }}:server\\\"\",\n    \"test\": \"jest\"\n  },\n  \"files\": [\n    \"dist\"\n  ]\n}\n"
  },
  {
    "path": "templates/js/example/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\">\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n  <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n\n  <title>{{= appName }}</title>\n\n  <style>\n    body {\n      display: flex;\n      justify-content: center;\n      align-items: center;\n      height: 100vh;\n      font-size: 20px;\n      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;\n    }\n\n    .demo {\n      text-align: center;\n      max-width: 1000px;\n      margin: 0 auto;\n    }\n\n    .logo {\n      max-width: 400px;\n      padding-bottom: 3em;\n    }\n\n    button {\n      font-size: 20px;\n      margin-top: 1em;\n    }\n  </style>\n</head>\n  <body>\n    <div class=\"demo\">\n      <img class=\"logo\" src=\"https://user-images.githubusercontent.com/2853428/54870888-3b2b5800-4d8b-11e9-8e3d-f56fd7692117.png\" />\n      <div id=\"root\"></div>\n    </div>\n\n    <script src=\"../dist/{{= appName }}.umd.js\"></script>\n  </body>\n</html>\n"
  },
  {
    "path": "templates/js/license.md",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2019\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "templates/js/readme.md",
    "content": "# 🐗 {{= appName }}\n\n> My awesome lib created by [Javali](https://javali.js.org)\n"
  },
  {
    "path": "templates/js/rollup.config.js",
    "content": "import resolve from 'rollup-plugin-node-resolve'\nimport commonjs from 'rollup-plugin-commonjs'\nimport pkg from './package.json'\nimport babel from 'rollup-plugin-babel'\n\nexport default [\n  {\n    input: 'src/main.js',\n    output: {\n      name: 'index',\n      file: pkg.browser,\n      format: 'umd'\n    },\n    plugins: [\n      resolve(),\n      commonjs(),\n      babel({\n        exclude: 'node_modules/**'\n      })\n    ]\n  },\n  {\n    input: 'src/main.js',\n    external: [],\n    output: [\n      { file: pkg.main, format: 'cjs' },\n      { file: pkg.module, format: 'es' }\n    ]\n  }\n]\n"
  },
  {
    "path": "templates/js/src/main.js",
    "content": "import myLibrary from './my-library'\n\nconst myLib = new myLibrary('#root')\n"
  },
  {
    "path": "templates/js/src/my-library.js",
    "content": "class myLibrary {\n  constructor (trigger) {\n    this.trigger = trigger\n    this.renderDiv()\n    this.listenClick()\n  }\n\n  renderDiv () {\n    const div = document.querySelector(this.trigger)\n    div.innerHTML = `<div id=\"counter\">0</div><button id=\"btn\">Counter</button>`\n  }\n\n  updateCounter () {\n    const div = document.getElementById('counter')\n    div.innerHTML = parseInt(div.innerHTML) + 1\n  }\n\n  listenClick () {\n    const btn = document.getElementById('btn')\n    btn.addEventListener('click', this.updateCounter)\n  }\n}\n\nexport default myLibrary\n"
  },
  {
    "path": "templates/js/src/my-library.test.js",
    "content": "import myLibrary from './my-library'\n\ndocument.body.innerHTML = '<div id=\"root\"></div>'\n\ndescribe('myLibrary', () => {\n  it('render library wrapper inside trigger div', () => {\n    const myLib = new myLibrary('#root')\n    expect(document.body.innerHTML).toBe('<div id=\"root\"><div id=\"counter\">0</div><button id=\"btn\">Counter</button></div>')\n  })\n\n  it('start counter with 0', () => {\n    const myLib = new myLibrary('#root')\n    const counter = document.getElementById('counter').innerHTML\n    expect(parseInt(counter)).toBe(0)\n  })\n\n  it('when click on button, counter is 1', () => {\n    const myLib = new myLibrary('#root')\n    myLib.updateCounter()\n    const counter = document.getElementById('counter').innerHTML\n    expect(parseInt(counter)).toBe(1)\n  })\n})\n"
  },
  {
    "path": "templates/ts/_babelrc",
    "content": "{\n  \"presets\": [\n    [\"@babel/preset-env\", {\n      \"modules\": false,\n      \"targets\": {\n        \"browsers\": \"ie >= 11\"\n      }\n\t\t}],\n\t\t\"@babel/preset-typescript\"\n  ],\n  \"env\": {\n    \"test\": {\n      \"presets\": [[\"@babel/preset-env\"]]\n    }\n  }\n}\n"
  },
  {
    "path": "templates/ts/_editorconfig",
    "content": "root = true\n\n[*]\ncharset = utf-8\nindent_style = space\nindent_size = 2\nend_of_line = lf\ninsert_final_newline = true\ntrim_trailing_whitespace = true\n"
  },
  {
    "path": "templates/ts/_gitignore",
    "content": "node_modules/\ndist/\nnpm-debug.log\nyarn-error.log\npackage-lock.json\n"
  },
  {
    "path": "templates/ts/_npmrc",
    "content": "package-lock=false\n"
  },
  {
    "path": "templates/ts/_package",
    "content": "{\n  \"name\": \"{{= appName }}\",\n  \"version\": \"0.1.0\",\n  \"main\": \"dist/{{= appName }}.cjs.js\",\n  \"types\": \"dist/{{= appName }}.d.ts\",\n  \"module\": \"dist/{{= appName }}.esm.js\",\n  \"browser\": \"dist/{{= appName }}.umd.js\",\n  \"license\": \"MIT\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"\"\n  },\n  \"devDependencies\": {\n    \"@babel/core\": \"7.4.0\",\n    \"@babel/preset-env\": \"7.4.2\",\n\t\t\"@babel/preset-typescript\": \"7.3.3\",\n    \"@types/jest\": \"24.0.11\",\n    \"babel-core\": \"7.0.0-bridge.0\",\n    \"babel-jest\": \"24.5.0\",\n    \"jest\": \"24.5.0\",\n    \"live-server\": \"^1.2.1\",\n    \"rollup\": \"1.7.0\",\n    \"rollup-plugin-babel\": \"4.3.2\",\n    \"rollup-plugin-commonjs\": \"9.2.1\",\n    \"rollup-plugin-node-resolve\": \"4.0.1\",\n    \"concurrently\": \"^4.1.0\"\n  },\n  \"scripts\": {\n    \"prepare\": \"{{= appCmd }} build\",\n    \"build\": \"rollup -c && yarn build:types\",\n    \"watch\": \"rollup -c -w\",\n    \"server\": \"live-server --port=7000 -q --open=./example\",\n    \"start\": \"concurrently \\\"{{= appManager }}:watch\\\" \\\"{{= appManager }}:server\\\"\",\n    \"test\": \"jest\",\n    \"build:types\": \"tsc -p tsconfig.app.json --emitDeclarationOnly\"\n  },\n  \"files\": [\n    \"dist\"\n  ],\n  \"dependencies\": {\n    \"typescript\": \"^3.3.4000\"\n  }\n}\n"
  },
  {
    "path": "templates/ts/example/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\">\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n  <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n\n  <title>{{= appName }}</title>\n\n  <style>\n    body {\n      display: flex;\n      justify-content: center;\n      align-items: center;\n      height: 100vh;\n      font-size: 20px;\n      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;\n    }\n\n    .demo {\n      text-align: center;\n      max-width: 1000px;\n      margin: 0 auto;\n    }\n\n    .logo {\n      max-width: 400px;\n      padding-bottom: 3em;\n    }\n\n    button {\n      font-size: 20px;\n      margin-top: 1em;\n    }\n  </style>\n</head>\n  <body>\n    <div class=\"demo\">\n      <img class=\"logo\" src=\"https://user-images.githubusercontent.com/2853428/54870888-3b2b5800-4d8b-11e9-8e3d-f56fd7692117.png\" />\n      <div id=\"root\"></div>\n    </div>\n\n    <script src=\"../dist/{{= appName }}.umd.js\"></script>\n  </body>\n</html>\n"
  },
  {
    "path": "templates/ts/license.md",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2019\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "templates/ts/readme.md",
    "content": "# 🐗 {{= appName }}\n\n> My awesome lib created by [Javali](https://javali.js.org)\n"
  },
  {
    "path": "templates/ts/rollup.config.js",
    "content": "import resolve from 'rollup-plugin-node-resolve'\nimport commonjs from 'rollup-plugin-commonjs'\nimport pkg from './package.json'\nimport babel from 'rollup-plugin-babel'\n\nconst plugins = [\n  resolve({\n    extensions: ['.js', '.ts']\n  }),\n  commonjs(),\n  babel({\n    exclude: 'node_modules/**',\n    extensions: ['.js', '.ts']\n  })\n]\n\nexport default [\n  {\n    input: 'src/main.ts',\n    output: {\n      name: 'index',\n      file: pkg.browser,\n      format: 'umd'\n    },\n    plugins\n  },\n  {\n    input: 'src/main.ts',\n    external: [],\n    output: [\n      { file: pkg.main, format: 'cjs' },\n      { file: pkg.module, format: 'es' }\n    ],\n    plugins\n  }\n]\n"
  },
  {
    "path": "templates/ts/src/main.ts",
    "content": "import myLibrary from './my-library'\n\nconst myLib = new myLibrary('#root')\n"
  },
  {
    "path": "templates/ts/src/my-library.test.ts",
    "content": "import myLibrary from './my-library'\n\ndocument.body.innerHTML = '<div id=\"root\"></div>'\n\ndescribe('myLibrary', () => {\n  it('render library wrapper inside trigger div', () => {\n    const myLib = new myLibrary('#root')\n    expect(document.body.innerHTML).toBe('<div id=\"root\"><div id=\"counter\">0</div><button id=\"btn\">Counter</button></div>')\n  })\n\n  it('start counter with 0', () => {\n    const myLib = new myLibrary('#root')\n    const counter = document.getElementById('counter').innerHTML\n    expect(parseInt(counter)).toBe(0)\n  })\n\n  it('when click on button, counter is 1', () => {\n    const myLib = new myLibrary('#root')\n    myLib.updateCounter()\n    const counter = document.getElementById('counter').innerHTML\n    expect(parseInt(counter)).toBe(1)\n  })\n})\n"
  },
  {
    "path": "templates/ts/src/my-library.ts",
    "content": "class myLibrary {\n\ttrigger: string;\n\n  constructor (trigger: string) {\n    this.trigger = trigger\n    this.renderDiv()\n    this.listenClick()\n  }\n\n  renderDiv () {\n    const div = document.querySelector(this.trigger)\n    div!.innerHTML = `<div id=\"counter\">0</div><button id=\"btn\">Counter</button>`\n  }\n\n  updateCounter () {\n    const div = document.getElementById('counter')\n    div!.innerHTML = `${parseInt(div!.innerHTML) + 1}`\n  }\n\n  listenClick () {\n    const btn = document.getElementById('btn')\n    btn!.addEventListener('click', this.updateCounter)\n  }\n}\n\nexport default myLibrary\n"
  },
  {
    "path": "templates/ts/tsconfig.app.json",
    "content": "{\n  \"extends\": \"./tsconfig.json\",\n  \"exclude\": [\"**/*.test.ts\"]\n}"
  },
  {
    "path": "templates/ts/tsconfig.json",
    "content": "{\n  \"include\": [\"src\"],\n  \"compilerOptions\": {\n    /* Basic Options */\n    \"target\": \"es5\",                          /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */\n    \"module\": \"commonjs\",                     /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */\n    // \"lib\": [],                             /* Specify library files to be included in the compilation. */\n    // \"allowJs\": true,                       /* Allow javascript files to be compiled. */\n    // \"checkJs\": true,                       /* Report errors in .js files. */\n    // \"jsx\": \"preserve\",                     /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */\n    \"declaration\": true,                   /* Generates corresponding '.d.ts' file. */\n    \"declarationMap\": true,                /* Generates a sourcemap for each corresponding '.d.ts' file. */\n    // \"sourceMap\": true,                     /* Generates corresponding '.map' file. */\n    // \"outFile\": \"./\",                       /* Concatenate and emit output to single file. */\n    \"outDir\": \"./dist\",                        /* Redirect output structure to the directory. */\n    // \"rootDir\": \"./\",                       /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */\n    // \"composite\": true,                     /* Enable project compilation */\n    // \"removeComments\": true,                /* Do not emit comments to output. */\n    // \"noEmit\": true,                        /* Do not emit outputs. */\n    // \"importHelpers\": true,                 /* Import emit helpers from 'tslib'. */\n    // \"downlevelIteration\": true,            /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */\n    // \"isolatedModules\": true,               /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */\n\n    /* Strict Type-Checking Options */\n    \"strict\": true,                           /* Enable all strict type-checking options. */\n    // \"noImplicitAny\": true,                 /* Raise error on expressions and declarations with an implied 'any' type. */\n    // \"strictNullChecks\": true,              /* Enable strict null checks. */\n    // \"strictFunctionTypes\": true,           /* Enable strict checking of function types. */\n    // \"strictBindCallApply\": true,           /* Enable strict 'bind', 'call', and 'apply' methods on functions. */\n    // \"strictPropertyInitialization\": true,  /* Enable strict checking of property initialization in classes. */\n    // \"noImplicitThis\": true,                /* Raise error on 'this' expressions with an implied 'any' type. */\n    // \"alwaysStrict\": true,                  /* Parse in strict mode and emit \"use strict\" for each source file. */\n\n    /* Additional Checks */\n    // \"noUnusedLocals\": true,                /* Report errors on unused locals. */\n    // \"noUnusedParameters\": true,            /* Report errors on unused parameters. */\n    // \"noImplicitReturns\": true,             /* Report error when not all code paths in function return a value. */\n    // \"noFallthroughCasesInSwitch\": true,    /* Report errors for fallthrough cases in switch statement. */\n\n    /* Module Resolution Options */\n    // \"moduleResolution\": \"node\",            /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */\n    // \"baseUrl\": \"./\",                       /* Base directory to resolve non-absolute module names. */\n    // \"paths\": {},                           /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */\n    // \"rootDirs\": [],                        /* List of root folders whose combined content represents the structure of the project at runtime. */\n    // \"typeRoots\": [],                       /* List of folders to include type definitions from. */\n    // \"types\": [],                           /* Type declaration files to be included in compilation. */\n    // \"allowSyntheticDefaultImports\": true,  /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */\n    \"esModuleInterop\": true                   /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */\n    // \"preserveSymlinks\": true,              /* Do not resolve the real path of symlinks. */\n\n    /* Source Map Options */\n    // \"sourceRoot\": \"\",                      /* Specify the location where debugger should locate TypeScript files instead of source locations. */\n    // \"mapRoot\": \"\",                         /* Specify the location where debugger should locate map files instead of generated locations. */\n    // \"inlineSourceMap\": true,               /* Emit a single file with source maps instead of having a separate file. */\n    // \"inlineSources\": true,                 /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */\n\n    /* Experimental Options */\n    // \"experimentalDecorators\": true,        /* Enables experimental support for ES7 decorators. */\n    // \"emitDecoratorMetadata\": true,         /* Enables experimental support for emitting type metadata for decorators. */\n  }\n}\n"
  },
  {
    "path": "tests/index.test.js",
    "content": "const fs = require('fs')\nconst path = require('path')\nconst rimraf = require('rimraf')\nconst exec = require('child_process').exec\n\nconst TEMP_FOLDER = '__temp__'\n\nbeforeAll(() => {\n  if (!fs.existsSync(TEMP_FOLDER)) {\n    fs.mkdirSync(TEMP_FOLDER)\n  }\n})\n\ntest('Run Javali cli without errors', async () => {\n  const result = await cli('my-library', TEMP_FOLDER)\n  expect(result.code).toBe(0)\n})\n\ntest('Create a library called \"my-library\"', async () => {\n  await cli('my-library', TEMP_FOLDER)\n  const folderExists = fs.existsSync(`${TEMP_FOLDER}/my-library`)\n  expect(folderExists).toBe(true)\n})\n\ntest('Create a library called \"my-library-with-typescript\" with Typescript', async () => {\n  await cli('my-library-with-typescript --typescript', TEMP_FOLDER)\n  const fileExists = fs.existsSync(`${TEMP_FOLDER}/my-library-with-typescript/tsconfig.json`)\n  expect(fileExists).toBe(true)\n})\n\nafterAll(() => {\n  rimraf.sync(TEMP_FOLDER)\n})\n\nfunction cli (args, cwd) {\n  return new Promise(resolve => {\n    exec(`node ${path.resolve('./cli/index')} ${args}`,\n      { cwd },\n      (error, stdout, stderr) => {\n        resolve({\n          code: error && error.code ? error.code : 0,\n          error,\n          stdout,\n          stderr\n        })\n      })\n  })\n}\n"
  }
]