Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refa: migrate most small booru to subpackages of core #164

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

MaikoTan
Copy link
Member

This PR migrates most small booru sources to core, and then re-export from their original package.

  • danbooru
  • e621
  • gelbooru
  • konachan
  • lolibooru
  • safebooru
  • sankaku
  • yande

Still not migrated

  • local: contains bunch of processing for local files.
  • lolicon / pixiv: has (or will have) router registering.
  • moehu: has a script to generate tag list, which is not suitable for structures of core.

@MaikoTan MaikoTan requested review from shigma and Lipraty March 19, 2024 03:22
Copy link

github-actions bot commented Mar 19, 2024

PR Health

Build ❌

Details
packages/core/src/source.ts(20,55): error TS2353: Object literal may only specify known properties, and 'proxyAgent' does not exist in type 'Config'.
packages/yande/src/index.ts(1,30): error TS2307: Cannot find module 'koishi-plugin-booru/yande' or its corresponding type declarations.
packages/sankaku/src/index.ts(1,39): error TS2307: Cannot find module 'koishi-plugin-booru/sankaku' or its corresponding type declarations.
packages/safebooru/src/index.ts(1,34): error TS2307: Cannot find module 'koishi-plugin-booru/safebooru' or its corresponding type declarations.
packages/pixiv/src/index.ts(9,29): error TS2307: Cannot find module 'koishi-plugin-booru' or its corresponding type declarations.
packages/pixiv/src/index.ts(31,25): error TS2339: Property 'ctx' does not exist on type 'PixivImageSource'.
packages/pixiv/src/index.ts(38,34): error TS2339: Property 'ctx' does not exist on type 'PixivImageSource'.
packages/pixiv/src/index.ts(46,14): error TS2339: Property 'ctx' does not exist on type 'PixivImageSource'.
packages/pixiv/src/index.ts(50,12): error TS2339: Property 'ctx' does not exist on type 'PixivImageSource'.
packages/pixiv/src/index.ts(54,33): error TS2339: Property 'http' does not exist on type 'PixivImageSource'.
packages/pixiv/src/index.ts(68,12): error TS4112: This member cannot have an 'override' modifier because its containing class 'PixivImageSource' does not extend another class.
packages/pixiv/src/index.ts(79,63): error TS2339: Property 'config' does not exist on type 'PixivImageSource'.
packages/pixiv/src/index.ts(80,59): error TS2339: Property 'config' does not exist on type 'PixivImageSource'.
packages/pixiv/src/index.ts(81,63): error TS2339: Property 'config' does not exist on type 'PixivImageSource'.
packages/pixiv/src/index.ts(121,28): error TS2339: Property 'config' does not exist on type 'PixivImageSource'.
packages/pixiv/src/index.ts(130,23): error TS2339: Property 'http' does not exist on type 'PixivImageSource'.
packages/pixiv/src/index.ts(130,67): error TS2339: Property 'config' does not exist on type 'PixivImageSource'.
packages/pixiv/src/index.ts(143,23): error TS2339: Property 'http' does not exist on type 'PixivImageSource'.
packages/pixiv/src/index.ts(143,67): error TS2339: Property 'config' does not exist on type 'PixivImageSource'.
packages/pixiv/src/index.ts(166,31): error TS2339: Property 'http' does not exist on type 'PixivImageSource'.
packages/pixiv/src/index.ts(206,14): error TS2339: Property 'config' does not exist on type 'PixivImageSource'.
packages/pixiv/src/index.ts(206,54): error TS2339: Property 'config' does not exist on type 'PixivImageSource'.
packages/pixiv/src/index.ts(207,33): error TS2339: Property 'config' does not exist on type 'PixivImageSource'.
packages/pixiv/src/index.ts(207,66): error TS2339: Property 'config' does not exist on type 'PixivImageSource'.
packages/pixiv/src/index.ts(207,86): error TS2339: Property 'config' does not exist on type 'PixivImageSource'.
packages/pixiv/src/index.ts(209,21): error TS2339: Property 'config' does not exist on type 'PixivImageSource'.
packages/pixiv/src/index.ts(209,61): error TS2339: Property 'config' does not exist on type 'PixivImageSource'.
packages/pixiv/src/index.ts(209,82): error TS2339: Property 'ctx' does not exist on type 'PixivImageSource'.
packages/pixiv/src/index.ts(210,50): error TS2339: Property 'config' does not exist on type 'PixivImageSource'.
packages/pixiv/src/index.ts(212,24): error TS2339: Property 'ctx' does not exist on type 'PixivImageSource'.
packages/pixiv/src/index.ts(212,68): error TS2339: Property 'config' does not exist on type 'PixivImageSource'.
packages/pixiv/src/index.ts(214,21): error TS2339: Property 'config' does not exist on type 'PixivImageSource'.
packages/pixiv/src/index.ts(214,61): error TS2339: Property 'ctx' does not exist on type 'PixivImageSource'.
packages/pixiv/src/index.ts(216,31): error TS2339: Property 'http' does not exist on type 'PixivImageSource'.
packages/pixiv/src/index.ts(218,19): error TS2339: Property 'ctx' does not exist on type 'PixivImageSource'.
packages/pixiv/src/index.ts(221,41): error TS2339: Property 'config' does not exist on type 'PixivImageSource'.
packages/pixiv/src/index.ts(241,16): error TS2322: Type 'Schema<unknown, unknown>' is not assignable to type 'Schema<Config>'.
Types of property 'value' are incompatible.
  Type 'unknown' is not assignable to type 'Config'.
packages/moehu/src/index.ts(3,29): error TS2307: Cannot find module 'koishi-plugin-booru' or its corresponding type declarations.
packages/moehu/src/index.ts(23,22): error TS2339: Property 'config' does not exist on type 'MoehuImageSource'.
packages/moehu/src/index.ts(28,29): error TS2339: Property 'ctx' does not exist on type 'MoehuImageSource'.
packages/moehu/src/index.ts(61,16): error TS2322: Type 'Schema<unknown, unknown>' is not assignable to type 'Schema<Config>'.
Types of property 'value' are incompatible.
  Type 'unknown' is not assignable to type 'Config'.
packages/lolicon/src/index.ts(2,29): error TS2307: Cannot find module 'koishi-plugin-booru' or its corresponding type declarations.
packages/lolicon/src/index.ts(10,12): error TS4112: This member cannot have an 'override' modifier because its containing class 'LoliconImageSource' does not extend another class.
packages/lolicon/src/index.ts(15,31): error TS2339: Property 'config' does not exist on type 'LoliconImageSource'.
packages/lolicon/src/index.ts(15,64): error TS2339: Property 'config' does not exist on type 'LoliconImageSource'.
packages/lolicon/src/index.ts(15,84): error TS2339: Property 'config' does not exist on type 'LoliconImageSource'.
packages/lolicon/src/index.ts(17,17): error TS2339: Property 'config' does not exist on type 'LoliconImageSource'.
packages/lolicon/src/index.ts(20,23): error TS2339: Property 'config' does not exist on type 'LoliconImageSource'.
packages/lolicon/src/index.ts(23,29): error TS2339: Property 'http' does not exist on type 'LoliconImageSource'.
packages/lolicon/src/index.ts(23,62): error TS2339: Property 'config' does not exist on type 'LoliconImageSource'.
packages/lolicon/src/index.ts(30,32): error TS2339: Property 'config' does not exist on type 'LoliconImageSource'.
packages/lolicon/src/index.ts(31,32): error TS2339: Property 'config' does not exist on type 'LoliconImageSource'.
packages/lolicon/src/index.ts(31,53): error TS2339: Property 'config' does not exist on type 'LoliconImageSource'.
packages/lolicon/src/index.ts(59,16): error TS2322: Type 'Schema<unknown, unknown>' is not assignable to type 'Schema<Config>'.
Types of property 'value' are incompatible.
  Type 'unknown' is not assignable to type 'Config'.
packages/lolibooru/src/index.ts(1,34): error TS2307: Cannot find module 'koishi-plugin-booru/lolibooru' or its corresponding type declarations.
packages/local/src/index.ts(7,29): error TS2307: Cannot find module 'koishi-plugin-booru' or its corresponding type declarations.
packages/local/src/index.ts(21,19): error TS4112: This member cannot have an 'override' modifier because its containing class 'LocalImageSource' does not extend another class.
packages/local/src/index.ts(95,14): error TS2339: Property 'config' does not exist on type 'LocalImageSource'.
packages/local/src/index.ts(95,49): error TS2339: Property 'config' does not exist on type 'LocalImageSource'.
packages/local/src/index.ts(185,16): error TS2322: Type 'Schema<unknown, unknown>' is not assignable to type 'Schema<Config>'.
Types of property 'value' are incompatible.
  Type 'unknown' is not assignable to type 'Config'.
packages/konachan/src/index.ts(1,33): error TS2307: Cannot find module 'koishi-plugin-booru/konachan' or its corresponding type declarations.
packages/gelbooru/src/index.ts(1,33): error TS2307: Cannot find module 'koishi-plugin-booru/gelbooru' or its corresponding type declarations.
packages/e621/src/index.ts(1,29): error TS2307: Cannot find module 'koishi-plugin-booru/e621' or its corresponding type declarations.
packages/danbooru/src/index.ts(1,33): error TS2307: Cannot find module 'koishi-plugin-booru/danbooru' or its corresponding type declarations.

Lint ✅

Details
/home/runner/work/koishi-plugin-booru/koishi-plugin-booru/packages/core/src/sources/danbooru/index.ts
11:3  warning  Useless constructor  @typescript-eslint/no-useless-constructor

/home/runner/work/koishi-plugin-booru/koishi-plugin-booru/packages/core/src/sources/gelbooru/index.ts
11:3  warning  Useless constructor  @typescript-eslint/no-useless-constructor

/home/runner/work/koishi-plugin-booru/koishi-plugin-booru/packages/core/src/sources/konachan/index.ts
26:3  warning  Useless constructor  @typescript-eslint/no-useless-constructor

/home/runner/work/koishi-plugin-booru/koishi-plugin-booru/packages/core/src/sources/lolibooru/index.ts
25:3  warning  Useless constructor  @typescript-eslint/no-useless-constructor

/home/runner/work/koishi-plugin-booru/koishi-plugin-booru/packages/core/src/sources/safebooru/index.ts
11:3  warning  Useless constructor  @typescript-eslint/no-useless-constructor

/home/runner/work/koishi-plugin-booru/koishi-plugin-booru/packages/core/src/sources/yande/index.ts
26:3  warning  Useless constructor  @typescript-eslint/no-useless-constructor

✖ 6 problems (0 errors, 6 warnings)

Checking formatting...
All matched files use Prettier code style!

packages/core/package.json Outdated Show resolved Hide resolved
@MaikoTan MaikoTan marked this pull request as ready for review May 29, 2024 02:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants