message: feat: export cli func
diff: @@ -18,8 +18,7 @@ const spinner = {
  })
  }
  -yargs
  - .command('start', 'Start Server', {}, async (argv: Argv) => {
  +const startFunc = async (argv: Argv) => {
  spinner.start()
  process.env.NODE_ENV = 'development'
  if (!argv.noclean) {
  @@ -36,8 +35,9 @@ yargs
  }
  await plugin.clientPlugin?.start?.(argv)
  await plugin.serverPlugin?.start?.(argv)
  - })
  - .command('build', 'Build server and client files', {}, async (argv: Argv) => {
  +}
  +
  +const buildFunc = async (argv: Argv) => {
  spinner.start()
  process.env.NODE_ENV = 'production'
  if (!argv.noclean) {
  @@ -55,8 +55,9 @@ yargs
  await plugin.clientPlugin?.build?.(argv)
  await plugin.serverPlugin?.build?.(argv)
  await generateHtml(argv)
  - })
  - .command('deploy', 'Deploy function to aliyun cloud or tencent cloud', {}, async (argv: Argv) => {
  +}
  +
  +const deployFunc = async (argv: Argv) => {
  process.env.NODE_ENV = 'production'
  const { loadPlugin } = await import('ssr-server-utils')
  const plugin = loadPlugin()
  @@ -67,6 +68,17 @@ yargs
  }
  await plugin.serverPlugin?.deploy?.(argv)
  spinner.stop()
  +}
  +
  +yargs
  + .command('start', 'Start Server', {}, async (argv: Argv) => {
  + await startFunc(argv)
  + })
  + .command('build', 'Build server and client files', {}, async (argv: Argv) => {
  + await buildFunc(argv)
  + })
  + .command('deploy', 'Deploy function to aliyun cloud or tencent cloud', {}, async (argv: Argv) => {
  + await deployFunc(argv)
  })
  .demandCommand(1, 'You need at least one command before moving on')
  .option('version', {
  @@ -82,3 +94,9 @@ yargs
  console.log(msg)
  })
  .parse()
  +
  +export {
  + startFunc,
  + buildFunc,
  + deployFunc
  +}
  