├── .editorconfig ├── .eslintignore ├── .eslintrc.json ├── .gitignore ├── README.md ├── firstShot ├── jye-react │ ├── .eslintrc.json │ ├── .gitignore │ ├── README.md │ ├── index.js │ ├── package-lock.json │ ├── package.json │ └── util │ │ ├── index.js │ │ └── index.txt └── jye-script │ ├── .gitignore │ ├── README.md │ ├── index.js │ ├── package-lock.json │ ├── package.json │ ├── template │ └── index.html │ ├── util │ └── index.js │ └── webpackConfig │ ├── webpack.base.js │ ├── webpack.deve.js │ └── webpack.prod.js ├── package.json ├── packages └── @chuhc │ ├── cli │ ├── README.md │ ├── bin │ │ └── chuhc.js │ ├── lib │ │ ├── PackageManager.js │ │ ├── create.js │ │ ├── update.js │ │ └── util │ │ │ ├── catchFn.js │ │ │ ├── checkVersion.js │ │ │ ├── env.js │ │ │ ├── index.js │ │ │ ├── index.txt │ │ │ ├── pkg.js │ │ │ └── writeFileTree.js │ ├── package-lock.json │ └── package.json │ ├── plugin-less │ ├── index.js │ ├── package-lock.json │ └── package.json │ ├── plugin-typescript │ ├── README.md │ ├── index.js │ ├── package-lock.json │ └── package.json │ ├── scripts │ ├── README.md │ ├── bin │ │ └── index.js │ ├── lib │ │ ├── build.js │ │ ├── config.js │ │ ├── config │ │ │ ├── webpack.base.js │ │ │ ├── webpack.deve.js │ │ │ └── webpack.prod.js │ │ ├── dev.js │ │ ├── enrty.js │ │ ├── template │ │ │ └── index.html │ │ └── util │ │ │ ├── index.js │ │ │ └── merge.js │ ├── package-lock.json │ └── package.json │ └── template │ ├── README.md │ ├── index.js │ ├── package-lock.json │ ├── package.json │ └── template │ ├── .eslintrc.json │ ├── README.md │ ├── chuhc.config.js │ ├── gitignore │ ├── src │ ├── home │ │ ├── index.css │ │ └── index.js │ └── index │ │ ├── index.css │ │ └── index.js │ └── tsconfig.json └── static └── example.gif /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | quote_type = single 11 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "parser": "@babel/eslint-parser", 3 | "env": { 4 | "commonjs": true, 5 | "es6": true, 6 | "node": true 7 | }, 8 | "parserOptions": { 9 | "ecmaVersion": 2016, 10 | "sourceType": "module" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | unpackage/ 4 | dist/ 5 | 6 | # local env files 7 | .env.local 8 | .env.*.local 9 | 10 | # Log files 11 | npm-debug.log* 12 | yarn-debug.log* 13 | yarn-error.log* 14 | 15 | # Editor directories and files 16 | .project 17 | .idea 18 | .vscode 19 | *.suo 20 | *.ntvs* 21 | *.njsproj 22 | *.sln 23 | *.sw* 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # chuhc-cli 脚手架 2 | 3 | ## 安装 4 | 5 | ``` 6 | $ npm i @chuhc/cli -g 7 | $ chuhc create test 8 | ``` 9 | 10 | ## 前言 11 | 12 | [掘金文章](https://juejin.im/post/6882681067971543047) 13 | 14 | 后面去看了`@vue/cli`的源码,不得不说,确实很正式很规范化。参考了@vue/cli 的部分功能,对脚手架进行修改。 15 | 16 | ## 效果栗子 17 | 18 | ![image](https://github.com/cjj281795819/chuhc-react/blob/master/static/example.gif) 19 | 20 | ## 项目结构 21 | 22 | 项目`chuhc-react`的结构分成了四个部分: 23 | 24 | - `@chuhc/cli` 脚手架命令行内容,通过命令去初始化项目等等操作。 25 | - `@chuhc/scripts` 项目编译运行打包内容,暂未接入部署等流程。 26 | - `@chuhc/template` 模板文件。 27 | - `@chuhc/plugin-xxx` 项目封装的插件,例如`@chuhc/plugin-typescript`等等。 28 | 29 | ## cli 30 | 31 | 之前是直接通过`inquirer`的一些交互命令,获取信息后,通过`download-git-repo`去对应`github`拉取模板文件,这样虽然比较简单,但是多个模板的话,维护就很难受了。 32 | 33 | 而在`@vue/cli`里,是通过多个插件组合成一个整体模板,在很多脚手架根目录下,都有一个`xxx.config.js`暴露出来。然后在运行`node`命令时,去读取配置文件,根据配置文件的内容去进行对应操作,例如:使用`webpack-chain`动态修改`config`,最后再调用`toConfig`去生成新的`webpack`配置内容。 34 | 35 | ### 插件判断,生成 pkg 36 | 37 | 一个基本的`package.json`模板,除了常规不变的`version`、`private`、`license`等等,像`name`,`scripts`,`dependencies`,`devDependencies`需要我们去手动添加进去。 38 | 39 | `name`就使用脚手架初始化传入的参数,而`scripts`则是在成功引入`@chuhc/scripts`后,使用其运行命令。 40 | 41 | 像一些必备的,例如`react`,`react-dom`,我们可以直接放到`dependencies`里,而`devDependencies`一般是初始化时,用户手动选择的`plugins`。 42 | 43 | 借助`inquirer`去罗列插件,让用户选择需要引入哪些插件。 44 | 45 | ```javascript 46 | const CHUHC_PLUGIN_CHECK = [ 47 | { 48 | name: 'Typescript', 49 | value: ['tsx', '@chuhc/plugin-typescript'], 50 | }, 51 | { 52 | name: 'Less', 53 | value: ['less', '@chuhc/plugin-less'], 54 | }, 55 | ]; 56 | 57 | const { plugins } = await inquirer.prompt([ 58 | { 59 | type: 'checkbox', 60 | name: 'plugins', 61 | message: 'Do you need these plugins', 62 | choices: CHUHC_PLUGIN_CHECK, // 一个结构,自己觉得怎么处理方便,怎么来 63 | }, 64 | ]); 65 | ``` 66 | 67 | 那么根据上面的`code`就可以获取到,用户需要哪些`plugin`了,那么可以将这些`plugin`放入到`json`的`devDependencies`里。 68 | 69 | ### 获取依赖最新版本 70 | 71 | 上述无论是`react`还是`plugin`,都需要一个版本号,我这里是采用命令行去获取最新版本,然后作为其`value`值。如果直接遍历运行`execSync`的话,会阻塞住,`ora`的`loading`也要卡着不动,于是选择`promise`去运行,通过`exec`回调来结束`promise`。 72 | 73 | ```javascript 74 | const forEachSetV = (list, obj, key) => { 75 | const promises = []; 76 | const manager = hasCnpm() ? 'cnpm' : 'npm'; // 判断选择cnpm还是npm 77 | 78 | list.forEach((item) => { 79 | if (typeof item === 'object') { 80 | return forEachSetV(item, obj, key); 81 | } 82 | 83 | const newPromise = new Promise((res) => { 84 | exec(`${manager} view ${item} version`, (err, stdout, stderr) => { 85 | obj[key][item] = stdout.slice(0, stdout.length - 1); 86 | res(0); 87 | }); 88 | }); 89 | 90 | promises.push(newPromise); 91 | }); 92 | 93 | return promises; 94 | }; 95 | 96 | const promise = [ 97 | ...forEachSetV(depe, pkg, 'dependencies'), 98 | ...forEachSetV(devD, pkg, 'devDependencies'), 99 | ]; 100 | await Promise.all(promise); 101 | ``` 102 | 103 | 那么就获取到版本号后,再将其他数据一同填入到`json`中,将其作为`package.json`的值,在新项目目录下,新建它。 104 | 105 | ```javascript 106 | const fs = require('fs-extra'); // fs-extra是系统fs模块的扩展 107 | const path = require('path'); 108 | 109 | module.exports = (dir, files) => { 110 | Object.keys(files).forEach((name) => { 111 | const pathName = path.join(dir, name); 112 | fs.ensureDirSync(path.dirname(pathName)); // 如果没有文件夹则新建文件夹 113 | fs.writeFileSync(pathName, files[name]); // 新建文件 114 | }); 115 | }; 116 | 117 | writeFileTree(targetDir, { 118 | 'package.json': JSON.stringify(pkg, null, 2), 119 | }); 120 | ``` 121 | 122 | ### 选择包管理工具 123 | 124 | 因为`npm`的速度不甚理想,可以将其作为兜底处理。先判断当前环境中,是否有`yarn`、`cnpm`等等,然后优先选择前者,若都没有,则再使用`npm`进行操作。 125 | 126 | ```javascript 127 | const PM_CONFIG = { 128 | npm: { 129 | install: ['install', '--loglevel', 'error'], // 打印error信息 130 | remove: ['uninstall', '--loglevel', 'error'], 131 | }, 132 | yarn: { 133 | install: [], 134 | remove: ['remove'], 135 | }, 136 | }; 137 | PM_CONFIG.cnpm = PM_CONFIG.npm; 138 | 139 | module.exports = class PackageManager { 140 | constructor({ pkgName }) { 141 | this.pkgName = pkgName; 142 | 143 | if (hasYarn()) { 144 | this.bin = 'yarn'; 145 | } else if (hasCnpm()) { 146 | this.bin = 'cnpm'; 147 | } else { 148 | this.bin = 'npm'; 149 | } 150 | } 151 | 152 | // 封装了下运行命令函数 153 | runCommand(command, args = []) { 154 | const _commands = [this.bin, ...PM_CONFIG[this.bin][command], ...args]; 155 | execSync(_commands.join(' '), { stdio: [0, 1, 2] }); 156 | } 157 | 158 | install() { 159 | try { 160 | this.runCommand('install', ['--offline']); // offline指先去拉取缓存区里的,如果没有则去服务器拉 161 | } catch (e) { 162 | this.runCommand('install'); // 报错兜底 163 | } 164 | } 165 | 166 | git() { 167 | try { 168 | execSync('git init'); 169 | return true; 170 | } catch (e) { 171 | return false; 172 | } 173 | } 174 | }; 175 | ``` 176 | 177 | 而判断`yarn`和`cnpm`环境中是否存在,可以通过判断`version`等等方法,去看是否能够成功执行,若成功执行,则说明环境中存在,反之则否。 178 | 179 | ```javascript 180 | const judgeEnv = (name) => { 181 | const envKey = `_has${name[0].toUpperCase()}${name.slice(1)}`; // 保存下结果 182 | 183 | if (_env[envKey] !== null) { 184 | return _env[envKey]; 185 | } 186 | 187 | try { 188 | execSync(`${name} --version`, { stdio: 'ignore' }); // 不打印信息 189 | 190 | return (_env[envKey] = true); 191 | } catch (e) { 192 | return (_env[envKey] = false); 193 | } 194 | }; 195 | 196 | const hasYarn = judgeEnv.bind(this, 'yarn'); 197 | 198 | const hasCnpm = judgeEnv.bind(this, 'cnpm'); 199 | ``` 200 | 201 | 然后通过`install`方法去安装依赖,再将一些参数传递给`@chuhc/template`去把一些基本模板复制过去。 202 | 203 | ## scripts 204 | 205 | 因为是多页面项目,`scripts`里主要做了以下几件事情: 206 | 207 | - 通过`glob`去匹配入口,然后将其作为`entry`动态传入,并动态传入多个`html-webpack-plugin`给`plugins`。 208 | - 通过读取项目根目录下的`chuhc.config.js`文件,来动态修改`webpack`配置内容并调用对应的插件。 209 | - 最后生成最终的`webpack`配置文件,传入给`webpack`去进行编译运行打包等等操作。 210 | 211 | ### 匹配入口 212 | 213 | 匹配入口主要使用`glob`去匹配,只有满足匹配要求,才作为入口。然后通过匹配到的信息,去生成对应的`entry`内容,和`plugin`内容,传递给`webpack`配置文件。 214 | 215 | ```javascript 216 | const SRC = './src/**/index.?(js|jsx|ts|tsx)'; 217 | /** 218 | * get webpack entry 219 | */ 220 | const getEntries = () => { 221 | if (entries) return entries; 222 | entries = {}; 223 | 224 | const pages = glob.sync(SRC); 225 | pages.forEach((page) => { 226 | // 遍历传entry 227 | const dirname = path.dirname(page); 228 | const entry = path.basename(dirname); 229 | entries[entry] = page; 230 | }); 231 | return entries; 232 | }; 233 | 234 | /** 235 | * get pages info 236 | * @param {Boolean} isProd 237 | */ 238 | const getPages = (isProd) => { 239 | const plugins = []; 240 | let entries = getEntries(); 241 | 242 | Object.keys(entries).map((dirname) => { 243 | // 遍历传plugin 244 | plugins.push( 245 | new HtmlWebpackPlugin({ 246 | chunks: isProd ? ['libs', dirname] : [dirname], 247 | filename: `./${dirname}/index.html`, 248 | template: path.join(__dirname, './template/index.html'), 249 | }) 250 | ); 251 | }); 252 | 253 | return plugins; 254 | }; 255 | ``` 256 | 257 | ### 链式配置 config 258 | 259 | 链式配置推荐使用[webpack-chain](https://github.com/Yatoo2018/webpack-chain/tree/zh-cmn-Hans),`@vue/cli`也是使用它。因为我们原本就有一些基本配置内容,可以通过`config.merge`将我们已有的配置对象合并到配置实例中。 260 | 261 | 但是不支持直接转化,需要我们对某些配置内容,进行手动去转化,例如:`module`。而`plugins`不支持已经`new`的`plugin`,我这边的处理是跳过对`plugin`的合并,最后再使用`webpack-merge`将`config.toConfig()`和`plugins`再合并成最终的配置对象。 262 | 263 | ```javascript 264 | const Config = require('webpack-chain'); 265 | const chuhcConfig = require(`${process.cwd()}/chuhc.config.js`); // 读取根目录的配置文件 266 | const { setBaseConfig } = require('./util/merge'); // 将已有的配置文件对象合并到配置实例 267 | const BASE = require('./config/webpack.base'); // 配置对象base 268 | const DEVE = merge(BASE, require('./config/webpack.deve')); // 配置对象 deve 269 | const PROD = merge(BASE, require('./config/webpack.prod')); // 配置对象 prod 270 | 271 | const config = new Config(); 272 | 273 | // 我这边就只是对plugin做一下处理,可以做其他很多事情,这里只是举个例子 274 | const handleChuhcConfig = ({ plugins } = {}) => { 275 | // to do sth. 276 | if (plugins) { 277 | plugins.forEach((plugin) => { 278 | require(plugin[0])(config, plugin[1]); 279 | }); 280 | } 281 | }; 282 | 283 | const getConfig = (isDeve) => { 284 | config.clear(); // 清除配置 285 | 286 | setBaseConfig(isDeve ? DEVE : PROD, config); 287 | handleChuhcConfig(chuhcConfig); 288 | 289 | return merge(config.toConfig(), { 290 | plugins: isDeve ? DEVE.plugins : PROD.plugins, 291 | }); // 最后再合并 292 | }; 293 | ``` 294 | 295 | ### 编译运行 296 | 297 | 在获取到`webpack config`后,那么可以根据是`dev`命令还是`build`命令,去调用对应的函数,进行编译运行打包等等操作了。(同理,根据`program.command`) 298 | 299 | ```javascript 300 | // dev 运行 301 | const webpack = require('webpack'); 302 | const WebpackDevServer = require('webpack-dev-server'); 303 | const { getDeveConfig } = require('./config'); 304 | 305 | module.exports = () => { 306 | const DEVE_CONFIG = getDeveConfig(); 307 | const { devServer } = DEVE_CONFIG; 308 | const compiler = webpack(DEVE_CONFIG); 309 | const server = new WebpackDevServer(compiler, { ...devServer }); 310 | server.listen(devServer.port); 311 | }; 312 | ``` 313 | 314 | ```javascript 315 | // build 316 | const webpack = require('webpack'); 317 | const { getProdConfig } = require('./config'); 318 | const logSymbols = require('log-symbols'); 319 | 320 | module.exports = () => { 321 | const PROD_CONFIG = getProdConfig(); 322 | const compiler = webpack(PROD_CONFIG); 323 | 324 | compiler.run((err, stats) => { 325 | if (err) { 326 | // 回调中接收错误信息。 327 | console.error(err); 328 | } else { 329 | console.log(logSymbols.success, '打包成功!'); 330 | } 331 | }); 332 | }; 333 | ``` 334 | 335 | ## template 336 | 337 | `template`主要就是通过传入的参数,来判断是否要`copy`对应的文件,同时根据`options`来去修改对应文件内容和后缀。代码过于无趣,就不贴了。 338 | 339 | ## plugin-xx 340 | 341 | `plugin`的话,可以做的事情比较多,我这边目前就只是来链式修改`webpack`配置信息。这只是其中一种功能,还有很多例如:自己写一个`webpack plugin / loader`去传入,去做一些其他事情。 342 | 343 | ```javascript 344 | // example 345 | module.exports = (config) => { 346 | ['.tsx', '.ts'].forEach((item) => config.resolve.extensions.add(item)); 347 | 348 | config.module 349 | .rule('js') 350 | .test(/\.(js|ts|tsx|jsx)$/) 351 | .use('babel-loader') 352 | .tap((options) => { 353 | options.presets.push('@babel/preset-typescript'); 354 | return options; 355 | }); 356 | }; 357 | ``` 358 | -------------------------------------------------------------------------------- /firstShot/jye-react/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "parser": "@babel/eslint-parser", 3 | "env": { 4 | "commonjs": true, 5 | "es6": true, 6 | "node": true 7 | }, 8 | "parserOptions": { 9 | "ecmaVersion": 2016, 10 | "sourceType": "module" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /firstShot/jye-react/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | unpackage/ 4 | dist/ 5 | 6 | # local env files 7 | .env.local 8 | .env.*.local 9 | 10 | # Log files 11 | npm-debug.log* 12 | yarn-debug.log* 13 | yarn-error.log* 14 | 15 | # Editor directories and files 16 | .project 17 | .idea 18 | .vscode 19 | *.suo 20 | *.ntvs* 21 | *.njsproj 22 | *.sln 23 | *.sw* 24 | -------------------------------------------------------------------------------- /firstShot/jye-react/README.md: -------------------------------------------------------------------------------- 1 | # jye-react 脚手架 2 | 3 | 通过命令行创建项目,目前提供 ts / js 模板 4 | 5 | ``` 6 | $ jye-react init 7 | ``` 8 | -------------------------------------------------------------------------------- /firstShot/jye-react/index.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | const path = require('path'); 4 | const fs = require('fs'); 5 | const program = require('commander'); 6 | const packageJson = require('./package.json'); 7 | const download = require('download-git-repo'); 8 | const inputer = require('inquirer'); 9 | const ora = require('ora'); 10 | const logSymbols = require('log-symbols'); 11 | const semver = require('semver'); 12 | const colors = require('colors'); 13 | const { checkTime } = require('./util'); 14 | const { exec } = require('child_process'); 15 | 16 | const loading = ora('Loading unicorns'); 17 | 18 | program.version(packageJson.version, '-v, --version'); 19 | 20 | const LANG_LIST = { 21 | typescript: 'master', 22 | javascript: 'lang/js', 23 | }; 24 | 25 | // 该github库已经删除,请改成自己的github 26 | const downloadAdress = (lang) => 27 | `cjj281795819/jiangyuer-react#${LANG_LIST[lang]}`; 28 | 29 | const downloadCallback = async (answer, err) => { 30 | loading.stop(); 31 | 32 | if (err) { 33 | console.log(logSymbols.error, '我好像遇到问题了'); 34 | return; 35 | } 36 | 37 | console.log(logSymbols.success, '项目创建成功!'); 38 | 39 | const filename = `${answer.name}/package.json`; 40 | 41 | if (fs.existsSync(filename)) { 42 | let _newPagJson = fs.readFileSync(filename).toString(); 43 | 44 | _newPagJson = JSON.parse(_newPagJson); 45 | 46 | _newPagJson.name = answer.name; 47 | _newPagJson.author = answer.author; 48 | _newPagJson.description = answer.description; 49 | 50 | _newPagJson = JSON.stringify(_newPagJson, null, '\t'); 51 | 52 | fs.writeFileSync(filename, _newPagJson); 53 | 54 | loading.color = 'green'; 55 | loading.text = '正在疯狂为你拉node_modules'; 56 | 57 | loading.start(); 58 | 59 | const pullNodeModules = new Promise((res) => { 60 | process.chdir(path.join(process.cwd(), answer.name)); 61 | exec('npm i', () => { 62 | res(1); 63 | }); 64 | }); 65 | 66 | await pullNodeModules; 67 | 68 | loading.stop(); 69 | 70 | console.log(logSymbols.success, '成功了同学,来吧,展示!'); 71 | console.log(` 72 | `); 73 | console.log(logSymbols.info, `first setp:$ cd ${answer.name}`.blue); 74 | console.log(logSymbols.info, `second setp:$ npm run dev`.blue); 75 | console.log(` 76 | `); 77 | } else { 78 | console.log(logSymbols.error, '我好像遇到问题了'); 79 | } 80 | }; 81 | 82 | program 83 | .command('init') 84 | .description('初始化项目') 85 | .action(async () => { 86 | const checkResult = checkTime(); 87 | 88 | if (checkResult && semver.gt(checkResult, packageJson.version)) { 89 | console.log( 90 | logSymbols.error, 91 | `当前版本过低,请及时更新版本至${checkResult}` 92 | ); 93 | 94 | process.exit(1); 95 | } 96 | 97 | const answer = await inputer.prompt([ 98 | { 99 | type: 'input', 100 | name: 'name', 101 | message: '请输入项目名称', 102 | }, 103 | { 104 | type: 'input', 105 | name: 'author', 106 | message: '请输入项目作者名', 107 | }, 108 | { 109 | type: 'input', 110 | name: 'description', 111 | message: '请输入项目介绍', 112 | }, 113 | { 114 | type: 'list', 115 | message: '使用哪种语言进行开发', 116 | name: 'lang', 117 | choices: ['typescript', 'javascript'], 118 | }, 119 | ]); 120 | 121 | download( 122 | downloadAdress(answer.lang), 123 | `./${answer.name}`, 124 | downloadCallback.bind(null, answer) 125 | ); 126 | 127 | loading.color = 'green'; 128 | loading.text = '我正在疯狂为你加载中'; 129 | loading.start(); 130 | }); 131 | 132 | program.on('command:*', function () { 133 | console.log('请输入help查阅指令'); 134 | process.exit(1); 135 | }); 136 | 137 | program.parse(process.argv); 138 | -------------------------------------------------------------------------------- /firstShot/jye-react/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jye-react", 3 | "version": "1.0.6", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "@sindresorhus/is": { 8 | "version": "0.7.0", 9 | "resolved": "http://bnpm.byted.org/@sindresorhus/is/download/@sindresorhus/is-0.7.0.tgz", 10 | "integrity": "sha1-mgb08TfuhNffBGDB/bETX/psUP0=" 11 | }, 12 | "@types/color-name": { 13 | "version": "1.1.1", 14 | "resolved": "http://bnpm.byted.org/@types/color-name/download/@types/color-name-1.1.1.tgz", 15 | "integrity": "sha1-HBJhu+qhCoBVu8XYq4S3sq/IRqA=" 16 | }, 17 | "ansi-escapes": { 18 | "version": "4.3.1", 19 | "resolved": "http://bnpm.byted.org/ansi-escapes/download/ansi-escapes-4.3.1.tgz", 20 | "integrity": "sha1-pcR8xDGB8fOP/XB2g3cA05VSKmE=", 21 | "requires": { 22 | "type-fest": "^0.11.0" 23 | } 24 | }, 25 | "ansi-regex": { 26 | "version": "5.0.0", 27 | "resolved": "http://bnpm.byted.org/ansi-regex/download/ansi-regex-5.0.0.tgz", 28 | "integrity": "sha1-OIU59VF5vzkznIGvMKZU1p+Hy3U=" 29 | }, 30 | "ansi-styles": { 31 | "version": "4.2.1", 32 | "resolved": "http://bnpm.byted.org/ansi-styles/download/ansi-styles-4.2.1.tgz", 33 | "integrity": "sha1-kK51xCTQCNJiTFvynq0xd+v881k=", 34 | "requires": { 35 | "@types/color-name": "^1.1.1", 36 | "color-convert": "^2.0.1" 37 | } 38 | }, 39 | "archive-type": { 40 | "version": "4.0.0", 41 | "resolved": "http://bnpm.byted.org/archive-type/download/archive-type-4.0.0.tgz", 42 | "integrity": "sha1-+S5yIzBW38aWlHJ0nCZ72wRrHXA=", 43 | "requires": { 44 | "file-type": "^4.2.0" 45 | }, 46 | "dependencies": { 47 | "file-type": { 48 | "version": "4.4.0", 49 | "resolved": "http://bnpm.byted.org/file-type/download/file-type-4.4.0.tgz", 50 | "integrity": "sha1-G2AOX8ofvcboDApwxxyNul95BsU=" 51 | } 52 | } 53 | }, 54 | "balanced-match": { 55 | "version": "1.0.0", 56 | "resolved": "http://bnpm.byted.org/balanced-match/download/balanced-match-1.0.0.tgz", 57 | "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" 58 | }, 59 | "base64-js": { 60 | "version": "1.3.1", 61 | "resolved": "http://bnpm.byted.org/base64-js/download/base64-js-1.3.1.tgz", 62 | "integrity": "sha1-WOzoy3XdB+ce0IxzarxfrE2/jfE=" 63 | }, 64 | "bl": { 65 | "version": "1.2.2", 66 | "resolved": "http://bnpm.byted.org/bl/download/bl-1.2.2.tgz", 67 | "integrity": "sha1-oWCRFxcQPAdBDO9j71Gzl8Alr5w=", 68 | "requires": { 69 | "readable-stream": "^2.3.5", 70 | "safe-buffer": "^5.1.1" 71 | } 72 | }, 73 | "brace-expansion": { 74 | "version": "1.1.11", 75 | "resolved": "http://bnpm.byted.org/brace-expansion/download/brace-expansion-1.1.11.tgz", 76 | "integrity": "sha1-PH/L9SnYcibz0vUrlm/1Jx60Qd0=", 77 | "requires": { 78 | "balanced-match": "^1.0.0", 79 | "concat-map": "0.0.1" 80 | } 81 | }, 82 | "buffer": { 83 | "version": "5.6.0", 84 | "resolved": "http://bnpm.byted.org/buffer/download/buffer-5.6.0.tgz", 85 | "integrity": "sha1-oxdJ3H2B2E2wir+Te2uMQDP2J4Y=", 86 | "requires": { 87 | "base64-js": "^1.0.2", 88 | "ieee754": "^1.1.4" 89 | } 90 | }, 91 | "buffer-alloc": { 92 | "version": "1.2.0", 93 | "resolved": "http://bnpm.byted.org/buffer-alloc/download/buffer-alloc-1.2.0.tgz", 94 | "integrity": "sha1-iQ3ZDZI6hz4I4Q5f1RpX5bfM4Ow=", 95 | "requires": { 96 | "buffer-alloc-unsafe": "^1.1.0", 97 | "buffer-fill": "^1.0.0" 98 | } 99 | }, 100 | "buffer-alloc-unsafe": { 101 | "version": "1.1.0", 102 | "resolved": "http://bnpm.byted.org/buffer-alloc-unsafe/download/buffer-alloc-unsafe-1.1.0.tgz", 103 | "integrity": "sha1-vX3CauKXLQ7aJTvgYdupkjScGfA=" 104 | }, 105 | "buffer-crc32": { 106 | "version": "0.2.13", 107 | "resolved": "http://bnpm.byted.org/buffer-crc32/download/buffer-crc32-0.2.13.tgz", 108 | "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=" 109 | }, 110 | "buffer-fill": { 111 | "version": "1.0.0", 112 | "resolved": "http://bnpm.byted.org/buffer-fill/download/buffer-fill-1.0.0.tgz", 113 | "integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw=" 114 | }, 115 | "cacheable-request": { 116 | "version": "2.1.4", 117 | "resolved": "http://bnpm.byted.org/cacheable-request/download/cacheable-request-2.1.4.tgz", 118 | "integrity": "sha1-DYCIAbY0KtM8kd+dC0TcCbkeXD0=", 119 | "requires": { 120 | "clone-response": "1.0.2", 121 | "get-stream": "3.0.0", 122 | "http-cache-semantics": "3.8.1", 123 | "keyv": "3.0.0", 124 | "lowercase-keys": "1.0.0", 125 | "normalize-url": "2.0.1", 126 | "responselike": "1.0.2" 127 | }, 128 | "dependencies": { 129 | "lowercase-keys": { 130 | "version": "1.0.0", 131 | "resolved": "http://bnpm.byted.org/lowercase-keys/download/lowercase-keys-1.0.0.tgz", 132 | "integrity": "sha1-TjNms55/VFfjXxMkvfb4jQv8cwY=" 133 | } 134 | } 135 | }, 136 | "caw": { 137 | "version": "2.0.1", 138 | "resolved": "http://bnpm.byted.org/caw/download/caw-2.0.1.tgz", 139 | "integrity": "sha1-bDygcfwZRyCIPC3F2psHS/x+npU=", 140 | "requires": { 141 | "get-proxy": "^2.0.0", 142 | "isurl": "^1.0.0-alpha5", 143 | "tunnel-agent": "^0.6.0", 144 | "url-to-options": "^1.0.1" 145 | } 146 | }, 147 | "chalk": { 148 | "version": "4.1.0", 149 | "resolved": "http://bnpm.byted.org/chalk/download/chalk-4.1.0.tgz", 150 | "integrity": "sha1-ThSHCmGNni7dl92DRf2dncMVZGo=", 151 | "requires": { 152 | "ansi-styles": "^4.1.0", 153 | "supports-color": "^7.1.0" 154 | } 155 | }, 156 | "chardet": { 157 | "version": "0.7.0", 158 | "resolved": "http://bnpm.byted.org/chardet/download/chardet-0.7.0.tgz", 159 | "integrity": "sha1-kAlISfCTfy7twkJdDSip5fDLrZ4=" 160 | }, 161 | "cli-cursor": { 162 | "version": "3.1.0", 163 | "resolved": "http://bnpm.byted.org/cli-cursor/download/cli-cursor-3.1.0.tgz", 164 | "integrity": "sha1-JkMFp65JDR0Dvwybp8kl0XU68wc=", 165 | "requires": { 166 | "restore-cursor": "^3.1.0" 167 | } 168 | }, 169 | "cli-width": { 170 | "version": "3.0.0", 171 | "resolved": "http://bnpm.byted.org/cli-width/download/cli-width-3.0.0.tgz", 172 | "integrity": "sha1-ovSEN6LKqaIkNueUvwceyeYc7fY=" 173 | }, 174 | "clone-response": { 175 | "version": "1.0.2", 176 | "resolved": "http://bnpm.byted.org/clone-response/download/clone-response-1.0.2.tgz", 177 | "integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=", 178 | "requires": { 179 | "mimic-response": "^1.0.0" 180 | } 181 | }, 182 | "color-convert": { 183 | "version": "2.0.1", 184 | "resolved": "http://bnpm.byted.org/color-convert/download/color-convert-2.0.1.tgz", 185 | "integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=", 186 | "requires": { 187 | "color-name": "~1.1.4" 188 | } 189 | }, 190 | "color-name": { 191 | "version": "1.1.4", 192 | "resolved": "http://bnpm.byted.org/color-name/download/color-name-1.1.4.tgz", 193 | "integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=" 194 | }, 195 | "colors": { 196 | "version": "1.4.0", 197 | "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", 198 | "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==" 199 | }, 200 | "commander": { 201 | "version": "6.0.0", 202 | "resolved": "http://bnpm.byted.org/commander/download/commander-6.0.0.tgz", 203 | "integrity": "sha1-KycNqU+PuQFEVTEvgpoRKdv4iH4=" 204 | }, 205 | "concat-map": { 206 | "version": "0.0.1", 207 | "resolved": "http://bnpm.byted.org/concat-map/download/concat-map-0.0.1.tgz", 208 | "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" 209 | }, 210 | "config-chain": { 211 | "version": "1.1.12", 212 | "resolved": "http://bnpm.byted.org/config-chain/download/config-chain-1.1.12.tgz", 213 | "integrity": "sha1-D96NCRIA616AjK8l/mGMAvSOTvo=", 214 | "requires": { 215 | "ini": "^1.3.4", 216 | "proto-list": "~1.2.1" 217 | } 218 | }, 219 | "content-disposition": { 220 | "version": "0.5.3", 221 | "resolved": "http://bnpm.byted.org/content-disposition/download/content-disposition-0.5.3.tgz", 222 | "integrity": "sha1-4TDK9+cnkIfFYWwgB9BIVpiYT70=", 223 | "requires": { 224 | "safe-buffer": "5.1.2" 225 | }, 226 | "dependencies": { 227 | "safe-buffer": { 228 | "version": "5.1.2", 229 | "resolved": "http://bnpm.byted.org/safe-buffer/download/safe-buffer-5.1.2.tgz", 230 | "integrity": "sha1-mR7GnSluAxN0fVm9/St0XDX4go0=" 231 | } 232 | } 233 | }, 234 | "core-util-is": { 235 | "version": "1.0.2", 236 | "resolved": "http://bnpm.byted.org/core-util-is/download/core-util-is-1.0.2.tgz", 237 | "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" 238 | }, 239 | "decode-uri-component": { 240 | "version": "0.2.0", 241 | "resolved": "http://bnpm.byted.org/decode-uri-component/download/decode-uri-component-0.2.0.tgz", 242 | "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=" 243 | }, 244 | "decompress": { 245 | "version": "4.2.1", 246 | "resolved": "http://bnpm.byted.org/decompress/download/decompress-4.2.1.tgz", 247 | "integrity": "sha1-AH9VzGpiwFWvo3wH62pO4bdz8Rg=", 248 | "requires": { 249 | "decompress-tar": "^4.0.0", 250 | "decompress-tarbz2": "^4.0.0", 251 | "decompress-targz": "^4.0.0", 252 | "decompress-unzip": "^4.0.1", 253 | "graceful-fs": "^4.1.10", 254 | "make-dir": "^1.0.0", 255 | "pify": "^2.3.0", 256 | "strip-dirs": "^2.0.0" 257 | }, 258 | "dependencies": { 259 | "pify": { 260 | "version": "2.3.0", 261 | "resolved": "http://bnpm.byted.org/pify/download/pify-2.3.0.tgz", 262 | "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" 263 | } 264 | } 265 | }, 266 | "decompress-response": { 267 | "version": "3.3.0", 268 | "resolved": "http://bnpm.byted.org/decompress-response/download/decompress-response-3.3.0.tgz", 269 | "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", 270 | "requires": { 271 | "mimic-response": "^1.0.0" 272 | } 273 | }, 274 | "decompress-tar": { 275 | "version": "4.1.1", 276 | "resolved": "http://bnpm.byted.org/decompress-tar/download/decompress-tar-4.1.1.tgz", 277 | "integrity": "sha1-cYy9P8sWIJcW5womuE57pFkuWvE=", 278 | "requires": { 279 | "file-type": "^5.2.0", 280 | "is-stream": "^1.1.0", 281 | "tar-stream": "^1.5.2" 282 | }, 283 | "dependencies": { 284 | "file-type": { 285 | "version": "5.2.0", 286 | "resolved": "http://bnpm.byted.org/file-type/download/file-type-5.2.0.tgz", 287 | "integrity": "sha1-LdvqfHP/42No365J3DOMBYwritY=" 288 | } 289 | } 290 | }, 291 | "decompress-tarbz2": { 292 | "version": "4.1.1", 293 | "resolved": "http://bnpm.byted.org/decompress-tarbz2/download/decompress-tarbz2-4.1.1.tgz", 294 | "integrity": "sha1-MIKluIDqQEOBY0nzeLVsUWvho5s=", 295 | "requires": { 296 | "decompress-tar": "^4.1.0", 297 | "file-type": "^6.1.0", 298 | "is-stream": "^1.1.0", 299 | "seek-bzip": "^1.0.5", 300 | "unbzip2-stream": "^1.0.9" 301 | }, 302 | "dependencies": { 303 | "file-type": { 304 | "version": "6.2.0", 305 | "resolved": "http://bnpm.byted.org/file-type/download/file-type-6.2.0.tgz", 306 | "integrity": "sha1-5QzXXTVv/tTjBtxPW89Sp5kDqRk=" 307 | } 308 | } 309 | }, 310 | "decompress-targz": { 311 | "version": "4.1.1", 312 | "resolved": "http://bnpm.byted.org/decompress-targz/download/decompress-targz-4.1.1.tgz", 313 | "integrity": "sha1-wJvDXE0R894J8tLaU+neI+fOHu4=", 314 | "requires": { 315 | "decompress-tar": "^4.1.1", 316 | "file-type": "^5.2.0", 317 | "is-stream": "^1.1.0" 318 | }, 319 | "dependencies": { 320 | "file-type": { 321 | "version": "5.2.0", 322 | "resolved": "http://bnpm.byted.org/file-type/download/file-type-5.2.0.tgz", 323 | "integrity": "sha1-LdvqfHP/42No365J3DOMBYwritY=" 324 | } 325 | } 326 | }, 327 | "decompress-unzip": { 328 | "version": "4.0.1", 329 | "resolved": "http://bnpm.byted.org/decompress-unzip/download/decompress-unzip-4.0.1.tgz", 330 | "integrity": "sha1-3qrM39FK6vhVePczroIQ+bSEj2k=", 331 | "requires": { 332 | "file-type": "^3.8.0", 333 | "get-stream": "^2.2.0", 334 | "pify": "^2.3.0", 335 | "yauzl": "^2.4.2" 336 | }, 337 | "dependencies": { 338 | "file-type": { 339 | "version": "3.9.0", 340 | "resolved": "http://bnpm.byted.org/file-type/download/file-type-3.9.0.tgz", 341 | "integrity": "sha1-JXoHg4TR24CHvESdEH1SpSZyuek=" 342 | }, 343 | "get-stream": { 344 | "version": "2.3.1", 345 | "resolved": "http://bnpm.byted.org/get-stream/download/get-stream-2.3.1.tgz", 346 | "integrity": "sha1-Xzj5PzRgCWZu4BUKBUFn+Rvdld4=", 347 | "requires": { 348 | "object-assign": "^4.0.1", 349 | "pinkie-promise": "^2.0.0" 350 | } 351 | }, 352 | "pify": { 353 | "version": "2.3.0", 354 | "resolved": "http://bnpm.byted.org/pify/download/pify-2.3.0.tgz", 355 | "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" 356 | } 357 | } 358 | }, 359 | "download": { 360 | "version": "7.1.0", 361 | "resolved": "http://bnpm.byted.org/download/download/download-7.1.0.tgz", 362 | "integrity": "sha1-kFmqnXC1A+52oTKJe+beyOVYcjM=", 363 | "requires": { 364 | "archive-type": "^4.0.0", 365 | "caw": "^2.0.1", 366 | "content-disposition": "^0.5.2", 367 | "decompress": "^4.2.0", 368 | "ext-name": "^5.0.0", 369 | "file-type": "^8.1.0", 370 | "filenamify": "^2.0.0", 371 | "get-stream": "^3.0.0", 372 | "got": "^8.3.1", 373 | "make-dir": "^1.2.0", 374 | "p-event": "^2.1.0", 375 | "pify": "^3.0.0" 376 | } 377 | }, 378 | "download-git-repo": { 379 | "version": "3.0.2", 380 | "resolved": "http://bnpm.byted.org/download-git-repo/download/download-git-repo-3.0.2.tgz", 381 | "integrity": "sha1-jKriT7Kr1kUxct7qVhkDYCTxkPY=", 382 | "requires": { 383 | "download": "^7.1.0", 384 | "git-clone": "^0.1.0", 385 | "rimraf": "^3.0.0" 386 | } 387 | }, 388 | "duplexer3": { 389 | "version": "0.1.4", 390 | "resolved": "http://bnpm.byted.org/duplexer3/download/duplexer3-0.1.4.tgz", 391 | "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=" 392 | }, 393 | "emoji-regex": { 394 | "version": "8.0.0", 395 | "resolved": "http://bnpm.byted.org/emoji-regex/download/emoji-regex-8.0.0.tgz", 396 | "integrity": "sha1-6Bj9ac5cz8tARZT4QpY79TFkzDc=" 397 | }, 398 | "end-of-stream": { 399 | "version": "1.4.4", 400 | "resolved": "http://bnpm.byted.org/end-of-stream/download/end-of-stream-1.4.4.tgz", 401 | "integrity": "sha1-WuZKX0UFe682JuwU2gyl5LJDHrA=", 402 | "requires": { 403 | "once": "^1.4.0" 404 | } 405 | }, 406 | "escape-string-regexp": { 407 | "version": "1.0.5", 408 | "resolved": "http://bnpm.byted.org/escape-string-regexp/download/escape-string-regexp-1.0.5.tgz", 409 | "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" 410 | }, 411 | "ext-list": { 412 | "version": "2.2.2", 413 | "resolved": "http://bnpm.byted.org/ext-list/download/ext-list-2.2.2.tgz", 414 | "integrity": "sha1-C5jmTtgvWs8PKTG6v2khLvUt3Tc=", 415 | "requires": { 416 | "mime-db": "^1.28.0" 417 | } 418 | }, 419 | "ext-name": { 420 | "version": "5.0.0", 421 | "resolved": "http://bnpm.byted.org/ext-name/download/ext-name-5.0.0.tgz", 422 | "integrity": "sha1-cHgZgdGD7hXROZPIgiBFxQbI8KY=", 423 | "requires": { 424 | "ext-list": "^2.0.0", 425 | "sort-keys-length": "^1.0.0" 426 | } 427 | }, 428 | "external-editor": { 429 | "version": "3.1.0", 430 | "resolved": "http://bnpm.byted.org/external-editor/download/external-editor-3.1.0.tgz", 431 | "integrity": "sha1-ywP3QL764D6k0oPK7SdBqD8zVJU=", 432 | "requires": { 433 | "chardet": "^0.7.0", 434 | "iconv-lite": "^0.4.24", 435 | "tmp": "^0.0.33" 436 | } 437 | }, 438 | "fd-slicer": { 439 | "version": "1.1.0", 440 | "resolved": "http://bnpm.byted.org/fd-slicer/download/fd-slicer-1.1.0.tgz", 441 | "integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=", 442 | "requires": { 443 | "pend": "~1.2.0" 444 | } 445 | }, 446 | "figures": { 447 | "version": "3.2.0", 448 | "resolved": "http://bnpm.byted.org/figures/download/figures-3.2.0.tgz", 449 | "integrity": "sha1-YlwYvSk8YE3EqN2y/r8MiDQXRq8=", 450 | "requires": { 451 | "escape-string-regexp": "^1.0.5" 452 | } 453 | }, 454 | "file-type": { 455 | "version": "8.1.0", 456 | "resolved": "http://bnpm.byted.org/file-type/download/file-type-8.1.0.tgz", 457 | "integrity": "sha1-JE87fvZBu+DMoZbHJ25LMyOZ9ow=" 458 | }, 459 | "filename-reserved-regex": { 460 | "version": "2.0.0", 461 | "resolved": "http://bnpm.byted.org/filename-reserved-regex/download/filename-reserved-regex-2.0.0.tgz", 462 | "integrity": "sha1-q/c9+rc10EVECr/qLZHzieu/oik=" 463 | }, 464 | "filenamify": { 465 | "version": "2.1.0", 466 | "resolved": "http://bnpm.byted.org/filenamify/download/filenamify-2.1.0.tgz", 467 | "integrity": "sha1-iPr0lfsbR6v9YSMAACoWIoxnfuk=", 468 | "requires": { 469 | "filename-reserved-regex": "^2.0.0", 470 | "strip-outer": "^1.0.0", 471 | "trim-repeated": "^1.0.0" 472 | } 473 | }, 474 | "from2": { 475 | "version": "2.3.0", 476 | "resolved": "http://bnpm.byted.org/from2/download/from2-2.3.0.tgz", 477 | "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", 478 | "requires": { 479 | "inherits": "^2.0.1", 480 | "readable-stream": "^2.0.0" 481 | } 482 | }, 483 | "fs-constants": { 484 | "version": "1.0.0", 485 | "resolved": "http://bnpm.byted.org/fs-constants/download/fs-constants-1.0.0.tgz", 486 | "integrity": "sha1-a+Dem+mYzhavivwkSXue6bfM2a0=" 487 | }, 488 | "fs.realpath": { 489 | "version": "1.0.0", 490 | "resolved": "http://bnpm.byted.org/fs.realpath/download/fs.realpath-1.0.0.tgz", 491 | "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" 492 | }, 493 | "get-proxy": { 494 | "version": "2.1.0", 495 | "resolved": "http://bnpm.byted.org/get-proxy/download/get-proxy-2.1.0.tgz", 496 | "integrity": "sha1-NJ8rTZHUTE1NTpy6KtkBQ/rF75M=", 497 | "requires": { 498 | "npm-conf": "^1.1.0" 499 | } 500 | }, 501 | "get-stream": { 502 | "version": "3.0.0", 503 | "resolved": "http://bnpm.byted.org/get-stream/download/get-stream-3.0.0.tgz", 504 | "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=" 505 | }, 506 | "git-clone": { 507 | "version": "0.1.0", 508 | "resolved": "http://bnpm.byted.org/git-clone/download/git-clone-0.1.0.tgz", 509 | "integrity": "sha1-DXYWN3gJOu9/HDAjjyqe8/B6Lrk=" 510 | }, 511 | "glob": { 512 | "version": "7.1.6", 513 | "resolved": "http://bnpm.byted.org/glob/download/glob-7.1.6.tgz", 514 | "integrity": "sha1-FB8zuBp8JJLhJVlDB0gMRmeSeKY=", 515 | "requires": { 516 | "fs.realpath": "^1.0.0", 517 | "inflight": "^1.0.4", 518 | "inherits": "2", 519 | "minimatch": "^3.0.4", 520 | "once": "^1.3.0", 521 | "path-is-absolute": "^1.0.0" 522 | } 523 | }, 524 | "got": { 525 | "version": "8.3.2", 526 | "resolved": "http://bnpm.byted.org/got/download/got-8.3.2.tgz", 527 | "integrity": "sha1-HSP2Q5Dpf3dsrFLluTbl9RTS6Tc=", 528 | "requires": { 529 | "@sindresorhus/is": "^0.7.0", 530 | "cacheable-request": "^2.1.1", 531 | "decompress-response": "^3.3.0", 532 | "duplexer3": "^0.1.4", 533 | "get-stream": "^3.0.0", 534 | "into-stream": "^3.1.0", 535 | "is-retry-allowed": "^1.1.0", 536 | "isurl": "^1.0.0-alpha5", 537 | "lowercase-keys": "^1.0.0", 538 | "mimic-response": "^1.0.0", 539 | "p-cancelable": "^0.4.0", 540 | "p-timeout": "^2.0.1", 541 | "pify": "^3.0.0", 542 | "safe-buffer": "^5.1.1", 543 | "timed-out": "^4.0.1", 544 | "url-parse-lax": "^3.0.0", 545 | "url-to-options": "^1.0.1" 546 | } 547 | }, 548 | "graceful-fs": { 549 | "version": "4.2.4", 550 | "resolved": "http://bnpm.byted.org/graceful-fs/download/graceful-fs-4.2.4.tgz", 551 | "integrity": "sha1-Ila94U02MpWMRl68ltxGfKB6Kfs=" 552 | }, 553 | "handlebars": { 554 | "version": "4.7.6", 555 | "resolved": "http://bnpm.byted.org/handlebars/download/handlebars-4.7.6.tgz", 556 | "integrity": "sha1-1MBcG6+Q6ZRfd6pop6IZqkp9904=", 557 | "requires": { 558 | "minimist": "^1.2.5", 559 | "neo-async": "^2.6.0", 560 | "source-map": "^0.6.1", 561 | "uglify-js": "^3.1.4", 562 | "wordwrap": "^1.0.0" 563 | } 564 | }, 565 | "has-flag": { 566 | "version": "4.0.0", 567 | "resolved": "http://bnpm.byted.org/has-flag/download/has-flag-4.0.0.tgz", 568 | "integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=" 569 | }, 570 | "has-symbol-support-x": { 571 | "version": "1.4.2", 572 | "resolved": "http://bnpm.byted.org/has-symbol-support-x/download/has-symbol-support-x-1.4.2.tgz", 573 | "integrity": "sha1-FAn5i8ACR9pF2mfO4KNvKC/yZFU=" 574 | }, 575 | "has-to-string-tag-x": { 576 | "version": "1.4.1", 577 | "resolved": "http://bnpm.byted.org/has-to-string-tag-x/download/has-to-string-tag-x-1.4.1.tgz", 578 | "integrity": "sha1-oEWrOD17SyASoAFIqwql8pAETU0=", 579 | "requires": { 580 | "has-symbol-support-x": "^1.4.1" 581 | } 582 | }, 583 | "http-cache-semantics": { 584 | "version": "3.8.1", 585 | "resolved": "http://bnpm.byted.org/http-cache-semantics/download/http-cache-semantics-3.8.1.tgz", 586 | "integrity": "sha1-ObDhat2bYFvwqe89nar0hDtMrNI=" 587 | }, 588 | "iconv-lite": { 589 | "version": "0.4.24", 590 | "resolved": "http://bnpm.byted.org/iconv-lite/download/iconv-lite-0.4.24.tgz", 591 | "integrity": "sha1-ICK0sl+93CHS9SSXSkdKr+czkIs=", 592 | "requires": { 593 | "safer-buffer": ">= 2.1.2 < 3" 594 | } 595 | }, 596 | "ieee754": { 597 | "version": "1.1.13", 598 | "resolved": "http://bnpm.byted.org/ieee754/download/ieee754-1.1.13.tgz", 599 | "integrity": "sha1-7BaFWOlaoYH9h9N/VcMrvLZwi4Q=" 600 | }, 601 | "inflight": { 602 | "version": "1.0.6", 603 | "resolved": "http://bnpm.byted.org/inflight/download/inflight-1.0.6.tgz", 604 | "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", 605 | "requires": { 606 | "once": "^1.3.0", 607 | "wrappy": "1" 608 | } 609 | }, 610 | "inherits": { 611 | "version": "2.0.4", 612 | "resolved": "http://bnpm.byted.org/inherits/download/inherits-2.0.4.tgz", 613 | "integrity": "sha1-D6LGT5MpF8NDOg3tVTY6rjdBa3w=" 614 | }, 615 | "ini": { 616 | "version": "1.3.5", 617 | "resolved": "http://bnpm.byted.org/ini/download/ini-1.3.5.tgz", 618 | "integrity": "sha1-7uJfVtscnsYIXgwid4CD9Zar+Sc=" 619 | }, 620 | "inquirer": { 621 | "version": "7.3.3", 622 | "resolved": "http://bnpm.byted.org/inquirer/download/inquirer-7.3.3.tgz", 623 | "integrity": "sha1-BNF2sq8Er8FXqD/XwQDpjuCq0AM=", 624 | "requires": { 625 | "ansi-escapes": "^4.2.1", 626 | "chalk": "^4.1.0", 627 | "cli-cursor": "^3.1.0", 628 | "cli-width": "^3.0.0", 629 | "external-editor": "^3.0.3", 630 | "figures": "^3.0.0", 631 | "lodash": "^4.17.19", 632 | "mute-stream": "0.0.8", 633 | "run-async": "^2.4.0", 634 | "rxjs": "^6.6.0", 635 | "string-width": "^4.1.0", 636 | "strip-ansi": "^6.0.0", 637 | "through": "^2.3.6" 638 | } 639 | }, 640 | "into-stream": { 641 | "version": "3.1.0", 642 | "resolved": "http://bnpm.byted.org/into-stream/download/into-stream-3.1.0.tgz", 643 | "integrity": "sha1-lvsKk2wSur1v8XUqF9BWFqvQlMY=", 644 | "requires": { 645 | "from2": "^2.1.1", 646 | "p-is-promise": "^1.1.0" 647 | } 648 | }, 649 | "is-fullwidth-code-point": { 650 | "version": "3.0.0", 651 | "resolved": "http://bnpm.byted.org/is-fullwidth-code-point/download/is-fullwidth-code-point-3.0.0.tgz", 652 | "integrity": "sha1-8Rb4Bk/pCz94RKOJl8C3UFEmnx0=" 653 | }, 654 | "is-natural-number": { 655 | "version": "4.0.1", 656 | "resolved": "http://bnpm.byted.org/is-natural-number/download/is-natural-number-4.0.1.tgz", 657 | "integrity": "sha1-q5124dtM7VHjXeDHLr7PCfc0zeg=" 658 | }, 659 | "is-object": { 660 | "version": "1.0.1", 661 | "resolved": "http://bnpm.byted.org/is-object/download/is-object-1.0.1.tgz", 662 | "integrity": "sha1-iVJojF7C/9awPsyF52ngKQMINHA=" 663 | }, 664 | "is-plain-obj": { 665 | "version": "1.1.0", 666 | "resolved": "http://bnpm.byted.org/is-plain-obj/download/is-plain-obj-1.1.0.tgz", 667 | "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=" 668 | }, 669 | "is-retry-allowed": { 670 | "version": "1.2.0", 671 | "resolved": "http://bnpm.byted.org/is-retry-allowed/download/is-retry-allowed-1.2.0.tgz", 672 | "integrity": "sha1-13hIi9CkZmo76KFIK58rqv7eqLQ=" 673 | }, 674 | "is-stream": { 675 | "version": "1.1.0", 676 | "resolved": "http://bnpm.byted.org/is-stream/download/is-stream-1.1.0.tgz", 677 | "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" 678 | }, 679 | "isarray": { 680 | "version": "1.0.0", 681 | "resolved": "http://bnpm.byted.org/isarray/download/isarray-1.0.0.tgz", 682 | "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" 683 | }, 684 | "isurl": { 685 | "version": "1.0.0", 686 | "resolved": "http://bnpm.byted.org/isurl/download/isurl-1.0.0.tgz", 687 | "integrity": "sha1-sn9PSfPNqj6kSgpbfzRi5u3DnWc=", 688 | "requires": { 689 | "has-to-string-tag-x": "^1.2.0", 690 | "is-object": "^1.0.1" 691 | } 692 | }, 693 | "json-buffer": { 694 | "version": "3.0.0", 695 | "resolved": "http://bnpm.byted.org/json-buffer/download/json-buffer-3.0.0.tgz", 696 | "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=" 697 | }, 698 | "keyv": { 699 | "version": "3.0.0", 700 | "resolved": "http://bnpm.byted.org/keyv/download/keyv-3.0.0.tgz", 701 | "integrity": "sha1-RJI7o55osSp87H32wyaMAx8u83M=", 702 | "requires": { 703 | "json-buffer": "3.0.0" 704 | } 705 | }, 706 | "lodash": { 707 | "version": "4.17.20", 708 | "resolved": "http://bnpm.byted.org/lodash/download/lodash-4.17.20.tgz", 709 | "integrity": "sha1-tEqbYpe8tpjxxRo1RaKzs2jVnFI=" 710 | }, 711 | "log-symbols": { 712 | "version": "4.0.0", 713 | "resolved": "http://bnpm.byted.org/log-symbols/download/log-symbols-4.0.0.tgz", 714 | "integrity": "sha1-abPMRtIPRI7M23XqH6cz2eghySA=", 715 | "requires": { 716 | "chalk": "^4.0.0" 717 | } 718 | }, 719 | "lowercase-keys": { 720 | "version": "1.0.1", 721 | "resolved": "http://bnpm.byted.org/lowercase-keys/download/lowercase-keys-1.0.1.tgz", 722 | "integrity": "sha1-b54wtHCE2XGnyCD/FabFFnt0wm8=" 723 | }, 724 | "make-dir": { 725 | "version": "1.3.0", 726 | "resolved": "http://bnpm.byted.org/make-dir/download/make-dir-1.3.0.tgz", 727 | "integrity": "sha1-ecEDO4BRW9bSTsmTPoYMp17ifww=", 728 | "requires": { 729 | "pify": "^3.0.0" 730 | } 731 | }, 732 | "mime-db": { 733 | "version": "1.44.0", 734 | "resolved": "http://bnpm.byted.org/mime-db/download/mime-db-1.44.0.tgz", 735 | "integrity": "sha1-+hHF6wrKEzS0Izy01S8QxaYnL5I=" 736 | }, 737 | "mimic-fn": { 738 | "version": "2.1.0", 739 | "resolved": "http://bnpm.byted.org/mimic-fn/download/mimic-fn-2.1.0.tgz", 740 | "integrity": "sha1-ftLCzMyvhNP/y3pptXcR/CCDQBs=" 741 | }, 742 | "mimic-response": { 743 | "version": "1.0.1", 744 | "resolved": "http://bnpm.byted.org/mimic-response/download/mimic-response-1.0.1.tgz", 745 | "integrity": "sha1-SSNTiHju9CBjy4o+OweYeBSHqxs=" 746 | }, 747 | "minimatch": { 748 | "version": "3.0.4", 749 | "resolved": "http://bnpm.byted.org/minimatch/download/minimatch-3.0.4.tgz", 750 | "integrity": "sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=", 751 | "requires": { 752 | "brace-expansion": "^1.1.7" 753 | } 754 | }, 755 | "minimist": { 756 | "version": "1.2.5", 757 | "resolved": "http://bnpm.byted.org/minimist/download/minimist-1.2.5.tgz", 758 | "integrity": "sha1-Z9ZgFLZqaoqqDAg8X9WN9OTpdgI=" 759 | }, 760 | "mute-stream": { 761 | "version": "0.0.8", 762 | "resolved": "http://bnpm.byted.org/mute-stream/download/mute-stream-0.0.8.tgz", 763 | "integrity": "sha1-FjDEKyJR/4HiooPelqVJfqkuXg0=" 764 | }, 765 | "neo-async": { 766 | "version": "2.6.2", 767 | "resolved": "http://bnpm.byted.org/neo-async/download/neo-async-2.6.2.tgz", 768 | "integrity": "sha1-tKr7k+OustgXTKU88WOrfXMIMF8=" 769 | }, 770 | "normalize-url": { 771 | "version": "2.0.1", 772 | "resolved": "http://bnpm.byted.org/normalize-url/download/normalize-url-2.0.1.tgz", 773 | "integrity": "sha1-g1qdoVUfom9w6SMpBpojqmV01+Y=", 774 | "requires": { 775 | "prepend-http": "^2.0.0", 776 | "query-string": "^5.0.1", 777 | "sort-keys": "^2.0.0" 778 | }, 779 | "dependencies": { 780 | "sort-keys": { 781 | "version": "2.0.0", 782 | "resolved": "http://bnpm.byted.org/sort-keys/download/sort-keys-2.0.0.tgz", 783 | "integrity": "sha1-ZYU1WEhh7JfXMNbPQYIuH1ZoQSg=", 784 | "requires": { 785 | "is-plain-obj": "^1.0.0" 786 | } 787 | } 788 | } 789 | }, 790 | "npm-conf": { 791 | "version": "1.1.3", 792 | "resolved": "http://bnpm.byted.org/npm-conf/download/npm-conf-1.1.3.tgz", 793 | "integrity": "sha1-JWzEe9DiGMJZxOlVC/QTvCGSr/k=", 794 | "requires": { 795 | "config-chain": "^1.1.11", 796 | "pify": "^3.0.0" 797 | } 798 | }, 799 | "object-assign": { 800 | "version": "4.1.1", 801 | "resolved": "http://bnpm.byted.org/object-assign/download/object-assign-4.1.1.tgz", 802 | "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" 803 | }, 804 | "once": { 805 | "version": "1.4.0", 806 | "resolved": "http://bnpm.byted.org/once/download/once-1.4.0.tgz", 807 | "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", 808 | "requires": { 809 | "wrappy": "1" 810 | } 811 | }, 812 | "onetime": { 813 | "version": "5.1.2", 814 | "resolved": "http://bnpm.byted.org/onetime/download/onetime-5.1.2.tgz", 815 | "integrity": "sha1-0Oluu1awdHbfHdnEgG5SN5hcpF4=", 816 | "requires": { 817 | "mimic-fn": "^2.1.0" 818 | } 819 | }, 820 | "os-tmpdir": { 821 | "version": "1.0.2", 822 | "resolved": "http://bnpm.byted.org/os-tmpdir/download/os-tmpdir-1.0.2.tgz", 823 | "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" 824 | }, 825 | "p-cancelable": { 826 | "version": "0.4.1", 827 | "resolved": "http://bnpm.byted.org/p-cancelable/download/p-cancelable-0.4.1.tgz", 828 | "integrity": "sha1-NfNj1n1SCByNlYXje8zrfgu8sqA=" 829 | }, 830 | "p-event": { 831 | "version": "2.3.1", 832 | "resolved": "http://bnpm.byted.org/p-event/download/p-event-2.3.1.tgz", 833 | "integrity": "sha1-WWJ57xaassPgyuiMHPuwgHmZPvY=", 834 | "requires": { 835 | "p-timeout": "^2.0.1" 836 | } 837 | }, 838 | "p-finally": { 839 | "version": "1.0.0", 840 | "resolved": "http://bnpm.byted.org/p-finally/download/p-finally-1.0.0.tgz", 841 | "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=" 842 | }, 843 | "p-is-promise": { 844 | "version": "1.1.0", 845 | "resolved": "http://bnpm.byted.org/p-is-promise/download/p-is-promise-1.1.0.tgz", 846 | "integrity": "sha1-nJRWmJ6fZYgBewQ01WCXZ1w9oF4=" 847 | }, 848 | "p-timeout": { 849 | "version": "2.0.1", 850 | "resolved": "http://bnpm.byted.org/p-timeout/download/p-timeout-2.0.1.tgz", 851 | "integrity": "sha1-2N0ZeVldLcATnh/ka4tkbLPN8Dg=", 852 | "requires": { 853 | "p-finally": "^1.0.0" 854 | } 855 | }, 856 | "path-is-absolute": { 857 | "version": "1.0.1", 858 | "resolved": "http://bnpm.byted.org/path-is-absolute/download/path-is-absolute-1.0.1.tgz", 859 | "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" 860 | }, 861 | "pend": { 862 | "version": "1.2.0", 863 | "resolved": "http://bnpm.byted.org/pend/download/pend-1.2.0.tgz", 864 | "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=" 865 | }, 866 | "pify": { 867 | "version": "3.0.0", 868 | "resolved": "http://bnpm.byted.org/pify/download/pify-3.0.0.tgz", 869 | "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=" 870 | }, 871 | "pinkie": { 872 | "version": "2.0.4", 873 | "resolved": "http://bnpm.byted.org/pinkie/download/pinkie-2.0.4.tgz", 874 | "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=" 875 | }, 876 | "pinkie-promise": { 877 | "version": "2.0.1", 878 | "resolved": "http://bnpm.byted.org/pinkie-promise/download/pinkie-promise-2.0.1.tgz", 879 | "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", 880 | "requires": { 881 | "pinkie": "^2.0.0" 882 | } 883 | }, 884 | "prepend-http": { 885 | "version": "2.0.0", 886 | "resolved": "http://bnpm.byted.org/prepend-http/download/prepend-http-2.0.0.tgz", 887 | "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=" 888 | }, 889 | "process-nextick-args": { 890 | "version": "2.0.1", 891 | "resolved": "http://bnpm.byted.org/process-nextick-args/download/process-nextick-args-2.0.1.tgz", 892 | "integrity": "sha1-eCDZsWEgzFXKmud5JoCufbptf+I=" 893 | }, 894 | "proto-list": { 895 | "version": "1.2.4", 896 | "resolved": "http://bnpm.byted.org/proto-list/download/proto-list-1.2.4.tgz", 897 | "integrity": "sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk=" 898 | }, 899 | "query-string": { 900 | "version": "5.1.1", 901 | "resolved": "http://bnpm.byted.org/query-string/download/query-string-5.1.1.tgz", 902 | "integrity": "sha1-p4wBK3HBfgXy4/ojGd0zBoLvs8s=", 903 | "requires": { 904 | "decode-uri-component": "^0.2.0", 905 | "object-assign": "^4.1.0", 906 | "strict-uri-encode": "^1.0.0" 907 | } 908 | }, 909 | "readable-stream": { 910 | "version": "2.3.7", 911 | "resolved": "http://bnpm.byted.org/readable-stream/download/readable-stream-2.3.7.tgz", 912 | "integrity": "sha1-Hsoc9xGu+BTAT2IlKjamL2yyO1c=", 913 | "requires": { 914 | "core-util-is": "~1.0.0", 915 | "inherits": "~2.0.3", 916 | "isarray": "~1.0.0", 917 | "process-nextick-args": "~2.0.0", 918 | "safe-buffer": "~5.1.1", 919 | "string_decoder": "~1.1.1", 920 | "util-deprecate": "~1.0.1" 921 | }, 922 | "dependencies": { 923 | "safe-buffer": { 924 | "version": "5.1.2", 925 | "resolved": "http://bnpm.byted.org/safe-buffer/download/safe-buffer-5.1.2.tgz", 926 | "integrity": "sha1-mR7GnSluAxN0fVm9/St0XDX4go0=" 927 | } 928 | } 929 | }, 930 | "responselike": { 931 | "version": "1.0.2", 932 | "resolved": "http://bnpm.byted.org/responselike/download/responselike-1.0.2.tgz", 933 | "integrity": "sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=", 934 | "requires": { 935 | "lowercase-keys": "^1.0.0" 936 | } 937 | }, 938 | "restore-cursor": { 939 | "version": "3.1.0", 940 | "resolved": "http://bnpm.byted.org/restore-cursor/download/restore-cursor-3.1.0.tgz", 941 | "integrity": "sha1-OfZ8VLOnpYzqUjbZXPADQjljH34=", 942 | "requires": { 943 | "onetime": "^5.1.0", 944 | "signal-exit": "^3.0.2" 945 | } 946 | }, 947 | "rimraf": { 948 | "version": "3.0.2", 949 | "resolved": "http://bnpm.byted.org/rimraf/download/rimraf-3.0.2.tgz", 950 | "integrity": "sha1-8aVAK6YiCtUswSgrrBrjqkn9Bho=", 951 | "requires": { 952 | "glob": "^7.1.3" 953 | } 954 | }, 955 | "run-async": { 956 | "version": "2.4.1", 957 | "resolved": "http://bnpm.byted.org/run-async/download/run-async-2.4.1.tgz", 958 | "integrity": "sha1-hEDsz5nqPnC9QJ1JqriOEMGJpFU=" 959 | }, 960 | "rxjs": { 961 | "version": "6.6.2", 962 | "resolved": "http://bnpm.byted.org/rxjs/download/rxjs-6.6.2.tgz", 963 | "integrity": "sha1-gJanrAPyzE/lhg725XKBDZ4BwNI=", 964 | "requires": { 965 | "tslib": "^1.9.0" 966 | } 967 | }, 968 | "safe-buffer": { 969 | "version": "5.2.1", 970 | "resolved": "http://bnpm.byted.org/safe-buffer/download/safe-buffer-5.2.1.tgz", 971 | "integrity": "sha1-Hq+fqb2x/dTsdfWPnNtOa3gn7sY=" 972 | }, 973 | "safer-buffer": { 974 | "version": "2.1.2", 975 | "resolved": "http://bnpm.byted.org/safer-buffer/download/safer-buffer-2.1.2.tgz", 976 | "integrity": "sha1-RPoWGwGHuVSd2Eu5GAL5vYOFzWo=" 977 | }, 978 | "seek-bzip": { 979 | "version": "1.0.6", 980 | "resolved": "http://bnpm.byted.org/seek-bzip/download/seek-bzip-1.0.6.tgz", 981 | "integrity": "sha1-NcQXH1WmgJFrUqB4WezztYV/IcQ=", 982 | "requires": { 983 | "commander": "^2.8.1" 984 | }, 985 | "dependencies": { 986 | "commander": { 987 | "version": "2.20.3", 988 | "resolved": "http://bnpm.byted.org/commander/download/commander-2.20.3.tgz", 989 | "integrity": "sha1-/UhehMA+tIgcIHIrpIA16FMa6zM=" 990 | } 991 | } 992 | }, 993 | "semver": { 994 | "version": "7.3.2", 995 | "resolved": "http://bnpm.byted.org/semver/download/semver-7.3.2.tgz", 996 | "integrity": "sha1-YElisFK4HtB4aq6EOJ/7pw/9OTg=" 997 | }, 998 | "signal-exit": { 999 | "version": "3.0.3", 1000 | "resolved": "http://bnpm.byted.org/signal-exit/download/signal-exit-3.0.3.tgz", 1001 | "integrity": "sha1-oUEMLt2PB3sItOJTyOrPyvBXRhw=" 1002 | }, 1003 | "sort-keys": { 1004 | "version": "1.1.2", 1005 | "resolved": "http://bnpm.byted.org/sort-keys/download/sort-keys-1.1.2.tgz", 1006 | "integrity": "sha1-RBttTTRnmPG05J6JIK37oOVD+a0=", 1007 | "requires": { 1008 | "is-plain-obj": "^1.0.0" 1009 | } 1010 | }, 1011 | "sort-keys-length": { 1012 | "version": "1.0.1", 1013 | "resolved": "http://bnpm.byted.org/sort-keys-length/download/sort-keys-length-1.0.1.tgz", 1014 | "integrity": "sha1-nLb09OnkgVWmqgZx7dM2/xR5oYg=", 1015 | "requires": { 1016 | "sort-keys": "^1.0.0" 1017 | } 1018 | }, 1019 | "source-map": { 1020 | "version": "0.6.1", 1021 | "resolved": "http://bnpm.byted.org/source-map/download/source-map-0.6.1.tgz", 1022 | "integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=" 1023 | }, 1024 | "strict-uri-encode": { 1025 | "version": "1.1.0", 1026 | "resolved": "http://bnpm.byted.org/strict-uri-encode/download/strict-uri-encode-1.1.0.tgz", 1027 | "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=" 1028 | }, 1029 | "string-width": { 1030 | "version": "4.2.0", 1031 | "resolved": "http://bnpm.byted.org/string-width/download/string-width-4.2.0.tgz", 1032 | "integrity": "sha1-lSGCxGzHssMT0VluYjmSvRY7crU=", 1033 | "requires": { 1034 | "emoji-regex": "^8.0.0", 1035 | "is-fullwidth-code-point": "^3.0.0", 1036 | "strip-ansi": "^6.0.0" 1037 | } 1038 | }, 1039 | "string_decoder": { 1040 | "version": "1.1.1", 1041 | "resolved": "http://bnpm.byted.org/string_decoder/download/string_decoder-1.1.1.tgz", 1042 | "integrity": "sha1-nPFhG6YmhdcDCunkujQUnDrwP8g=", 1043 | "requires": { 1044 | "safe-buffer": "~5.1.0" 1045 | }, 1046 | "dependencies": { 1047 | "safe-buffer": { 1048 | "version": "5.1.2", 1049 | "resolved": "http://bnpm.byted.org/safe-buffer/download/safe-buffer-5.1.2.tgz", 1050 | "integrity": "sha1-mR7GnSluAxN0fVm9/St0XDX4go0=" 1051 | } 1052 | } 1053 | }, 1054 | "strip-ansi": { 1055 | "version": "6.0.0", 1056 | "resolved": "http://bnpm.byted.org/strip-ansi/download/strip-ansi-6.0.0.tgz", 1057 | "integrity": "sha1-CxVx3XZpzNTz4G4U7x7tJiJa5TI=", 1058 | "requires": { 1059 | "ansi-regex": "^5.0.0" 1060 | } 1061 | }, 1062 | "strip-dirs": { 1063 | "version": "2.1.0", 1064 | "resolved": "http://bnpm.byted.org/strip-dirs/download/strip-dirs-2.1.0.tgz", 1065 | "integrity": "sha1-SYdzYmT8NEzyD2w0rKnRPR1O1sU=", 1066 | "requires": { 1067 | "is-natural-number": "^4.0.1" 1068 | } 1069 | }, 1070 | "strip-outer": { 1071 | "version": "1.0.1", 1072 | "resolved": "http://bnpm.byted.org/strip-outer/download/strip-outer-1.0.1.tgz", 1073 | "integrity": "sha1-sv0qv2YEudHmATBXGV34Nrip1jE=", 1074 | "requires": { 1075 | "escape-string-regexp": "^1.0.2" 1076 | } 1077 | }, 1078 | "supports-color": { 1079 | "version": "7.1.0", 1080 | "resolved": "http://bnpm.byted.org/supports-color/download/supports-color-7.1.0.tgz", 1081 | "integrity": "sha1-aOMlkd9z4lrRxLSRCKLsUHliv9E=", 1082 | "requires": { 1083 | "has-flag": "^4.0.0" 1084 | } 1085 | }, 1086 | "tar-stream": { 1087 | "version": "1.6.2", 1088 | "resolved": "http://bnpm.byted.org/tar-stream/download/tar-stream-1.6.2.tgz", 1089 | "integrity": "sha1-jqVdqzeXIlPZqa+Q/c1VmuQ1xVU=", 1090 | "requires": { 1091 | "bl": "^1.0.0", 1092 | "buffer-alloc": "^1.2.0", 1093 | "end-of-stream": "^1.0.0", 1094 | "fs-constants": "^1.0.0", 1095 | "readable-stream": "^2.3.0", 1096 | "to-buffer": "^1.1.1", 1097 | "xtend": "^4.0.0" 1098 | } 1099 | }, 1100 | "through": { 1101 | "version": "2.3.8", 1102 | "resolved": "http://bnpm.byted.org/through/download/through-2.3.8.tgz", 1103 | "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" 1104 | }, 1105 | "timed-out": { 1106 | "version": "4.0.1", 1107 | "resolved": "http://bnpm.byted.org/timed-out/download/timed-out-4.0.1.tgz", 1108 | "integrity": "sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8=" 1109 | }, 1110 | "tmp": { 1111 | "version": "0.0.33", 1112 | "resolved": "http://bnpm.byted.org/tmp/download/tmp-0.0.33.tgz", 1113 | "integrity": "sha1-bTQzWIl2jSGyvNoKonfO07G/rfk=", 1114 | "requires": { 1115 | "os-tmpdir": "~1.0.2" 1116 | } 1117 | }, 1118 | "to-buffer": { 1119 | "version": "1.1.1", 1120 | "resolved": "http://bnpm.byted.org/to-buffer/download/to-buffer-1.1.1.tgz", 1121 | "integrity": "sha1-STvUj2LXxD/N7TE6A9ytsuEhOoA=" 1122 | }, 1123 | "trim-repeated": { 1124 | "version": "1.0.0", 1125 | "resolved": "http://bnpm.byted.org/trim-repeated/download/trim-repeated-1.0.0.tgz", 1126 | "integrity": "sha1-42RqLqTokTEr9+rObPsFOAvAHCE=", 1127 | "requires": { 1128 | "escape-string-regexp": "^1.0.2" 1129 | } 1130 | }, 1131 | "tslib": { 1132 | "version": "1.13.0", 1133 | "resolved": "http://bnpm.byted.org/tslib/download/tslib-1.13.0.tgz", 1134 | "integrity": "sha1-yIHhPMcBWJTtkUhi0nZDb6mkcEM=" 1135 | }, 1136 | "tunnel-agent": { 1137 | "version": "0.6.0", 1138 | "resolved": "http://bnpm.byted.org/tunnel-agent/download/tunnel-agent-0.6.0.tgz", 1139 | "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", 1140 | "requires": { 1141 | "safe-buffer": "^5.0.1" 1142 | } 1143 | }, 1144 | "type-fest": { 1145 | "version": "0.11.0", 1146 | "resolved": "http://bnpm.byted.org/type-fest/download/type-fest-0.11.0.tgz", 1147 | "integrity": "sha1-l6vwhyMQ/tiKXEZrJWgVdhReM/E=" 1148 | }, 1149 | "uglify-js": { 1150 | "version": "3.10.2", 1151 | "resolved": "http://bnpm.byted.org/uglify-js/download/uglify-js-3.10.2.tgz", 1152 | "integrity": "sha1-jPoSCf0EGZzIp/mTDd7bMLDxkS0=", 1153 | "optional": true 1154 | }, 1155 | "unbzip2-stream": { 1156 | "version": "1.4.3", 1157 | "resolved": "http://bnpm.byted.org/unbzip2-stream/download/unbzip2-stream-1.4.3.tgz", 1158 | "integrity": "sha1-sNoExDcTEd93HNwhXofyEwmRrOc=", 1159 | "requires": { 1160 | "buffer": "^5.2.1", 1161 | "through": "^2.3.8" 1162 | } 1163 | }, 1164 | "url-parse-lax": { 1165 | "version": "3.0.0", 1166 | "resolved": "http://bnpm.byted.org/url-parse-lax/download/url-parse-lax-3.0.0.tgz", 1167 | "integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=", 1168 | "requires": { 1169 | "prepend-http": "^2.0.0" 1170 | } 1171 | }, 1172 | "url-to-options": { 1173 | "version": "1.0.1", 1174 | "resolved": "http://bnpm.byted.org/url-to-options/download/url-to-options-1.0.1.tgz", 1175 | "integrity": "sha1-FQWgOiiaSMvXpDTvuu7FBV9WM6k=" 1176 | }, 1177 | "util-deprecate": { 1178 | "version": "1.0.2", 1179 | "resolved": "http://bnpm.byted.org/util-deprecate/download/util-deprecate-1.0.2.tgz", 1180 | "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" 1181 | }, 1182 | "wordwrap": { 1183 | "version": "1.0.0", 1184 | "resolved": "http://bnpm.byted.org/wordwrap/download/wordwrap-1.0.0.tgz", 1185 | "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=" 1186 | }, 1187 | "wrappy": { 1188 | "version": "1.0.2", 1189 | "resolved": "http://bnpm.byted.org/wrappy/download/wrappy-1.0.2.tgz", 1190 | "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" 1191 | }, 1192 | "xtend": { 1193 | "version": "4.0.2", 1194 | "resolved": "http://bnpm.byted.org/xtend/download/xtend-4.0.2.tgz", 1195 | "integrity": "sha1-u3J3n1+kZRhrH0OPZ0+jR/2121Q=" 1196 | }, 1197 | "yauzl": { 1198 | "version": "2.10.0", 1199 | "resolved": "http://bnpm.byted.org/yauzl/download/yauzl-2.10.0.tgz", 1200 | "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=", 1201 | "requires": { 1202 | "buffer-crc32": "~0.2.3", 1203 | "fd-slicer": "~1.1.0" 1204 | } 1205 | } 1206 | } 1207 | } 1208 | -------------------------------------------------------------------------------- /firstShot/jye-react/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jye-react", 3 | "version": "1.0.9", 4 | "description": "江鱼儿呃呃呃脚手架搭建", 5 | "main": "index.js", 6 | "bin": { 7 | "jye-react": "./index.js" 8 | }, 9 | "scripts": { 10 | "test": "echo \"Error: no test specified\" && exit 1" 11 | }, 12 | "keywords": [], 13 | "author": "", 14 | "license": "ISC", 15 | "dependencies": { 16 | "colors": "^1.4.0", 17 | "commander": "^6.0.0", 18 | "download-git-repo": "^3.0.2", 19 | "handlebars": "^4.7.6", 20 | "inquirer": "^7.3.3", 21 | "log-symbols": "^4.0.0", 22 | "semver": "^7.3.2" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /firstShot/jye-react/util/index.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const path = require('path'); 3 | const { execSync } = require('child_process'); 4 | 5 | const resolve = _path => path.join(__dirname, _path); 6 | 7 | const timePath = resolve('index.txt'); 8 | 9 | const MAX_TIME = 86400000; 10 | 11 | const checkTime = () => { 12 | const lastTime = +fs.readFileSync(timePath).toString(); 13 | const nowTime = new Date().getTime(); 14 | 15 | if (lastTime && nowTime - lastTime <= MAX_TIME) { 16 | return; 17 | } 18 | 19 | fs.writeFileSync(timePath, nowTime); 20 | 21 | const lastV = execSync('npm view jye-react version', { encoding: 'utf8' }); 22 | return lastV; 23 | }; 24 | 25 | module.exports = { 26 | checkTime, 27 | }; 28 | -------------------------------------------------------------------------------- /firstShot/jye-react/util/index.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjj281795819/chuhc-react/d20ef1aced2e1923595cd60e36ee2f0e506e40c2/firstShot/jye-react/util/index.txt -------------------------------------------------------------------------------- /firstShot/jye-script/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | .npm 4 | *.log* 5 | *.pid 6 | *.pid.* 7 | *.report 8 | .sonarlint 9 | .idea/ 10 | .eslintcache 11 | .vscode/**/* 12 | !.vscode/settings.json 13 | !.vscode/extensions.json 14 | dist/ 15 | coverage/ 16 | lib-cov 17 | -------------------------------------------------------------------------------- /firstShot/jye-script/README.md: -------------------------------------------------------------------------------- 1 | ## jye-scripts 2 | 3 | 供 jye-react 使用,内部封装好打包逻辑和命令,让开发自由自在享受时光。 4 | -------------------------------------------------------------------------------- /firstShot/jye-script/index.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | const program = require('commander'); 4 | const webpack = require('webpack'); 5 | const WebpackDevServer = require('webpack-dev-server'); 6 | const deveConfig = require('./webpackConfig/webpack.deve'); 7 | const prodConfig = require('./webpackConfig/webpack.prod'); 8 | const logSymbols = require('log-symbols'); 9 | 10 | program.command('dev').action(() => { 11 | const { devServer } = deveConfig; 12 | const compiler = webpack(deveConfig); 13 | const server = new WebpackDevServer(compiler, { ...devServer }); 14 | 15 | server.listen(devServer.port); 16 | }); 17 | 18 | program.command('build').action(() => { 19 | const compiler = webpack(prodConfig); 20 | 21 | compiler.run((err, stats) => { 22 | if (err) { 23 | // 回调中接收错误信息。 24 | console.error(err); 25 | } else { 26 | console.log(logSymbols.success, '打包成功!'); 27 | } 28 | }); 29 | }); 30 | 31 | program.on('command:*', function() { 32 | console.log('error'); 33 | process.exit(1); 34 | }); 35 | 36 | program.parse(process.argv); 37 | -------------------------------------------------------------------------------- /firstShot/jye-script/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jye-scripts", 3 | "version": "1.0.8", 4 | "description": "供jye-react使用", 5 | "main": "index.js", 6 | "bin": { 7 | "jye-scripts": "./index.js" 8 | }, 9 | "scripts": { 10 | "test": "echo \"Error: no test specified\" && exit 1" 11 | }, 12 | "keywords": [], 13 | "author": "cjj281795819", 14 | "license": "ISC", 15 | "dependencies": { 16 | "@babel/core": "^7.11.4", 17 | "@babel/plugin-proposal-class-properties": "^7.10.4", 18 | "@babel/plugin-proposal-object-rest-spread": "^7.11.0", 19 | "@babel/preset-env": "^7.11.0", 20 | "@babel/preset-react": "^7.10.4", 21 | "@babel/preset-typescript": "^7.10.4", 22 | "babel-loader": "^8.1.0", 23 | "clean-webpack-plugin": "^3.0.0", 24 | "commander": "^6.1.0", 25 | "css-loader": "^4.2.2", 26 | "file-loader": "^6.0.0", 27 | "html-webpack-plugin": "^4.3.0", 28 | "less": "^3.12.2", 29 | "less-loader": "^7.0.0", 30 | "log-symbols": "^4.0.0", 31 | "mini-css-extract-plugin": "^0.11.0", 32 | "url-loader": "^4.1.0", 33 | "webpack": "^4.44.1", 34 | "webpack-dev-server": "^3.11.0", 35 | "webpack-merge": "^5.1.2" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /firstShot/jye-script/template/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Document 8 | 9 | 10 |
11 | 12 | 13 | -------------------------------------------------------------------------------- /firstShot/jye-script/util/index.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const glob = require('glob'); 3 | const HtmlWebpackPlugin = require('html-webpack-plugin'); 4 | const logSymbols = require('log-symbols'); 5 | 6 | const _src = './src/**/index.tsx'; 7 | let entrys = null; 8 | let onceDone = false; 9 | 10 | const dirname = process.cwd(); 11 | 12 | /** 13 | * 获取路径,(根路径开始) 14 | * @param {String} src 15 | */ 16 | const resolve = src => path.join(dirname, src); 17 | 18 | /** 19 | * 获取路径,(当前路径开始) 20 | * @param {String} src 21 | */ 22 | const nowPathResolve = src => path.join(__dirname, src); 23 | 24 | /** 25 | * 获取入口地址 26 | */ 27 | const getEntrysInfo = () => { 28 | if (entrys) { 29 | return entrys; 30 | } 31 | 32 | entrys = {}; 33 | 34 | let pages = glob.sync(_src); 35 | pages.map(p => { 36 | let dirname = path.dirname(p); 37 | dirname = dirname.slice(dirname.lastIndexOf('/') + 1); 38 | 39 | entrys[dirname] = p; 40 | }); 41 | 42 | return entrys; 43 | }; 44 | 45 | /** 46 | * 获取页面 47 | * @param {Boolean} isProd 是否生产环境 48 | */ 49 | const getPages = isProd => { 50 | const plugins = []; 51 | let entrysInfo = getEntrysInfo(); 52 | 53 | Object.keys(entrysInfo).map(dirname => { 54 | plugins.push( 55 | new HtmlWebpackPlugin({ 56 | chunks: isProd ? ['libs', dirname] : [dirname], 57 | filename: `./${dirname}/index.html`, 58 | template: nowPathResolve('../template/index.html'), 59 | }), 60 | ); 61 | }); 62 | 63 | return plugins; 64 | }; 65 | 66 | /** 67 | * 清空屏幕 68 | */ 69 | const clearScreen = () => { 70 | process.stdout.write( 71 | process.platform === 'win32' ? '\x1Bc' : '\x1B[2J\x1B[3J\x1B[H', 72 | ); 73 | }; 74 | 75 | /** 76 | * 挂载编译完成后hook 77 | * @param {*} app 78 | * @param {*} server 79 | * @param {*} compiler 80 | */ 81 | const devServerAfter = (app, server, compiler) => { 82 | const port = server.options.port; 83 | compiler.hooks.done.tap('done', () => { 84 | if (onceDone) { 85 | return; 86 | } 87 | 88 | onceDone = true; 89 | 90 | const entrys = getEntrysInfo(); 91 | 92 | clearScreen(); 93 | 94 | console.log(` 95 | `); 96 | 97 | Object.keys(entrys).map(entry => 98 | console.log( 99 | logSymbols.success, 100 | `${entry}的入口:http://localhost:${port}/${entry}`, 101 | ), 102 | ); 103 | 104 | console.log(` 105 | `); 106 | }); 107 | }; 108 | 109 | module.exports = { 110 | resolve, 111 | getEntrysInfo, 112 | getPages, 113 | devServerAfter, 114 | }; 115 | -------------------------------------------------------------------------------- /firstShot/jye-script/webpackConfig/webpack.base.js: -------------------------------------------------------------------------------- 1 | const MiniCssExtractPlugin = require('mini-css-extract-plugin'); 2 | const { CleanWebpackPlugin } = require('clean-webpack-plugin'); 3 | const { getEntrysInfo } = require('../util'); 4 | 5 | module.exports = { 6 | entry: getEntrysInfo(), 7 | resolve: { 8 | extensions: ['.js', '.ts', '.tsx', '.jsx'], 9 | }, 10 | module: { 11 | rules: [ 12 | { 13 | test: /\.(js|ts|tsx|jsx)$/, 14 | use: { 15 | loader: 'babel-loader', 16 | options: { 17 | presets: [ 18 | '@babel/preset-env', 19 | '@babel/preset-react', 20 | '@babel/preset-typescript', 21 | ], 22 | plugins: [ 23 | '@babel/plugin-proposal-class-properties', 24 | '@babel/plugin-proposal-object-rest-spread', 25 | ], 26 | compact: true, 27 | }, 28 | }, 29 | }, 30 | { 31 | test: /\.less$/, 32 | use: [MiniCssExtractPlugin.loader, 'css-loader', 'less-loader'], 33 | }, 34 | { 35 | test: /\.(jpg|png|jpeg|gif)$/, 36 | use: [ 37 | { 38 | loader: 'url-loader', 39 | options: { 40 | limit: 10240, 41 | name: 'img/[name].[hash:7].[ext]', 42 | esModule: false, 43 | }, 44 | }, 45 | ], 46 | }, 47 | ], 48 | }, 49 | plugins: [new CleanWebpackPlugin()], 50 | }; 51 | -------------------------------------------------------------------------------- /firstShot/jye-script/webpackConfig/webpack.deve.js: -------------------------------------------------------------------------------- 1 | const MiniCssExtractPlugin = require('mini-css-extract-plugin'); 2 | const base = require('./webpack.base'); 3 | const { merge } = require('webpack-merge'); 4 | const { resolve, getPages, devServerAfter } = require('../util'); 5 | 6 | module.exports = merge(base, { 7 | mode: 'development', 8 | output: { 9 | filename: '[name].js', 10 | path: resolve('dist'), 11 | }, 12 | devtool: 'cheap-module-eval-source-map', 13 | plugins: [ 14 | ...getPages(false), 15 | new MiniCssExtractPlugin({ 16 | filename: '[name].css', 17 | }), 18 | ], 19 | devServer: { 20 | contentBase: resolve('dist'), 21 | compress: true, 22 | port: 9999, 23 | stats: 'errors-only', 24 | hot: true, 25 | after: devServerAfter, 26 | }, 27 | }); 28 | -------------------------------------------------------------------------------- /firstShot/jye-script/webpackConfig/webpack.prod.js: -------------------------------------------------------------------------------- 1 | const MiniCssExtractPlugin = require('mini-css-extract-plugin'); 2 | const base = require('./webpack.base'); 3 | const { merge } = require('webpack-merge'); 4 | const { resolve, getPages } = require('../util'); 5 | 6 | module.exports = merge(base, { 7 | mode: 'production', 8 | output: { 9 | filename: '[name]-[contentHash:5].js', 10 | path: resolve('dist'), 11 | }, 12 | optimization: { 13 | splitChunks: { 14 | cacheGroups: { 15 | libs: { 16 | test: /node_modules/, // 我们对依赖进行分包处理 17 | chunks: 'initial', 18 | name: 'libs', 19 | }, 20 | }, 21 | }, 22 | }, 23 | plugins: [ 24 | ...getPages(true), 25 | new MiniCssExtractPlugin({ 26 | filename: '[name]-[contentHash:5].css', 27 | }), 28 | ], 29 | }); 30 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "chuhc-react", 3 | "version": "1.0.9", 4 | "description": "江鱼儿呃呃呃脚手架搭建", 5 | "scripts": { 6 | "test": "echo \"Error: no test specified\" && exit 1" 7 | }, 8 | "private": true, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "devDependencies": { 13 | "@babel/core": "^7.11.6", 14 | "@babel/eslint-parser": "^7.11.5", 15 | "eslint": "^7.9.0" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/@chuhc/cli/README.md: -------------------------------------------------------------------------------- 1 | # chuhc-cli 脚手架 2 | 3 | 待更新 4 | -------------------------------------------------------------------------------- /packages/@chuhc/cli/bin/chuhc.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | /** 3 | * as a startup file 4 | */ 5 | const program = require('commander'); 6 | const pkg = require('../package.json'); 7 | const chalk = require('chalk'); 8 | 9 | program 10 | .version(`@chuhc/cli ${pkg.version}`, '-v -version') 11 | .usage(' [options]'); 12 | 13 | program 14 | .command('create ') 15 | .description('create project') 16 | .action((name) => { 17 | require('../lib/create.js')(name); 18 | }); 19 | 20 | program 21 | .command('update') 22 | .description('@chuhc/cli update') 23 | .action(() => { 24 | require('../lib/update.js')(); 25 | }); 26 | 27 | program.arguments('').action((cmd) => { 28 | program.outputHelp(); 29 | console.log(); 30 | console.log(` ${chalk.red(`Unknown command ${chalk.yellow(cmd)}.`)}`); 31 | console.log(); 32 | }); 33 | 34 | program.program.parse(process.argv); 35 | -------------------------------------------------------------------------------- /packages/@chuhc/cli/lib/PackageManager.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Download Management 3 | */ 4 | const path = require('path'); 5 | const { execSync } = require('child_process'); 6 | const { hasYarn, hasCnpm } = require('./util/env'); 7 | 8 | const PM_CONFIG = { 9 | npm: { 10 | install: ['install', '--loglevel', 'error'], 11 | remove: ['uninstall', '--loglevel', 'error'], 12 | }, 13 | yarn: { 14 | install: [], 15 | remove: ['remove'], 16 | }, 17 | }; 18 | PM_CONFIG.cnpm = PM_CONFIG.npm; 19 | 20 | module.exports = class PackageManager { 21 | constructor({ pkgName }) { 22 | this.pkgName = pkgName; 23 | 24 | if (hasYarn()) { 25 | this.bin = 'yarn'; 26 | } else if (hasCnpm()) { 27 | this.bin = 'cnpm'; 28 | } else { 29 | this.bin = 'npm'; 30 | } 31 | } 32 | 33 | cdPath() { 34 | const aimPath = path.join(process.cwd(), this.pkgName); 35 | 36 | process.chdir(aimPath); 37 | } 38 | 39 | runCommand(command, args = []) { 40 | const _commands = [this.bin, ...PM_CONFIG[this.bin][command], ...args]; 41 | 42 | execSync(_commands.join(' '), { stdio: [0, 1, 2] }); 43 | } 44 | 45 | install() { 46 | try { 47 | this.runCommand('install', ['--offline']); 48 | } catch (e) { 49 | this.runCommand('install'); 50 | } 51 | } 52 | 53 | git() { 54 | try { 55 | execSync('git init'); 56 | return true; 57 | } catch (e) { 58 | return false; 59 | } 60 | } 61 | }; 62 | -------------------------------------------------------------------------------- /packages/@chuhc/cli/lib/create.js: -------------------------------------------------------------------------------- 1 | /** 2 | * create project 3 | */ 4 | const fs = require('fs-extra'); 5 | const path = require('path'); 6 | const ora = require('ora'); 7 | const inquirer = require('inquirer'); 8 | const catchFn = require('./util/catchFn'); 9 | const PackageManager = require('./PackageManager'); 10 | const writeFileTree = require('./util/writeFileTree'); 11 | const template = require('@chuhc/template'); 12 | const { beforeCreate } = require('./util/checkVersion'); 13 | const { clear, validateName, forEachSetV } = require('./util'); 14 | const { setPkg, setPkgScripts, getPluginOptions } = require('./util/pkg'); 15 | 16 | const loading = ora(); 17 | 18 | const CHUHC_PLUGIN_CHECK = [ 19 | { 20 | name: 'Typescript', 21 | value: ['tsx', '@chuhc/plugin-typescript'], 22 | }, 23 | { 24 | name: 'Less', 25 | value: ['less', '@chuhc/plugin-less'], 26 | }, 27 | ]; 28 | 29 | async function create(pkgName) { 30 | validateName(pkgName); 31 | 32 | const cwd = process.cwd(); 33 | const targetDir = path.join(cwd, pkgName); 34 | 35 | await beforeCreate(); 36 | 37 | if (fs.existsSync(targetDir)) { 38 | clear(); 39 | 40 | const { overwrite } = await inquirer.prompt([ 41 | { 42 | type: 'list', 43 | message: `Target directory already exists. Can I overwrite it`, 44 | name: 'overwrite', 45 | choices: [ 46 | { name: 'Yes', value: true }, 47 | { name: 'No', value: false }, 48 | ], 49 | }, 50 | ]); 51 | 52 | overwrite || process.exit(1); 53 | await fs.remove(targetDir); 54 | } 55 | 56 | clear(); 57 | 58 | const { plugins: morePlugins } = await inquirer.prompt([ 59 | { 60 | type: 'checkbox', 61 | name: 'plugins', 62 | message: 'Do you need these plugins', 63 | choices: CHUHC_PLUGIN_CHECK, 64 | }, 65 | ]); 66 | 67 | loading.start('loading'); 68 | 69 | fs.mkdirSync(targetDir); 70 | 71 | const { options, plugins: devD } = getPluginOptions(morePlugins); 72 | const pm = new PackageManager({ pkgName }); 73 | const pkg = setPkg({ 74 | name: pkgName, 75 | dependencies: {}, 76 | devDependencies: {}, 77 | }); 78 | const depe = ['react', 'react-dom']; 79 | 80 | options.config = { 81 | plugins: devD.map((item) => [item, {}]), 82 | }; 83 | 84 | devD.push('babel-eslint', '@chuhc/scripts'); 85 | 86 | const promise = [ 87 | ...forEachSetV(depe, pkg, 'dependencies'), 88 | ...forEachSetV(devD, pkg, 'devDependencies'), 89 | ]; 90 | 91 | await Promise.all(promise); 92 | 93 | setPkgScripts(pkg); 94 | pm.cdPath(); 95 | 96 | writeFileTree(targetDir, { 97 | 'package.json': JSON.stringify(pkg, null, 2), 98 | }); 99 | 100 | loading.succeed('🚀 Initialization successful!'); 101 | 102 | pm.install(); 103 | 104 | options.git = pm.git(); 105 | 106 | template(options); 107 | 108 | loading.succeed('🎉 Successfully created project!'); 109 | console.log(); 110 | console.log(`$ cd ${pkgName}`); 111 | console.log('$ npm run dev'); 112 | console.log(); 113 | } 114 | 115 | module.exports = (...args) => catchFn(create, ...args); 116 | -------------------------------------------------------------------------------- /packages/@chuhc/cli/lib/update.js: -------------------------------------------------------------------------------- 1 | /** 2 | * check update 3 | */ 4 | const semver = require('semver'); 5 | const pkg = require('../package.json'); 6 | const catchFn = require('./util/catchFn'); 7 | const { checkVersion } = require('./util/checkVersion'); 8 | const { hasCnpm } = require('./util/env'); 9 | const { execSync } = require('child_process'); 10 | 11 | const MANAGER = hasCnpm() ? 'cnpm' : 'npm'; 12 | 13 | const getNewVersion = () => { 14 | const lastV = checkVersion(true); 15 | 16 | if (semver.gt(lastV, pkg.version)) { 17 | console.log('ready to upgrade'); 18 | execSync(`${MANAGER} update @chuhc/cli -g`); 19 | } else { 20 | console.log(`This is the latest version of ${pkg.version}`); 21 | } 22 | }; 23 | 24 | module.exports = (...args) => catchFn(getNewVersion, ...args); 25 | -------------------------------------------------------------------------------- /packages/@chuhc/cli/lib/util/catchFn.js: -------------------------------------------------------------------------------- 1 | /** 2 | * catch throw error 3 | */ 4 | module.exports = (fn, ...args) => { 5 | try { 6 | fn(...args); 7 | } catch (err) { 8 | console.log(err); 9 | } 10 | }; 11 | -------------------------------------------------------------------------------- /packages/@chuhc/cli/lib/util/checkVersion.js: -------------------------------------------------------------------------------- 1 | /** 2 | * version judge 3 | */ 4 | const semver = require('semver'); 5 | const inquirer = require('inquirer'); 6 | const pkg = require('../../package.json'); 7 | const fs = require('fs-extra'); 8 | const path = require('path'); 9 | const { hasCnpm } = require('./env'); 10 | const { execSync } = require('child_process'); 11 | 12 | const resolve = (_path) => path.join(__dirname, _path); 13 | 14 | const timePath = resolve('index.txt'); 15 | 16 | const MAX_TIME = 86400000; 17 | 18 | const MANAGER = hasCnpm() ? 'cnpm' : 'npm'; 19 | 20 | const checkVersion = (force = false) => { 21 | const lastTime = +fs.readFileSync(timePath).toString(); 22 | const nowTime = new Date().getTime(); 23 | 24 | if (!force && lastTime && nowTime - lastTime <= MAX_TIME) { 25 | return; 26 | } 27 | 28 | fs.writeFileSync(timePath, nowTime); 29 | 30 | const lastV = execSync(`${MANAGER} view @chuhc/cli version`, { 31 | encoding: 'utf8', 32 | }); 33 | return lastV; 34 | }; 35 | 36 | const beforeCreate = async () => { 37 | const lastV = checkVersion() || '1.0.0'; 38 | 39 | if (semver.gt(lastV, pkg.version)) { 40 | const { update } = await inquirer.prompt([ 41 | { 42 | type: 'list', 43 | message: `The latest version is ${lastV} do you need to upgrade`, 44 | name: 'update', 45 | choices: [ 46 | { name: 'Yes', value: true }, 47 | { name: 'No', value: false }, 48 | ], 49 | }, 50 | ]); 51 | 52 | update && execSync(`${MANAGER} update @chuhc/cli -g`); 53 | } 54 | 55 | return; 56 | }; 57 | 58 | module.exports = { 59 | checkVersion, 60 | beforeCreate, 61 | }; 62 | -------------------------------------------------------------------------------- /packages/@chuhc/cli/lib/util/env.js: -------------------------------------------------------------------------------- 1 | /** 2 | * environment 3 | */ 4 | const { execSync } = require('child_process'); 5 | 6 | let _env = { 7 | _hasYarn: null, 8 | _hasCnpm: null 9 | }; 10 | 11 | /** 12 | * judge env 13 | */ 14 | const judgeEnv = name => { 15 | const envKey = `_has${name[0].toUpperCase()}${name.slice(1)}`; 16 | 17 | if (_env[envKey] !== null) { 18 | return _env[envKey]; 19 | } 20 | 21 | try { 22 | execSync(`${name} --version`, { stdio: 'ignore' }); 23 | 24 | return (_env[envKey] = true); 25 | } catch (e) { 26 | return (_env[envKey] = false); 27 | } 28 | }; 29 | 30 | const hasYarn = judgeEnv.bind(this, 'yarn'); 31 | 32 | const hasCnpm = judgeEnv.bind(this, 'cnpm'); 33 | 34 | module.exports = { 35 | hasYarn, 36 | hasCnpm 37 | }; 38 | -------------------------------------------------------------------------------- /packages/@chuhc/cli/lib/util/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * some fn 3 | */ 4 | const { exec } = require('child_process'); 5 | const { hasCnpm } = require('./env'); 6 | const chalk = require('chalk'); 7 | const validateNpmPackageName = require('validate-npm-package-name'); 8 | 9 | /** 10 | * clear screen 11 | */ 12 | const clear = () => { 13 | process.stdout.write( 14 | process.platform === 'win32' ? '\x1Bc' : '\x1B[2J\x1B[3J\x1B[H' 15 | ); 16 | }; 17 | 18 | /** 19 | * judge package name 20 | */ 21 | const validateName = name => { 22 | const result = validateNpmPackageName(name); 23 | 24 | if (!result.validForNewPackages) { 25 | console.log(`Invalid project name: ${chalk.red(name)}`); 26 | 27 | result.warnings && 28 | result.warnings.forEach(warn => { 29 | console.log(chalk.red.dim(`warn: ${warn}`)); 30 | }); 31 | 32 | result.errors && 33 | result.errors.forEach(err => { 34 | console.log(chalk.red.dim(`err: ${err}`)); 35 | }); 36 | 37 | process.exit(1); 38 | } 39 | }; 40 | 41 | /** 42 | * set package.json npm package 43 | */ 44 | const forEachSetV = (list, obj, key) => { 45 | const promises = []; 46 | const manager = hasCnpm() ? 'cnpm' : 'npm'; 47 | 48 | list.forEach(item => { 49 | if (typeof item === 'object') { 50 | return forEachSetV(item, obj, key); 51 | } 52 | 53 | const newPromise = new Promise(res => { 54 | exec(`${manager} view ${item} version`, (err, stdout, stderr) => { 55 | obj[key][item] = stdout.slice(0, stdout.length - 1); 56 | res(0); 57 | }); 58 | }); 59 | 60 | promises.push(newPromise); 61 | }); 62 | 63 | return promises; 64 | }; 65 | 66 | module.exports = { 67 | clear, 68 | validateName, 69 | forEachSetV 70 | }; 71 | -------------------------------------------------------------------------------- /packages/@chuhc/cli/lib/util/index.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjj281795819/chuhc-react/d20ef1aced2e1923595cd60e36ee2f0e506e40c2/packages/@chuhc/cli/lib/util/index.txt -------------------------------------------------------------------------------- /packages/@chuhc/cli/lib/util/pkg.js: -------------------------------------------------------------------------------- 1 | const setPkg = options => { 2 | const { name, ...rest } = options; 3 | 4 | return { 5 | name, 6 | version: '1.0.0', 7 | private: true, 8 | description: '', 9 | main: 'index.js', 10 | scripts: {}, 11 | keywords: [], 12 | author: '', 13 | license: 'ISC', 14 | ...rest 15 | }; 16 | }; 17 | 18 | const setPkgScripts = pkg => { 19 | pkg.scripts = { 20 | dev: 'chuhc-scripts dev', 21 | build: 'chuhc-scripts build' 22 | }; 23 | }; 24 | 25 | const getPluginOptions = _plugin => { 26 | const options = {}; 27 | const plugins = []; 28 | 29 | _plugin.forEach(item => { 30 | const [opt, ...rest] = item; 31 | 32 | options[opt] = true; 33 | plugins.push(...rest); 34 | }); 35 | 36 | return { options, plugins }; 37 | }; 38 | 39 | module.exports = { 40 | setPkg, 41 | setPkgScripts, 42 | getPluginOptions 43 | }; 44 | -------------------------------------------------------------------------------- /packages/@chuhc/cli/lib/util/writeFileTree.js: -------------------------------------------------------------------------------- 1 | /** 2 | * write Files 3 | */ 4 | const fs = require('fs-extra'); 5 | const path = require('path'); 6 | 7 | module.exports = (dir, files) => { 8 | Object.keys(files).forEach((name) => { 9 | const pathName = path.join(dir, name); 10 | fs.ensureDirSync(path.dirname(pathName)); 11 | fs.writeFileSync(pathName, files[name]); 12 | }); 13 | }; 14 | -------------------------------------------------------------------------------- /packages/@chuhc/cli/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@chuhc/cli", 3 | "version": "1.0.3", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "@chuhc/template": { 8 | "version": "1.0.9", 9 | "resolved": "https://registry.npmjs.org/@chuhc/template/-/template-1.0.9.tgz", 10 | "integrity": "sha512-udOTZLyP7xjaSp03W9AgP9DSPUQ1hLsM6SaCBGeWJzgJ6qFEPA3gDCKQU/LTZSbr+H/icFi5+Hp2Js+mxiRP/A==" 11 | }, 12 | "@types/color-name": { 13 | "version": "1.1.1", 14 | "resolved": "http://bnpm.byted.org/@types/color-name/download/@types/color-name-1.1.1.tgz", 15 | "integrity": "sha1-HBJhu+qhCoBVu8XYq4S3sq/IRqA=" 16 | }, 17 | "ansi-escapes": { 18 | "version": "4.3.1", 19 | "resolved": "http://bnpm.byted.org/ansi-escapes/download/ansi-escapes-4.3.1.tgz", 20 | "integrity": "sha1-pcR8xDGB8fOP/XB2g3cA05VSKmE=", 21 | "requires": { 22 | "type-fest": "^0.11.0" 23 | } 24 | }, 25 | "ansi-regex": { 26 | "version": "5.0.0", 27 | "resolved": "http://bnpm.byted.org/ansi-regex/download/ansi-regex-5.0.0.tgz", 28 | "integrity": "sha1-OIU59VF5vzkznIGvMKZU1p+Hy3U=" 29 | }, 30 | "ansi-styles": { 31 | "version": "4.2.1", 32 | "resolved": "http://bnpm.byted.org/ansi-styles/download/ansi-styles-4.2.1.tgz", 33 | "integrity": "sha1-kK51xCTQCNJiTFvynq0xd+v881k=", 34 | "requires": { 35 | "@types/color-name": "^1.1.1", 36 | "color-convert": "^2.0.1" 37 | } 38 | }, 39 | "at-least-node": { 40 | "version": "1.0.0", 41 | "resolved": "http://bnpm.byted.org/at-least-node/download/at-least-node-1.0.0.tgz", 42 | "integrity": "sha1-YCzUtG6EStTv/JKoARo8RuAjjcI=" 43 | }, 44 | "builtins": { 45 | "version": "1.0.3", 46 | "resolved": "http://bnpm.byted.org/builtins/download/builtins-1.0.3.tgz", 47 | "integrity": "sha1-y5T662HIaWRR2zZTThQi+U8K7og=" 48 | }, 49 | "chalk": { 50 | "version": "4.1.0", 51 | "resolved": "http://bnpm.byted.org/chalk/download/chalk-4.1.0.tgz", 52 | "integrity": "sha1-ThSHCmGNni7dl92DRf2dncMVZGo=", 53 | "requires": { 54 | "ansi-styles": "^4.1.0", 55 | "supports-color": "^7.1.0" 56 | } 57 | }, 58 | "chardet": { 59 | "version": "0.7.0", 60 | "resolved": "http://bnpm.byted.org/chardet/download/chardet-0.7.0.tgz", 61 | "integrity": "sha1-kAlISfCTfy7twkJdDSip5fDLrZ4=" 62 | }, 63 | "cli-cursor": { 64 | "version": "3.1.0", 65 | "resolved": "http://bnpm.byted.org/cli-cursor/download/cli-cursor-3.1.0.tgz", 66 | "integrity": "sha1-JkMFp65JDR0Dvwybp8kl0XU68wc=", 67 | "requires": { 68 | "restore-cursor": "^3.1.0" 69 | } 70 | }, 71 | "cli-width": { 72 | "version": "3.0.0", 73 | "resolved": "http://bnpm.byted.org/cli-width/download/cli-width-3.0.0.tgz", 74 | "integrity": "sha1-ovSEN6LKqaIkNueUvwceyeYc7fY=" 75 | }, 76 | "color-convert": { 77 | "version": "2.0.1", 78 | "resolved": "http://bnpm.byted.org/color-convert/download/color-convert-2.0.1.tgz", 79 | "integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=", 80 | "requires": { 81 | "color-name": "~1.1.4" 82 | } 83 | }, 84 | "color-name": { 85 | "version": "1.1.4", 86 | "resolved": "http://bnpm.byted.org/color-name/download/color-name-1.1.4.tgz", 87 | "integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=" 88 | }, 89 | "commander": { 90 | "version": "6.1.0", 91 | "resolved": "http://bnpm.byted.org/commander/download/commander-6.1.0.tgz", 92 | "integrity": "sha1-+Ncit4EDFBAGtm9Me6HpcxW6dbw=" 93 | }, 94 | "emoji-regex": { 95 | "version": "8.0.0", 96 | "resolved": "http://bnpm.byted.org/emoji-regex/download/emoji-regex-8.0.0.tgz", 97 | "integrity": "sha1-6Bj9ac5cz8tARZT4QpY79TFkzDc=" 98 | }, 99 | "escape-string-regexp": { 100 | "version": "1.0.5", 101 | "resolved": "http://bnpm.byted.org/escape-string-regexp/download/escape-string-regexp-1.0.5.tgz", 102 | "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" 103 | }, 104 | "external-editor": { 105 | "version": "3.1.0", 106 | "resolved": "http://bnpm.byted.org/external-editor/download/external-editor-3.1.0.tgz", 107 | "integrity": "sha1-ywP3QL764D6k0oPK7SdBqD8zVJU=", 108 | "requires": { 109 | "chardet": "^0.7.0", 110 | "iconv-lite": "^0.4.24", 111 | "tmp": "^0.0.33" 112 | } 113 | }, 114 | "figures": { 115 | "version": "3.2.0", 116 | "resolved": "http://bnpm.byted.org/figures/download/figures-3.2.0.tgz", 117 | "integrity": "sha1-YlwYvSk8YE3EqN2y/r8MiDQXRq8=", 118 | "requires": { 119 | "escape-string-regexp": "^1.0.5" 120 | } 121 | }, 122 | "fs-extra": { 123 | "version": "9.0.1", 124 | "resolved": "http://bnpm.byted.org/fs-extra/download/fs-extra-9.0.1.tgz", 125 | "integrity": "sha1-kQ2gBiQ3ukw5/t2GPxZ1zP78ufw=", 126 | "requires": { 127 | "at-least-node": "^1.0.0", 128 | "graceful-fs": "^4.2.0", 129 | "jsonfile": "^6.0.1", 130 | "universalify": "^1.0.0" 131 | } 132 | }, 133 | "graceful-fs": { 134 | "version": "4.2.4", 135 | "resolved": "http://bnpm.byted.org/graceful-fs/download/graceful-fs-4.2.4.tgz", 136 | "integrity": "sha1-Ila94U02MpWMRl68ltxGfKB6Kfs=" 137 | }, 138 | "has-flag": { 139 | "version": "4.0.0", 140 | "resolved": "http://bnpm.byted.org/has-flag/download/has-flag-4.0.0.tgz", 141 | "integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=" 142 | }, 143 | "iconv-lite": { 144 | "version": "0.4.24", 145 | "resolved": "http://bnpm.byted.org/iconv-lite/download/iconv-lite-0.4.24.tgz", 146 | "integrity": "sha1-ICK0sl+93CHS9SSXSkdKr+czkIs=", 147 | "requires": { 148 | "safer-buffer": ">= 2.1.2 < 3" 149 | } 150 | }, 151 | "inquirer": { 152 | "version": "7.3.3", 153 | "resolved": "http://bnpm.byted.org/inquirer/download/inquirer-7.3.3.tgz", 154 | "integrity": "sha1-BNF2sq8Er8FXqD/XwQDpjuCq0AM=", 155 | "requires": { 156 | "ansi-escapes": "^4.2.1", 157 | "chalk": "^4.1.0", 158 | "cli-cursor": "^3.1.0", 159 | "cli-width": "^3.0.0", 160 | "external-editor": "^3.0.3", 161 | "figures": "^3.0.0", 162 | "lodash": "^4.17.19", 163 | "mute-stream": "0.0.8", 164 | "run-async": "^2.4.0", 165 | "rxjs": "^6.6.0", 166 | "string-width": "^4.1.0", 167 | "strip-ansi": "^6.0.0", 168 | "through": "^2.3.6" 169 | } 170 | }, 171 | "is-fullwidth-code-point": { 172 | "version": "3.0.0", 173 | "resolved": "http://bnpm.byted.org/is-fullwidth-code-point/download/is-fullwidth-code-point-3.0.0.tgz", 174 | "integrity": "sha1-8Rb4Bk/pCz94RKOJl8C3UFEmnx0=" 175 | }, 176 | "jsonfile": { 177 | "version": "6.0.1", 178 | "resolved": "http://bnpm.byted.org/jsonfile/download/jsonfile-6.0.1.tgz", 179 | "integrity": "sha1-mJZsuiFDeMjIS4LghZB7QL9hQXk=", 180 | "requires": { 181 | "graceful-fs": "^4.1.6", 182 | "universalify": "^1.0.0" 183 | } 184 | }, 185 | "lodash": { 186 | "version": "4.17.20", 187 | "resolved": "http://bnpm.byted.org/lodash/download/lodash-4.17.20.tgz", 188 | "integrity": "sha1-tEqbYpe8tpjxxRo1RaKzs2jVnFI=" 189 | }, 190 | "mimic-fn": { 191 | "version": "2.1.0", 192 | "resolved": "http://bnpm.byted.org/mimic-fn/download/mimic-fn-2.1.0.tgz", 193 | "integrity": "sha1-ftLCzMyvhNP/y3pptXcR/CCDQBs=" 194 | }, 195 | "mute-stream": { 196 | "version": "0.0.8", 197 | "resolved": "http://bnpm.byted.org/mute-stream/download/mute-stream-0.0.8.tgz", 198 | "integrity": "sha1-FjDEKyJR/4HiooPelqVJfqkuXg0=" 199 | }, 200 | "onetime": { 201 | "version": "5.1.2", 202 | "resolved": "http://bnpm.byted.org/onetime/download/onetime-5.1.2.tgz", 203 | "integrity": "sha1-0Oluu1awdHbfHdnEgG5SN5hcpF4=", 204 | "requires": { 205 | "mimic-fn": "^2.1.0" 206 | } 207 | }, 208 | "os-tmpdir": { 209 | "version": "1.0.2", 210 | "resolved": "http://bnpm.byted.org/os-tmpdir/download/os-tmpdir-1.0.2.tgz", 211 | "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" 212 | }, 213 | "restore-cursor": { 214 | "version": "3.1.0", 215 | "resolved": "http://bnpm.byted.org/restore-cursor/download/restore-cursor-3.1.0.tgz", 216 | "integrity": "sha1-OfZ8VLOnpYzqUjbZXPADQjljH34=", 217 | "requires": { 218 | "onetime": "^5.1.0", 219 | "signal-exit": "^3.0.2" 220 | } 221 | }, 222 | "run-async": { 223 | "version": "2.4.1", 224 | "resolved": "http://bnpm.byted.org/run-async/download/run-async-2.4.1.tgz", 225 | "integrity": "sha1-hEDsz5nqPnC9QJ1JqriOEMGJpFU=" 226 | }, 227 | "rxjs": { 228 | "version": "6.6.3", 229 | "resolved": "http://bnpm.byted.org/rxjs/download/rxjs-6.6.3.tgz", 230 | "integrity": "sha1-jKhGNcTaqQDA05Z6buesYCce5VI=", 231 | "requires": { 232 | "tslib": "^1.9.0" 233 | } 234 | }, 235 | "safer-buffer": { 236 | "version": "2.1.2", 237 | "resolved": "http://bnpm.byted.org/safer-buffer/download/safer-buffer-2.1.2.tgz", 238 | "integrity": "sha1-RPoWGwGHuVSd2Eu5GAL5vYOFzWo=" 239 | }, 240 | "semver": { 241 | "version": "7.3.2", 242 | "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", 243 | "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==" 244 | }, 245 | "signal-exit": { 246 | "version": "3.0.3", 247 | "resolved": "http://bnpm.byted.org/signal-exit/download/signal-exit-3.0.3.tgz", 248 | "integrity": "sha1-oUEMLt2PB3sItOJTyOrPyvBXRhw=" 249 | }, 250 | "string-width": { 251 | "version": "4.2.0", 252 | "resolved": "http://bnpm.byted.org/string-width/download/string-width-4.2.0.tgz", 253 | "integrity": "sha1-lSGCxGzHssMT0VluYjmSvRY7crU=", 254 | "requires": { 255 | "emoji-regex": "^8.0.0", 256 | "is-fullwidth-code-point": "^3.0.0", 257 | "strip-ansi": "^6.0.0" 258 | } 259 | }, 260 | "strip-ansi": { 261 | "version": "6.0.0", 262 | "resolved": "http://bnpm.byted.org/strip-ansi/download/strip-ansi-6.0.0.tgz", 263 | "integrity": "sha1-CxVx3XZpzNTz4G4U7x7tJiJa5TI=", 264 | "requires": { 265 | "ansi-regex": "^5.0.0" 266 | } 267 | }, 268 | "supports-color": { 269 | "version": "7.2.0", 270 | "resolved": "http://bnpm.byted.org/supports-color/download/supports-color-7.2.0.tgz", 271 | "integrity": "sha1-G33NyzK4E4gBs+R4umpRyqiWSNo=", 272 | "requires": { 273 | "has-flag": "^4.0.0" 274 | } 275 | }, 276 | "through": { 277 | "version": "2.3.8", 278 | "resolved": "http://bnpm.byted.org/through/download/through-2.3.8.tgz", 279 | "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" 280 | }, 281 | "tmp": { 282 | "version": "0.0.33", 283 | "resolved": "http://bnpm.byted.org/tmp/download/tmp-0.0.33.tgz", 284 | "integrity": "sha1-bTQzWIl2jSGyvNoKonfO07G/rfk=", 285 | "requires": { 286 | "os-tmpdir": "~1.0.2" 287 | } 288 | }, 289 | "tslib": { 290 | "version": "1.13.0", 291 | "resolved": "http://bnpm.byted.org/tslib/download/tslib-1.13.0.tgz", 292 | "integrity": "sha1-yIHhPMcBWJTtkUhi0nZDb6mkcEM=" 293 | }, 294 | "type-fest": { 295 | "version": "0.11.0", 296 | "resolved": "http://bnpm.byted.org/type-fest/download/type-fest-0.11.0.tgz", 297 | "integrity": "sha1-l6vwhyMQ/tiKXEZrJWgVdhReM/E=" 298 | }, 299 | "universalify": { 300 | "version": "1.0.0", 301 | "resolved": "http://bnpm.byted.org/universalify/download/universalify-1.0.0.tgz", 302 | "integrity": "sha1-thodoXPoQ1sv48Z9Kbmt+FlL0W0=" 303 | }, 304 | "validate-npm-package-name": { 305 | "version": "3.0.0", 306 | "resolved": "http://bnpm.byted.org/validate-npm-package-name/download/validate-npm-package-name-3.0.0.tgz", 307 | "integrity": "sha1-X6kS2B630MdK/BQN5zF/DKffQ34=", 308 | "requires": { 309 | "builtins": "^1.0.3" 310 | } 311 | } 312 | } 313 | } 314 | -------------------------------------------------------------------------------- /packages/@chuhc/cli/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@chuhc/cli", 3 | "version": "1.0.4", 4 | "description": "江鱼儿脚手架cli部分", 5 | "main": "index.js", 6 | "bin": { 7 | "chuhc": "./bin/chuhc.js" 8 | }, 9 | "scripts": { 10 | "test": "echo \"Error: no test specified\" && exit 1" 11 | }, 12 | "keywords": [ 13 | "react", 14 | "chuhc", 15 | "@chuhc/cli" 16 | ], 17 | "author": "cjj281795819", 18 | "license": "ISC", 19 | "dependencies": { 20 | "@chuhc/template": "1.0.9", 21 | "chalk": "^4.1.0", 22 | "commander": "^6.1.0", 23 | "fs-extra": "^9.0.1", 24 | "inquirer": "^7.3.3", 25 | "semver": "^7.3.2", 26 | "validate-npm-package-name": "^3.0.0" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /packages/@chuhc/plugin-less/index.js: -------------------------------------------------------------------------------- 1 | const MiniCssExtractPlugin = require('mini-css-extract-plugin'); 2 | 3 | module.exports = config => { 4 | const _config = config.module.rule('less').test(/\.less$/); 5 | const use = [MiniCssExtractPlugin.loader, 'css-loader', 'less-loader']; 6 | use.forEach(item => { 7 | if (typeof item === 'string') { 8 | _config.use(item).loader(item); 9 | } else { 10 | throw new Error('这里待补齐'); 11 | } 12 | }); 13 | }; 14 | -------------------------------------------------------------------------------- /packages/@chuhc/plugin-less/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "plugin-less", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "@types/json-schema": { 8 | "version": "7.0.6", 9 | "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.6.tgz", 10 | "integrity": "sha512-3c+yGKvVP5Y9TYBEibGNR+kLtijnj7mYrXRg+WpFb2X9xm04g/DXYkfg4hmzJQosc9snFNUPkbYIhu+KAm6jJw==" 11 | }, 12 | "ajv": { 13 | "version": "6.12.5", 14 | "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.5.tgz", 15 | "integrity": "sha512-lRF8RORchjpKG50/WFf8xmg7sgCLFiYNNnqdKflk63whMQcWR5ngGjiSXkL9bjxy6B2npOK2HSMN49jEBMSkag==", 16 | "requires": { 17 | "fast-deep-equal": "^3.1.1", 18 | "fast-json-stable-stringify": "^2.0.0", 19 | "json-schema-traverse": "^0.4.1", 20 | "uri-js": "^4.2.2" 21 | } 22 | }, 23 | "ajv-keywords": { 24 | "version": "3.5.2", 25 | "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", 26 | "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==" 27 | }, 28 | "big.js": { 29 | "version": "5.2.2", 30 | "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", 31 | "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==" 32 | }, 33 | "emojis-list": { 34 | "version": "3.0.0", 35 | "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", 36 | "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==" 37 | }, 38 | "errno": { 39 | "version": "0.1.7", 40 | "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", 41 | "integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==", 42 | "optional": true, 43 | "requires": { 44 | "prr": "~1.0.1" 45 | } 46 | }, 47 | "fast-deep-equal": { 48 | "version": "3.1.3", 49 | "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", 50 | "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" 51 | }, 52 | "fast-json-stable-stringify": { 53 | "version": "2.1.0", 54 | "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", 55 | "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" 56 | }, 57 | "graceful-fs": { 58 | "version": "4.2.4", 59 | "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", 60 | "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", 61 | "optional": true 62 | }, 63 | "image-size": { 64 | "version": "0.5.5", 65 | "resolved": "https://registry.npmjs.org/image-size/-/image-size-0.5.5.tgz", 66 | "integrity": "sha1-Cd/Uq50g4p6xw+gLiZA3jfnjy5w=", 67 | "optional": true 68 | }, 69 | "is-plain-obj": { 70 | "version": "1.1.0", 71 | "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", 72 | "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=" 73 | }, 74 | "json-schema-traverse": { 75 | "version": "0.4.1", 76 | "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", 77 | "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" 78 | }, 79 | "json5": { 80 | "version": "2.1.3", 81 | "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", 82 | "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==", 83 | "requires": { 84 | "minimist": "^1.2.5" 85 | } 86 | }, 87 | "klona": { 88 | "version": "2.0.4", 89 | "resolved": "https://registry.npmjs.org/klona/-/klona-2.0.4.tgz", 90 | "integrity": "sha512-ZRbnvdg/NxqzC7L9Uyqzf4psi1OM4Cuc+sJAkQPjO6XkQIJTNbfK2Rsmbw8fx1p2mkZdp2FZYo2+LwXYY/uwIA==" 91 | }, 92 | "less": { 93 | "version": "3.12.2", 94 | "resolved": "https://registry.npmjs.org/less/-/less-3.12.2.tgz", 95 | "integrity": "sha512-+1V2PCMFkL+OIj2/HrtrvZw0BC0sYLMICJfbQjuj/K8CEnlrFX6R5cKKgzzttsZDHyxQNL1jqMREjKN3ja/E3Q==", 96 | "requires": { 97 | "errno": "^0.1.1", 98 | "graceful-fs": "^4.1.2", 99 | "image-size": "~0.5.0", 100 | "make-dir": "^2.1.0", 101 | "mime": "^1.4.1", 102 | "native-request": "^1.0.5", 103 | "source-map": "~0.6.0", 104 | "tslib": "^1.10.0" 105 | } 106 | }, 107 | "less-loader": { 108 | "version": "7.0.2", 109 | "resolved": "https://registry.npmjs.org/less-loader/-/less-loader-7.0.2.tgz", 110 | "integrity": "sha512-7MKlgjnkCf63E3Lv6w2FvAEgLMx3d/tNBExITcanAq7ys5U8VPWT3F6xcRjYmdNfkoQ9udoVFb1r2azSiTnD6w==", 111 | "requires": { 112 | "klona": "^2.0.4", 113 | "loader-utils": "^2.0.0", 114 | "schema-utils": "^3.0.0" 115 | } 116 | }, 117 | "loader-utils": { 118 | "version": "2.0.0", 119 | "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz", 120 | "integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==", 121 | "requires": { 122 | "big.js": "^5.2.2", 123 | "emojis-list": "^3.0.0", 124 | "json5": "^2.1.2" 125 | } 126 | }, 127 | "make-dir": { 128 | "version": "2.1.0", 129 | "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", 130 | "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", 131 | "optional": true, 132 | "requires": { 133 | "pify": "^4.0.1", 134 | "semver": "^5.6.0" 135 | } 136 | }, 137 | "mime": { 138 | "version": "1.6.0", 139 | "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", 140 | "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", 141 | "optional": true 142 | }, 143 | "mini-css-extract-plugin": { 144 | "version": "1.0.0", 145 | "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-1.0.0.tgz", 146 | "integrity": "sha512-IsmrPv1nkdSUtFCDrAsuv5kg0k/27sLxfXqSz8vLjnbRKrNgoRdQrUNA4MppawvD+GHLkNP6L1P93Bw50ALkbg==", 147 | "requires": { 148 | "loader-utils": "^2.0.0", 149 | "normalize-url": "1.9.1", 150 | "schema-utils": "^3.0.0", 151 | "webpack-sources": "^1.1.0" 152 | } 153 | }, 154 | "minimist": { 155 | "version": "1.2.5", 156 | "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", 157 | "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" 158 | }, 159 | "native-request": { 160 | "version": "1.0.7", 161 | "resolved": "https://registry.npmjs.org/native-request/-/native-request-1.0.7.tgz", 162 | "integrity": "sha512-9nRjinI9bmz+S7dgNtf4A70+/vPhnd+2krGpy4SUlADuOuSa24IDkNaZ+R/QT1wQ6S8jBdi6wE7fLekFZNfUpQ==", 163 | "optional": true 164 | }, 165 | "normalize-url": { 166 | "version": "1.9.1", 167 | "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-1.9.1.tgz", 168 | "integrity": "sha1-LMDWazHqIwNkWENuNiDYWVTGbDw=", 169 | "requires": { 170 | "object-assign": "^4.0.1", 171 | "prepend-http": "^1.0.0", 172 | "query-string": "^4.1.0", 173 | "sort-keys": "^1.0.0" 174 | } 175 | }, 176 | "object-assign": { 177 | "version": "4.1.1", 178 | "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", 179 | "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" 180 | }, 181 | "pify": { 182 | "version": "4.0.1", 183 | "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", 184 | "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", 185 | "optional": true 186 | }, 187 | "prepend-http": { 188 | "version": "1.0.4", 189 | "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", 190 | "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=" 191 | }, 192 | "prr": { 193 | "version": "1.0.1", 194 | "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", 195 | "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=", 196 | "optional": true 197 | }, 198 | "punycode": { 199 | "version": "2.1.1", 200 | "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", 201 | "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" 202 | }, 203 | "query-string": { 204 | "version": "4.3.4", 205 | "resolved": "https://registry.npmjs.org/query-string/-/query-string-4.3.4.tgz", 206 | "integrity": "sha1-u7aTucqRXCMlFbIosaArYJBD2+s=", 207 | "requires": { 208 | "object-assign": "^4.1.0", 209 | "strict-uri-encode": "^1.0.0" 210 | } 211 | }, 212 | "schema-utils": { 213 | "version": "3.0.0", 214 | "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.0.0.tgz", 215 | "integrity": "sha512-6D82/xSzO094ajanoOSbe4YvXWMfn2A//8Y1+MUqFAJul5Bs+yn36xbK9OtNDcRVSBJ9jjeoXftM6CfztsjOAA==", 216 | "requires": { 217 | "@types/json-schema": "^7.0.6", 218 | "ajv": "^6.12.5", 219 | "ajv-keywords": "^3.5.2" 220 | } 221 | }, 222 | "semver": { 223 | "version": "5.7.1", 224 | "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", 225 | "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", 226 | "optional": true 227 | }, 228 | "sort-keys": { 229 | "version": "1.1.2", 230 | "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-1.1.2.tgz", 231 | "integrity": "sha1-RBttTTRnmPG05J6JIK37oOVD+a0=", 232 | "requires": { 233 | "is-plain-obj": "^1.0.0" 234 | } 235 | }, 236 | "source-list-map": { 237 | "version": "2.0.1", 238 | "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz", 239 | "integrity": "sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==" 240 | }, 241 | "source-map": { 242 | "version": "0.6.1", 243 | "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", 244 | "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" 245 | }, 246 | "strict-uri-encode": { 247 | "version": "1.1.0", 248 | "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", 249 | "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=" 250 | }, 251 | "tslib": { 252 | "version": "1.14.1", 253 | "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", 254 | "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" 255 | }, 256 | "uri-js": { 257 | "version": "4.4.0", 258 | "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.0.tgz", 259 | "integrity": "sha512-B0yRTzYdUCCn9n+F4+Gh4yIDtMQcaJsmYBDsTSG8g/OejKBodLQ2IHfN3bM7jUsRXndopT7OIXWdYqc1fjmV6g==", 260 | "requires": { 261 | "punycode": "^2.1.0" 262 | } 263 | }, 264 | "webpack-sources": { 265 | "version": "1.4.3", 266 | "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.4.3.tgz", 267 | "integrity": "sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ==", 268 | "requires": { 269 | "source-list-map": "^2.0.0", 270 | "source-map": "~0.6.1" 271 | } 272 | } 273 | } 274 | } 275 | -------------------------------------------------------------------------------- /packages/@chuhc/plugin-less/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@chuhc/plugin-less", 3 | "version": "1.0.1", 4 | "description": "江鱼儿呃呃呃less插件", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [ 10 | "react", 11 | "chuhc", 12 | "@chuhc/plugin-less" 13 | ], 14 | "author": "", 15 | "license": "ISC", 16 | "peerDependencies": { 17 | "mini-css-extract-plugin": "^1.0.0" 18 | }, 19 | "dependencies": { 20 | "less": "^3.12.2", 21 | "less-loader": "^7.0.2" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /packages/@chuhc/plugin-typescript/README.md: -------------------------------------------------------------------------------- 1 | # chuhc-cli 脚手架 2 | 3 | plugin-typescript 部分 4 | 5 | 待更新 6 | -------------------------------------------------------------------------------- /packages/@chuhc/plugin-typescript/index.js: -------------------------------------------------------------------------------- 1 | module.exports = config => { 2 | ['.tsx', '.ts'].forEach(item => config.resolve.extensions.add(item)); 3 | 4 | config.module 5 | .rule('js') 6 | .test(/\.(js|ts|tsx|jsx)$/) 7 | .use('babel-loader') 8 | .tap(options => { 9 | options.presets.push('@babel/preset-typescript'); 10 | return options; 11 | }); 12 | }; 13 | -------------------------------------------------------------------------------- /packages/@chuhc/plugin-typescript/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "plugin-typescript", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "@babel/code-frame": { 8 | "version": "7.10.4", 9 | "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", 10 | "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", 11 | "requires": { 12 | "@babel/highlight": "^7.10.4" 13 | } 14 | }, 15 | "@babel/generator": { 16 | "version": "7.11.6", 17 | "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.11.6.tgz", 18 | "integrity": "sha512-DWtQ1PV3r+cLbySoHrwn9RWEgKMBLLma4OBQloPRyDYvc5msJM9kvTLo1YnlJd1P/ZuKbdli3ijr5q3FvAF3uA==", 19 | "requires": { 20 | "@babel/types": "^7.11.5", 21 | "jsesc": "^2.5.1", 22 | "source-map": "^0.5.0" 23 | } 24 | }, 25 | "@babel/helper-create-class-features-plugin": { 26 | "version": "7.10.5", 27 | "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.10.5.tgz", 28 | "integrity": "sha512-0nkdeijB7VlZoLT3r/mY3bUkw3T8WG/hNw+FATs/6+pG2039IJWjTYL0VTISqsNHMUTEnwbVnc89WIJX9Qed0A==", 29 | "requires": { 30 | "@babel/helper-function-name": "^7.10.4", 31 | "@babel/helper-member-expression-to-functions": "^7.10.5", 32 | "@babel/helper-optimise-call-expression": "^7.10.4", 33 | "@babel/helper-plugin-utils": "^7.10.4", 34 | "@babel/helper-replace-supers": "^7.10.4", 35 | "@babel/helper-split-export-declaration": "^7.10.4" 36 | } 37 | }, 38 | "@babel/helper-function-name": { 39 | "version": "7.10.4", 40 | "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.10.4.tgz", 41 | "integrity": "sha512-YdaSyz1n8gY44EmN7x44zBn9zQ1Ry2Y+3GTA+3vH6Mizke1Vw0aWDM66FOYEPw8//qKkmqOckrGgTYa+6sceqQ==", 42 | "requires": { 43 | "@babel/helper-get-function-arity": "^7.10.4", 44 | "@babel/template": "^7.10.4", 45 | "@babel/types": "^7.10.4" 46 | } 47 | }, 48 | "@babel/helper-get-function-arity": { 49 | "version": "7.10.4", 50 | "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.10.4.tgz", 51 | "integrity": "sha512-EkN3YDB+SRDgiIUnNgcmiD361ti+AVbL3f3Henf6dqqUyr5dMsorno0lJWJuLhDhkI5sYEpgj6y9kB8AOU1I2A==", 52 | "requires": { 53 | "@babel/types": "^7.10.4" 54 | } 55 | }, 56 | "@babel/helper-member-expression-to-functions": { 57 | "version": "7.11.0", 58 | "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.11.0.tgz", 59 | "integrity": "sha512-JbFlKHFntRV5qKw3YC0CvQnDZ4XMwgzzBbld7Ly4Mj4cbFy3KywcR8NtNctRToMWJOVvLINJv525Gd6wwVEx/Q==", 60 | "requires": { 61 | "@babel/types": "^7.11.0" 62 | } 63 | }, 64 | "@babel/helper-optimise-call-expression": { 65 | "version": "7.10.4", 66 | "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.10.4.tgz", 67 | "integrity": "sha512-n3UGKY4VXwXThEiKrgRAoVPBMqeoPgHVqiHZOanAJCG9nQUL2pLRQirUzl0ioKclHGpGqRgIOkgcIJaIWLpygg==", 68 | "requires": { 69 | "@babel/types": "^7.10.4" 70 | } 71 | }, 72 | "@babel/helper-plugin-utils": { 73 | "version": "7.10.4", 74 | "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz", 75 | "integrity": "sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg==" 76 | }, 77 | "@babel/helper-replace-supers": { 78 | "version": "7.10.4", 79 | "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.10.4.tgz", 80 | "integrity": "sha512-sPxZfFXocEymYTdVK1UNmFPBN+Hv5mJkLPsYWwGBxZAxaWfFu+xqp7b6qWD0yjNuNL2VKc6L5M18tOXUP7NU0A==", 81 | "requires": { 82 | "@babel/helper-member-expression-to-functions": "^7.10.4", 83 | "@babel/helper-optimise-call-expression": "^7.10.4", 84 | "@babel/traverse": "^7.10.4", 85 | "@babel/types": "^7.10.4" 86 | } 87 | }, 88 | "@babel/helper-split-export-declaration": { 89 | "version": "7.11.0", 90 | "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.11.0.tgz", 91 | "integrity": "sha512-74Vejvp6mHkGE+m+k5vHY93FX2cAtrw1zXrZXRlG4l410Nm9PxfEiVTn1PjDPV5SnmieiueY4AFg2xqhNFuuZg==", 92 | "requires": { 93 | "@babel/types": "^7.11.0" 94 | } 95 | }, 96 | "@babel/helper-validator-identifier": { 97 | "version": "7.10.4", 98 | "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", 99 | "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==" 100 | }, 101 | "@babel/highlight": { 102 | "version": "7.10.4", 103 | "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", 104 | "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", 105 | "requires": { 106 | "@babel/helper-validator-identifier": "^7.10.4", 107 | "chalk": "^2.0.0", 108 | "js-tokens": "^4.0.0" 109 | } 110 | }, 111 | "@babel/parser": { 112 | "version": "7.11.5", 113 | "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.11.5.tgz", 114 | "integrity": "sha512-X9rD8qqm695vgmeaQ4fvz/o3+Wk4ZzQvSHkDBgpYKxpD4qTAUm88ZKtHkVqIOsYFFbIQ6wQYhC6q7pjqVK0E0Q==" 115 | }, 116 | "@babel/plugin-syntax-typescript": { 117 | "version": "7.10.4", 118 | "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.10.4.tgz", 119 | "integrity": "sha512-oSAEz1YkBCAKr5Yiq8/BNtvSAPwkp/IyUnwZogd8p+F0RuYQQrLeRUzIQhueQTTBy/F+a40uS7OFKxnkRvmvFQ==", 120 | "requires": { 121 | "@babel/helper-plugin-utils": "^7.10.4" 122 | } 123 | }, 124 | "@babel/plugin-transform-typescript": { 125 | "version": "7.11.0", 126 | "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.11.0.tgz", 127 | "integrity": "sha512-edJsNzTtvb3MaXQwj8403B7mZoGu9ElDJQZOKjGUnvilquxBA3IQoEIOvkX/1O8xfAsnHS/oQhe2w/IXrr+w0w==", 128 | "requires": { 129 | "@babel/helper-create-class-features-plugin": "^7.10.5", 130 | "@babel/helper-plugin-utils": "^7.10.4", 131 | "@babel/plugin-syntax-typescript": "^7.10.4" 132 | } 133 | }, 134 | "@babel/preset-typescript": { 135 | "version": "7.10.4", 136 | "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.10.4.tgz", 137 | "integrity": "sha512-SdYnvGPv+bLlwkF2VkJnaX/ni1sMNetcGI1+nThF1gyv6Ph8Qucc4ZZAjM5yZcE/AKRXIOTZz7eSRDWOEjPyRQ==", 138 | "requires": { 139 | "@babel/helper-plugin-utils": "^7.10.4", 140 | "@babel/plugin-transform-typescript": "^7.10.4" 141 | } 142 | }, 143 | "@babel/template": { 144 | "version": "7.10.4", 145 | "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.10.4.tgz", 146 | "integrity": "sha512-ZCjD27cGJFUB6nmCB1Enki3r+L5kJveX9pq1SvAUKoICy6CZ9yD8xO086YXdYhvNjBdnekm4ZnaP5yC8Cs/1tA==", 147 | "requires": { 148 | "@babel/code-frame": "^7.10.4", 149 | "@babel/parser": "^7.10.4", 150 | "@babel/types": "^7.10.4" 151 | } 152 | }, 153 | "@babel/traverse": { 154 | "version": "7.11.5", 155 | "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.11.5.tgz", 156 | "integrity": "sha512-EjiPXt+r7LiCZXEfRpSJd+jUMnBd4/9OUv7Nx3+0u9+eimMwJmG0Q98lw4/289JCoxSE8OolDMNZaaF/JZ69WQ==", 157 | "requires": { 158 | "@babel/code-frame": "^7.10.4", 159 | "@babel/generator": "^7.11.5", 160 | "@babel/helper-function-name": "^7.10.4", 161 | "@babel/helper-split-export-declaration": "^7.11.0", 162 | "@babel/parser": "^7.11.5", 163 | "@babel/types": "^7.11.5", 164 | "debug": "^4.1.0", 165 | "globals": "^11.1.0", 166 | "lodash": "^4.17.19" 167 | } 168 | }, 169 | "@babel/types": { 170 | "version": "7.11.5", 171 | "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.5.tgz", 172 | "integrity": "sha512-bvM7Qz6eKnJVFIn+1LPtjlBFPVN5jNDc1XmN15vWe7Q3DPBufWWsLiIvUu7xW87uTG6QoggpIDnUgLQvPheU+Q==", 173 | "requires": { 174 | "@babel/helper-validator-identifier": "^7.10.4", 175 | "lodash": "^4.17.19", 176 | "to-fast-properties": "^2.0.0" 177 | } 178 | }, 179 | "@types/prop-types": { 180 | "version": "15.7.3", 181 | "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.3.tgz", 182 | "integrity": "sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw==" 183 | }, 184 | "@types/react": { 185 | "version": "16.9.51", 186 | "resolved": "https://registry.npmjs.org/@types/react/-/react-16.9.51.tgz", 187 | "integrity": "sha512-lQa12IyO+DMlnSZ3+AGHRUiUcpK47aakMMoBG8f7HGxJT8Yfe+WE128HIXaHOHVPReAW0oDS3KAI0JI2DDe1PQ==", 188 | "requires": { 189 | "@types/prop-types": "*", 190 | "csstype": "^3.0.2" 191 | } 192 | }, 193 | "@types/react-dom": { 194 | "version": "16.9.8", 195 | "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-16.9.8.tgz", 196 | "integrity": "sha512-ykkPQ+5nFknnlU6lDd947WbQ6TE3NNzbQAkInC2EKY1qeYdTKp7onFusmYZb+ityzx2YviqT6BXSu+LyWWJwcA==", 197 | "requires": { 198 | "@types/react": "*" 199 | } 200 | }, 201 | "ansi-styles": { 202 | "version": "3.2.1", 203 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", 204 | "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", 205 | "requires": { 206 | "color-convert": "^1.9.0" 207 | } 208 | }, 209 | "chalk": { 210 | "version": "2.4.2", 211 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", 212 | "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", 213 | "requires": { 214 | "ansi-styles": "^3.2.1", 215 | "escape-string-regexp": "^1.0.5", 216 | "supports-color": "^5.3.0" 217 | } 218 | }, 219 | "clone-deep": { 220 | "version": "4.0.1", 221 | "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", 222 | "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", 223 | "requires": { 224 | "is-plain-object": "^2.0.4", 225 | "kind-of": "^6.0.2", 226 | "shallow-clone": "^3.0.0" 227 | } 228 | }, 229 | "color-convert": { 230 | "version": "1.9.3", 231 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", 232 | "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", 233 | "requires": { 234 | "color-name": "1.1.3" 235 | } 236 | }, 237 | "color-name": { 238 | "version": "1.1.3", 239 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", 240 | "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" 241 | }, 242 | "csstype": { 243 | "version": "3.0.3", 244 | "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.0.3.tgz", 245 | "integrity": "sha512-jPl+wbWPOWJ7SXsWyqGRk3lGecbar0Cb0OvZF/r/ZU011R4YqiRehgkQ9p4eQfo9DSDLqLL3wHwfxeJiuIsNag==" 246 | }, 247 | "debug": { 248 | "version": "4.2.0", 249 | "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", 250 | "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", 251 | "requires": { 252 | "ms": "2.1.2" 253 | } 254 | }, 255 | "escape-string-regexp": { 256 | "version": "1.0.5", 257 | "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", 258 | "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" 259 | }, 260 | "globals": { 261 | "version": "11.12.0", 262 | "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", 263 | "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==" 264 | }, 265 | "has-flag": { 266 | "version": "3.0.0", 267 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", 268 | "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" 269 | }, 270 | "is-plain-object": { 271 | "version": "2.0.4", 272 | "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", 273 | "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", 274 | "requires": { 275 | "isobject": "^3.0.1" 276 | } 277 | }, 278 | "isobject": { 279 | "version": "3.0.1", 280 | "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", 281 | "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" 282 | }, 283 | "js-tokens": { 284 | "version": "4.0.0", 285 | "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", 286 | "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" 287 | }, 288 | "jsesc": { 289 | "version": "2.5.2", 290 | "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", 291 | "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==" 292 | }, 293 | "kind-of": { 294 | "version": "6.0.3", 295 | "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", 296 | "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==" 297 | }, 298 | "lodash": { 299 | "version": "4.17.20", 300 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", 301 | "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" 302 | }, 303 | "ms": { 304 | "version": "2.1.2", 305 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", 306 | "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" 307 | }, 308 | "shallow-clone": { 309 | "version": "3.0.1", 310 | "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", 311 | "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", 312 | "requires": { 313 | "kind-of": "^6.0.2" 314 | } 315 | }, 316 | "source-map": { 317 | "version": "0.5.7", 318 | "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", 319 | "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" 320 | }, 321 | "supports-color": { 322 | "version": "5.5.0", 323 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", 324 | "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", 325 | "requires": { 326 | "has-flag": "^3.0.0" 327 | } 328 | }, 329 | "to-fast-properties": { 330 | "version": "2.0.0", 331 | "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", 332 | "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=" 333 | }, 334 | "typescript": { 335 | "version": "4.0.3", 336 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.3.tgz", 337 | "integrity": "sha512-tEu6DGxGgRJPb/mVPIZ48e69xCn2yRmCgYmDugAVwmJ6o+0u1RI18eO7E7WBTLYLaEVVOhwQmcdhQHweux/WPg==" 338 | }, 339 | "webpack-merge": { 340 | "version": "5.2.0", 341 | "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.2.0.tgz", 342 | "integrity": "sha512-QBglJBg5+lItm3/Lopv8KDDK01+hjdg2azEwi/4vKJ8ZmGPdtJsTpjtNNOW3a4WiqzXdCATtTudOZJngE7RKkA==", 343 | "requires": { 344 | "clone-deep": "^4.0.1", 345 | "wildcard": "^2.0.0" 346 | } 347 | }, 348 | "wildcard": { 349 | "version": "2.0.0", 350 | "resolved": "https://registry.npmjs.org/wildcard/-/wildcard-2.0.0.tgz", 351 | "integrity": "sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw==" 352 | } 353 | } 354 | } 355 | -------------------------------------------------------------------------------- /packages/@chuhc/plugin-typescript/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@chuhc/plugin-typescript", 3 | "version": "1.0.1", 4 | "description": "江鱼儿呃呃呃ts插件", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [ 10 | "react", 11 | "chuhc", 12 | "@chuhc/plugin-typescript" 13 | ], 14 | "author": "", 15 | "license": "ISC", 16 | "dependencies": { 17 | "@babel/preset-typescript": "^7.10.4", 18 | "@types/react": "^16.9.51", 19 | "@types/react-dom": "^16.9.8", 20 | "typescript": "^4.0.3" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/@chuhc/scripts/README.md: -------------------------------------------------------------------------------- 1 | # chuhc-cli 脚手架 2 | 3 | scriptss 部分 4 | 5 | 待更新 6 | -------------------------------------------------------------------------------- /packages/@chuhc/scripts/bin/index.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | const program = require('commander'); 3 | 4 | program.command('dev').action(() => { 5 | require('../lib/dev.js')(); 6 | }); 7 | 8 | program.command('build').action(() => { 9 | require('../lib/build.js')(); 10 | }); 11 | 12 | program.arguments('').action(cmd => { 13 | program.outputHelp(); 14 | console.log(); 15 | console.log(` ${chalk.red(`Unknown command ${chalk.yellow(cmd)}.`)}`); 16 | console.log(); 17 | }); 18 | 19 | program.parse(process.argv); 20 | -------------------------------------------------------------------------------- /packages/@chuhc/scripts/lib/build.js: -------------------------------------------------------------------------------- 1 | /** 2 | * webpack build 3 | */ 4 | const webpack = require('webpack'); 5 | const { getProdConfig } = require('./config'); 6 | const logSymbols = require('log-symbols'); 7 | 8 | module.exports = () => { 9 | const PROD_CONFIG = getProdConfig(); 10 | const compiler = webpack(PROD_CONFIG); 11 | 12 | compiler.run((err, stats) => { 13 | if (err) { 14 | // 回调中接收错误信息。 15 | console.error(err); 16 | } else { 17 | console.log(logSymbols.success, '打包成功!'); 18 | } 19 | }); 20 | }; 21 | -------------------------------------------------------------------------------- /packages/@chuhc/scripts/lib/config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * webpack config 3 | */ 4 | const { merge } = require('webpack-merge'); 5 | const Config = require('webpack-chain'); 6 | const chuhcConfig = require(`${process.cwd()}/chuhc.config.js`); 7 | const { setBaseConfig } = require('./util/merge'); 8 | const BASE = require('./config/webpack.base'); 9 | const DEVE = merge(BASE, require('./config/webpack.deve')); 10 | const PROD = merge(BASE, require('./config/webpack.prod')); 11 | 12 | const config = new Config(); 13 | 14 | const handleChuhcConfig = ({ plugins } = {}) => { 15 | if (plugins) { 16 | plugins.forEach(plugin => { 17 | require(plugin[0])(config, plugin[1]); 18 | }); 19 | } 20 | }; 21 | 22 | const getConfig = isDeve => { 23 | config.clear(); 24 | 25 | setBaseConfig(isDeve ? DEVE : PROD, config); 26 | handleChuhcConfig(chuhcConfig); 27 | 28 | return merge(config.toConfig(), { 29 | plugins: isDeve ? DEVE.plugins : PROD.plugins 30 | }); 31 | }; 32 | 33 | exports.getDeveConfig = () => getConfig(true); 34 | 35 | exports.getProdConfig = () => getConfig(false); 36 | -------------------------------------------------------------------------------- /packages/@chuhc/scripts/lib/config/webpack.base.js: -------------------------------------------------------------------------------- 1 | const MiniCssExtractPlugin = require('mini-css-extract-plugin'); 2 | const { CleanWebpackPlugin } = require('clean-webpack-plugin'); 3 | const { getEntries } = require('../enrty'); 4 | 5 | module.exports = { 6 | entry: getEntries(), 7 | resolve: { 8 | extensions: ['.js', '.jsx'] 9 | }, 10 | module: { 11 | rules: [ 12 | { 13 | test: /\.(js|jsx)$/, 14 | use: { 15 | loader: 'babel-loader', 16 | options: { 17 | presets: ['@babel/preset-env', '@babel/preset-react'], 18 | compact: true 19 | } 20 | } 21 | }, 22 | { 23 | test: /\.css$/, 24 | use: [MiniCssExtractPlugin.loader, 'css-loader'] 25 | }, 26 | { 27 | test: /\.(jpg|png|jpeg|gif)$/, 28 | use: { 29 | loader: 'url-loader', 30 | options: { 31 | limit: 10240, 32 | name: 'img/[name].[hash:7].[ext]', 33 | esModule: false 34 | } 35 | } 36 | } 37 | ] 38 | }, 39 | plugins: [new CleanWebpackPlugin()] 40 | }; 41 | -------------------------------------------------------------------------------- /packages/@chuhc/scripts/lib/config/webpack.deve.js: -------------------------------------------------------------------------------- 1 | const MiniCssExtractPlugin = require('mini-css-extract-plugin'); 2 | const { getPages } = require('../enrty'); 3 | const { resolve, devServerAfter } = require('../util'); 4 | 5 | module.exports = { 6 | mode: 'development', 7 | output: { 8 | filename: '[name].js', 9 | path: resolve('dist') 10 | }, 11 | devtool: 'cheap-module-eval-source-map', 12 | plugins: [ 13 | ...getPages(false), 14 | new MiniCssExtractPlugin({ 15 | filename: '[name].css' 16 | }) 17 | ], 18 | devServer: { 19 | contentBase: resolve('dist'), 20 | compress: true, 21 | port: 9999, 22 | stats: 'errors-only', 23 | hot: true, 24 | after: devServerAfter 25 | } 26 | }; 27 | -------------------------------------------------------------------------------- /packages/@chuhc/scripts/lib/config/webpack.prod.js: -------------------------------------------------------------------------------- 1 | const MiniCssExtractPlugin = require('mini-css-extract-plugin'); 2 | const OptimizeCssAssetsWebpackPlugin = require('optimize-css-assets-webpack-plugin'); 3 | const { getPages } = require('../enrty'); 4 | const { resolve } = require('../util'); 5 | 6 | module.exports = { 7 | mode: 'production', 8 | output: { 9 | filename: '[name]-[contentHash:5].js', 10 | path: resolve('dist') 11 | }, 12 | optimization: { 13 | splitChunks: { 14 | cacheGroups: { 15 | libs: { 16 | test: /node_modules/, // 我们对依赖进行分包处理 17 | chunks: 'initial', 18 | name: 'libs' 19 | } 20 | } 21 | } 22 | }, 23 | plugins: [ 24 | ...getPages(true), 25 | new MiniCssExtractPlugin({ 26 | filename: '[name]-[contentHash:5].css' 27 | }), 28 | new OptimizeCssAssetsWebpackPlugin() 29 | ] 30 | }; 31 | -------------------------------------------------------------------------------- /packages/@chuhc/scripts/lib/dev.js: -------------------------------------------------------------------------------- 1 | /** 2 | * scripts dev 3 | */ 4 | const webpack = require('webpack'); 5 | const WebpackDevServer = require('webpack-dev-server'); 6 | const { getDeveConfig } = require('./config'); 7 | 8 | module.exports = () => { 9 | const DEVE_CONFIG = getDeveConfig(); 10 | const { devServer } = DEVE_CONFIG; 11 | const compiler = webpack(DEVE_CONFIG); 12 | const server = new WebpackDevServer(compiler, { ...devServer }); 13 | server.listen(devServer.port); 14 | }; 15 | -------------------------------------------------------------------------------- /packages/@chuhc/scripts/lib/enrty.js: -------------------------------------------------------------------------------- 1 | /** 2 | * get webpack entry info 3 | */ 4 | const glob = require('glob'); 5 | const path = require('path'); 6 | const HtmlWebpackPlugin = require('html-webpack-plugin'); 7 | 8 | let entries = null; 9 | 10 | const SRC = './src/**/index.?(js|jsx|ts|tsx)'; 11 | 12 | /** 13 | * get webpack entry 14 | */ 15 | const getEntries = () => { 16 | if (entries) return entries; 17 | 18 | entries = {}; 19 | 20 | const pages = glob.sync(SRC); 21 | pages.forEach(page => { 22 | const dirname = path.dirname(page); 23 | const entry = path.basename(dirname); 24 | 25 | entries[entry] = page; 26 | }); 27 | 28 | return entries; 29 | }; 30 | 31 | /** 32 | * get pages info 33 | * @param {Boolean} isProd 34 | */ 35 | const getPages = isProd => { 36 | const plugins = []; 37 | let entries = getEntries(); 38 | 39 | Object.keys(entries).map(dirname => { 40 | plugins.push( 41 | new HtmlWebpackPlugin({ 42 | chunks: isProd ? ['libs', dirname] : [dirname], 43 | filename: `./${dirname}/index.html`, 44 | template: path.join(__dirname, './template/index.html') 45 | }) 46 | ); 47 | }); 48 | 49 | return plugins; 50 | }; 51 | 52 | module.exports = { 53 | getEntries, 54 | getPages 55 | }; 56 | -------------------------------------------------------------------------------- /packages/@chuhc/scripts/lib/template/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Document 8 | 9 | 10 |
11 | 12 | 13 | -------------------------------------------------------------------------------- /packages/@chuhc/scripts/lib/util/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * some fn 3 | */ 4 | const path = require('path'); 5 | const { getEntries } = require('../enrty'); 6 | 7 | const dirname = process.cwd(); 8 | 9 | let onceDone = false; 10 | 11 | const clearScreen = () => { 12 | process.stdout.write( 13 | process.platform === 'win32' ? '\x1Bc' : '\x1B[2J\x1B[3J\x1B[H' 14 | ); 15 | }; 16 | 17 | exports.devServerAfter = (app, server, compiler) => { 18 | const port = server.options.port; 19 | compiler.hooks.done.tap('done', () => { 20 | if (onceDone) { 21 | return; 22 | } 23 | 24 | onceDone = true; 25 | 26 | const entrys = getEntries(); 27 | 28 | clearScreen(); 29 | 30 | console.log(` 31 | `); 32 | 33 | Object.keys(entrys).map(entry => 34 | console.log(`🚀 ${entry}的入口:http://localhost:${port}/${entry}`) 35 | ); 36 | 37 | console.log(` 38 | `); 39 | }); 40 | }; 41 | 42 | exports.resolve = src => path.join(dirname, src); 43 | -------------------------------------------------------------------------------- /packages/@chuhc/scripts/lib/util/merge.js: -------------------------------------------------------------------------------- 1 | /** 2 | * webpack merge 3 | */ 4 | const RE_SUFFIX = ['js', 'css', 'jpg']; 5 | 6 | const reSuffix = test => { 7 | const strRe = test.toString(); 8 | for (let i = 0; i < RE_SUFFIX.length; i++) { 9 | if (strRe.includes(RE_SUFFIX[i])) { 10 | return RE_SUFFIX[i]; 11 | } 12 | } 13 | 14 | throw new Error(`not exist module.rules.test: ${test}`); 15 | }; 16 | 17 | exports.setBaseConfig = (base, config) => { 18 | Object.keys(base).forEach(key => { 19 | const val = {}; 20 | val[key] = base[key]; 21 | 22 | switch (key) { 23 | case 'plugins': { 24 | break; 25 | } 26 | case 'module': { 27 | const modules = base[key]; 28 | modules.rules.forEach(rule => { 29 | const { test, use } = rule; 30 | const _config = config.module.rule(reSuffix(test)).test(test); 31 | if (use instanceof Array) { 32 | use.forEach(item => { 33 | if (typeof item === 'string') { 34 | _config.use(item).loader(item); 35 | } else { 36 | throw new Error('这里待补齐'); 37 | } 38 | }); 39 | } else { 40 | const { loader, options } = use; 41 | _config 42 | .use(loader) 43 | .loader(loader) 44 | .options(options); 45 | } 46 | }); 47 | break; 48 | } 49 | default: 50 | config.merge(val); 51 | } 52 | }); 53 | }; 54 | -------------------------------------------------------------------------------- /packages/@chuhc/scripts/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@chuhc/scripts", 3 | "version": "1.0.3", 4 | "description": "江鱼儿脚手架scripts部分", 5 | "main": "index.js", 6 | "bin": { 7 | "chuhc-scripts": "./bin/index.js" 8 | }, 9 | "scripts": { 10 | "test": "echo \"Error: no test specified\" && exit 1" 11 | }, 12 | "keywords": [ 13 | "react", 14 | "chuhc", 15 | "@chuhc/scripts" 16 | ], 17 | "author": "cjj281795819", 18 | "license": "ISC", 19 | "dependencies": { 20 | "@babel/core": "^7.11.4", 21 | "@babel/preset-env": "^7.11.0", 22 | "@babel/preset-react": "^7.10.4", 23 | "babel-loader": "^8.1.0", 24 | "clean-webpack-plugin": "^3.0.0", 25 | "commander": "^6.1.0", 26 | "css-loader": "^4.2.2", 27 | "file-loader": "^6.0.0", 28 | "html-webpack-plugin": "^4.3.0", 29 | "log-symbols": "^4.0.0", 30 | "mini-css-extract-plugin": "^1.0.0", 31 | "url-loader": "^4.1.0", 32 | "webpack": "^4.44.1", 33 | "webpack-chain": "^6.5.1", 34 | "webpack-dev-server": "^3.11.0", 35 | "webpack-merge": "^5.1.2", 36 | "optimize-css-assets-webpack-plugin": "^5.0.4" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /packages/@chuhc/template/README.md: -------------------------------------------------------------------------------- 1 | # chuhc-cli 脚手架 2 | 3 | template 部分 4 | 5 | 待更新 6 | -------------------------------------------------------------------------------- /packages/@chuhc/template/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @jye/template 3 | */ 4 | const fs = require('fs-extra'); 5 | const path = require('path'); 6 | 7 | const copyPageFiles = (cwd, tempSrc, { tsx, less }) => { 8 | ['index', 'home'].forEach((item) => { 9 | const src = path.join(tempSrc, `src/${item}/index`); 10 | const destSrc = `${cwd}/${item}/index`; 11 | 12 | let suffixs = [['.js'], ['.css']]; 13 | 14 | suffixs[0][1] = tsx ? '.tsx' : '.js'; 15 | suffixs[1][1] = less ? '.less' : '.css'; 16 | 17 | suffixs.forEach((suffix, index) => { 18 | if (index === 0 && less) { 19 | let content = fs.readFileSync(src + suffix[0]).toString(); 20 | content = content.replace(/.css/g, '.less'); 21 | 22 | fs.writeFile(destSrc + suffix[1], content); 23 | return; 24 | } 25 | 26 | fs.copySync(src + suffix[0], destSrc + suffix[1]); 27 | }); 28 | }); 29 | }; 30 | 31 | module.exports = ({ tsx, less, git, config = {} }) => { 32 | const cwd = process.cwd(); 33 | const tempSrc = path.join(__dirname, './template'); 34 | const files = fs.readdirSync(tempSrc); 35 | 36 | files.forEach((file) => { 37 | const src = path.join(tempSrc, file); 38 | const destSrc = `${cwd}/${file}`; 39 | 40 | switch (file) { 41 | case 'src': { 42 | fs.ensureDirSync(destSrc); 43 | fs.emptyDirSync(`${destSrc}/index`); 44 | fs.emptyDirSync(`${destSrc}/home`); 45 | 46 | copyPageFiles(destSrc, tempSrc, { tsx, less }); 47 | break; 48 | } 49 | 50 | case 'tsconfig.json': { 51 | if (tsx) { 52 | fs.copySync(src, destSrc); 53 | } 54 | break; 55 | } 56 | 57 | case 'gitignore': { 58 | if (git) { 59 | const dirname = path.dirname(destSrc); 60 | const newSrc = path.join(dirname, '.gitignore'); 61 | const content = fs.readFileSync(src).toString(); 62 | console.log(src); 63 | console.log(dirname); 64 | console.log(newSrc); 65 | fs.writeFileSync(newSrc, content); 66 | } 67 | break; 68 | } 69 | 70 | case 'chuhc.config.js': { 71 | const content = `module.exports = ${JSON.stringify(config, null, 2)}`; 72 | fs.writeFileSync(destSrc, content); 73 | break; 74 | } 75 | 76 | default: 77 | fs.copySync(src, destSrc); 78 | } 79 | }); 80 | }; 81 | -------------------------------------------------------------------------------- /packages/@chuhc/template/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@chuhc/template", 3 | "version": "1.0.9", 4 | "lockfileVersion": 1 5 | } 6 | -------------------------------------------------------------------------------- /packages/@chuhc/template/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@chuhc/template", 3 | "version": "1.0.9", 4 | "description": "江鱼儿脚手架template部分", 5 | "main": "index.js", 6 | "keywords": [ 7 | "react", 8 | "chuhc", 9 | "@chuhc/template" 10 | ], 11 | "author": "cjj281795819", 12 | "license": "ISC", 13 | "peerDependencies": { 14 | "fs-extra": ">9" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /packages/@chuhc/template/template/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "browser": true, 4 | "commonjs": true, 5 | "es6": true, 6 | "node": true 7 | }, 8 | "parser": "babel-eslint", 9 | "parserOptions": { 10 | "ecmaVersion": 2016, 11 | "sourceType": "module" 12 | }, 13 | "rules": {} 14 | } 15 | -------------------------------------------------------------------------------- /packages/@chuhc/template/template/README.md: -------------------------------------------------------------------------------- 1 | # @chuhc/cli 2 | 3 | 江鱼儿呃呃呃脚手架,不定期更新 4 | 5 | 一起来学习吧! 6 | -------------------------------------------------------------------------------- /packages/@chuhc/template/template/chuhc.config.js: -------------------------------------------------------------------------------- 1 | module.exports = {}; 2 | -------------------------------------------------------------------------------- /packages/@chuhc/template/template/gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | .npm 4 | *.log* 5 | *.pid 6 | *.pid.* 7 | *.report 8 | .sonarlint 9 | .idea/ 10 | .eslintcache 11 | .vscode/**/* 12 | !.vscode/settings.json 13 | !.vscode/extensions.json 14 | dist/ 15 | coverage/ 16 | lib-cov 17 | -------------------------------------------------------------------------------- /packages/@chuhc/template/template/src/home/index.css: -------------------------------------------------------------------------------- 1 | .container { 2 | position: absolute; 3 | left: 50%; 4 | top: 50%; 5 | transform: translate(-50%, -50%); 6 | font-size: 20px; 7 | letter-spacing: 3px; 8 | } 9 | 10 | li { 11 | list-style: none; 12 | } 13 | -------------------------------------------------------------------------------- /packages/@chuhc/template/template/src/home/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import './index.css'; 4 | 5 | const rapList = ['我出门总是带着五瓶药水', '手中的卡牌不停切换到位']; 6 | 7 | const App = () => { 8 | return ( 9 |
    10 | @chuhc/cli 模板 11 | {rapList.map(v => ( 12 |
  • {v}
  • 13 | ))} 14 |
15 | ); 16 | }; 17 | 18 | ReactDOM.render(, document.getElementById('root')); 19 | -------------------------------------------------------------------------------- /packages/@chuhc/template/template/src/index/index.css: -------------------------------------------------------------------------------- 1 | .container { 2 | position: absolute; 3 | left: 50%; 4 | top: 50%; 5 | transform: translate(-50%, -50%); 6 | font-size: 20px; 7 | letter-spacing: 3px; 8 | } 9 | 10 | li { 11 | list-style: none; 12 | } 13 | -------------------------------------------------------------------------------- /packages/@chuhc/template/template/src/index/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import './index.css'; 4 | 5 | const rapList = ['别跟我撒娇也别叫我宝贝', '就算我一个人也不会后退']; 6 | 7 | const App = () => { 8 | return ( 9 |
    10 | @chuhc/cli 模板 11 | {rapList.map(v => ( 12 |
  • {v}
  • 13 | ))} 14 |
15 | ); 16 | }; 17 | 18 | ReactDOM.render(, document.getElementById('root')); 19 | -------------------------------------------------------------------------------- /packages/@chuhc/template/template/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "lib": ["dom", "dom.iterable", "esnext"], 5 | "allowJs": true, 6 | "skipLibCheck": true, 7 | "esModuleInterop": true, 8 | "allowSyntheticDefaultImports": true, 9 | "strict": true, 10 | "noImplicitAny": true, 11 | "forceConsistentCasingInFileNames": true, 12 | "module": "esnext", 13 | "moduleResolution": "node", 14 | "resolveJsonModule": true, 15 | "isolatedModules": true, 16 | "noEmit": true, 17 | "jsx": "react" 18 | }, 19 | "include": ["src"] 20 | } 21 | -------------------------------------------------------------------------------- /static/example.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjj281795819/chuhc-react/d20ef1aced2e1923595cd60e36ee2f0e506e40c2/static/example.gif --------------------------------------------------------------------------------