Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Mar 26, 2020
2 parents df43b04 + fe43409 commit acaffac
Show file tree
Hide file tree
Showing 15 changed files with 58 additions and 67 deletions.
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,37 +23,37 @@
"version": "1.0.0",
"license": "MIT",
"devDependencies": {
"@octokit/rest": "^17.1.0",
"@octokit/rest": "^17.1.3",
"@types/cross-spawn": "^6.0.1",
"@types/fs-extra": "^8.1.0",
"@types/jest": "^25.1.4",
"@types/node": "^13.9.1",
"@types/semver": "^7.1.0",
"@typescript-eslint/eslint-plugin": "^2.23.0",
"@typescript-eslint/parser": "^2.23.0",
"cac": "^6.5.7",
"@typescript-eslint/eslint-plugin": "^2.25.0",
"@typescript-eslint/parser": "^2.25.0",
"cac": "^6.5.8",
"cross-spawn": "^7.0.1",
"del": "^5.1.0",
"eslint": "^6.8.0",
"eslint-config-standard": "^14.1.0",
"eslint-config-standard": "^14.1.1",
"eslint-plugin-import": "^2.20.1",
"eslint-plugin-jest": "^23.8.2",
"eslint-plugin-node": "^11.0.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.1",
"express": "^4.17.1",
"fs-extra": "^8.1.0",
"fs-extra": "^9.0.0",
"globby": "^11.0.0",
"jest": "^25.1.0",
"jest": "^25.2.1",
"kleur": "^3.0.3",
"latest-version": "^5.1.0",
"open": "^7.0.3",
"ora": "^4.0.3",
"p-map": "^4.0.0",
"prompts": "^2.3.1",
"prompts": "^2.3.2",
"semver": "^7.1.3",
"ts-jest": "^25.2.1",
"ts-node": "^8.6.2",
"ts-node": "^8.8.1",
"typescript": "^3.8.3"
}
}
6 changes: 3 additions & 3 deletions packages/database-level/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "koishi-database-level",
"description": "Leveldb support for Koishi",
"version": "1.1.6",
"version": "1.1.7",
"main": "dist/index.js",
"files": [
"dist"
Expand Down Expand Up @@ -33,10 +33,10 @@
"leveldb"
],
"devDependencies": {
"koishi-test-utils": "^3.2.1"
"koishi-test-utils": "^3.2.2"
},
"peerDependencies": {
"koishi-core": "^1.11.1"
"koishi-core": "^1.11.2"
},
"dependencies": {
"@types/leveldown": "^4.0.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/database-memory/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "koishi-database-memory",
"description": "An in-memory database implementation for Koishi",
"version": "1.1.6",
"version": "1.1.7",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"files": [
Expand All @@ -22,7 +22,7 @@
},
"homepage": "https://github.com/koishijs/koishi/tree/master/packages/database-memory#readme",
"peerDependencies": {
"koishi-core": "^1.11.1"
"koishi-core": "^1.11.2"
},
"dependencies": {
"koishi-utils": "^1.0.4"
Expand Down
4 changes: 2 additions & 2 deletions packages/database-mysql/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "koishi-database-mysql",
"description": "MySQL support for Koishi",
"version": "1.1.6",
"version": "1.1.7",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"files": [
Expand Down Expand Up @@ -35,7 +35,7 @@
"@types/mysql": "^2.15.9"
},
"peerDependencies": {
"koishi-core": "^1.11.1"
"koishi-core": "^1.11.2"
},
"dependencies": {
"koishi-utils": "^1.0.4",
Expand Down
6 changes: 3 additions & 3 deletions packages/database-sqlite/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "koishi-database-sqlite",
"version": "1.0.0-alpha.12",
"version": "1.0.0-alpha.13",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"files": [
Expand All @@ -22,10 +22,10 @@
"homepage": "https://github.com/koishijs/koishi/tree/master/packages/database-sqlite#readme",
"devDependencies": {
"@types/sqlite3": "^3.1.6",
"koishi-test-utils": "^3.2.1"
"koishi-test-utils": "^3.2.2"
},
"peerDependencies": {
"koishi-core": "^1.11.1"
"koishi-core": "^1.11.2"
},
"dependencies": {
"koishi-utils": "^1.0.4",
Expand Down
14 changes: 7 additions & 7 deletions packages/koishi-cli/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": "1.11.1",
"version": "1.11.2",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"files": [
Expand Down Expand Up @@ -31,17 +31,17 @@
"koishi"
],
"devDependencies": {
"@types/js-yaml": "^3.12.2",
"@types/js-yaml": "^3.12.3",
"@types/prompts": "^2.0.5"
},
"dependencies": {
"cac": "^6.5.7",
"cac": "^6.5.8",
"js-yaml": "^3.13.1",
"kleur": "^3.0.3",
"koishi-core": "^1.11.1",
"koishi-plugin-common": "^2.1.7",
"koishi-plugin-schedule": "^1.0.12",
"koishi-core": "^1.11.2",
"koishi-plugin-common": "^2.1.8",
"koishi-plugin-schedule": "^1.0.13",
"koishi-utils": "^1.0.4",
"prompts": "^2.3.1"
"prompts": "^2.3.2"
}
}
8 changes: 4 additions & 4 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": "1.11.1",
"version": "1.11.2",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"files": [
Expand Down Expand Up @@ -33,10 +33,10 @@
],
"devDependencies": {
"@types/debug": "^4.1.5",
"@types/ws": "^7.2.2",
"@types/ws": "^7.2.3",
"get-port": "^5.1.1",
"koishi-database-memory": "^1.1.6",
"koishi-test-utils": "^3.2.1"
"koishi-database-memory": "^1.1.7",
"koishi-test-utils": "^3.2.2"
},
"dependencies": {
"axios": "^0.19.2",
Expand Down
4 changes: 1 addition & 3 deletions packages/koishi-core/src/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,7 @@ export class Command {

const { maxUsage, minInterval, authority } = command.config
let shouldFetchAuthority = !userFields.has('authority') && authority > 0
let shouldFetchUsage = !userFields.has('usage') && (
typeof maxUsage === 'number' && maxUsage < Infinity ||
typeof minInterval === 'number' && minInterval > 0)
let shouldFetchUsage = !(userFields.has('usage') || !maxUsage && !minInterval)
for (const option of command._options) {
if (option.camels[0] in options) {
if (option.authority > 0) shouldFetchAuthority = true
Expand Down
15 changes: 4 additions & 11 deletions packages/koishi-core/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,6 @@ export class WsClient extends Server {
if (error) reject(error)
})

let resolved = false
this.socket.on('message', (data) => {
data = data.toString()
this.debug('receive', data)
Expand All @@ -337,19 +336,13 @@ export class WsClient extends Server {
return reject(new Error(data))
}

if (!resolved) {
resolved = true
this.debug('connect to ws server:', this.app.options.server)
resolve()
}

if ('post_type' in parsed) {
const meta = this.prepareMeta(parsed)
if (meta) this.dispatchMeta(meta)
} else {
if (parsed.echo === -1) {
this.version = camelCase(parsed.data)
}
} else if (parsed.echo === -1) {
this.version = camelCase(parsed.data)
this.debug('connect to ws server:', this.app.options.server)
resolve()
this._listeners[parsed.echo]?.(parsed)
}
})
Expand Down
8 changes: 4 additions & 4 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": "2.1.7",
"version": "2.1.8",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"author": "Shigma <1700011071@pku.edu.cn>",
Expand All @@ -28,11 +28,11 @@
"plugin"
],
"devDependencies": {
"koishi-database-memory": "^1.1.6",
"koishi-test-utils": "^3.2.1"
"koishi-database-memory": "^1.1.7",
"koishi-test-utils": "^3.2.2"
},
"dependencies": {
"koishi-core": "^1.11.1",
"koishi-core": "^1.11.2",
"koishi-utils": "^1.0.4"
}
}
6 changes: 3 additions & 3 deletions packages/plugin-nlp/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "koishi-plugin-nlp",
"description": "Natural Language Processor for Koishi",
"version": "1.0.7",
"version": "1.0.8",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"author": "Shigma <1700011071@pku.edu.cn>",
Expand Down Expand Up @@ -30,10 +30,10 @@
"jieba"
],
"devDependencies": {
"koishi-test-utils": "^3.2.1"
"koishi-test-utils": "^3.2.2"
},
"dependencies": {
"koishi-core": "^1.11.1",
"koishi-core": "^1.11.2",
"koishi-utils": "^1.0.4",
"nodejieba": "^2.4.1"
}
Expand Down
6 changes: 3 additions & 3 deletions packages/plugin-recorder/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "koishi-plugin-recorder",
"description": "Save Chat Records for Koishi",
"version": "1.0.0-alpha.10",
"version": "1.0.0-alpha.11",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"author": "Shigma <1700011071@pku.edu.cn>",
Expand Down Expand Up @@ -31,10 +31,10 @@
],
"devDependencies": {
"del": "^5.1.0",
"koishi-test-utils": "^3.2.1"
"koishi-test-utils": "^3.2.2"
},
"dependencies": {
"koishi-core": "^1.11.1",
"koishi-core": "^1.11.2",
"koishi-utils": "^1.0.4"
}
}
10 changes: 5 additions & 5 deletions packages/plugin-schedule/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "koishi-plugin-schedule",
"description": "Schedule plugin for Koishi",
"version": "1.0.12",
"version": "1.0.13",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"author": "Shigma <1700011071@pku.edu.cn>",
Expand Down Expand Up @@ -31,12 +31,12 @@
],
"devDependencies": {
"@types/ms": "^0.7.31",
"koishi-database-level": "^1.1.6",
"koishi-database-mysql": "^1.1.6",
"koishi-test-utils": "^3.2.1"
"koishi-database-level": "^1.1.7",
"koishi-database-mysql": "^1.1.7",
"koishi-test-utils": "^3.2.2"
},
"dependencies": {
"koishi-core": "^1.11.1",
"koishi-core": "^1.11.2",
"koishi-utils": "^1.0.4",
"ms": "^2.1.2"
}
Expand Down
10 changes: 5 additions & 5 deletions packages/plugin-teach/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "koishi-plugin-teach",
"description": "Teach plugin for Koishi",
"version": "0.1.21",
"version": "0.1.22",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"author": "Shigma <1700011071@pku.edu.cn>",
Expand Down Expand Up @@ -31,12 +31,12 @@
"conversation"
],
"devDependencies": {
"koishi-database-level": "^1.1.6",
"koishi-database-mysql": "^1.1.6",
"koishi-test-utils": "^3.2.1"
"koishi-database-level": "^1.1.7",
"koishi-database-mysql": "^1.1.7",
"koishi-test-utils": "^3.2.2"
},
"dependencies": {
"koishi-core": "^1.11.1",
"koishi-core": "^1.11.2",
"koishi-utils": "^1.0.4"
}
}
6 changes: 3 additions & 3 deletions packages/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": "3.2.1",
"version": "3.2.2",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"files": [
Expand Down Expand Up @@ -33,7 +33,7 @@
"utilities"
],
"peerDependencies": {
"jest": "^25.1.0"
"jest": "^25.2.1"
},
"devDependencies": {
"@types/debug": "^4.1.5",
Expand All @@ -43,7 +43,7 @@
"axios": "^0.19.2",
"debug": "^4.1.1",
"get-port": "^5.1.1",
"koishi-core": "^1.11.1",
"koishi-core": "^1.11.2",
"koishi-utils": "^1.0.4"
}
}

0 comments on commit acaffac

Please sign in to comment.