mirror of
https://github.com/youzan/vant.git
synced 2025-10-15 23:55:08 +00:00
chore: add vant-cli pacakge
This commit is contained in:
18
packages/vant-cli/package.json
Normal file
18
packages/vant-cli/package.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "@vant/cli",
|
||||
"version": "0.1.1",
|
||||
"description": "vant cli tools",
|
||||
"main": "./src/index.js",
|
||||
"bin": {
|
||||
"vant": "./src/index.js"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"license": "MIT",
|
||||
"repository": "https://github.com/youzan/vant/tree/dev/packages/vant-cli",
|
||||
"dependencies": {
|
||||
"commander": "^2.17.1",
|
||||
"shelljs": "^0.8.2"
|
||||
}
|
||||
}
|
25
packages/vant-cli/src/changelog.js
Normal file
25
packages/vant-cli/src/changelog.js
Normal file
@@ -0,0 +1,25 @@
|
||||
const path = require('path');
|
||||
const shelljs = require('shelljs');
|
||||
|
||||
function changelog(dist, cmd) {
|
||||
const basepath = process.cwd();
|
||||
const tag = cmd.tag || 'v1.0.0';
|
||||
|
||||
shelljs.exec(`
|
||||
basepath=${basepath}
|
||||
|
||||
github_changelog_generator \
|
||||
--header-label "# 更新日志" \
|
||||
--bugs-label "**Bug Fixes**" \
|
||||
--enhancement-label "**Breaking changes**" \
|
||||
--issues-label "**Issue**" \
|
||||
--pr-label "**Improvements**" \
|
||||
--no-issues \
|
||||
--no-unreleased \
|
||||
--since-tag ${tag} \
|
||||
-o ${path.join(basepath, dist)}
|
||||
`
|
||||
);
|
||||
}
|
||||
|
||||
module.exports = changelog;
|
11
packages/vant-cli/src/index.js
Normal file
11
packages/vant-cli/src/index.js
Normal file
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const commander = require('commander');
|
||||
const changelog = require('./changelog');
|
||||
|
||||
commander
|
||||
.command('changelog <dir>')
|
||||
.option('--tag [tag]', 'Since tag')
|
||||
.action(changelog);
|
||||
|
||||
commander.parse(process.argv);
|
Reference in New Issue
Block a user