Skip to content

Commit

Permalink
chore: bump versions
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Mar 5, 2021
1 parent 8062901 commit 2097178
Show file tree
Hide file tree
Showing 29 changed files with 77 additions and 73 deletions.
2 changes: 1 addition & 1 deletion build/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ if (CI && (GITHUB_REF !== 'refs/heads/master' || GITHUB_EVENT_NAME !== 'push'))
return console.log(`Tag ${version} already exists.`)
}

const body = draft(tags[tags.length - 1])
const body = draft(tags[tags.length - 1], bumpMap)
console.log(body)

if (!GITHUB_TOKEN) return
Expand Down
22 changes: 13 additions & 9 deletions build/release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,34 @@ const headerMap = {
feat: 'Features',
fix: 'Bug Fixes',
dep: 'Dependencies',
'': 'Other Changes',
}

const prefixes = Object.keys(headerMap)
const prefixRegExp = new RegExp(`^(${prefixes.join('|')})(?:\\((\\S+)\\))?: (.+)$`)

export function draft(base: string) {
export function draft(base: string, bumpMap: Record<string, string> = {}) {
const updates = {}
const commits = spawnSync(['git', 'log', `${base}..HEAD`, '--format=%H %s']).split(/\r?\n/).reverse()
for (const commit of commits) {
const hash = commit.slice(0, 40)
const details = prefixRegExp.exec(commit.slice(41))
if (!details) continue
let message = details[3]
if (details[2]) message = `**${details[2]}:** ${message}`
const message = commit.slice(41)
// skip merge commits
if (message.startsWith('Merge')) continue

const details = prefixRegExp.exec(message) || ['', '', '', message]
let body = details[3]
if (details[2]) body = `**${details[2]}:** ${body}`
if (!updates[details[1]]) updates[details[1]] = ''
updates[details[1]] += `- ${message} (${hash})\n`
updates[details[1]] += `- ${body} (${hash})\n`
}

let body = ''
let output = Object.entries(bumpMap).map(([name, version]) => `- ${name}@${version}`).join('\n') + '\n'
for (const type in headerMap) {
if (!updates[type]) continue
body += `## ${headerMap[type]}\n\n${updates[type]}\n`
output += `\n## ${headerMap[type]}\n\n${updates[type]}`
}
return body
return output
}

if (require.main === module) {
Expand Down
6 changes: 3 additions & 3 deletions packages/adapter-discord/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "koishi-adapter-discord",
"description": "Discord adapter for Koishi",
"version": "1.0.0",
"version": "1.0.1",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"files": [
Expand All @@ -28,11 +28,11 @@
"koishi"
],
"peerDependencies": {
"koishi-core": "^3.0.0"
"koishi-core": "^3.0.1"
},
"devDependencies": {
"@types/ws": "^7.4.0",
"koishi-test-utils": "^6.0.0-beta.9"
"koishi-test-utils": "^6.0.0-beta.10"
},
"dependencies": {
"axios": "^0.21.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/adapter-kaiheila/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
"koishi"
],
"peerDependencies": {
"koishi-core": "^3.0.0"
"koishi-core": "^3.0.1"
},
"devDependencies": {
"koishi-test-utils": "^6.0.0-beta.9"
"koishi-test-utils": "^6.0.0-beta.10"
},
"dependencies": {
"axios": "^0.21.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/adapter-onebot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
"koishi"
],
"peerDependencies": {
"koishi-core": "^3.0.0"
"koishi-core": "^3.0.1"
},
"devDependencies": {
"@types/ws": "^7.4.0",
"get-port": "^5.1.1",
"koishi-test-utils": "^6.0.0-beta.9"
"koishi-test-utils": "^6.0.0-beta.10"
},
"dependencies": {
"axios": "^0.21.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/adapter-telegram/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
"koishi"
],
"peerDependencies": {
"koishi-core": "^3.0.0"
"koishi-core": "^3.0.1"
},
"devDependencies": {
"koishi-test-utils": "^6.0.0-beta.9"
"koishi-test-utils": "^6.0.0-beta.10"
},
"dependencies": {
"axios": "^0.21.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/adapter-tomon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
"koishi"
],
"peerDependencies": {
"koishi-core": "^3.0.0"
"koishi-core": "^3.0.1"
},
"devDependencies": {
"@types/pako": "^1.0.1",
"koishi-test-utils": "^6.0.0-beta.9"
"koishi-test-utils": "^6.0.0-beta.10"
},
"dependencies": {
"axios": "^0.21.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/koishi-core/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "koishi-core",
"description": "Core features for Koishi",
"version": "3.0.0",
"version": "3.0.1",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"engines": {
Expand Down Expand Up @@ -30,7 +30,7 @@
],
"devDependencies": {
"@types/koa": "^2.13.1",
"koishi-test-utils": "^6.0.0-beta.9"
"koishi-test-utils": "^6.0.0-beta.10"
},
"dependencies": {
"@koa/router": "^10.0.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/koishi-test-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "koishi-test-utils",
"description": "Test utilities for Koishi",
"version": "6.0.0-beta.9",
"version": "6.0.0-beta.10",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"engines": {
Expand Down Expand Up @@ -37,7 +37,7 @@
"dependencies": {
"chai": "^4.3.3",
"chai-as-promised": "^7.1.1",
"koishi-core": "^3.0.0",
"koishi-core": "^3.0.1",
"koishi-utils": "^4.0.1"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/koishi-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
],
"devDependencies": {
"@types/supports-color": "^7.2.0",
"koishi-test-utils": "^6.0.0-beta.9"
"koishi-test-utils": "^6.0.0-beta.10"
},
"dependencies": {
"supports-color": "^8.1.1"
Expand Down
16 changes: 8 additions & 8 deletions packages/koishi/ecosystem.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"koishi-adapter-discord": {
"version": "1.0.0",
"version": "1.0.1",
"description": "Discord adapter for Koishi"
},
"koishi-adapter-kaiheila": {
Expand All @@ -20,15 +20,15 @@
"description": "Tomon adapter for Koishi"
},
"koishi-plugin-adventure": {
"version": "0.1.12",
"version": "0.1.13",
"description": "Adventure Game for Koishi"
},
"koishi-plugin-chess": {
"version": "3.0.0-beta.10",
"version": "3.0.0-beta.11",
"description": "Chess Plugin for Koishi"
},
"koishi-plugin-common": {
"version": "4.0.0-beta.19",
"version": "4.0.0",
"description": "Common plugins for Koishi"
},
"koishi-plugin-dice": {
Expand All @@ -40,7 +40,7 @@
"description": "Execute JavaScript in Koishi"
},
"koishi-plugin-github": {
"version": "3.0.0-beta.10",
"version": "3.0.0-beta.11",
"description": "GitHub webhook plugin for Koishi"
},
"koishi-plugin-image-search": {
Expand All @@ -59,15 +59,15 @@
"description": "MySQL support for Koishi"
},
"koishi-plugin-puppeteer": {
"version": "2.0.0-beta.10",
"version": "2.0.0",
"description": "Take Screenshots in Koishi"
},
"koishi-plugin-rss": {
"version": "2.0.0-beta.10",
"description": "Subscribe RSS Url for Koishi"
},
"koishi-plugin-schedule": {
"version": "3.0.0-beta.10",
"version": "3.0.0",
"description": "Schedule plugin for Koishi"
},
"koishi-plugin-status": {
Expand All @@ -83,7 +83,7 @@
"description": "Some simple tools for Koishi"
},
"koishi-plugin-webui": {
"version": "0.1.2",
"version": "0.1.3",
"description": "Web UI for Koishi"
}
}
4 changes: 2 additions & 2 deletions packages/koishi/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "koishi",
"description": "A QQ bot framework based on CQHTTP",
"version": "3.0.0",
"version": "3.0.1",
"main": "index.js",
"typings": "index.d.ts",
"engines": {
Expand Down Expand Up @@ -38,7 +38,7 @@
"cac": "^6.7.2",
"chokidar": "^3.5.1",
"kleur": "^4.1.4",
"koishi-core": "^3.0.0",
"koishi-core": "^3.0.1",
"koishi-utils": "^4.0.1",
"prompts": "^2.4.0"
}
Expand Down
8 changes: 4 additions & 4 deletions packages/plugin-adventure/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "koishi-plugin-adventure",
"version": "0.1.12",
"version": "0.1.13",
"description": "Adventure Game for Koishi",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
Expand Down Expand Up @@ -28,13 +28,13 @@
"adventure"
],
"peerDependencies": {
"koishi-core": "^3.0.0",
"koishi-plugin-common": "^4.0.0-beta.19",
"koishi-core": "^3.0.1",
"koishi-plugin-common": "^4.0.0",
"koishi-plugin-mysql": "^3.0.0-beta.16",
"koishi-plugin-teach": "^2.0.0-beta.15",
"koishi-utils": "^4.0.1"
},
"devDependencies": {
"koishi-test-utils": "^6.0.0-beta.9"
"koishi-test-utils": "^6.0.0-beta.10"
}
}
6 changes: 3 additions & 3 deletions packages/plugin-chess/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "koishi-plugin-chess",
"description": "Chess Plugin for Koishi",
"version": "3.0.0-beta.10",
"version": "3.0.0-beta.11",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"files": [
Expand Down Expand Up @@ -29,8 +29,8 @@
"game"
],
"peerDependencies": {
"koishi-core": "^3.0.0",
"koishi-plugin-puppeteer": "^2.0.0-beta.10",
"koishi-core": "^3.0.1",
"koishi-plugin-puppeteer": "^2.0.0",
"koishi-utils": "^4.0.1"
}
}
6 changes: 3 additions & 3 deletions packages/plugin-common/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "koishi-plugin-common",
"description": "Common plugins for Koishi",
"version": "4.0.0-beta.19",
"version": "4.0.0",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"files": [
Expand Down Expand Up @@ -30,10 +30,10 @@
"plugin"
],
"peerDependencies": {
"koishi-core": "^3.0.0",
"koishi-core": "^3.0.1",
"koishi-utils": "^4.0.1"
},
"devDependencies": {
"koishi-test-utils": "^6.0.0-beta.9"
"koishi-test-utils": "^6.0.0-beta.10"
}
}
4 changes: 2 additions & 2 deletions packages/plugin-dice/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
"dice"
],
"peerDependencies": {
"koishi-core": "^3.0.0",
"koishi-core": "^3.0.1",
"koishi-utils": "^4.0.1"
},
"devDependencies": {
"koishi-test-utils": "^6.0.0-beta.9"
"koishi-test-utils": "^6.0.0-beta.10"
}
}
4 changes: 2 additions & 2 deletions packages/plugin-eval/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"code"
],
"peerDependencies": {
"koishi-core": "^3.0.0"
"koishi-core": "^3.0.1"
},
"dependencies": {
"js-yaml": "^4.0.0",
Expand All @@ -43,6 +43,6 @@
},
"devDependencies": {
"@types/js-yaml": "^4.0.0",
"koishi-test-utils": "^6.0.0-beta.9"
"koishi-test-utils": "^6.0.0-beta.10"
}
}
8 changes: 4 additions & 4 deletions packages/plugin-github/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "koishi-plugin-github",
"description": "GitHub webhook plugin for Koishi",
"version": "3.0.0-beta.10",
"version": "3.0.0-beta.11",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"files": [
Expand Down Expand Up @@ -29,11 +29,11 @@
"webhook"
],
"devDependencies": {
"koishi-test-utils": "^6.0.0-beta.9"
"koishi-test-utils": "^6.0.0-beta.10"
},
"peerDependencies": {
"koishi-core": "^3.0.0",
"koishi-plugin-puppeteer": "^2.0.0-beta.10",
"koishi-core": "^3.0.1",
"koishi-plugin-puppeteer": "^2.0.0",
"koishi-utils": "^4.0.1"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-image-search/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"pixiv"
],
"peerDependencies": {
"koishi-core": "^3.0.0",
"koishi-core": "^3.0.1",
"koishi-utils": "^4.0.1"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-mongo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"@types/mongodb": "^3.6.8"
},
"peerDependencies": {
"koishi-core": "^3.0.0"
"koishi-core": "^3.0.1"
},
"dependencies": {
"mongodb": "^3.6.4"
Expand Down
Loading

0 comments on commit 2097178

Please sign in to comment.