Skip to content

Commit

Permalink
refactor: migrate to koishi 4.15.2, fix inject dependent (#106)
Browse files Browse the repository at this point in the history
* chore: update issue template

* chore(core): change to `inject`

* chore: bump versions

* chore: fix version change

* Revert "chore: update issue template"

This reverts commit 7c49055.

---------

Co-authored-by: Maiko Sinkyaet Tan <[email protected]>
  • Loading branch information
Lipraty and MaikoTan authored Oct 30, 2023
1 parent 856637a commit ff57481
Show file tree
Hide file tree
Showing 14 changed files with 56 additions and 47 deletions.
6 changes: 3 additions & 3 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "koishi-plugin-booru",
"description": "Image service for Koishi",
"version": "1.0.3",
"version": "1.1.0",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
"files": [
Expand Down Expand Up @@ -44,11 +44,11 @@
}
},
"peerDependencies": {
"koishi": "^4.10.0"
"koishi": "^4.15.2"
},
"devDependencies": {
"@koishijs/assets": "^1.0.2",
"koishi": "^4.12.4"
"koishi": "^4.15.2"
},
"dependencies": {
"languagedetect": "^2.0.0"
Expand Down
9 changes: 9 additions & 0 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ declare module 'koishi' {
}

class ImageService extends Service {
static inject = {
required: [],
optional: ['assets'],
}
private sources: ImageSource[] = []
private languageDetect = new LanguageDetect()

Expand Down Expand Up @@ -151,6 +155,11 @@ export const Config = Schema.intersect([
}).description('输出设置'),
])

export const inject = {
required: [],
optional: ['assets'],
}

export function apply(ctx: Context, config: Config) {
ctx.plugin(ImageService, config)

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/source.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Context, Schema } from 'koishi'

export abstract class ImageSource<Config extends ImageSource.Config = ImageSource.Config> {
static using = ['booru']
static inject = ['booru']

languages: string[] = []
source: string
Expand Down
8 changes: 4 additions & 4 deletions packages/danbooru/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "koishi-plugin-booru-danbooru",
"description": "Image service by Danbooru for Koishi",
"version": "1.0.4",
"version": "1.1.0",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
"files": [
Expand Down Expand Up @@ -45,10 +45,10 @@
}
},
"peerDependencies": {
"koishi": "^4.10.0",
"koishi-plugin-booru": "^1.0.3"
"koishi": "^4.15.2",
"koishi-plugin-booru": "^1.1.0"
},
"devDependencies": {
"koishi": "^4.12.4"
"koishi": "^4.15.2"
}
}
8 changes: 4 additions & 4 deletions packages/e621/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "koishi-plugin-booru-e621",
"description": "Image service by e621/e926 for Koishi",
"version": "1.0.0",
"version": "1.1.0",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
"files": [
Expand Down Expand Up @@ -46,10 +46,10 @@
}
},
"peerDependencies": {
"koishi": "^4.10.0",
"koishi-plugin-booru": "^1.0.3"
"koishi": "^4.15.2",
"koishi-plugin-booru": "^1.1.0"
},
"devDependencies": {
"koishi": "^4.12.4"
"koishi": "^4.15.2"
}
}
8 changes: 4 additions & 4 deletions packages/gelbooru/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "koishi-plugin-booru-gelbooru",
"description": "Image service by gelbooru for Koishi",
"version": "1.0.3",
"version": "1.1.0",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
"files": [
Expand Down Expand Up @@ -46,10 +46,10 @@
}
},
"peerDependencies": {
"koishi": "^4.10.0",
"koishi-plugin-booru": "^1.0.3"
"koishi": "^4.15.2",
"koishi-plugin-booru": "^1.1.0"
},
"devDependencies": {
"koishi": "^4.12.4"
"koishi": "^4.15.2"
}
}
8 changes: 4 additions & 4 deletions packages/konachan/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "koishi-plugin-booru-konachan",
"description": "Image service by konachan for Koishi",
"version": "1.0.3",
"version": "1.1.0",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
"files": [
Expand Down Expand Up @@ -46,10 +46,10 @@
}
},
"peerDependencies": {
"koishi": "^4.10.0",
"koishi-plugin-booru": "^1.0.3"
"koishi": "^4.15.2",
"koishi-plugin-booru": "^1.1.0"
},
"devDependencies": {
"koishi": "^4.12.4"
"koishi": "^4.15.2"
}
}
6 changes: 3 additions & 3 deletions packages/local/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "koishi-plugin-booru-local",
"description": "Image service from local directories for Koishi",
"version": "1.0.0",
"version": "1.1.0",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
"files": [
Expand Down Expand Up @@ -48,7 +48,7 @@
}
},
"peerDependencies": {
"koishi": "^4.10.0",
"koishi-plugin-booru": "^1.0.3"
"koishi": "^4.15.2",
"koishi-plugin-booru": "^1.1.0"
}
}
8 changes: 4 additions & 4 deletions packages/lolibooru/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "koishi-plugin-booru-lolibooru",
"description": "Image service by lolibooru for Koishi",
"version": "1.0.3",
"version": "1.1.0",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
"files": [
Expand Down Expand Up @@ -46,10 +46,10 @@
}
},
"peerDependencies": {
"koishi": "^4.10.0",
"koishi-plugin-booru": "^1.0.3"
"koishi": "^4.15.2",
"koishi-plugin-booru": "^1.1.0"
},
"devDependencies": {
"koishi": "^4.12.4"
"koishi": "^4.15.2"
}
}
8 changes: 4 additions & 4 deletions packages/lolicon/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "koishi-plugin-booru-lolicon",
"description": "Image service by lolicon.app for Koishi",
"version": "1.0.4",
"version": "1.1.0",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
"files": [
Expand Down Expand Up @@ -45,10 +45,10 @@
}
},
"peerDependencies": {
"koishi": "^4.10.0",
"koishi-plugin-booru": "^1.0.3"
"koishi": "^4.15.2",
"koishi-plugin-booru": "^1.1.0"
},
"devDependencies": {
"koishi": "^4.12.4"
"koishi": "^4.15.2"
}
}
8 changes: 4 additions & 4 deletions packages/pixiv/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "koishi-plugin-booru-pixiv",
"description": "Image service from pixiv.net for Koishi",
"version": "1.0.3",
"version": "1.1.0",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
"files": [
Expand Down Expand Up @@ -46,10 +46,10 @@
}
},
"peerDependencies": {
"koishi": "^4.10.0",
"koishi-plugin-booru": "^1.0.3"
"koishi": "^4.15.2",
"koishi-plugin-booru": "^1.1.0"
},
"devDependencies": {
"koishi": "^4.12.4"
"koishi": "^4.15.2"
}
}
8 changes: 4 additions & 4 deletions packages/safebooru/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "koishi-plugin-booru-safebooru",
"description": "Image service by safebooru for Koishi",
"version": "1.0.3",
"version": "1.1.0",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
"files": [
Expand Down Expand Up @@ -46,10 +46,10 @@
}
},
"peerDependencies": {
"koishi": "^4.10.0",
"koishi-plugin-booru": "^1.0.3"
"koishi": "^4.15.2",
"koishi-plugin-booru": "^1.1.0"
},
"devDependencies": {
"koishi": "^4.12.4"
"koishi": "^4.15.2"
}
}
8 changes: 4 additions & 4 deletions packages/sankaku/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "koishi-plugin-booru-sankaku",
"description": "Image service by sankaku for Koishi",
"version": "1.0.1",
"version": "1.1.0",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
"files": [
Expand Down Expand Up @@ -46,10 +46,10 @@
}
},
"peerDependencies": {
"koishi": "^4.10.0",
"koishi-plugin-booru": "^1.0.3"
"koishi": "^4.15.2",
"koishi-plugin-booru": "^1.1.0"
},
"devDependencies": {
"koishi": "^4.12.4"
"koishi": "^4.15.2"
}
}
8 changes: 4 additions & 4 deletions packages/yande/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "koishi-plugin-booru-yande",
"description": "Image service by yande for Koishi",
"version": "1.0.3",
"version": "1.1.0",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
"files": [
Expand Down Expand Up @@ -46,10 +46,10 @@
}
},
"peerDependencies": {
"koishi": "^4.10.0",
"koishi-plugin-booru": "^1.0.3"
"koishi": "^4.15.2",
"koishi-plugin-booru": "^1.1.0"
},
"devDependencies": {
"koishi": "^4.12.4"
"koishi": "^4.15.2"
}
}

0 comments on commit ff57481

Please sign in to comment.