-
-
Notifications
You must be signed in to change notification settings - Fork 248
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refa: separate @koishijs/plugin-server
- Loading branch information
Showing
10 changed files
with
111 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,11 @@ | ||
// This file is only intended for users who do not use CLI. | ||
|
||
import { Context, defineProperty, Schema } from '@koishijs/core' | ||
import { Router, WebSocketLayer } from '@satorijs/router' | ||
import Loader from '@koishijs/loader' | ||
|
||
import '@satorijs/satori' | ||
|
||
export { Loader, Router, WebSocketLayer } | ||
export { Loader } | ||
|
||
export * from '@koishijs/core' | ||
export * from '@koishijs/loader' | ||
export * from '@koishijs/utils' | ||
|
||
Context.service('router', Router) | ||
|
||
declare module '@koishijs/core' { | ||
namespace Context { | ||
interface Config extends Config.Network {} | ||
|
||
namespace Config { | ||
interface Network { | ||
host?: string | ||
port?: number | ||
maxPort?: number | ||
selfUrl?: string | ||
} | ||
|
||
interface Static extends Schema<Config> { | ||
Network: Schema<Network> | ||
} | ||
} | ||
} | ||
} | ||
|
||
defineProperty(Context.Config, 'Network', Router.Config.description('网络设置')) | ||
|
||
Context.Config.list.unshift(Context.Config.Network) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,6 +44,7 @@ | |
"koishi": "^4.15.7" | ||
}, | ||
"devDependencies": { | ||
"@koishijs/plugin-server": "^0.1.2", | ||
"koishi": "^4.15.7" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.DS_Store | ||
tsconfig.tsbuildinfo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{ | ||
"name": "@koishijs/plugin-server", | ||
"description": "Server service for Koishi", | ||
"version": "0.1.2", | ||
"main": "lib/index.js", | ||
"module": "lib/index.mjs", | ||
"typings": "lib/index.d.ts", | ||
"files": [ | ||
"lib", | ||
"src" | ||
], | ||
"author": "Shigma <[email protected]>", | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/cordisjs/server.git", | ||
"directory": "packages/core" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/satorijs/satori/issues" | ||
}, | ||
"homepage": "https://koishi.chat/plugins/develop/server.html", | ||
"keywords": [ | ||
"bot", | ||
"adapter", | ||
"protocol", | ||
"chatbot", | ||
"koishi", | ||
"router", | ||
"server" | ||
], | ||
"koishi": { | ||
"service": { | ||
"implements": [ | ||
"server" | ||
] | ||
}, | ||
"description": { | ||
"en": "Service & Router Service", | ||
"zh": "服务器与路由服务" | ||
} | ||
}, | ||
"peerDependencies": { | ||
"koishi": "^4.15.7" | ||
}, | ||
"devDependencies": { | ||
"koishi": "^4.15.7" | ||
}, | ||
"dependencies": { | ||
"@cordisjs/server": "^0.1.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# [@koishijs/plugin-server](https://koishi.chat/plugins/develop/server.html) | ||
|
||
Server service for [Koishi](https://koishi.chat). | ||
|
||
- [Documentation](https://koishi.chat/plugins/develop/server.html) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import Server from '@cordisjs/server' | ||
|
||
export default Server | ||
export * from '@cordisjs/server' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"extends": "../../tsconfig.base", | ||
"compilerOptions": { | ||
"outDir": "lib", | ||
"rootDir": "src", | ||
}, | ||
"include": [ | ||
"src", | ||
], | ||
} |