Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
I
init-things
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
nanahira
init-things
Commits
321b2238
Commit
321b2238
authored
Nov 12, 2021
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
thirdeye
parent
c5652e8e
Pipeline
#6776
failed with stages
in 42 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
22 deletions
+10
-22
things/koishi-plugin-init/install-npm.sh
things/koishi-plugin-init/install-npm.sh
+1
-1
things/koishi-plugin-init/src/config.ts
things/koishi-plugin-init/src/config.ts
+1
-1
things/koishi-plugin-init/src/index.ts
things/koishi-plugin-init/src/index.ts
+7
-8
things/koishi-plugin-init/src/plugin.ts
things/koishi-plugin-init/src/plugin.ts
+0
-11
things/koishi-plugin-init/webpack.config.js
things/koishi-plugin-init/webpack.config.js
+1
-1
No files found.
things/koishi-plugin-init/install-npm.sh
View file @
321b2238
#!/bin/bash
#!/bin/bash
npm
install
--save
\
npm
install
--save
\
source-map-support
\
source-map-support
\
koishi-
utils-schemagen
koishi-
thirdeye
npm
install
--save-dev
\
npm
install
--save-dev
\
@types/node
\
@types/node
\
...
...
things/koishi-plugin-init/src/config.ts
View file @
321b2238
import
'
source-map-support/register
'
;
import
'
source-map-support/register
'
;
import
{
DefineSchema
}
from
'
koishi-
utils-schemagen
'
;
import
{
DefineSchema
}
from
'
koishi-
thirdeye
'
;
export
class
MyPluginConfig
{
export
class
MyPluginConfig
{
@
DefineSchema
({
desc
:
'
命令名
'
,
default
:
'
cmd
'
})
@
DefineSchema
({
desc
:
'
命令名
'
,
default
:
'
cmd
'
})
...
...
things/koishi-plugin-init/src/index.ts
View file @
321b2238
import
'
source-map-support/register
'
;
import
'
source-map-support/register
'
;
import
{
Context
,
Schema
}
from
'
koishi
'
;
import
{
Context
}
from
'
koishi
'
;
import
{
MyPlugin
}
from
'
./plugin
'
;
import
{
MyPluginConfig
,
MyPluginConfigLike
}
from
'
./config
'
;
import
{
MyPluginConfig
,
MyPluginConfigLike
}
from
'
./config
'
;
import
{
schemaFromClass
}
from
'
koishi-utils-schemagen
'
;
import
{
KoishiPlugin
,
InjectConfig
}
from
'
koishi-thirdeye
'
;
export
*
from
'
./config
'
;
export
*
from
'
./config
'
;
export
*
from
'
./plugin
'
;
declare
module
'
koishi
'
{
declare
module
'
koishi
'
{
interface
Modules
{
interface
Modules
{
...
@@ -12,8 +10,9 @@ declare module 'koishi' {
...
@@ -12,8 +10,9 @@ declare module 'koishi' {
}
}
}
}
export
const
name
=
'
myplugin
'
;
@
KoishiPlugin
({
name
:
'
myplugin
'
,
schema
:
MyPluginConfig
})
export
const
schema
:
Schema
<
MyPluginConfigLike
>
=
schemaFromClass
(
MyPluginConfig
);
export
default
class
MyPlugin
{
export
function
apply
(
ctx
:
Context
,
config
:
MyPluginConfigLike
)
{
constructor
(
private
ctx
:
Context
,
config
:
MyPluginConfigLike
)
{}
ctx
.
plugin
(
MyPlugin
,
config
);
@
InjectConfig
()
private
config
:
MyPluginConfig
;
}
}
things/koishi-plugin-init/src/plugin.ts
deleted
100644 → 0
View file @
c5652e8e
import
'
source-map-support/register
'
;
import
{
Context
}
from
'
koishi
'
;
import
{
MyPluginConfig
,
MyPluginConfigLike
}
from
'
./config
'
;
import
{
schemaTransform
}
from
'
koishi-utils-schemagen
'
;
export
class
MyPlugin
{
private
config
:
MyPluginConfig
;
constructor
(
private
ctx
:
Context
,
_config
:
MyPluginConfigLike
)
{
this
.
config
=
schemaTransform
(
MyPluginConfig
,
_config
);
}
}
things/koishi-plugin-init/webpack.config.js
View file @
321b2238
...
@@ -32,7 +32,7 @@ module.exports = {
...
@@ -32,7 +32,7 @@ module.exports = {
...(
packAll
...(
packAll
?
{}
?
{}
:
{
:
{
'
koishi-
utils-schemagen
'
:
'
koishi-utils-schemagen
'
,
'
koishi-
thirdeye
'
:
'
koishi-thirdeye
'
,
}),
}),
},
},
};
};
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