@@ -17,6 +17,7 @@ import { gitCommit } from "./command/git-commit";
1717import { gitInitSimpleHooks } from "./command/git-init-hooks" ;
1818import { clear } from "./command/clear" ;
1919import { npmRun } from "./command/npm-run" ;
20+ import { npmDepCheck } from "./command/npm-dep-check" ;
2021
2122export const commandSet : CommandSet = {
2223 gitCommitCmd : ( cli : CAC ) => {
@@ -30,14 +31,14 @@ export const commandSet: CommandSet = {
3031 } ) ;
3132 } ) ;
3233 } ,
33- gitCommitVerifySetup : ( cli : CAC ) => {
34+ gitCommitVerifyCmd : ( cli : CAC ) => {
3435 cli
3536 . command ( "verify" , "校验 COMMIT_EDITMSG 中的信息是否符合 Angualr 规范" )
3637 . action ( async ( ) => {
3738 await gitCommitVerify ( ) ;
3839 } ) ;
3940 } ,
40- clearSetup : ( cli : CAC ) => {
41+ clearCmd : ( cli : CAC ) => {
4142 cli
4243 . command ( "clear" , "运行 rimraf 删除不再需要的文件或文件夹" )
4344 . option ( "-p, --pattern <pattern>" , "设置配置规则" , {
@@ -51,22 +52,32 @@ export const commandSet: CommandSet = {
5152 await clear ( patterns ) ;
5253 } ) ;
5354 } ,
54- initSimpleGitHooks : ( cli : CAC ) => {
55+ initSimpleGitHooksCmd : ( cli : CAC ) => {
5556 cli
5657 . command ( "hooks" , "新增或修改 simple-git-hooks 配置后需要重新初始化" )
5758 . action ( async ( ) => {
5859 await gitInitSimpleHooks ( ) ;
5960 } ) ;
6061 } ,
61- npmRunSetup : ( cli : CAC ) => {
62+ npmDepCheck : ( cli : CAC ) => {
63+ cli
64+ . command (
65+ "depcheck" ,
66+ "运行 npm-check 检查过时的、不正确的和未使用的依赖项" ,
67+ )
68+ . action ( async ( ) => {
69+ await npmDepCheck ( ) ;
70+ } ) ;
71+ } ,
72+ npmRunCmd : ( cli : CAC ) => {
6273 cli . command ( "run" , "列出可以运行的全部脚本" ) . action ( async ( ) => {
6374 await npmRun ( ) ;
6475 } ) ;
6576 } ,
66- eslintFix : ( cli : CAC ) => {
77+ eslintFixCmd : ( cli : CAC ) => {
6778 cli
6879 . command ( "fix" , "运行 eslint 静态扫描和修复代码中存在的问题" )
69- . option ( "-p, --pattern <pattern>" , "设置配置规则 " , {
80+ . option ( "-p, --pattern <pattern>" , "设置匹配规则 " , {
7081 default : [ ...eslintGlob ] ,
7182 } )
7283 . action ( async ( options ) => {
@@ -77,10 +88,10 @@ export const commandSet: CommandSet = {
7788 await eslintFix ( patterns ) ;
7889 } ) ;
7990 } ,
80- prettierFormat : ( cli : CAC ) => {
91+ prettierFormatCmd : ( cli : CAC ) => {
8192 cli
8293 . command ( "format" , "运行 prettier 格式化代码风格" )
83- . option ( "-p, --pattern <pattern>" , "设置配置规则 " , {
94+ . option ( "-p, --pattern <pattern>" , "设置匹配规则 " , {
8495 default : [ ...formatGlob ] ,
8596 } )
8697 . action ( async ( options ) => {
0 commit comments