mirror of
				https://gitee.com/vant-contrib/vant.git
				synced 2025-10-27 01:32:10 +08:00 
			
		
		
		
	feat(cli): support config npm tag
This commit is contained in:
		
							parent
							
								
									daff756a03
								
							
						
					
					
						commit
						ba63cd18fa
					
				| @ -18,7 +18,7 @@ | |||||||
|     "lint": "vant-cli lint && ls-lint", |     "lint": "vant-cli lint && ls-lint", | ||||||
|     "test": "vant-cli test", |     "test": "vant-cli test", | ||||||
|     "build": "vant-cli build", |     "build": "vant-cli build", | ||||||
|     "release": "vant-cli release", |     "release": "vant-cli release --tag next", | ||||||
|     "test:watch": "vant-cli test --watch", |     "test:watch": "vant-cli test --watch", | ||||||
|     "release:site": "sh docs/site/release.sh", |     "release:site": "sh docs/site/release.sh", | ||||||
|     "test:coverage": "open test/coverage/index.html" |     "test:coverage": "open test/coverage/index.html" | ||||||
|  | |||||||
| @ -4,11 +4,14 @@ import { join } from 'path'; | |||||||
| 
 | 
 | ||||||
| const PLUGIN_PATH = join(__dirname, '../compiler/vant-cli-release-plugin.js'); | const PLUGIN_PATH = join(__dirname, '../compiler/vant-cli-release-plugin.js'); | ||||||
| 
 | 
 | ||||||
| export async function release() { | export async function release(command: { tag?: string }) { | ||||||
|   await releaseIt({ |   await releaseIt({ | ||||||
|     plugins: { |     plugins: { | ||||||
|       [PLUGIN_PATH]: {}, |       [PLUGIN_PATH]: {}, | ||||||
|     }, |     }, | ||||||
|  |     npm: { | ||||||
|  |       tag: command.tag, | ||||||
|  |     }, | ||||||
|     git: { |     git: { | ||||||
|       tagName: 'v${version}', |       tagName: 'v${version}', | ||||||
|       commitMessage: 'chore: release ${version}', |       commitMessage: 'chore: release ${version}', | ||||||
|  | |||||||
| @ -19,13 +19,9 @@ version(`@vant/cli ${packageJson.version}`); | |||||||
| 
 | 
 | ||||||
| process.env.VANT_CLI_VERSION = packageJson.version; | process.env.VANT_CLI_VERSION = packageJson.version; | ||||||
| 
 | 
 | ||||||
| command('dev') | command('dev').description('Run webpack dev server').action(dev); | ||||||
|   .description('Run webpack dev server') |  | ||||||
|   .action(dev); |  | ||||||
| 
 | 
 | ||||||
| command('lint') | command('lint').description('Run eslint and stylelint').action(lint); | ||||||
|   .description('Run eslint and stylelint') |  | ||||||
|   .action(lint); |  | ||||||
| 
 | 
 | ||||||
| command('test') | command('test') | ||||||
|   .description('Run unit tests through jest') |   .description('Run unit tests through jest') | ||||||
| @ -39,9 +35,7 @@ command('test') | |||||||
|   ) |   ) | ||||||
|   .action(test); |   .action(test); | ||||||
| 
 | 
 | ||||||
| command('clean') | command('clean').description('Clean all dist files').action(clean); | ||||||
|   .description('Clean all dist files') |  | ||||||
|   .action(clean); |  | ||||||
| 
 | 
 | ||||||
| command('build') | command('build') | ||||||
|   .description('Compile components in production mode') |   .description('Compile components in production mode') | ||||||
| @ -50,18 +44,15 @@ command('build') | |||||||
| 
 | 
 | ||||||
| command('release') | command('release') | ||||||
|   .description('Compile components and release it') |   .description('Compile components and release it') | ||||||
|  |   .option('--tag <tag>', 'Release tag') | ||||||
|   .action(release); |   .action(release); | ||||||
| 
 | 
 | ||||||
| command('build-site') | command('build-site') | ||||||
|   .description('Compile site in production mode') |   .description('Compile site in production mode') | ||||||
|   .action(buildSite); |   .action(buildSite); | ||||||
| 
 | 
 | ||||||
| command('changelog') | command('changelog').description('Generate changelog').action(changelog); | ||||||
|   .description('Generate changelog') |  | ||||||
|   .action(changelog); |  | ||||||
| 
 | 
 | ||||||
| command('commit-lint') | command('commit-lint').description('Lint commit message').action(commitLint); | ||||||
|   .description('Lint commit message') |  | ||||||
|   .action(commitLint); |  | ||||||
| 
 | 
 | ||||||
| parse(); | parse(); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user