import { createPlugin } from '@modern-js/core' ; import { change , bump , pre , release } from './commands' ; import { i18n , localeKeys } from './locale' ; import { getLocaleLanguage } from './utils' ; export default createPlugin ( ( ) => { i18n . changeLanguage ( { locale : getLocaleLanguage ( ) } ) ; return { plugins ( ) { return [ { } ] ; } , commands ( { program } ) { program . command ( 'change' ) . description ( i18n . t ( localeKeys . command . change . describe ) ) . option ( '--empty' , i18n . t ( localeKeys . command . change . empty ) , false ) . option ( '--open' , i18n . t ( localeKeys . command . change . open ) , false ) . action ( ( options ) => change ( options ) ) ; program . command ( 'bump' ) . description ( i18n . t ( localeKeys . command . bump . describe ) ) . option ( '--canary' , i18n . t ( localeKeys . command . bump . canary ) , false ) . option ( '--preid <tag>' , i18n . t ( localeKeys . command . bump . preid ) , 'next' ) . option ( '--snapshot [snapshot]' , i18n . t ( localeKeys . command . bump . snapshot ) , false ) . action ( ( options ) => bump ( options ) ) ; program . command ( 'pre <enter|exit> [tag]' ) . description ( i18n . t ( localeKeys . command . pre . describe ) ) . action ( ( type , tag ? ) => pre ( type , tag ) ) ; program . command ( 'release' ) . description ( i18n . t ( localeKeys . command . release . describe ) ) . option ( '--tag <tag>' , i18n . t ( localeKeys . command . release . tag ) , '' ) . option ( '--ignore-scripts' , i18n . t ( localeKeys . command . release . ignore_scripts ) , '' ) . option ( '--no-git-checks' , i18n . t ( localeKeys . command . release . no_git_checks ) , '' ) . action ( ( options ) => release ( options ) ) ; } , } ; } , { name : '@modern-js/plugin-changeset' } ) as any ;