[
  {
    "path": ".editorconfig",
    "content": "root = true\n\n[*]\nindent_style = space\nindent_size = 2\nend_of_line = lf\ncharset = utf-8\ntrim_trailing_whitespace = true\ninsert_final_newline = true\n\n[*.md]\ntrim_trailing_whitespace = false"
  },
  {
    "path": ".gitattributes",
    "content": "* text=auto\n"
  },
  {
    "path": ".gitignore",
    "content": "node_modules\npackages/*/yarn.lock\n"
  },
  {
    "path": "LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright (c) egoist <0x142857@gmail.com> (https://egoistian.com)\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": "README.md",
    "content": "# create-vue-app\n\n[![NPM version](https://img.shields.io/npm/v/create-vue-app.svg?style=flat)](https://npmjs.com/package/create-vue-app) [![NPM downloads](https://img.shields.io/npm/dm/create-vue-app.svg?style=flat)](https://npmjs.com/package/create-vue-app) [![CircleCI](https://circleci.com/gh/vue-land/create-vue-app/tree/master.svg?style=shield)](https://circleci.com/gh/vue-land/create-vue-app/tree/master)  [![donate](https://img.shields.io/badge/$-donate-ff69b4.svg?maxAge=2592000&style=flat)](https://github.com/egoist/donate) [![chat](https://img.shields.io/badge/chat-on%20discord-7289DA.svg?style=flat)](https://chat.egoist.moe)\n\n## Features\n\n- No config until you need, thanks to [Poi](https://github.com/egoist/poi).\n  - Support all CSS preprocessors and CSS modules\n  - Hot mode reloading\n- Unit tests with [Jest](https://github.com/avajs/ava) with no config by default thanks to [Tyu](https://github.com/egoist/tyu).\n- Progressive Web App by default, thanks to [poi-preset-offline](https://github.com/egoist/poi/tree/master/packages/poi-preset-offline) and [offline-plugin](https://github.com/NekR/offline-plugin).\n\n## Install\n\n```bash\nyarn global add create-vue-app\n```\n\n## Usage\n\n```bash\n# Generate project in cwd\nmkdir my-vue-app && cd my-vue-app\ncreate-vue-app .\n\n# Generate project in specific folder\ncreate-vue-app my-vue-app\ncd my-vue-app\n```\n\nAlternatively, if you have Yarn^0.24, you can use the `yarn create` command:\n\n```bash\nyarn create vue-app my-vue-app\n```\n\n### Folder structure\n\n```bash\n.\n├── README.md\n├── index.ejs\n├── package.json\n├── poi.config.js\n├── src\n│   ├── components\n│   │   ├── App.test.js\n│   │   └── App.vue\n│   ├── index.js\n│   └── polyfills.js\n├── static\n│   └── favicon.ico\n└── yarn.lock\n```\n\n## Recipes\n\n- [Unit Test](./docs/unit-test.md)\n\n## FAQ\n\n### Where are the docs?\n\n**This project is using Poi under the hood**, so for most questions, hopefully go to [this page](https://poi.js.org/#/home) and you will get the answer.\n\n## Contributing\n\n1. Fork it!\n2. Create your feature branch: `git checkout -b my-new-feature`\n3. Commit your changes: `git commit -am 'Add some feature'`\n4. Push to the branch: `git push origin my-new-feature`\n5. Submit a pull request :D\n\n\n## Author\n\n**create-vue-app** © [egoist](https://github.com/egoist), Released under the [MIT](./LICENSE) License.<br>\nAuthored and maintained by egoist with help from contributors ([list](https://github.com/egoist/create-vue-app/contributors)).\n\n> [egoistian.com](https://egoistian.com) · GitHub [@egoist](https://github.com/egoist) · Twitter [@_egoistlily](https://twitter.com/_egoistlily)\n"
  },
  {
    "path": "circle.yml",
    "content": "machine:\n  node:\n    version: 7\n  environment:\n    PATH: \"${PATH}:${HOME}/${CIRCLE_PROJECT_REPONAME}/node_modules/.bin\"\n\ndependencies:\n  override:\n    - yarn\n  cache_directories:\n    - ~/.cache/yarn\n\ntest:\n  override:\n    - yarn test\n"
  },
  {
    "path": "cli.js",
    "content": "#!/usr/bin/env node\nconst path = require('path')\nconst cac = require('cac')\nconst sao = require('sao')\nconst update = require('update-notifier')\nconst pkg = require('./package')\n\nconst cli = cac()\n\ncli.command('*', 'Generate a new project', input => {\n  if (input.length === 0) {\n    return cli.showHelp()\n  }\n\n  const folderName = input[0]\n  const targetPath = path.resolve(folderName)\n  console.log(`> Generating project in ${targetPath}`)\n\n  return sao({\n    template: __dirname,\n    targetPath\n  })\n})\n\ncli.parse()\n\nupdate({\n  pkg\n}).notify()\n"
  },
  {
    "path": "docs/unit-test.md",
    "content": "# Unit Test\n\nRefer to [Tyu](https://github.com/egoist/tyu) which is using Jest under the hood.\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"create-vue-app\",\n  \"version\": \"2.0.0\",\n  \"description\": \"Create Vue app with no build configurations\",\n  \"scripts\": {\n    \"test\": \"npm run lint && npm run ava\",\n    \"ava\": \"ava test/test.js\",\n    \"lint\": \"xo\"\n  },\n  \"bin\": {\n    \"cva\": \"cli.js\",\n    \"create-vue-app\": \"cli.js\"\n  },\n  \"files\": [\n    \"sao.js\",\n    \"cli.js\",\n    \"template\"\n  ],\n  \"repository\": \"git@github.com:egoist/create-vue-app.git\",\n  \"author\": \"EGOIST <0x142857@gmail.com>\",\n  \"license\": \"MIT\",\n  \"devDependencies\": {\n    \"ava\": \"^0.24.0\",\n    \"eslint-config-rem\": \"^3.1.0\",\n    \"lerna\": \"^2.0.0-rc.5\",\n    \"xo\": \"^0.18.2\"\n  },\n  \"dependencies\": {\n    \"cac\": \"^4.2.0\",\n    \"sao\": \"^0.22.2\",\n    \"superb\": \"^1.3.0\",\n    \"update-notifier\": \"^2.1.0\"\n  },\n  \"xo\": {\n    \"extends\": \"rem/prettier\",\n    \"ignores\": [\n      \"template/**\"\n    ],\n    \"rules\": {\n      \"ava/no-ignored-test-files\": 0\n    }\n  }\n}\n"
  },
  {
    "path": "sao.js",
    "content": "const superb = require('superb')\n\nmodule.exports = {\n  prompts: {\n    name: {\n      message: `What's the name of your new project`,\n      default: ':folderName:'\n    },\n    description: {\n      message: 'How would your describe your superb project',\n      default: `My ${superb()} Vue project`\n    },\n    pwa: {\n      type: 'confirm',\n      default: true,\n      message: 'Add Progressive Web App (PWA) support',\n      store: true\n    },\n    manifest: {\n      type: 'confirm',\n      default: true,\n      when: 'pwa',\n      message: 'Use default manifest.json and icons for PWA',\n      store: true\n    },\n    unitTest: {\n      type: 'confirm',\n      default: true,\n      message: 'Use Tyu(Jest) to run unit tests',\n      store: true\n    },\n    username: {\n      message: `What's your GitHub username`,\n      default: ':gitUser:',\n      store: true\n    },\n    email: {\n      message: `What's your GitHub email`,\n      default: ':gitEmail:',\n      store: true\n    }\n  },\n  move: {\n    gitignore: '.gitignore'\n  },\n  filters: {\n    'src/pwa.js': 'pwa',\n    'static/manifest.json': 'manifest',\n    'static/icons/**': 'manifest',\n    'src/components/App.test.js': 'unitTest'\n  },\n  gitInit: true,\n  installDependencies: true,\n  post(_) {\n    _.showTip()\n    console.log(_.chalk.cyan('\\n  To develop it:'))\n    console.log('\\n    yarn dev')\n\n    console.log(_.chalk.cyan('\\n  To build for production:'))\n    console.log('\\n    yarn build')\n\n    console.log(\n      _.chalk.dim('\\n  For more usages, please check out ./README.md')\n    )\n    console.log()\n  }\n}\n"
  },
  {
    "path": "template/.editorconfig",
    "content": "root = true\n\n[*]\nindent_style = space\nindent_size = 2\nend_of_line = lf\ncharset = utf-8\ntrim_trailing_whitespace = true\ninsert_final_newline = true\n\n[*.md]\ntrim_trailing_whitespace = false"
  },
  {
    "path": "template/README.md",
    "content": "# <%= name %>\n\n> <%= description %>\n\n## Commands\n\nYou can replace `yarn` with `npm run` here.\n\n```bash\n# build for production\nyarn build\n\n# development mode\nyarn dev\n\n# run unit tests\nyarn test\n\n# serve the bundled dist folder in production mode\nyarn serve\n```\n\n## Polyfills\n\nBy default we only polyfill `window.Promise` and `Object.assign`. You can add more polyfills in `./src/polyfills.js`.\n\n## Analyze bundle size\n\nRun `yarn report` to get a report of bundle size which helps you:\n\n- Realize what's really inside your bundle\n- Find out what modules make up the most of it's size\n- Find modules that got there by mistake\n- Optimize it!\n\n<% if (pwa){ -%>\n## Progressive Web App\n\nYour app is now offline-ready (only in production bundle), which means you can visit it without network.<% if (manifest) { %>\n\nHere we use a default [manifest.json](./static/manifest.json) to configurure your pwa, for example, to enable *Add to Home Screen* feature on Android. It will be copied directly to `./dist/manifest.json`.\n\n<% } %>\nFor all the available options, please head to [poi-preset-offline](https://github.com/egoist/poi/tree/master/packages/poi-preset-offline#api).\n<% } %>\n---\n\nThis project is generated by [create-vue-app](https://github.com/vue-land/create-vue-app).\n"
  },
  {
    "path": "template/gitignore",
    "content": "node_modules\n*.log\n.DS_Store\n\n# poi dist\ndist\n"
  },
  {
    "path": "template/index.ejs",
    "content": "<!DOCTYPE html>\n<html>\n  <head>\n    <meta http-equiv=\"Content-type\" content=\"text/html; charset=utf-8\"/>\n    <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"/>\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>\n    <title><%%= htmlWebpackPlugin.options.title %%></title>\n\n    <% if (manifest) { %>\n    <link rel=\"manifest\" href=\"/manifest.json\">\n    <meta name=\"theme-color\" content=\"#4DBA87\">\n    <% } %>\n\n    <%% if (htmlWebpackPlugin.options.description) { %%>\n    <meta name=\"description\" content=\"<%%= htmlWebpackPlugin.options.description %%>\"/>\n    <%% } %%>\n\n    <%% for (var chunk of webpack.chunks) {\n        for (var file of chunk.files) {\n          if (file.match(/\\.(js|css)$/)) { %%>\n    <link rel=\"<%%= chunk.initial?'preload':'prefetch' %%>\" href=\"<%%= htmlWebpackPlugin.files.publicPath + file %%>\" as=\"<%%= file.match(/\\.css$/)?'style':'script' %%>\"><%% }}} %%>\n  </head>\n  <body>\n    <noscript>\n      You need to enable JavaScript to run this app.\n    </noscript>\n    <div id=\"app\"></div>\n  </body>\n</html>\n"
  },
  {
    "path": "template/package.json",
    "content": "{\n  \"private\": true,\n  \"name\": \"<%= name %>\",\n  \"productName\": \"<%= name %>\",\n  \"description\": \"<%= description %>\",\n  \"version\": \"0.0.0\",\n  \"license\": \"MIT\",\n  \"scripts\": {\n    \"dev\": \"poi\",\n    \"build\": \"poi build\",\n    \"report\": \"poi build --bundle-report\",\n    \"serve\": \"serve dist --single\"<% if (unitTest) { %>,\n    \"test\": \"tyu\"<% } %>\n  },\n  \"author\": {\n    \"name\": \"<%= username %>\",\n    \"email\": \"<%= email %>\"\n  },\n  \"dependencies\": {<% if (pwa) { %>\n    \"offline-plugin\": \"^4.8.0\",<% } %>\n    \"normalize.css\": \"^7.0.0\",\n    \"object-assign\": \"^4.1.1\",\n    \"promise-polyfill\": \"^6.0.2\"\n  },\n  \"devDependencies\": {\n    \"poi\": \"^9.0.0\",\n    \"poi-preset-bundle-report\": \"^2.0.0\",\n    \"serve\": \"^6.1.0\"<% if (unitTest) { %>,\n    \"tyu\": \"^1.0.4\"<% } %><% if (pwa) { %>,\n    \"poi-preset-offline\": \"^9.0.0\"<% } %>\n  }\n}\n"
  },
  {
    "path": "template/poi.config.js",
    "content": "const path = require('path')\nconst pkg = require('./package')\n\nmodule.exports = {\n  entry: [\n    'src/polyfills.js',\n    'src/index.js'\n  ],\n  html: {\n    title: pkg.productName,\n    description: pkg.description,\n    template: path.join(__dirname, 'index.ejs')\n  },\n  postcss: {\n    plugins: [\n      // Your postcss plugins\n    ]\n  },\n  presets: [\n    require('poi-preset-bundle-report')()<%_ if (pwa) { %>,\n    require('poi-preset-offline')({\n      pwa: './src/pwa.js', // Path to pwa runtime entry\n      pluginOptions: {} // Additional options for offline-plugin\n    })<% } %>\n  ]\n}\n"
  },
  {
    "path": "template/src/components/App.test.js",
    "content": "import Vue from 'vue'\nimport App from './App.vue'\n\nVue.config.productionTip = false\n\nit('does not crash', () => {\n  const Ctor = Vue.extend(App)\n  const vm = new Ctor().$mount()\n  expect(vm.$el.textContent).toMatch(/Welcome to Vue\\.js/)\n})\n"
  },
  {
    "path": "template/src/components/App.vue",
    "content": "<template>\n  <div id=\"app\">\n    <div class=\"banner\">\n      <img\n        src=\"https://vuejs.org/images/logo.png\"\n        width=\"100\"\n        alt=\"vue\"\n        class=\"logo\"\n      />\n      <h1>Welcome to Vue.js</h1>\n    </div>\n    <div class=\"bottom\">\n      To get started, edit <code>./src/components/App.vue</code> and save to reload.<br/>\n      <span class=\"fade\">\n        Checkout <code>./README.md</code> for more usages.\n      </span>\n    </div>\n  </div>\n</template>\n\n<script>\n  export default {\n    name: 'app'\n  }\n</script>\n\n<!-- CSS libraries -->\n<style src=\"normalize.css/normalize.css\"></style>\n\n<!-- Global CSS -->\n<style>\n  code {\n    font-family: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif;\n    font-size: 0.9em;\n    white-space: pre-wrap;\n    color: #2c3e50;\n  }\n\n  code::before, code::after {\n    content: '`';\n  }\n</style>\n\n<!-- Scoped component css -->\n<!-- It only affect current component -->\n<style scoped>\n  #app {\n    text-align: center;\n  }\n\n  #app h1 {\n    color: #2c3e50;\n    font-weight: 300;\n    margin: 0;\n  }\n\n  .banner {\n    height: 200px;\n    background-color: #f6f6f6;\n    padding: 50px 10px;\n  }\n\n  .bottom {\n    padding: 80px 10px;\n    font-size: 24px;\n    font-weight: 300;\n  }\n\n  .fade {\n    font-size: 14px;\n  }\n\n  .logo {\n    animation: spin 4s 1s infinite linear\n  }\n\n  @keyframes spin {\n    from {transform:rotate(0deg);}\n    to {transform:rotate(360deg);}\n  }\n</style>\n"
  },
  {
    "path": "template/src/index.js",
    "content": "import Vue from 'vue'\nimport App from './components/App.vue'\n\nVue.config.productionTip = false\n\nnew Vue({\n  el: '#app',\n  render: h => h(App)\n})\n"
  },
  {
    "path": "template/src/polyfills.js",
    "content": "if (!window.Promise) {\n  window.Promise = require('promise-polyfill')\n}\n\nObject.assign = require('object-assign')\n"
  },
  {
    "path": "template/src/pwa.js",
    "content": "import runtime from 'offline-plugin/runtime'\n\nruntime.install({\n  onUpdateReady() {\n    runtime.applyUpdate()\n  }\n})\n"
  },
  {
    "path": "template/static/manifest.json",
    "content": "{\n  \"name\": \"<%= name %>\",\n  \"short_name\": \"<%= name %>\",\n  \"icons\": [\n    {\n      \"src\": \"/icons/android-chrome-192x192.png\",\n      \"sizes\": \"192x192\",\n      \"type\": \"image/png\"\n    },\n    {\n      \"src\": \"/icons/android-chrome-512x512.png\",\n      \"sizes\": \"512x512\",\n      \"type\": \"image/png\"\n    }\n  ],\n  \"start_url\": \"/\",\n  \"display\": \"standalone\",\n  \"background_color\": \"#000000\",\n  \"theme_color\": \"#4DBA87\"\n}\n"
  },
  {
    "path": "test/snapshots/test.js.md",
    "content": "# Snapshot report for `test/test.js`\n\nThe actual snapshot is saved in `test.js.snap`.\n\nGenerated by [AVA](https://ava.li).\n\n## defaults\n\n> Snapshot 1\n\n    [\n      '.editorconfig',\n      '.gitignore',\n      'README.md',\n      'index.ejs',\n      'package.json',\n      'poi.config.js',\n      'src/components/App.test.js',\n      'src/components/App.vue',\n      'src/index.js',\n      'src/polyfills.js',\n      'src/pwa.js',\n      'static/favicon.ico',\n      'static/icons/android-chrome-192x192.png',\n      'static/icons/android-chrome-512x512.png',\n      'static/manifest.json',\n    \n\n## no unit test\n\n> Snapshot 1\n\n    [\n      '.editorconfig',\n      '.gitignore',\n      'README.md',\n      'index.ejs',\n      'package.json',\n      'poi.config.js',\n      'src/components/App.vue',\n      'src/index.js',\n      'src/polyfills.js',\n      'src/pwa.js',\n      'static/favicon.ico',\n      'static/icons/android-chrome-192x192.png',\n      'static/icons/android-chrome-512x512.png',\n      'static/manifest.json',\n    ]\n\n> scripts\n\n    {\n      build: 'poi build',\n      dev: 'poi',\n      report: 'poi build --bundle-report',\n      serve: 'serve dist --single',\n    }\n\n> devDependencies\n\n    {\n      poi: '^9.0.0',\n      'poi-preset-bundle-report': '^2.0.0',\n      'poi-preset-offline': '^9.0.0',\n      serve: '^6.1.0',\n    }"
  },
  {
    "path": "test/test.js",
    "content": "import path from 'path'\nimport test from 'ava'\nimport sao from 'sao'\n\nconst template = path.join(__dirname, '..')\n\ntest('defaults', async t => {\n  const res = await sao.mockPrompt(template, {})\n  t.snapshot(res.fileList)\n})\n\ntest('no unit test', async t => {\n  const res = await sao.mockPrompt(template, {\n    unitTest: false\n  })\n  t.snapshot(res.fileList)\n  const pkg = JSON.parse(res.fileContents('package.json'))\n  t.snapshot(pkg.scripts, 'scripts')\n  t.snapshot(pkg.devDependencies, 'devDependencies')\n})\n"
  }
]