[
  {
    "path": ".editorconfig",
    "content": "root = true\n\n[*]\ncharset = utf-8\nend_of_line = lf\ninsert_final_newline = false\ntrim_trailing_whitespace = true\n\n[*.js]\nindent_style = space\nindent_size = 4\n"
  },
  {
    "path": ".gitignore",
    "content": "# Folders to ignore\nnode_modules\n\n# Editor directories and files to ignore\n.DS_STORE\n.DS_Store\n.idea\n.vscode\n.prettierrc\n.cache\n.project\n.settings\n.tmproj\n*.esproj\n*.sublime-project\n*.sublime-workspace\n*.suo\n*.ntvs*\n*.njsproj\n*.sln\n\n# Log files to ignore\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n*.log\n\n# Cache files to ignore\n.yarn-cache\n"
  },
  {
    "path": ".npmignore",
    "content": "# Folders to ignore\nnode_modules\n\n# Editor directories and files to ignore\n.DS_STORE\n.DS_Store\n.idea\n.vscode\n.prettierrc\n.cache\n.project\n.settings\n.tmproj\n.gitignore\n.editorconfig\n*.esproj\n*.sublime-project\n*.sublime-workspace\n*.suo\n*.ntvs*\n*.njsproj\n*.sln\n\n# Log files to ignore\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n*.log\n\n# Cache files to ignore\n.yarn-cache\n"
  },
  {
    "path": "LICENSE",
    "content": "MIT License\n\nCopyright (c) zhengaojin\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."
  },
  {
    "path": "README-en.md",
    "content": "![rs-admin-cli](https://jines-z.github.io/images/rs-admin-cli.png)\n---------------------------------------------------------------\n[![React](https://img.shields.io/badge/react-^16.8.4-brightgreen.svg?style=flat-square)](https://github.com/facebook/react)\n[![Ant Design](https://img.shields.io/badge/ant--design-^3.8.0-yellowgreen.svg?style=flat-square)](https://github.com/ant-design/ant-design)\n[![Mobx](https://img.shields.io/badge/mobx-^5.9.4-orange.svg?style=flat-square)](https://github.com/mobxjs/mobx)\n\n[简体中文](https://github.com/Jines-z/rs-admin-cli) | English\n\n## Overview\n`rs-admin-cli` is a scaffolding that is rapidly developed based on react and provides:\n\n-   Interactive project scaffolding via `rs-admin-cli`。\n-   Start zero-configuration prototyping quickly with `rs-compiler`。\n-   Includes three solutions:\n\n    -   react + redux\n    -   react + mobx\n    -   react + mobx + typescript\n    -   react + mobx + typescript + electron\n-   Rich project configuration to meet different needs。\n\n## Quick Start\n\n#### Install🔥\n~~~\nnpm install -g rs-admin-cli\n~~~\n\n#### Init\n~~~\nrs init yourProjectName\n~~~\n\n#### Run\n~~~\ncd yourProjectName\nnpm start\n~~~\n\n#### Build\n~~~\nnpm run build\n~~~\n\n## Preview\n![rs-admin-cli](https://jines-z.github.io/images/rs-admin-cli.gif)\n\nAddress: [Mobx](https://jines-z.github.io/rs-mobx)  [Redux](https://jines-z.github.io/rs-redux)\n\n[Log](https://github.com/Jines-z/rs-admin-cli/wiki/Log)\n\n\n"
  },
  {
    "path": "README.md",
    "content": "![rs-admin-cli](https://jines-z.github.io/images/rs-admin-cli.png)\n---------------------------------------------------------------\n[![React](https://img.shields.io/badge/react-^16.8.6-brightgreen.svg?style=flat-square)](https://github.com/facebook/react)\n[![Ant Design](https://img.shields.io/badge/ant--design-^3.8.0-yellowgreen.svg?style=flat-square)](https://github.com/ant-design/ant-design)\n[![Mobx](https://img.shields.io/badge/mobx-^5.9.4-orange.svg?style=flat-square)](https://github.com/mobxjs/mobx)\n\n简体中文 | [English](https://github.com/Jines-z/rs-admin-cli/blob/master/README-en.md)\n\n## 介绍\n`rs-admin-cli` 是一个基于 react 进行快速开发的脚手架，提供:\n\n-   通过 `rs-admin-cli` 搭建交互式的项目脚手架。\n-   通过 `rs-compiler` 快速开始零配置原型开发。\n-   包含三套解决方案:\n\n    -   react + redux\n    -   react + mobx\n    -   react + mobx + typescript\n    -   react + mobx + typescript + electron\n-   具有丰富的项目配置项，可满足不同的需求。\n    \n## 快速使用\n\n#### 全局安装🔥\n~~~\nnpm install -g rs-admin-cli\n~~~\n\n#### 新建项目\n~~~\nrs init yourProjectName\n~~~\n\n#### 运行\n~~~\ncd yourProjectName\nnpm start\n~~~\n\n#### 打包\n~~~\nnpm run build\n~~~\n\n## 预览\n![rs-admin-cli](https://jines-z.github.io/images/rs-admin-cli.gif)\n\n地址：[Mobx](https://jines-z.github.io/rs-mobx)  [Redux](https://jines-z.github.io/rs-redux)\n\n#### 更新日志迁移至[Wiki](https://github.com/Jines-z/rs-admin-cli/wiki/%E6%9B%B4%E6%96%B0%E6%97%A5%E5%BF%97)\n"
  },
  {
    "path": "bin/index.js",
    "content": "#!/usr/bin/env node\n\nconst program     = require('commander')\nconst download    = require('../packages/Download')\nconst { version } = require('../package')\n\nprogram\n    .version(version, '-v, --version')\n    .command('init <name>')\n    .description('Set your project name')\n    .action(function (dir, cmd) {\n        download(dir)\n    })\n\nprogram.parse(process.argv)\n\nif (process.argv.slice(2).length === 0) {\n    program.help()\n}\n"
  },
  {
    "path": "lib/Banner.js",
    "content": "const figlet = require('figlet')\n\nconst Banner = text => {\n    return new Promise((resolve, reject) => {\n        figlet.text(text, { font: 'rectangles' }, function(err, data) {\n            if (err) {\n                reject(err)\n                console.log('Something went wrong...')\n                process.exit(0)\n            }\n            console.log(data)\n            resolve()\n        })\n    })\n}\n\nmodule.exports = Banner\n"
  },
  {
    "path": "lib/Div.js",
    "content": "const ui      = require('cliui')()\nconst chalk   = require('chalk')\nconst figures = require('figures')\n\nconst Div = list => {\n    list.forEach(item => {\n        ui.div({\n            text: chalk.green(figures.tick),\n            width: 2,\n            padding: [0, 0, 0, 0]\n        }, {\n            text: item,\n            width: 25\n        })\n    })\n\n    console.log(`${ui.toString()}\\n`)\n}\n\nmodule.exports = Div\n"
  },
  {
    "path": "lib/Dll.js",
    "content": "const { spawn } = require('child_process')\n\nconst Dll = dir => {\n    return new Promise((resolve, reject) => {\n        const child = spawn('npm', ['run', 'dll'], {\n            cwd: dir,\n            stdio: [0, 1, 2],\n            shell: process.platform === 'win32',\n            detached: false\n        })\n\n        child.on('close', (code) => {\n            if (code !== 0) {\n                console.log('command failed !')\n                process.exit(0)\n            }\n            resolve()\n        })\n    })\n}\n\nmodule.exports = Dll"
  },
  {
    "path": "lib/Inquirer.js",
    "content": "const inquirer = require('inquirer')\nconst promptList = [{\n    type: 'list',\n    message: 'Choose a package management tool: ',\n    name: 'command',\n    choices: [\n        'yarn',\n        'npm'\n    ]\n}, {\n    type: 'list',\n    message: 'Choose what you need: ',\n    name: 'state',\n    choices: [\n        'electron',\n        'redux',\n        'mobx',\n        'mobx-typescript'\n    ]\n}]\n\nconst Inquirer = () => {\n    return new Promise((resolve, reject) => {\n        inquirer.prompt(promptList).then(answers => {\n            resolve(answers)\n        })\n    })\n}\n\nmodule.exports = Inquirer\n"
  },
  {
    "path": "lib/Install.js",
    "content": "const { spawn } = require('child_process')\n\nconst Install = (dir, command) => {\n    return new Promise((resolve, reject) => {\n        const child = spawn(command, ['install'], {\n            cwd: dir,\n            stdio: [0, 1, 2],\n            shell: process.platform === 'win32',\n            detached: false\n        })\n\n        child.on('close', (code) => {\n            if (code !== 0) {\n                console.log('command failed !')\n                process.exit(0)\n            }\n            resolve()\n        })\n    })\n}\n\nmodule.exports = Install"
  },
  {
    "path": "lib/Spinner.js",
    "content": "const ora         = require('ora')\n\nconst Spinner = new ora({\n    text: 'Download template ...\\n',\n    color: 'white'\n})\n\nmodule.exports = Spinner\n"
  },
  {
    "path": "lib/Utils.js",
    "content": "const { readdir } = require(\"fs\")\n\nconst readDir = dir => {\n    return new Promise((resolve, reject) => {\n        readdir(dir, (err, files) => {\n            if (err) {\n                console.log(err)\n                process.exit(0)\n            } else {\n                resolve(files)\n            }\n        })\n    })\n}\n\nmodule.exports = {\n    readDir\n}\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"rs-admin-cli\",\n  \"version\": \"3.2.3\",\n  \"description\": \"Command line interface for react\",\n  \"author\": \"zhengaojin <zhengaojin@live.cn>\",\n  \"private\": false,\n  \"bin\": {\n    \"rs\": \"./bin/index.js\"\n  },\n  \"keywords\": [\n    \"react\",\n    \"react-starter-kit\",\n    \"cli\",\n    \"admin\",\n    \"redux\",\n    \"mobx\",\n    \"typescript\",\n    \"electron\"\n  ],\n  \"license\": \"MIT\",\n  \"dependencies\": {\n    \"chalk\": \"^2.4.2\",\n    \"cliui\": \"^4.1.0\",\n    \"commander\": \"^2.20.3\",\n    \"download-git-repo\": \"^3.0.2\",\n    \"figlet\": \"^1.5.0\",\n    \"figures\": \"^3.2.0\",\n    \"inquirer\": \"^6.2.0\",\n    \"ora\": \"^5.0.0\",\n    \"lodash\": \"^4.17.20\"\n  }\n}\n"
  },
  {
    "path": "packages/Download.js",
    "content": "const GitRepo  = require('download-git-repo')\nconst Chalk    = require('chalk')\nconst Spinner  = require('../lib/Spinner')\nconst Banner   = require('../lib/Banner')\nconst Div      = require('../lib/Div')\nconst Install  = require('../lib/Install')\nconst Dll      = require('../lib/Dll')\nconst Inquirer = require('../lib/Inquirer')\nconst Utils    = require('../lib/Utils')\n\nconst Download = async (dir) => {\n    await Banner('rs admin cli')\n    const answers = await Inquirer()\n    process.stdout.write('\\033c')\n    Spinner.start()\n    GitRepo(`github:Jines-z/rs-template-${answers.state}`, `${dir}/`, async function (err) {\n        if (!err) {\n            Spinner.stop()\n            console.log(`# Download completed! \\n`)\n            const fileNames = await Utils.readDir(dir)\n            Div(fileNames)\n            console.log(`# Preparatory install ... \\n`)\n            await Install(dir, answers.command)\n            await Dll(dir)\n            console.log('\\n')\n            console.log(`## Successfully created project ${dir}`)\n            console.log(`## Get started with the following commands:\\n`)\n            console.log(` ${Chalk.gray('$')} ${Chalk.cyan(`cd ${dir}`)}`)\n            console.log(` ${Chalk.gray('$')} ${Chalk.cyan(`npm start`)}\\n`)\n        } else {\n            Spinner.stop()\n            console.log(Chalk.red('\\n Download template failed ! \\n'))\n            process.exit(0)\n        }\n    })\n}\n\nmodule.exports = Download"
  }
]