Skip to content

Commit

Permalink
Feat: add some tools
Browse files Browse the repository at this point in the history
  • Loading branch information
pandaoh committed Jun 20, 2024
1 parent e6f4e60 commit a576b0d
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 5 deletions.
40 changes: 37 additions & 3 deletions bin/xcmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @Author: HxB
* @Date: 2022-04-25 16:27:06
* @LastEditors: DoubleAm
* @LastEditTime: 2024-05-24 10:26:54
* @LastEditTime: 2024-06-20 16:49:52
* @Description: 命令处理文件
* @FilePath: \js-xcmd\bin\xcmd.js
*/
Expand Down Expand Up @@ -422,10 +422,10 @@ program
.action((all) => {
let cmdStr = '';
if (!all) {
cmdStr = 'npm i nrm pnpm js-xcmd nodemon pm2 yarn rimraf -g';
cmdStr = 'npm i nrm pnpm js-xcmd nodemon pm2 yarn rimraf turbo tsx taze knip yalc -g';
} else {
cmdStr =
'npm i nrm pnpm js-xcmd nodemon pm2 yarn rimraf protobufjs protobufjs-cli create-react-app @vue/cli @angular/cli cordova cnpm -g -force';
'npm i nrm pnpm js-xcmd nodemon pm2 yarn rimraf turbo tsx taze knip yalc protobufjs protobufjs-cli @changesets/cli create-react-app @vue/cli @angular/cli cordova cnpm -g -force';
}
console.log({ cmdStr });
nodeCmd.run(cmdStr, (err, data, stderr) => {
Expand All @@ -436,6 +436,40 @@ program
});
});

program
.option('i-react-tools', 'i-react-tools')
.command('i-react-tools')
.description('安装 react 开发相关库')
.action(() => {
// zod react-hook-form @tanstack/react-query
// @mui/material @mui/lab @mui/base @mui/system @mui/utils @mui/types
// rebass
let cmdStr =
'npm i ahooks rxjs dayjs @sigi/[email protected] @sigi/[email protected] @sigi/[email protected] @sigi/[email protected] @sigi/[email protected] @emotion/styled @emotion/css @emotion/react';
console.log({ cmdStr });
nodeCmd.run(cmdStr, (err, data, stderr) => {
console.log(stderr);
if (err) return console.log(`%c出错啦!${data}`, 'color:red;');
console.log(data);
console.log('----------Successful----------');
});
});

program
.option('i-vue-tools', 'i-vue-tools')
.command('i-vue-tools')
.description('安装 vue 开发相关库')
.action(() => {
let cmdStr = 'npm i ...';
console.log({ cmdStr });
nodeCmd.run(cmdStr, (err, data, stderr) => {
console.log(stderr);
if (err) return console.log(`%c出错啦!${data}`, 'color:red;');
console.log(data);
console.log('----------Successful----------');
});
});

program
.option('dev [src]', 'dev [src]')
.command('dev [src]')
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "js-xcmd",
"version": "1.5.5",
"version": "1.5.6",
"description": "XCmd library for node.js.",
"main": "main.js",
"bin": {
Expand Down Expand Up @@ -37,4 +37,4 @@
"rimraf": "^5.0.5"
},
"time": "2717021815012024"
}
}

0 comments on commit a576b0d

Please sign in to comment.