Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
K
Koishi Plugin Edging
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
3rdeye
Koishi Plugin Edging
Commits
34a88cdf
Commit
34a88cdf
authored
Jul 25, 2022
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bump to Koishi 4.8
parent
fd4a1387
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
1481 additions
and
483 deletions
+1481
-483
dev/extras.ts
dev/extras.ts
+12
-16
dev/index.ts
dev/index.ts
+5
-5
package-lock.json
package-lock.json
+1433
-436
package.json
package.json
+12
-12
src/config.ts
src/config.ts
+3
-3
src/index.ts
src/index.ts
+5
-8
tests/sample.spec.ts
tests/sample.spec.ts
+3
-3
webpack.config.js
webpack.config.js
+8
-0
No files found.
dev/extras.ts
View file @
34a88cdf
...
...
@@ -13,22 +13,18 @@ export default class ExtrasInDev {
weight
:
2
,
});
ctx
.
plugin
(
PicSourceYandePlugin
,
{
instances
:
[
{
name
:
'
yande
'
,
weight
:
1
,
endpoint
:
'
https://yande.re/post.json
'
,
pageLimit
:
200
,
isDefault
:
true
,
},
{
name
:
'
konachan
'
,
weight
:
1
,
endpoint
:
'
https://konachan.com/post.json
'
,
pageLimit
:
200
,
isDefault
:
true
,
},
],
name
:
'
yande
'
,
weight
:
1
,
endpoint
:
'
https://yande.re/post.json
'
,
pageLimit
:
200
,
isDefault
:
true
,
});
ctx
.
plugin
(
PicSourceYandePlugin
,
{
name
:
'
konachan
'
,
weight
:
1
,
endpoint
:
'
https://konachan.com/post.json
'
,
pageLimit
:
200
,
isDefault
:
true
,
});
ctx
.
plugin
(
PicSourceHeisi
,
{
isDefault
:
true
});
ctx
.
plugin
(
PicSourceMiraikoi
,
{
isDefault
:
true
});
...
...
dev/index.ts
View file @
34a88cdf
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
:
'
localhost
'
,
prefix
:
'
.
'
,
...
...
@@ -19,7 +19,7 @@ app.plugin(ConsolePlugin, {
});
// Some services
app
.
plugin
(
CachePlugin
);
//
app.plugin(CachePlugin);
app
.
plugin
(
DatabasePlugin
);
// Some extras
...
...
package-lock.json
View file @
34a88cdf
This source diff could not be displayed because it is too large. You can
view the blob
instead.
package.json
View file @
34a88cdf
...
...
@@ -47,31 +47,31 @@
"testEnvironment"
:
"node"
},
"dependencies"
:
{
"
koishi-thirdeye
"
:
"
^1
0.3.2
"
,
"
koishi-thirdeye
"
:
"
^1
1.0.6
"
,
"
moment
"
:
"
^2.29.3
"
},
"peerDependencies"
:
{
"koishi"
:
"^4.
7.5
"
,
"
koishi-plugin-pics
"
:
"
^
9.4.1
"
"koishi"
:
"^4.
8.2
"
,
"
koishi-plugin-pics
"
:
"
^
10.0.0
"
},
"devDependencies"
:
{
"
@koishijs/plugin-cache-lru
"
:
"
^1.0.0-rc.0
"
,
"
@koishijs/plugin-console
"
:
"
^3.3.2
"
,
"
@koishijs/plugin-database-memory
"
:
"
^1.3.0
"
,
"
@koishijs/plugin-sandbox
"
:
"
^1.1.3
"
,
"
@koishijs/plugin-console
"
:
"
^4.1.1
"
,
"
@koishijs/plugin-database-memory
"
:
"
^1.4.1
"
,
"
@koishijs/plugin-sandbox
"
:
"
^2.0.1
"
,
"
@types/jest
"
:
"
^27.5.0
"
,
"
@types/node
"
:
"
^17.0.31
"
,
"
@typescript-eslint/eslint-plugin
"
:
"
^4.33.0
"
,
"
@typescript-eslint/parser
"
:
"
^4.33.0
"
,
"
esbuild-loader
"
:
"
^2.19.0
"
,
"
eslint
"
:
"
^7.32.0
"
,
"
eslint-config-prettier
"
:
"
^8.5.0
"
,
"
eslint-plugin-prettier
"
:
"
^3.4.1
"
,
"
jest
"
:
"
^28.0.3
"
,
"
koishi-plugin-pics
"
:
"
^
9.4.1
"
,
"
koishi-plugin-picsource-heisi
"
:
"
^
6.0.3
"
,
"
koishi-plugin-picsource-lolicon
"
:
"
^
9.2.5
"
,
"
koishi-plugin-picsource-miraikoi
"
:
"
^
1.0.2
"
,
"
koishi-plugin-picsource-yande
"
:
"
^
2.0.3
"
,
"
koishi-plugin-pics
"
:
"
^
10.0.0
"
,
"
koishi-plugin-picsource-heisi
"
:
"
^
7.0.0
"
,
"
koishi-plugin-picsource-lolicon
"
:
"
^
10.0.0
"
,
"
koishi-plugin-picsource-miraikoi
"
:
"
^
2.0.0
"
,
"
koishi-plugin-picsource-yande
"
:
"
^
3.0.0
"
,
"
prettier
"
:
"
^2.6.2
"
,
"
raw-loader
"
:
"
^4.0.2
"
,
"
ts-jest
"
:
"
^28.0.1
"
,
...
...
src/config.ts
View file @
34a88cdf
...
...
@@ -35,9 +35,9 @@ export class EdgingProfile {
bot
:
Bot
;
getBot
(
bots
:
Adapter
.
BotList
)
{
getBot
(
bots
:
Bot
[]
)
{
if
(
this
.
from
)
{
return
bots
.
get
(
this
.
from
);
return
bots
.
find
(
bot
=>
bot
.
sid
===
this
.
from
);
}
else
{
return
this
.
session
.
bot
;
}
...
...
@@ -130,7 +130,7 @@ export class EdgingProfile {
return
this
.
failTriggerWord
&&
message
.
startsWith
(
this
.
failTriggerWord
);
}
async
initialize
(
config
:
EdgingPluginConfig
,
bots
:
Adapter
.
BotList
)
{
async
initialize
(
config
:
EdgingPluginConfig
,
bots
:
Bot
[]
)
{
Object
.
keys
(
config
.
defaultProfile
).
forEach
((
key
)
=>
{
if
(
!
this
[
key
]
&&
config
.
defaultProfile
[
key
])
{
this
[
key
]
=
config
.
defaultProfile
[
key
];
...
...
src/index.ts
View file @
34a88cdf
...
...
@@ -2,7 +2,7 @@
import
{
EdgingPluginConfig
,
EdgingProfile
}
from
'
./config
'
;
import
{
DefinePlugin
,
Base
Plugin
,
Starter
Plugin
,
Provide
,
Inject
,
LifecycleEvents
,
...
...
@@ -22,11 +22,8 @@ import { dynamicInterval } from './utility';
export
*
from
'
./config
'
;
declare
module
'
koishi
'
{
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace
Context
{
interface
Services
{
edging
:
EdgingPlugin
;
}
interface
Context
{
edging
:
EdgingPlugin
;
}
}
...
...
@@ -74,7 +71,7 @@ export class EdgingPanel {
@
Provide
(
'
edging
'
,
{
immediate
:
true
})
@
DefinePlugin
({
name
:
'
edging
'
,
schema
:
EdgingPluginConfig
})
export
default
class
EdgingPlugin
extends
BasePlugin
<
EdgingPluginConfig
>
extends
StarterPlugin
(
EdgingPluginConfig
)
implements
LifecycleEvents
{
onApply
()
{
...
...
@@ -94,7 +91,7 @@ export default class EdgingPlugin
}
@
Inject
()
private
bots
:
Adapter
.
BotList
;
private
bots
:
Bot
[]
;
@
Inject
()
private
pics
:
PicsContainer
;
...
...
tests/sample.spec.ts
View file @
34a88cdf
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
();
});
...
...
webpack.config.js
View file @
34a88cdf
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
,
}),
],
},
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment