chore(projects): update @sa/scripts

This commit is contained in:
Soybean
2023-12-14 21:54:10 +08:00
parent a748166399
commit d778560dbd
9 changed files with 419 additions and 47 deletions

View File

@ -1,10 +1,10 @@
import cac from 'cac';
import { blue, lightGreen } from 'kolorist';
import { version } from '../package.json';
import { cleanup, execLintStaged, gitCommit, gitCommitVerify, prettierWrite, updatePkg } from './commands';
import { cleanup, gitCommit, gitCommitVerify, updatePkg } from './commands';
import { loadCliOptions } from './config';
type Command = 'cleanup' | 'update-pkg' | 'git-commit' | 'git-commit-verify' | 'prettier-write' | 'lint-staged';
type Command = 'cleanup' | 'update-pkg' | 'git-commit' | 'git-commit-verify';
type CommandAction<A extends object> = (args?: A) => Promise<void> | void;
@ -45,18 +45,6 @@ export async function setupCli() {
action: async () => {
await gitCommitVerify();
}
},
'prettier-write': {
desc: 'run prettier --write',
action: async () => {
await prettierWrite(cliOptions.prettierWriteGlob);
}
},
'lint-staged': {
desc: 'run lint-staged',
action: async () => {
await execLintStaged(cliOptions.lintStagedConfig);
}
}
};