chore: add vant-cli pacakge

This commit is contained in:
陈嘉涵
2019-08-22 11:46:40 +08:00
parent c5514f73b8
commit 8cca48131e
6 changed files with 67 additions and 1 deletions

View 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"
}
}

View 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;

View 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);