Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
K
koishi-plugin-srvpro-roomlist
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-srvpro-roomlist
Commits
f223b288
Commit
f223b288
authored
Nov 21, 2021
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
catchup
parent
a5592430
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
143 additions
and
106 deletions
+143
-106
.gitlab-ci.yml
.gitlab-ci.yml
+1
-1
package-lock.json
package-lock.json
+97
-73
package.json
package.json
+7
-8
src/config.ts
src/config.ts
+3
-3
src/index.ts
src/index.ts
+2
-2
src/plugin.ts
src/plugin.ts
+5
-6
webpack.config.js
webpack.config.js
+28
-13
No files found.
.gitlab-ci.yml
View file @
f223b288
...
...
@@ -23,7 +23,7 @@ upload_to_minio:
tags
:
-
linux
script
:
-
aws s3 --endpoint=https://minio.mycard.moe:9000 sync --delete dist/ s3://nanahira/koishi-plugin/srvpro-roomlist
-
aws s3 --endpoint=https://minio.mycard.moe:9000 sync --delete dist/
full/
s3://nanahira/koishi-plugin/srvpro-roomlist
only
:
-
master
...
...
package-lock.json
View file @
f223b288
This diff is collapsed.
Click to expand it.
package.json
View file @
f223b288
...
...
@@ -6,7 +6,7 @@
"types"
:
"dist/index.d.ts"
,
"scripts"
:
{
"lint"
:
"eslint --fix ."
,
"build"
:
"webpack"
"build"
:
"webpack
&& env PACK_ALL=1 webpack
"
},
"repository"
:
{
"type"
:
"git"
,
...
...
@@ -28,25 +28,24 @@
},
"homepage"
:
"
https://code.mycard.moe/3rdeye/koishi-plugin-srvpro-roomlist
"
,
"dependencies"
:
{
"
source-map-support
"
:
"
^0.5.20
"
"
schemastery-gen
"
:
"
^1.0.3
"
,
"
source-map-support
"
:
"
^0.5.20
"
,
"
lodash
"
:
"
^4.17.21
"
,
"
class-transformer
"
:
"
^0.4.0
"
},
"peerDependencies"
:
{
"
koishi
"
:
"
^4.0.0-
alpha.9
"
"
koishi
"
:
"
^4.0.0-
beta.2
"
},
"devDependencies"
:
{
"
@types/lodash
"
:
"
^4.14.175
"
,
"
@types/node
"
:
"
^16.11.1
"
,
"
@typescript-eslint/eslint-plugin
"
:
"
^4.33.0
"
,
"
@typescript-eslint/parser
"
:
"
^4.33.0
"
,
"
class-transformer
"
:
"
^0.4.0
"
,
"
eslint
"
:
"
^7.32.0
"
,
"
eslint-config-prettier
"
:
"
^8.3.0
"
,
"
eslint-plugin-prettier
"
:
"
^3.4.1
"
,
"
koishi
"
:
"
^4.0.0-alpha.9
"
,
"
koishi-utils-schemagen
"
:
"
^1.1.7
"
,
"
lodash
"
:
"
^4.17.21
"
,
"
koishi
"
:
"
^4.0.0-beta.2
"
,
"
prettier
"
:
"
^2.4.1
"
,
"
proxy-agent
"
:
"
^5.0.0
"
,
"
raw-loader
"
:
"
^4.0.2
"
,
"
ts-loader
"
:
"
^9.2.6
"
,
"
typescript
"
:
"
^4.4.4
"
,
...
...
src/config.ts
View file @
f223b288
import
'
source-map-support/register
'
;
import
{
DefineSchema
,
SchemaConf
}
from
'
koishi-utils-schemagen
'
;
import
{
Context
}
from
'
koishi
'
;
import
{
SRVProRoomInfo
}
from
'
./def
'
;
import
{
plainToClass
}
from
'
class-transformer
'
;
import
{
RegisterSchema
,
DefineSchema
}
from
'
schemastery-gen
'
;
export
interface
ServerLike
{
name
:
string
;
...
...
@@ -15,7 +15,7 @@ export interface ServerLike {
displayPlayerIp
?:
boolean
;
}
@
SchemaConf
({
desc
:
'
SRVPro 服务器
'
})
@
RegisterSchema
({
desc
:
'
SRVPro 服务器
'
})
export
class
Server
implements
ServerLike
{
@
DefineSchema
({
desc
:
'
服务器名称
'
,
required
:
true
})
name
:
string
;
...
...
@@ -69,7 +69,7 @@ export interface MyPluginConfigLike {
servers
:
ServerLike
[];
}
@
SchemaConf
({
required
:
true
})
@
RegisterSchema
({
required
:
true
})
export
class
MyPluginConfig
implements
MyPluginConfigLike
{
@
DefineSchema
({
desc
:
'
服务器列表命令名
'
,
default
:
'
serverlist
'
})
listCommandName
:
string
;
...
...
src/index.ts
View file @
f223b288
import
'
source-map-support/register
'
;
import
{
Context
}
from
'
koishi
'
;
import
{
MyPlugin
}
from
'
./plugin
'
;
import
{
MyPluginConfig
,
MyPluginConfigLike
}
from
'
./config
'
;
import
{
MyPluginConfig
}
from
'
./config
'
;
export
{
MyPluginConfig
}
from
'
./config
'
;
export
const
name
=
'
srvpro-roomlist
'
;
const
plugin
=
new
MyPlugin
();
export
const
schema
=
plugin
.
schema
;
export
function
apply
(
ctx
:
Context
,
config
:
MyPluginConfig
Like
)
{
export
function
apply
(
ctx
:
Context
,
config
:
MyPluginConfig
)
{
ctx
.
plugin
(
plugin
,
config
);
}
src/plugin.ts
View file @
f223b288
import
'
source-map-support/register
'
;
import
{
Context
,
Schema
}
from
'
koishi
'
;
import
{
MyPluginConfig
,
MyPluginConfigLike
}
from
'
./config
'
;
import
{
schemaFromClass
,
schemaTransform
}
from
'
koishi-utils-schemagen
'
;
import
{
Context
}
from
'
koishi
'
;
import
{
MyPluginConfig
}
from
'
./config
'
;
export
class
MyPlugin
{
private
config
:
MyPluginConfig
;
private
ctx
:
Context
;
name
=
'
srvpro-roomlist-main
'
;
schema
:
Schema
<
MyPluginConfigLike
>
=
schemaFromClass
(
MyPluginConfig
)
;
apply
(
ctx
:
Context
,
config
:
MyPluginConfig
Like
)
{
schema
=
MyPluginConfig
;
apply
(
ctx
:
Context
,
config
:
MyPluginConfig
)
{
this
.
ctx
=
ctx
;
this
.
config
=
schemaTransform
(
MyPluginConfig
,
config
)
;
this
.
config
=
config
;
ctx
.
command
(
`
${
this
.
config
.
listCommandName
}
`
,
'
获取服务器列表
'
)
.
action
(
...
...
webpack.config.js
View file @
f223b288
const
path
=
require
(
"
path
"
);
const
path
=
require
(
'
path
'
);
const
packgeInfo
=
require
(
'
./package.json
'
);
function
externalsFromDep
()
{
return
Object
.
fromEntries
(
[
...
Object
.
keys
(
packgeInfo
.
dependencies
||
{}),
...
Object
.
keys
(
packgeInfo
.
peerDependencies
||
{}),
]
.
filter
((
dep
)
=>
dep
!==
'
source-map-support
'
)
.
map
((
dep
)
=>
[
dep
,
dep
]),
);
}
const
packAll
=
!!
process
.
env
.
PACK_ALL
;
module
.
exports
=
{
entry
:
"
./src/index.ts
"
,
mode
:
"
production
"
,
target
:
"
node
"
,
devtool
:
"
source-map
"
,
entry
:
'
./src/index.ts
'
,
mode
:
'
production
'
,
target
:
'
node
'
,
devtool
:
'
source-map
'
,
module
:
{
rules
:
[
{
test
:
/
\.
tsx
?
$/
,
use
:
"
ts-loader
"
,
use
:
'
ts-loader
'
,
exclude
:
/node_modules/
,
},
{
test
:
/
\.
mustache$/
,
use
:
"
raw-loader
"
},
{
test
:
/
\.
mustache$/
,
use
:
'
raw-loader
'
},
],
},
resolve
:
{
extensions
:
[
"
.tsx
"
,
"
.ts
"
,
"
.js
"
],
extensions
:
[
'
.tsx
'
,
'
.ts
'
,
'
.js
'
],
},
output
:
{
filename
:
"
index.js
"
,
filename
:
'
index.js
'
,
library
:
{
type
:
"
commonjs
"
,
type
:
'
commonjs
'
,
},
path
:
path
.
resolve
(
__dirname
,
"
dist
"
),
path
:
path
.
resolve
(
__dirname
,
packAll
?
'
dist/full
'
:
'
dist
'
),
},
externals
:
{
'
koishi
'
:
'
koishi
'
,
}
koishi
:
'
koishi
'
,
...(
packAll
?
{}
:
externalsFromDep
()),
},
};
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