Commit 2364bf60 authored by nanahira's avatar nanahira

fix compile

parent f812eed7
......@@ -27,7 +27,9 @@ app.plugin(ExtrasInDev);
// Target plugin
app.plugin(TargetPlugin, {
instances: [{ name: 'ygopro', isDefault: true, path: './dev/test-pics' }],
name: 'ygopro',
isDefault: true,
path: './dev/test-pics',
});
app.start();
......@@ -9,7 +9,7 @@
"version": "9.2.3",
"license": "MIT",
"dependencies": {
"koishi-thirdeye": "^10.2.8",
"koishi-thirdeye": "^10.3.1",
"read-dir-deep": "^7.0.1"
},
"devDependencies": {
......@@ -36,8 +36,8 @@
"ws": "^8.3.0"
},
"peerDependencies": {
"koishi": "^4.7.4",
"koishi-plugin-pics": "^9.3.3"
"koishi": "^4.7.5",
"koishi-plugin-pics": "^9.4.1"
}
},
"node_modules/@ampproject/remapping": {
......@@ -1058,15 +1058,15 @@
}
},
"node_modules/@koishijs/core": {
"version": "4.7.4",
"resolved": "https://registry.npmjs.org/@koishijs/core/-/core-4.7.4.tgz",
"integrity": "sha512-S4pPaO05WC0htkQVcTMTluBZv4g8sEEBJ2ItHN2zJA8syet3iKJidT+s2gYt8d2rBo0Ndlvo1gBLGLNl/Zc9yg==",
"version": "4.7.5",
"resolved": "https://registry.npmjs.org/@koishijs/core/-/core-4.7.5.tgz",
"integrity": "sha512-So8tBtSTVIq8dTGs/0o92Om3bQhgYUhmzVhnYTqJbx+kW3kSowl/ORiBhJFK3GR6Dj+JyKLptsqQNE4DjZdNhw==",
"peer": true,
"dependencies": {
"@koishijs/utils": "^5.4.5",
"cordis": "^1.3.3",
"cordis": "^1.5.5",
"fastest-levenshtein": "^1.0.12",
"minato": "^1.1.0"
"minato": "^1.2.1"
},
"engines": {
"node": ">=12.0.0"
......@@ -2611,9 +2611,9 @@
"peer": true
},
"node_modules/cordis": {
"version": "1.3.3",
"resolved": "https://registry.npmjs.org/cordis/-/cordis-1.3.3.tgz",
"integrity": "sha512-mpyBWAEVYX8/YHoGWIqaOjrOk6DmtrOWZfsBSinNR+nDBlB39Ks6aC1B5oZ7AdnVoRE2ZYBCGecoHrlxcRxd6w==",
"version": "1.5.5",
"resolved": "https://registry.npmjs.org/cordis/-/cordis-1.5.5.tgz",
"integrity": "sha512-vCw6FA+OLO5e40so5XjhRnIw1ldGH1L74q/wlnuckqFtIq8teYkfnnmlNTS24RJNcgPz2DWdbVgCnoc+5Lc+UQ==",
"peer": true,
"dependencies": {
"cosmokit": "^1.1.2"
......@@ -5231,13 +5231,13 @@
}
},
"node_modules/koishi": {
"version": "4.7.4",
"resolved": "https://registry.npmjs.org/koishi/-/koishi-4.7.4.tgz",
"integrity": "sha512-VVHf3TyFsTuKrB8IZffxwmwiGx+zyhDo+DNNEFQjvomgqFdGEceAnLxNIf10K48aB1CDmkmi37b6uaURi4Z1Hw==",
"version": "4.7.5",
"resolved": "https://registry.npmjs.org/koishi/-/koishi-4.7.5.tgz",
"integrity": "sha512-Q+czD5hZIsikYwdoKUOZFZIuvXoamikXK6iX4FXnHUPsoXX16PjqX3D1sBKd9JLVMA49KSAGoFW0fN9IMHykYw==",
"peer": true,
"dependencies": {
"@koa/router": "^10.1.1",
"@koishijs/core": "^4.7.4",
"@koishijs/core": "^4.7.5",
"@koishijs/utils": "^5.4.5",
"@types/koa": "*",
"@types/koa__router": "*",
......@@ -5246,7 +5246,7 @@
"file-type": "^16.5.3",
"koa": "^2.13.4",
"koa-bodyparser": "^4.3.0",
"ns-require": "^1.1.2",
"ns-require": "^1.1.4",
"parseurl": "^1.3.3",
"path-to-regexp": "^6.2.1",
"portfinder": "^1.0.28",
......@@ -5258,9 +5258,9 @@
}
},
"node_modules/koishi-decorators": {
"version": "2.1.6",
"resolved": "https://registry.npmjs.org/koishi-decorators/-/koishi-decorators-2.1.6.tgz",
"integrity": "sha512-G1NN31fCIOafKkDME4YBzgHZ6J3b/CjsKr2AszZw9rmH6j7qHbs3PxXrkEK7zFSvTJh1RLHR2gDMhxqC7A3zTQ==",
"version": "2.1.7",
"resolved": "https://registry.npmjs.org/koishi-decorators/-/koishi-decorators-2.1.7.tgz",
"integrity": "sha512-OoExVOdpVEmv8FywtdjR8JUPQtBz1P2rabkIfmt3SQpp3jrkm67EgdQNH+Nw8+6CfSDukMP3+/xWsA64VE5VEQ==",
"dependencies": {
"@types/koa": "^2.13.4",
"@types/koa__router": "^8.0.11",
......@@ -5271,30 +5271,30 @@
"typed-reflector": "^1.0.10"
},
"peerDependencies": {
"koishi": "^4.7.4"
"koishi": "^4.7.5"
}
},
"node_modules/koishi-plugin-pics": {
"version": "9.3.3",
"resolved": "https://registry.npmjs.org/koishi-plugin-pics/-/koishi-plugin-pics-9.3.3.tgz",
"integrity": "sha512-PvBVJw9wAm8u+Cgn4ykrFbWZzA7uxq050rnpMOWjWz3qVG5NbaHimTQYbKhQoqCEHjVenCdj/JMCRjVtzrYHzg==",
"version": "9.4.1",
"resolved": "https://registry.npmjs.org/koishi-plugin-pics/-/koishi-plugin-pics-9.4.1.tgz",
"integrity": "sha512-TmUpK9hKwcBSbc1zrWaZksvs0a7xfFSvVSTsGkOG6QIMX38cEVGqzeFDy58Hu1f8CR2gJNenM53hI/6lq2Dd2Q==",
"peer": true,
"dependencies": {
"koishi-thirdeye": "^10.2.5",
"koishi-thirdeye": "^10.3.1",
"lodash": "^4.17.21"
},
"peerDependencies": {
"koishi": "^4.7.4"
"koishi": "^4.7.5"
}
},
"node_modules/koishi-thirdeye": {
"version": "10.2.8",
"resolved": "https://registry.npmjs.org/koishi-thirdeye/-/koishi-thirdeye-10.2.8.tgz",
"integrity": "sha512-fjHDMvc9SxwDuh7E34sl2qvpHrtkYQcrwrHXqk6K8X9sw0RiznL0QSx0EgPqUtr7QkbTm96p2J7MCPaTl5trWg==",
"version": "10.3.1",
"resolved": "https://registry.npmjs.org/koishi-thirdeye/-/koishi-thirdeye-10.3.1.tgz",
"integrity": "sha512-MEppegxBnl9MgwHxjXzItsgzmMnizewllJsuFGRyWasacOHrXieHTG07yGEVKhc8yWJT2JuqS79WI7excXcBXQ==",
"dependencies": {
"@types/koa": "^2.13.4",
"@types/koa__router": "^8.0.11",
"koishi-decorators": "^2.1.6",
"koishi-decorators": "^2.1.7",
"lodash": "^4.17.21",
"minato-decorators": "^2.0.7",
"reflect-metadata": "^0.1.13",
......@@ -5302,7 +5302,7 @@
"typed-reflector": "^1.0.10"
},
"peerDependencies": {
"koishi": "^4.7.4",
"koishi": "^4.7.5",
"schemastery": "^3.4.3"
}
},
......@@ -5522,13 +5522,13 @@
}
},
"node_modules/minato": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/minato/-/minato-1.1.0.tgz",
"integrity": "sha512-by1KMWxWlzq0iDV7tMkqS3thDRzYNQoS2ECfX5HRpMGaPQJqSgm5aY9IAky7knwAMoW3cMxQ/IhpvEShQqyj6A==",
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/minato/-/minato-1.2.1.tgz",
"integrity": "sha512-BYY18rr82aXAAVtMKkN4yDFsTUtsAmeDmyTRVOXG3mEzG74sNF5TU1nVT1QSC9dpvAcCFFs/vZO2rJoC8vSetQ==",
"peer": true,
"dependencies": {
"cosmokit": "^1.1.2",
"ns-require": "^1.1.2"
"ns-require": "^1.1.4"
}
},
"node_modules/minato-decorators": {
......@@ -5648,9 +5648,9 @@
}
},
"node_modules/ns-require": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/ns-require/-/ns-require-1.1.2.tgz",
"integrity": "sha512-GUF6I1hWDsGx1cA9FW27KIRAlkMel2UZagR39dVNPAPBgwWK1Ez0XB96WEz2OFcwHsCORI9h75dEZueHqZ/1pA==",
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/ns-require/-/ns-require-1.1.4.tgz",
"integrity": "sha512-Zk25pQj4u5i6DS0vaNO5aSSXewybVqqVVjz8AOxFy9DNPtmu3jlexMz6kUXLV2oB+X6iQeAnHXSzj5Qz/IeDaQ==",
"peer": true
},
"node_modules/nwsapi": {
......@@ -8673,15 +8673,15 @@
}
},
"@koishijs/core": {
"version": "4.7.4",
"resolved": "https://registry.npmjs.org/@koishijs/core/-/core-4.7.4.tgz",
"integrity": "sha512-S4pPaO05WC0htkQVcTMTluBZv4g8sEEBJ2ItHN2zJA8syet3iKJidT+s2gYt8d2rBo0Ndlvo1gBLGLNl/Zc9yg==",
"version": "4.7.5",
"resolved": "https://registry.npmjs.org/@koishijs/core/-/core-4.7.5.tgz",
"integrity": "sha512-So8tBtSTVIq8dTGs/0o92Om3bQhgYUhmzVhnYTqJbx+kW3kSowl/ORiBhJFK3GR6Dj+JyKLptsqQNE4DjZdNhw==",
"peer": true,
"requires": {
"@koishijs/utils": "^5.4.5",
"cordis": "^1.3.3",
"cordis": "^1.5.5",
"fastest-levenshtein": "^1.0.12",
"minato": "^1.1.0"
"minato": "^1.2.1"
}
},
"@koishijs/plugin-cache-lru": {
......@@ -9947,9 +9947,9 @@
"peer": true
},
"cordis": {
"version": "1.3.3",
"resolved": "https://registry.npmjs.org/cordis/-/cordis-1.3.3.tgz",
"integrity": "sha512-mpyBWAEVYX8/YHoGWIqaOjrOk6DmtrOWZfsBSinNR+nDBlB39Ks6aC1B5oZ7AdnVoRE2ZYBCGecoHrlxcRxd6w==",
"version": "1.5.5",
"resolved": "https://registry.npmjs.org/cordis/-/cordis-1.5.5.tgz",
"integrity": "sha512-vCw6FA+OLO5e40so5XjhRnIw1ldGH1L74q/wlnuckqFtIq8teYkfnnmlNTS24RJNcgPz2DWdbVgCnoc+5Lc+UQ==",
"peer": true,
"requires": {
"cosmokit": "^1.1.2"
......@@ -11912,13 +11912,13 @@
}
},
"koishi": {
"version": "4.7.4",
"resolved": "https://registry.npmjs.org/koishi/-/koishi-4.7.4.tgz",
"integrity": "sha512-VVHf3TyFsTuKrB8IZffxwmwiGx+zyhDo+DNNEFQjvomgqFdGEceAnLxNIf10K48aB1CDmkmi37b6uaURi4Z1Hw==",
"version": "4.7.5",
"resolved": "https://registry.npmjs.org/koishi/-/koishi-4.7.5.tgz",
"integrity": "sha512-Q+czD5hZIsikYwdoKUOZFZIuvXoamikXK6iX4FXnHUPsoXX16PjqX3D1sBKd9JLVMA49KSAGoFW0fN9IMHykYw==",
"peer": true,
"requires": {
"@koa/router": "^10.1.1",
"@koishijs/core": "^4.7.4",
"@koishijs/core": "^4.7.5",
"@koishijs/utils": "^5.4.5",
"@types/koa": "*",
"@types/koa__router": "*",
......@@ -11927,7 +11927,7 @@
"file-type": "^16.5.3",
"koa": "^2.13.4",
"koa-bodyparser": "^4.3.0",
"ns-require": "^1.1.2",
"ns-require": "^1.1.4",
"parseurl": "^1.3.3",
"path-to-regexp": "^6.2.1",
"portfinder": "^1.0.28",
......@@ -11936,9 +11936,9 @@
}
},
"koishi-decorators": {
"version": "2.1.6",
"resolved": "https://registry.npmjs.org/koishi-decorators/-/koishi-decorators-2.1.6.tgz",
"integrity": "sha512-G1NN31fCIOafKkDME4YBzgHZ6J3b/CjsKr2AszZw9rmH6j7qHbs3PxXrkEK7zFSvTJh1RLHR2gDMhxqC7A3zTQ==",
"version": "2.1.7",
"resolved": "https://registry.npmjs.org/koishi-decorators/-/koishi-decorators-2.1.7.tgz",
"integrity": "sha512-OoExVOdpVEmv8FywtdjR8JUPQtBz1P2rabkIfmt3SQpp3jrkm67EgdQNH+Nw8+6CfSDukMP3+/xWsA64VE5VEQ==",
"requires": {
"@types/koa": "^2.13.4",
"@types/koa__router": "^8.0.11",
......@@ -11950,23 +11950,23 @@
}
},
"koishi-plugin-pics": {
"version": "9.3.3",
"resolved": "https://registry.npmjs.org/koishi-plugin-pics/-/koishi-plugin-pics-9.3.3.tgz",
"integrity": "sha512-PvBVJw9wAm8u+Cgn4ykrFbWZzA7uxq050rnpMOWjWz3qVG5NbaHimTQYbKhQoqCEHjVenCdj/JMCRjVtzrYHzg==",
"version": "9.4.1",
"resolved": "https://registry.npmjs.org/koishi-plugin-pics/-/koishi-plugin-pics-9.4.1.tgz",
"integrity": "sha512-TmUpK9hKwcBSbc1zrWaZksvs0a7xfFSvVSTsGkOG6QIMX38cEVGqzeFDy58Hu1f8CR2gJNenM53hI/6lq2Dd2Q==",
"peer": true,
"requires": {
"koishi-thirdeye": "^10.2.5",
"koishi-thirdeye": "^10.3.1",
"lodash": "^4.17.21"
}
},
"koishi-thirdeye": {
"version": "10.2.8",
"resolved": "https://registry.npmjs.org/koishi-thirdeye/-/koishi-thirdeye-10.2.8.tgz",
"integrity": "sha512-fjHDMvc9SxwDuh7E34sl2qvpHrtkYQcrwrHXqk6K8X9sw0RiznL0QSx0EgPqUtr7QkbTm96p2J7MCPaTl5trWg==",
"version": "10.3.1",
"resolved": "https://registry.npmjs.org/koishi-thirdeye/-/koishi-thirdeye-10.3.1.tgz",
"integrity": "sha512-MEppegxBnl9MgwHxjXzItsgzmMnizewllJsuFGRyWasacOHrXieHTG07yGEVKhc8yWJT2JuqS79WI7excXcBXQ==",
"requires": {
"@types/koa": "^2.13.4",
"@types/koa__router": "^8.0.11",
"koishi-decorators": "^2.1.6",
"koishi-decorators": "^2.1.7",
"lodash": "^4.17.21",
"minato-decorators": "^2.0.7",
"reflect-metadata": "^0.1.13",
......@@ -12144,13 +12144,13 @@
"dev": true
},
"minato": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/minato/-/minato-1.1.0.tgz",
"integrity": "sha512-by1KMWxWlzq0iDV7tMkqS3thDRzYNQoS2ECfX5HRpMGaPQJqSgm5aY9IAky7knwAMoW3cMxQ/IhpvEShQqyj6A==",
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/minato/-/minato-1.2.1.tgz",
"integrity": "sha512-BYY18rr82aXAAVtMKkN4yDFsTUtsAmeDmyTRVOXG3mEzG74sNF5TU1nVT1QSC9dpvAcCFFs/vZO2rJoC8vSetQ==",
"peer": true,
"requires": {
"cosmokit": "^1.1.2",
"ns-require": "^1.1.2"
"ns-require": "^1.1.4"
}
},
"minato-decorators": {
......@@ -12246,9 +12246,9 @@
}
},
"ns-require": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/ns-require/-/ns-require-1.1.2.tgz",
"integrity": "sha512-GUF6I1hWDsGx1cA9FW27KIRAlkMel2UZagR39dVNPAPBgwWK1Ez0XB96WEz2OFcwHsCORI9h75dEZueHqZ/1pA==",
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/ns-require/-/ns-require-1.1.4.tgz",
"integrity": "sha512-Zk25pQj4u5i6DS0vaNO5aSSXewybVqqVVjz8AOxFy9DNPtmu3jlexMz6kUXLV2oB+X6iQeAnHXSzj5Qz/IeDaQ==",
"peer": true
},
"nwsapi": {
......
......@@ -28,12 +28,12 @@
},
"homepage": "https://github.com/koishijs/koishi-plugin-picsource-localfs",
"dependencies": {
"koishi-thirdeye": "^10.2.8",
"koishi-thirdeye": "^10.3.1",
"read-dir-deep": "^7.0.1"
},
"peerDependencies": {
"koishi": "^4.7.4",
"koishi-plugin-pics": "^9.3.3"
"koishi": "^4.7.5",
"koishi-plugin-pics": "^9.4.1"
},
"devDependencies": {
"@koishijs/plugin-cache-lru": "^1.0.0-rc.0",
......
import { Random } from 'koishi';
import { PicResult, PicSourcePlugin } from 'koishi-plugin-pics';
import { DefinePlugin, MultiInstancePlugin } from 'koishi-thirdeye';
import { DefinePlugin } from 'koishi-thirdeye';
import path from 'path';
import { readDirDeep } from 'read-dir-deep';
import { LocalSourceConfig } from './config';
import fs from 'fs';
@DefinePlugin()
export class LocalSource extends PicSourcePlugin(LocalSourceConfig) {
export default class LocalSource extends PicSourcePlugin(LocalSourceConfig) {
async randomPic(picTags: string[]): Promise<PicResult> {
const absolutePath = path.resolve(process.cwd(), this.config.path);
const files = (
......@@ -33,8 +33,3 @@ export class LocalSource extends PicSourcePlugin(LocalSourceConfig) {
};
}
}
@DefinePlugin()
export default class LocalSourcePlugin extends MultiInstancePlugin(
LocalSource,
) {}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment