feat(projects): add script: gen-route

This commit is contained in:
Soybean
2024-01-21 23:21:27 +08:00
parent 41349555bf
commit 697c1b6106
4 changed files with 89 additions and 2 deletions

View File

@ -1,10 +1,10 @@
import cac from 'cac';
import { blue, lightGreen } from 'kolorist';
import { version } from '../package.json';
import { cleanup, genChangelog, gitCommit, gitCommitVerify, release, updatePkg } from './commands';
import { cleanup, genChangelog, generateRoute, gitCommit, gitCommitVerify, release, updatePkg } from './commands';
import { loadCliOptions } from './config';
type Command = 'cleanup' | 'update-pkg' | 'git-commit' | 'git-commit-verify' | 'changelog' | 'release';
type Command = 'cleanup' | 'update-pkg' | 'git-commit' | 'git-commit-verify' | 'changelog' | 'release' | 'gen-route';
type CommandAction<A extends object> = (args?: A) => Promise<void> | void;
@ -82,6 +82,12 @@ export async function setupCli() {
action: async args => {
await release(args?.execute, args?.push);
}
},
'gen-route': {
desc: 'generate route',
action: async () => {
await generateRoute();
}
}
};