Commit 229a5ced authored by nanahira's avatar nanahira

bump to Koishi 4.8

parent 39b2bbf2
import { App } from 'koishi';
import { Context } from 'koishi';
import TargetPlugin from '../src';
import ConsolePlugin from '@koishijs/plugin-console';
import SandboxPlugin from '@koishijs/plugin-sandbox';
import * as DatabasePlugin from '@koishijs/plugin-database-memory';
import CachePlugin from '@koishijs/plugin-cache-lru';
import DatabasePlugin from '@koishijs/plugin-database-memory';
// import CachePlugin from '@koishijs/plugin-cache-lru';
import ExtrasInDev from './extras';
const app = new App({
const app = new Context({
port: 14514,
host: '0.0.0.0',
prefix: '.',
......@@ -19,7 +19,7 @@ app.plugin(ConsolePlugin, {
});
// Some services
app.plugin(CachePlugin);
// app.plugin(CachePlugin);
app.plugin(DatabasePlugin);
// Some extras
......
This diff is collapsed.
// import 'source-map-support/register';
import { RegisterSchema, SchemaProperty } from 'koishi-thirdeye';
import { Adapter, segment } from 'koishi';
import { Bot, segment } from 'koishi';
import _ from 'lodash';
import { AlertDto } from './def';
import { SendTarget } from 'koishi-target-def';
......@@ -61,7 +61,7 @@ export class InstanceConfig {
})
targets: SendTarget[];
async send(bots: Adapter.BotList, content: string) {
async send(bots: Bot[], content: string) {
return _.flatten(
await Promise.all(
this.targets.map((target) => target.send(bots, content)),
......
......@@ -10,7 +10,7 @@ import {
Post,
KoaContext,
} from 'koishi-thirdeye';
import { Adapter, Logger, Router } from 'koishi';
import { Bot, Logger, Router } from 'koishi';
import _ from 'lodash';
import { AlertDto } from './def';
export * from './config';
......@@ -18,7 +18,7 @@ export * from './config';
@DefinePlugin()
export class Instance extends StarterPlugin(InstanceConfig) {
@Inject()
private bots: Adapter.BotList;
private bots: Bot[];
private async send(content: string) {
return _.flatten(
......@@ -41,10 +41,9 @@ export class Instance extends StarterPlugin(InstanceConfig) {
@DefinePlugin()
export default class AlertmanagerPlugin
extends MultiInstancePlugin(Instance, AlertmanagerPluginConfig)
implements LifecycleEvents
{
@Inject(true)
private bots: Adapter.BotList;
private bots: Bot[];
@Inject(true)
private router: Router;
......
import { App } from 'koishi';
import { Context } from 'koishi';
import TargetPlugin from '../src';
describe('Test of plugin.', () => {
let app: App;
let app: Context;
beforeEach(async () => {
app = new App();
app = new Context();
// app.plugin(TargetPlugin);
await app.start();
});
......
const path = require('path');
const packgeInfo = require('./package.json');
const { ESBuildMinifyPlugin } = require('esbuild-loader');
function externalsFromDep() {
return Object.fromEntries(
......@@ -43,4 +44,11 @@ module.exports = {
koishi: 'koishi',
...(packAll ? {} : externalsFromDep()),
},
optimization: {
minimizer: [
new ESBuildMinifyPlugin({
keepNames: true,
}),
],
},
};
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