Showing
8 changed files
with
673 additions
and
0 deletions
.gitignore
0 → 100644
README.md
0 → 100644
| 1 | +qx-cli | ||
| 2 | + | ||
| 3 | +轻量的微前端子应用 Qx CLI 工具 | ||
| 4 | + | ||
| 5 | +### 快速开始 | ||
| 6 | + | ||
| 7 | +#### 通过 npx 使用 (推荐) | ||
| 8 | +1. 安装NPX:`npm install -g npx` | ||
| 9 | +2. 生成项目:`npx qx-cli init` | ||
| 10 | +3. 查看模板: `npx qx-cli list` | ||
| 11 | + | ||
| 12 | +### 通过 NPM 使用 | ||
| 13 | +1. `npm install -g qx-cli` | ||
| 14 | +2. 在终端输入 `qx-cli` | ||
| 15 | + | ||
| 16 | + Usage: qx <commands> | ||
| 17 | + | ||
| 18 | + Commands: | ||
| 19 | + | ||
| 20 | + list 查看所有的模板 | ||
| 21 | + init 通过模板生成项目(需按步骤选择) |
bin/index.js
0 → 100755
bin/init.js
0 → 100755
| 1 | +#!/usr/bin/env node | ||
| 2 | + | ||
| 3 | +const inquirer = require('inquirer') | ||
| 4 | +const chalk = require('chalk') | ||
| 5 | +const exec = require('child_process').exec; | ||
| 6 | + | ||
| 7 | +const templateMap = require(`${__dirname}/../template`) | ||
| 8 | + | ||
| 9 | +const templateOptions = Object.keys(templateMap).reduce((list, key) => { | ||
| 10 | + list.push({ | ||
| 11 | + name: `${templateMap[key].name} (${key})`, | ||
| 12 | + value: key, | ||
| 13 | + short: templateMap[key].name, | ||
| 14 | + }) | ||
| 15 | + return list | ||
| 16 | +}, []) | ||
| 17 | + | ||
| 18 | +const questions = [ | ||
| 19 | + { | ||
| 20 | + name: 'template', | ||
| 21 | + type: 'list', | ||
| 22 | + message: '请选择使用的模板?', | ||
| 23 | + choices: templateOptions, | ||
| 24 | + }, | ||
| 25 | + { | ||
| 26 | + name: "projectName", | ||
| 27 | + type: 'input', | ||
| 28 | + message: "请输入系统名称", | ||
| 29 | + validate(val) { | ||
| 30 | + if (val === '') return '请输入系统名称' | ||
| 31 | + return true | ||
| 32 | + } | ||
| 33 | + }, | ||
| 34 | +] | ||
| 35 | + | ||
| 36 | +function initAsk() { | ||
| 37 | + inquirer.prompt(questions).then(answers => { | ||
| 38 | + const result = { | ||
| 39 | + template: answers.template, | ||
| 40 | + projectName: answers.projectName, | ||
| 41 | + } | ||
| 42 | + const template = templateMap[result.template] | ||
| 43 | + | ||
| 44 | + initProject(result.projectName, template) | ||
| 45 | + }) | ||
| 46 | +} | ||
| 47 | + | ||
| 48 | +function initProject(projectName, template) { | ||
| 49 | + console.log(chalk.white('\n 开始下载模板... \n')) | ||
| 50 | + | ||
| 51 | + exec(`git clone -b ${template.branch} --depth=1 ${template.repo} ${projectName}`, err => { | ||
| 52 | + if (err) { | ||
| 53 | + console.log(chalk.red(`模板下载失败. ${err}`)) | ||
| 54 | + process.exit(1); | ||
| 55 | + } else { | ||
| 56 | + try { | ||
| 57 | + commitWork(projectName, err => { | ||
| 58 | + if (err) { | ||
| 59 | + console.log(chalk.red(err)) | ||
| 60 | + } else { | ||
| 61 | + console.log(chalk.green('\n ✅下载完成!')) | ||
| 62 | + console.log('\n 快速开始') | ||
| 63 | + console.log(`\n cd ${projectName}`) | ||
| 64 | + console.log('\n npm install') | ||
| 65 | + console.log('\n npm start\n') | ||
| 66 | + process.exit(1); | ||
| 67 | + } | ||
| 68 | + }) | ||
| 69 | + } catch (err) { | ||
| 70 | + console.log('项目配置生成失败', chalk.red(err)) | ||
| 71 | + } | ||
| 72 | + } | ||
| 73 | + }); | ||
| 74 | +} | ||
| 75 | + | ||
| 76 | + | ||
| 77 | +function commitWork(projectName, callback) { | ||
| 78 | + exec(` | ||
| 79 | + cd ${projectName} | ||
| 80 | + rm -rf .git | ||
| 81 | + git init | ||
| 82 | + git add . | ||
| 83 | + git commit -m 'init ${projectName}' | ||
| 84 | + `, callback) | ||
| 85 | +} | ||
| 86 | + | ||
| 87 | +initAsk() |
bin/list.js
0 → 100755
package-lock.json
0 → 100644
| 1 | +{ | ||
| 2 | + "name": "qx-cli", | ||
| 3 | + "version": "1.0.0", | ||
| 4 | + "lockfileVersion": 3, | ||
| 5 | + "requires": true, | ||
| 6 | + "packages": { | ||
| 7 | + "": { | ||
| 8 | + "name": "qx-cli", | ||
| 9 | + "version": "1.0.17", | ||
| 10 | + "license": "ISC", | ||
| 11 | + "dependencies": { | ||
| 12 | + "chalk": "^4.1.1", | ||
| 13 | + "commander": "^7.2.0", | ||
| 14 | + "inquirer": "^8.0.0" | ||
| 15 | + }, | ||
| 16 | + "bin": { | ||
| 17 | + "qx-cli": "bin/index.js", | ||
| 18 | + "qx-cli-init": "bin/init.js", | ||
| 19 | + "qx-cli-list": "bin/list.js" | ||
| 20 | + } | ||
| 21 | + }, | ||
| 22 | + "node_modules/ansi-escapes": { | ||
| 23 | + "version": "4.3.2", | ||
| 24 | + "resolved": "https://registry.npmmirror.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz", | ||
| 25 | + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", | ||
| 26 | + "dependencies": { | ||
| 27 | + "type-fest": "^0.21.3" | ||
| 28 | + }, | ||
| 29 | + "engines": { | ||
| 30 | + "node": ">=8" | ||
| 31 | + } | ||
| 32 | + }, | ||
| 33 | + "node_modules/ansi-regex": { | ||
| 34 | + "version": "5.0.1", | ||
| 35 | + "resolved": "https://registry.npmmirror.com/ansi-regex/-/ansi-regex-5.0.1.tgz", | ||
| 36 | + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", | ||
| 37 | + "engines": { | ||
| 38 | + "node": ">=8" | ||
| 39 | + } | ||
| 40 | + }, | ||
| 41 | + "node_modules/ansi-styles": { | ||
| 42 | + "version": "4.3.0", | ||
| 43 | + "resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz", | ||
| 44 | + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", | ||
| 45 | + "dependencies": { | ||
| 46 | + "color-convert": "^2.0.1" | ||
| 47 | + }, | ||
| 48 | + "engines": { | ||
| 49 | + "node": ">=8" | ||
| 50 | + } | ||
| 51 | + }, | ||
| 52 | + "node_modules/base64-js": { | ||
| 53 | + "version": "1.5.1", | ||
| 54 | + "resolved": "https://registry.npmmirror.com/base64-js/-/base64-js-1.5.1.tgz", | ||
| 55 | + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" | ||
| 56 | + }, | ||
| 57 | + "node_modules/bl": { | ||
| 58 | + "version": "4.1.0", | ||
| 59 | + "resolved": "https://registry.npmmirror.com/bl/-/bl-4.1.0.tgz", | ||
| 60 | + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", | ||
| 61 | + "dependencies": { | ||
| 62 | + "buffer": "^5.5.0", | ||
| 63 | + "inherits": "^2.0.4", | ||
| 64 | + "readable-stream": "^3.4.0" | ||
| 65 | + } | ||
| 66 | + }, | ||
| 67 | + "node_modules/buffer": { | ||
| 68 | + "version": "5.7.1", | ||
| 69 | + "resolved": "https://registry.npmmirror.com/buffer/-/buffer-5.7.1.tgz", | ||
| 70 | + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", | ||
| 71 | + "dependencies": { | ||
| 72 | + "base64-js": "^1.3.1", | ||
| 73 | + "ieee754": "^1.1.13" | ||
| 74 | + } | ||
| 75 | + }, | ||
| 76 | + "node_modules/chalk": { | ||
| 77 | + "version": "4.1.2", | ||
| 78 | + "resolved": "https://registry.npmmirror.com/chalk/-/chalk-4.1.2.tgz", | ||
| 79 | + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", | ||
| 80 | + "dependencies": { | ||
| 81 | + "ansi-styles": "^4.1.0", | ||
| 82 | + "supports-color": "^7.1.0" | ||
| 83 | + }, | ||
| 84 | + "engines": { | ||
| 85 | + "node": ">=10" | ||
| 86 | + } | ||
| 87 | + }, | ||
| 88 | + "node_modules/chardet": { | ||
| 89 | + "version": "0.7.0", | ||
| 90 | + "resolved": "https://registry.npmmirror.com/chardet/-/chardet-0.7.0.tgz", | ||
| 91 | + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==" | ||
| 92 | + }, | ||
| 93 | + "node_modules/cli-cursor": { | ||
| 94 | + "version": "3.1.0", | ||
| 95 | + "resolved": "https://registry.npmmirror.com/cli-cursor/-/cli-cursor-3.1.0.tgz", | ||
| 96 | + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", | ||
| 97 | + "dependencies": { | ||
| 98 | + "restore-cursor": "^3.1.0" | ||
| 99 | + }, | ||
| 100 | + "engines": { | ||
| 101 | + "node": ">=8" | ||
| 102 | + } | ||
| 103 | + }, | ||
| 104 | + "node_modules/cli-spinners": { | ||
| 105 | + "version": "2.8.0", | ||
| 106 | + "resolved": "https://registry.npmmirror.com/cli-spinners/-/cli-spinners-2.8.0.tgz", | ||
| 107 | + "integrity": "sha512-/eG5sJcvEIwxcdYM86k5tPwn0MUzkX5YY3eImTGpJOZgVe4SdTMY14vQpcxgBzJ0wXwAYrS8E+c3uHeK4JNyzQ==", | ||
| 108 | + "engines": { | ||
| 109 | + "node": ">=6" | ||
| 110 | + } | ||
| 111 | + }, | ||
| 112 | + "node_modules/cli-width": { | ||
| 113 | + "version": "3.0.0", | ||
| 114 | + "resolved": "https://registry.npmmirror.com/cli-width/-/cli-width-3.0.0.tgz", | ||
| 115 | + "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==", | ||
| 116 | + "engines": { | ||
| 117 | + "node": ">= 10" | ||
| 118 | + } | ||
| 119 | + }, | ||
| 120 | + "node_modules/clone": { | ||
| 121 | + "version": "1.0.4", | ||
| 122 | + "resolved": "https://registry.npmmirror.com/clone/-/clone-1.0.4.tgz", | ||
| 123 | + "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==", | ||
| 124 | + "engines": { | ||
| 125 | + "node": ">=0.8" | ||
| 126 | + } | ||
| 127 | + }, | ||
| 128 | + "node_modules/color-convert": { | ||
| 129 | + "version": "2.0.1", | ||
| 130 | + "resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz", | ||
| 131 | + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", | ||
| 132 | + "dependencies": { | ||
| 133 | + "color-name": "~1.1.4" | ||
| 134 | + }, | ||
| 135 | + "engines": { | ||
| 136 | + "node": ">=7.0.0" | ||
| 137 | + } | ||
| 138 | + }, | ||
| 139 | + "node_modules/color-name": { | ||
| 140 | + "version": "1.1.4", | ||
| 141 | + "resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz", | ||
| 142 | + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" | ||
| 143 | + }, | ||
| 144 | + "node_modules/commander": { | ||
| 145 | + "version": "7.2.0", | ||
| 146 | + "resolved": "https://registry.npmmirror.com/commander/-/commander-7.2.0.tgz", | ||
| 147 | + "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", | ||
| 148 | + "engines": { | ||
| 149 | + "node": ">= 10" | ||
| 150 | + } | ||
| 151 | + }, | ||
| 152 | + "node_modules/defaults": { | ||
| 153 | + "version": "1.0.4", | ||
| 154 | + "resolved": "https://registry.npmmirror.com/defaults/-/defaults-1.0.4.tgz", | ||
| 155 | + "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==", | ||
| 156 | + "dependencies": { | ||
| 157 | + "clone": "^1.0.2" | ||
| 158 | + } | ||
| 159 | + }, | ||
| 160 | + "node_modules/emoji-regex": { | ||
| 161 | + "version": "8.0.0", | ||
| 162 | + "resolved": "https://registry.npmmirror.com/emoji-regex/-/emoji-regex-8.0.0.tgz", | ||
| 163 | + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" | ||
| 164 | + }, | ||
| 165 | + "node_modules/escape-string-regexp": { | ||
| 166 | + "version": "1.0.5", | ||
| 167 | + "resolved": "https://registry.npmmirror.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", | ||
| 168 | + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", | ||
| 169 | + "engines": { | ||
| 170 | + "node": ">=0.8.0" | ||
| 171 | + } | ||
| 172 | + }, | ||
| 173 | + "node_modules/external-editor": { | ||
| 174 | + "version": "3.1.0", | ||
| 175 | + "resolved": "https://registry.npmmirror.com/external-editor/-/external-editor-3.1.0.tgz", | ||
| 176 | + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", | ||
| 177 | + "dependencies": { | ||
| 178 | + "chardet": "^0.7.0", | ||
| 179 | + "iconv-lite": "^0.4.24", | ||
| 180 | + "tmp": "^0.0.33" | ||
| 181 | + }, | ||
| 182 | + "engines": { | ||
| 183 | + "node": ">=4" | ||
| 184 | + } | ||
| 185 | + }, | ||
| 186 | + "node_modules/figures": { | ||
| 187 | + "version": "3.2.0", | ||
| 188 | + "resolved": "https://registry.npmmirror.com/figures/-/figures-3.2.0.tgz", | ||
| 189 | + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", | ||
| 190 | + "dependencies": { | ||
| 191 | + "escape-string-regexp": "^1.0.5" | ||
| 192 | + }, | ||
| 193 | + "engines": { | ||
| 194 | + "node": ">=8" | ||
| 195 | + } | ||
| 196 | + }, | ||
| 197 | + "node_modules/has-flag": { | ||
| 198 | + "version": "4.0.0", | ||
| 199 | + "resolved": "https://registry.npmmirror.com/has-flag/-/has-flag-4.0.0.tgz", | ||
| 200 | + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", | ||
| 201 | + "engines": { | ||
| 202 | + "node": ">=8" | ||
| 203 | + } | ||
| 204 | + }, | ||
| 205 | + "node_modules/iconv-lite": { | ||
| 206 | + "version": "0.4.24", | ||
| 207 | + "resolved": "https://registry.npmmirror.com/iconv-lite/-/iconv-lite-0.4.24.tgz", | ||
| 208 | + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", | ||
| 209 | + "dependencies": { | ||
| 210 | + "safer-buffer": ">= 2.1.2 < 3" | ||
| 211 | + }, | ||
| 212 | + "engines": { | ||
| 213 | + "node": ">=0.10.0" | ||
| 214 | + } | ||
| 215 | + }, | ||
| 216 | + "node_modules/ieee754": { | ||
| 217 | + "version": "1.2.1", | ||
| 218 | + "resolved": "https://registry.npmmirror.com/ieee754/-/ieee754-1.2.1.tgz", | ||
| 219 | + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" | ||
| 220 | + }, | ||
| 221 | + "node_modules/inherits": { | ||
| 222 | + "version": "2.0.4", | ||
| 223 | + "resolved": "https://registry.npmmirror.com/inherits/-/inherits-2.0.4.tgz", | ||
| 224 | + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" | ||
| 225 | + }, | ||
| 226 | + "node_modules/inquirer": { | ||
| 227 | + "version": "8.2.5", | ||
| 228 | + "resolved": "https://registry.npmmirror.com/inquirer/-/inquirer-8.2.5.tgz", | ||
| 229 | + "integrity": "sha512-QAgPDQMEgrDssk1XiwwHoOGYF9BAbUcc1+j+FhEvaOt8/cKRqyLn0U5qA6F74fGhTMGxf92pOvPBeh29jQJDTQ==", | ||
| 230 | + "dependencies": { | ||
| 231 | + "ansi-escapes": "^4.2.1", | ||
| 232 | + "chalk": "^4.1.1", | ||
| 233 | + "cli-cursor": "^3.1.0", | ||
| 234 | + "cli-width": "^3.0.0", | ||
| 235 | + "external-editor": "^3.0.3", | ||
| 236 | + "figures": "^3.0.0", | ||
| 237 | + "lodash": "^4.17.21", | ||
| 238 | + "mute-stream": "0.0.8", | ||
| 239 | + "ora": "^5.4.1", | ||
| 240 | + "run-async": "^2.4.0", | ||
| 241 | + "rxjs": "^7.5.5", | ||
| 242 | + "string-width": "^4.1.0", | ||
| 243 | + "strip-ansi": "^6.0.0", | ||
| 244 | + "through": "^2.3.6", | ||
| 245 | + "wrap-ansi": "^7.0.0" | ||
| 246 | + }, | ||
| 247 | + "engines": { | ||
| 248 | + "node": ">=12.0.0" | ||
| 249 | + } | ||
| 250 | + }, | ||
| 251 | + "node_modules/is-fullwidth-code-point": { | ||
| 252 | + "version": "3.0.0", | ||
| 253 | + "resolved": "https://registry.npmmirror.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", | ||
| 254 | + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", | ||
| 255 | + "engines": { | ||
| 256 | + "node": ">=8" | ||
| 257 | + } | ||
| 258 | + }, | ||
| 259 | + "node_modules/is-interactive": { | ||
| 260 | + "version": "1.0.0", | ||
| 261 | + "resolved": "https://registry.npmmirror.com/is-interactive/-/is-interactive-1.0.0.tgz", | ||
| 262 | + "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", | ||
| 263 | + "engines": { | ||
| 264 | + "node": ">=8" | ||
| 265 | + } | ||
| 266 | + }, | ||
| 267 | + "node_modules/is-unicode-supported": { | ||
| 268 | + "version": "0.1.0", | ||
| 269 | + "resolved": "https://registry.npmmirror.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", | ||
| 270 | + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", | ||
| 271 | + "engines": { | ||
| 272 | + "node": ">=10" | ||
| 273 | + } | ||
| 274 | + }, | ||
| 275 | + "node_modules/lodash": { | ||
| 276 | + "version": "4.17.21", | ||
| 277 | + "resolved": "https://registry.npmmirror.com/lodash/-/lodash-4.17.21.tgz", | ||
| 278 | + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" | ||
| 279 | + }, | ||
| 280 | + "node_modules/log-symbols": { | ||
| 281 | + "version": "4.1.0", | ||
| 282 | + "resolved": "https://registry.npmmirror.com/log-symbols/-/log-symbols-4.1.0.tgz", | ||
| 283 | + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", | ||
| 284 | + "dependencies": { | ||
| 285 | + "chalk": "^4.1.0", | ||
| 286 | + "is-unicode-supported": "^0.1.0" | ||
| 287 | + }, | ||
| 288 | + "engines": { | ||
| 289 | + "node": ">=10" | ||
| 290 | + } | ||
| 291 | + }, | ||
| 292 | + "node_modules/mimic-fn": { | ||
| 293 | + "version": "2.1.0", | ||
| 294 | + "resolved": "https://registry.npmmirror.com/mimic-fn/-/mimic-fn-2.1.0.tgz", | ||
| 295 | + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", | ||
| 296 | + "engines": { | ||
| 297 | + "node": ">=6" | ||
| 298 | + } | ||
| 299 | + }, | ||
| 300 | + "node_modules/mute-stream": { | ||
| 301 | + "version": "0.0.8", | ||
| 302 | + "resolved": "https://registry.npmmirror.com/mute-stream/-/mute-stream-0.0.8.tgz", | ||
| 303 | + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==" | ||
| 304 | + }, | ||
| 305 | + "node_modules/onetime": { | ||
| 306 | + "version": "5.1.2", | ||
| 307 | + "resolved": "https://registry.npmmirror.com/onetime/-/onetime-5.1.2.tgz", | ||
| 308 | + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", | ||
| 309 | + "dependencies": { | ||
| 310 | + "mimic-fn": "^2.1.0" | ||
| 311 | + }, | ||
| 312 | + "engines": { | ||
| 313 | + "node": ">=6" | ||
| 314 | + } | ||
| 315 | + }, | ||
| 316 | + "node_modules/ora": { | ||
| 317 | + "version": "5.4.1", | ||
| 318 | + "resolved": "https://registry.npmmirror.com/ora/-/ora-5.4.1.tgz", | ||
| 319 | + "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==", | ||
| 320 | + "dependencies": { | ||
| 321 | + "bl": "^4.1.0", | ||
| 322 | + "chalk": "^4.1.0", | ||
| 323 | + "cli-cursor": "^3.1.0", | ||
| 324 | + "cli-spinners": "^2.5.0", | ||
| 325 | + "is-interactive": "^1.0.0", | ||
| 326 | + "is-unicode-supported": "^0.1.0", | ||
| 327 | + "log-symbols": "^4.1.0", | ||
| 328 | + "strip-ansi": "^6.0.0", | ||
| 329 | + "wcwidth": "^1.0.1" | ||
| 330 | + }, | ||
| 331 | + "engines": { | ||
| 332 | + "node": ">=10" | ||
| 333 | + } | ||
| 334 | + }, | ||
| 335 | + "node_modules/os-tmpdir": { | ||
| 336 | + "version": "1.0.2", | ||
| 337 | + "resolved": "https://registry.npmmirror.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz", | ||
| 338 | + "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", | ||
| 339 | + "engines": { | ||
| 340 | + "node": ">=0.10.0" | ||
| 341 | + } | ||
| 342 | + }, | ||
| 343 | + "node_modules/readable-stream": { | ||
| 344 | + "version": "3.6.2", | ||
| 345 | + "resolved": "https://registry.npmmirror.com/readable-stream/-/readable-stream-3.6.2.tgz", | ||
| 346 | + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", | ||
| 347 | + "dependencies": { | ||
| 348 | + "inherits": "^2.0.3", | ||
| 349 | + "string_decoder": "^1.1.1", | ||
| 350 | + "util-deprecate": "^1.0.1" | ||
| 351 | + }, | ||
| 352 | + "engines": { | ||
| 353 | + "node": ">= 6" | ||
| 354 | + } | ||
| 355 | + }, | ||
| 356 | + "node_modules/restore-cursor": { | ||
| 357 | + "version": "3.1.0", | ||
| 358 | + "resolved": "https://registry.npmmirror.com/restore-cursor/-/restore-cursor-3.1.0.tgz", | ||
| 359 | + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", | ||
| 360 | + "dependencies": { | ||
| 361 | + "onetime": "^5.1.0", | ||
| 362 | + "signal-exit": "^3.0.2" | ||
| 363 | + }, | ||
| 364 | + "engines": { | ||
| 365 | + "node": ">=8" | ||
| 366 | + } | ||
| 367 | + }, | ||
| 368 | + "node_modules/run-async": { | ||
| 369 | + "version": "2.4.1", | ||
| 370 | + "resolved": "https://registry.npmmirror.com/run-async/-/run-async-2.4.1.tgz", | ||
| 371 | + "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", | ||
| 372 | + "engines": { | ||
| 373 | + "node": ">=0.12.0" | ||
| 374 | + } | ||
| 375 | + }, | ||
| 376 | + "node_modules/rxjs": { | ||
| 377 | + "version": "7.8.1", | ||
| 378 | + "resolved": "https://registry.npmmirror.com/rxjs/-/rxjs-7.8.1.tgz", | ||
| 379 | + "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", | ||
| 380 | + "dependencies": { | ||
| 381 | + "tslib": "^2.1.0" | ||
| 382 | + } | ||
| 383 | + }, | ||
| 384 | + "node_modules/safe-buffer": { | ||
| 385 | + "version": "5.2.1", | ||
| 386 | + "resolved": "https://registry.npmmirror.com/safe-buffer/-/safe-buffer-5.2.1.tgz", | ||
| 387 | + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" | ||
| 388 | + }, | ||
| 389 | + "node_modules/safer-buffer": { | ||
| 390 | + "version": "2.1.2", | ||
| 391 | + "resolved": "https://registry.npmmirror.com/safer-buffer/-/safer-buffer-2.1.2.tgz", | ||
| 392 | + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" | ||
| 393 | + }, | ||
| 394 | + "node_modules/signal-exit": { | ||
| 395 | + "version": "3.0.7", | ||
| 396 | + "resolved": "https://registry.npmmirror.com/signal-exit/-/signal-exit-3.0.7.tgz", | ||
| 397 | + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" | ||
| 398 | + }, | ||
| 399 | + "node_modules/string_decoder": { | ||
| 400 | + "version": "1.3.0", | ||
| 401 | + "resolved": "https://registry.npmmirror.com/string_decoder/-/string_decoder-1.3.0.tgz", | ||
| 402 | + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", | ||
| 403 | + "dependencies": { | ||
| 404 | + "safe-buffer": "~5.2.0" | ||
| 405 | + } | ||
| 406 | + }, | ||
| 407 | + "node_modules/string-width": { | ||
| 408 | + "version": "4.2.3", | ||
| 409 | + "resolved": "https://registry.npmmirror.com/string-width/-/string-width-4.2.3.tgz", | ||
| 410 | + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", | ||
| 411 | + "dependencies": { | ||
| 412 | + "emoji-regex": "^8.0.0", | ||
| 413 | + "is-fullwidth-code-point": "^3.0.0", | ||
| 414 | + "strip-ansi": "^6.0.1" | ||
| 415 | + }, | ||
| 416 | + "engines": { | ||
| 417 | + "node": ">=8" | ||
| 418 | + } | ||
| 419 | + }, | ||
| 420 | + "node_modules/strip-ansi": { | ||
| 421 | + "version": "6.0.1", | ||
| 422 | + "resolved": "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz", | ||
| 423 | + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", | ||
| 424 | + "dependencies": { | ||
| 425 | + "ansi-regex": "^5.0.1" | ||
| 426 | + }, | ||
| 427 | + "engines": { | ||
| 428 | + "node": ">=8" | ||
| 429 | + } | ||
| 430 | + }, | ||
| 431 | + "node_modules/supports-color": { | ||
| 432 | + "version": "7.2.0", | ||
| 433 | + "resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-7.2.0.tgz", | ||
| 434 | + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", | ||
| 435 | + "dependencies": { | ||
| 436 | + "has-flag": "^4.0.0" | ||
| 437 | + }, | ||
| 438 | + "engines": { | ||
| 439 | + "node": ">=8" | ||
| 440 | + } | ||
| 441 | + }, | ||
| 442 | + "node_modules/through": { | ||
| 443 | + "version": "2.3.8", | ||
| 444 | + "resolved": "https://registry.npmmirror.com/through/-/through-2.3.8.tgz", | ||
| 445 | + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==" | ||
| 446 | + }, | ||
| 447 | + "node_modules/tmp": { | ||
| 448 | + "version": "0.0.33", | ||
| 449 | + "resolved": "https://registry.npmmirror.com/tmp/-/tmp-0.0.33.tgz", | ||
| 450 | + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", | ||
| 451 | + "dependencies": { | ||
| 452 | + "os-tmpdir": "~1.0.2" | ||
| 453 | + }, | ||
| 454 | + "engines": { | ||
| 455 | + "node": ">=0.6.0" | ||
| 456 | + } | ||
| 457 | + }, | ||
| 458 | + "node_modules/tslib": { | ||
| 459 | + "version": "2.5.0", | ||
| 460 | + "resolved": "https://registry.npmmirror.com/tslib/-/tslib-2.5.0.tgz", | ||
| 461 | + "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==" | ||
| 462 | + }, | ||
| 463 | + "node_modules/type-fest": { | ||
| 464 | + "version": "0.21.3", | ||
| 465 | + "resolved": "https://registry.npmmirror.com/type-fest/-/type-fest-0.21.3.tgz", | ||
| 466 | + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", | ||
| 467 | + "engines": { | ||
| 468 | + "node": ">=10" | ||
| 469 | + } | ||
| 470 | + }, | ||
| 471 | + "node_modules/util-deprecate": { | ||
| 472 | + "version": "1.0.2", | ||
| 473 | + "resolved": "https://registry.npmmirror.com/util-deprecate/-/util-deprecate-1.0.2.tgz", | ||
| 474 | + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" | ||
| 475 | + }, | ||
| 476 | + "node_modules/wcwidth": { | ||
| 477 | + "version": "1.0.1", | ||
| 478 | + "resolved": "https://registry.npmmirror.com/wcwidth/-/wcwidth-1.0.1.tgz", | ||
| 479 | + "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==", | ||
| 480 | + "dependencies": { | ||
| 481 | + "defaults": "^1.0.3" | ||
| 482 | + } | ||
| 483 | + }, | ||
| 484 | + "node_modules/wrap-ansi": { | ||
| 485 | + "version": "7.0.0", | ||
| 486 | + "resolved": "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz", | ||
| 487 | + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", | ||
| 488 | + "dependencies": { | ||
| 489 | + "ansi-styles": "^4.0.0", | ||
| 490 | + "string-width": "^4.1.0", | ||
| 491 | + "strip-ansi": "^6.0.0" | ||
| 492 | + }, | ||
| 493 | + "engines": { | ||
| 494 | + "node": ">=10" | ||
| 495 | + } | ||
| 496 | + } | ||
| 497 | + } | ||
| 498 | +} |
package.json
0 → 100644
| 1 | +{ | ||
| 2 | + "name": "qx-cli", | ||
| 3 | + "version": "1.0.0", | ||
| 4 | + "description": "Qx CLI", | ||
| 5 | + "main": "index.js", | ||
| 6 | + "bin": { | ||
| 7 | + "qx-cli": "bin/index.js", | ||
| 8 | + "qx-cli-list": "bin/list.js", | ||
| 9 | + "qx-cli-init": "bin/init.js" | ||
| 10 | + }, | ||
| 11 | + "scripts": { | ||
| 12 | + "publish:patch": "npm version patch && npm publish", | ||
| 13 | + "publish:minor": "npm version minor && npm publish", | ||
| 14 | + "publish:major": "npm version major && npm publish" | ||
| 15 | + }, | ||
| 16 | + "author": "weimob-fe", | ||
| 17 | + "license": "ISC", | ||
| 18 | + "dependencies": { | ||
| 19 | + "chalk": "^4.1.1", | ||
| 20 | + "commander": "^7.2.0", | ||
| 21 | + "inquirer": "^8.0.0" | ||
| 22 | + } | ||
| 23 | +} |
template.json
0 → 100644
| 1 | +{ | ||
| 2 | + "qx-react-template": { | ||
| 3 | + "name": "微前端 React 模板项目", | ||
| 4 | + "repo": "http://gitlab.qgutech.com/tianqiang/micro-app-template.git", | ||
| 5 | + "branch": "master" | ||
| 6 | + }, | ||
| 7 | + "qx-custom-widget": { | ||
| 8 | + "name": "自定义组件开发模板", | ||
| 9 | + "repo": "http://gitlab.qgutech.com/qixiao/qx-custom-widget", | ||
| 10 | + "branch": "master" | ||
| 11 | + } | ||
| 12 | +} |