docs: 文档: 📚 新版本文档v1.1.2
This commit is contained in:
parent
829ecd335d
commit
1a06bbce77
97
bin/demo.js
97
bin/demo.js
|
@ -1,97 +0,0 @@
|
||||||
#!/usr/bin/env node
|
|
||||||
const { program } = require('commander'); // 命令行提示工具
|
|
||||||
const chalk = require('chalk'); // 终端输出颜色变化
|
|
||||||
const inquirer = require('inquirer'); // 交互选项
|
|
||||||
const ora = require('ora'); // loading效果
|
|
||||||
const spinner = ora('Loading unicorns').start(); // 注意要使用x几版本因为不支持
|
|
||||||
const figlet = require('figlet'); // 生成艺术字
|
|
||||||
|
|
||||||
figlet('Hello World!!', function (err, data) {
|
|
||||||
if (err) {
|
|
||||||
console.log('Something went wrong...');
|
|
||||||
console.dir(err);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
console.log(data);
|
|
||||||
});
|
|
||||||
|
|
||||||
figlet.text(
|
|
||||||
'Boo!',
|
|
||||||
{
|
|
||||||
font: 'Ghost',
|
|
||||||
horizontalLayout: 'default',
|
|
||||||
verticalLayout: 'default',
|
|
||||||
width: 80,
|
|
||||||
whitespaceBreak: true,
|
|
||||||
},
|
|
||||||
function (err, data) {
|
|
||||||
if (err) {
|
|
||||||
console.log('Something went wrong...');
|
|
||||||
console.dir(err);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
console.log(data);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
console.log(
|
|
||||||
figlet.textSync('Boo!', {
|
|
||||||
font: 'Ghost',
|
|
||||||
horizontalLayout: 'default',
|
|
||||||
verticalLayout: 'default',
|
|
||||||
width: 80,
|
|
||||||
whitespaceBreak: true,
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
|
|
||||||
setTimeout(() => {
|
|
||||||
spinner.color = 'red';
|
|
||||||
spinner.text = '网络较慢,请稍后...';
|
|
||||||
}, 1000);
|
|
||||||
|
|
||||||
setTimeout(() => {
|
|
||||||
spinner.succeed('下载成功!!!');
|
|
||||||
}, 2000);
|
|
||||||
|
|
||||||
setTimeout(() => {
|
|
||||||
spinner.fail('下载失败!!!');
|
|
||||||
}, 3000);
|
|
||||||
|
|
||||||
inquirer
|
|
||||||
.prompt([
|
|
||||||
/* Pass your questions in here */
|
|
||||||
{ type: 'input', name: 'food', message: '你吃什么', default: '包子' },
|
|
||||||
{ type: 'input', name: 'food', message: '吃辣吗?', default: '微辣' },
|
|
||||||
])
|
|
||||||
.then(answers => {
|
|
||||||
// Use user feedback for... whatever!!
|
|
||||||
console.log(answers);
|
|
||||||
})
|
|
||||||
.catch(error => {
|
|
||||||
if (error.isTtyError) {
|
|
||||||
// Prompt couldn't be rendered in the current environment
|
|
||||||
} else {
|
|
||||||
// Something else went wrong
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log(chalk.red('文字颜色'));
|
|
||||||
|
|
||||||
program.name('bunny-cli').usage('<command> [options]');
|
|
||||||
|
|
||||||
program
|
|
||||||
.option('-d, --debug', 'output extra debugging')
|
|
||||||
.option('-s, --small', 'small pizza size')
|
|
||||||
.option('-p, --pizza-type <type>', 'flavour of pizza');
|
|
||||||
|
|
||||||
program
|
|
||||||
.command('clone <source> [destination]')
|
|
||||||
.description('clone a repository into a newly created directory')
|
|
||||||
.action((source, destination) => {
|
|
||||||
console.log(source, destination);
|
|
||||||
});
|
|
||||||
|
|
||||||
program.parse(process.argv);
|
|
||||||
|
|
||||||
const options = program.opts();
|
|
||||||
console.log(options);
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "bunny-cli",
|
"name": "bunny-cli",
|
||||||
"version": "1.1.0",
|
"version": "1.1.2",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"bin": {
|
"bin": {
|
||||||
|
@ -31,10 +31,10 @@
|
||||||
"prettier": "^3.1.1"
|
"prettier": "^3.1.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@commitlint/cli": "^18.4.3",
|
"@commitlint/cli": "^17.6.7",
|
||||||
"@commitlint/config-conventional": "^18.4.3",
|
"@commitlint/config-conventional": "^17.6.7",
|
||||||
|
"cz-git": "^1.7.0",
|
||||||
"commitizen": "^4.3.0",
|
"commitizen": "^4.3.0",
|
||||||
"cz-git": "^1.8.0",
|
|
||||||
"eslint": "^8.56.0",
|
"eslint": "^8.56.0",
|
||||||
"husky": "^8.0.3",
|
"husky": "^8.0.3",
|
||||||
"lint-staged": "^15.2.0"
|
"lint-staged": "^15.2.0"
|
||||||
|
|
72
readme.md
72
readme.md
|
@ -1,69 +1,5 @@
|
||||||
# v1.0.0
|
# 1.1.2 更新
|
||||||
|
|
||||||
已自动去除CSS默认样式,和一些自带图片,默认安装`husky`
|
1. react模板和vue模板都添加了文档注释以及基础的代码校验
|
||||||
|
2. 都添加打包进度条
|
||||||
包含vue和react
|
3. `更新package.json包`
|
||||||
|
|
||||||
## vue
|
|
||||||
|
|
||||||
包含路由,可以选择`vuex`和`pinia`
|
|
||||||
|
|
||||||
## ract
|
|
||||||
|
|
||||||
react默认安装`@reduxjs/toolkit`,在环境中已经搭建
|
|
||||||
|
|
||||||
react可以选择是否有路由,有`useRoutes`和`RouterProvider `
|
|
||||||
|
|
||||||
### useRoutes
|
|
||||||
|
|
||||||
```tsx
|
|
||||||
import React, { Suspense } from 'react';
|
|
||||||
import { useRoutes } from 'react-router-dom';
|
|
||||||
import routes from './router';
|
|
||||||
|
|
||||||
function App() {
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<Suspense fallback={<h1>loading...</h1>}>{useRoutes(routes)}</Suspense>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default App;
|
|
||||||
```
|
|
||||||
|
|
||||||
### RouterProvider
|
|
||||||
|
|
||||||
```tsx
|
|
||||||
import { Suspense } from 'react';
|
|
||||||
import { RouterProvider } from 'react-router-dom';
|
|
||||||
import router from './router';
|
|
||||||
|
|
||||||
function App() {
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<Suspense fallback={<h1>loading...</h1>}>
|
|
||||||
<RouterProvider router={router} />
|
|
||||||
</Suspense>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default App;
|
|
||||||
```
|
|
||||||
|
|
||||||
> 修复没有文件夹安装自动跳过
|
|
||||||
|
|
||||||
# v1.0.2
|
|
||||||
|
|
||||||
添加react创建zustand,包含ts和js
|
|
||||||
|
|
||||||
# v1.0.3
|
|
||||||
|
|
||||||
新增vue大屏,使用rem方式布局,内置pina和vue-chart
|
|
||||||
|
|
||||||
# 1.1.0
|
|
||||||
|
|
||||||
1. 删除js模板
|
|
||||||
- js目前在项目中使用较少,为减少维护压力将其删除
|
|
||||||
2. 新增vue大屏模板
|
|
||||||
|
|
Loading…
Reference in New Issue