Compare commits

...

7 Commits

Author SHA1 Message Date
b7927830ae v0.3.2 2020-03-18 11:19:08 +08:00
2dbd2182c2 fix: source map print error
Signed-off-by: MiaoWoo <admin@yumc.pw>
2020-03-18 11:15:49 +08:00
01df79eaf1 refactor: move docs to MiaoDocs
Signed-off-by: MiaoWoo <admin@yumc.pw>
2020-03-10 13:19:48 +08:00
16fe9ba9bd update: README
Signed-off-by: MiaoWoo <admin@yumc.pw>
2020-03-04 02:23:37 +08:00
950ce69b83 feat: modify stage order
Signed-off-by: MiaoWoo <admin@yumc.pw>
2020-03-04 02:11:55 +08:00
fa8e44d838 feat: update readme and fix container package error
Signed-off-by: MiaoWoo <admin@yumc.pw>
2020-03-04 02:04:35 +08:00
b7af785273 feat: add docs package
Signed-off-by: MiaoWoo <admin@yumc.pw>
2020-03-04 02:04:02 +08:00
15 changed files with 96 additions and 37 deletions

View File

@@ -7,7 +7,6 @@
### Project Path
```txt
└─packages
└─packages
├─api 全平台兼容的接口
├─core 核心代码 用于引导加载
@@ -20,7 +19,6 @@
├─bukkit BukkitAPI内部实现
├─sponge SpongeAPI内部实现
├─nukkit NukkitAPI内部实现
├─ployfill JS环境的相关环境补全
├─plugin 插件管理器
├─websocket Netty的WebSocket注入
├─type Java的类型定义

View File

@@ -5,10 +5,55 @@
### 更新日志
- 2020-03-03
- 发布 `v0.3.1` 版本
- 2020-03-02
- 杂项 更新文档以及示例插件
- 2020-03-01
- 修复 多个包之间的循环依赖问题
- 优化 `@ms/types` 的引用逻辑
- 2020-02-29
- 更新 `TypeScript` 版本为 `3.8.3`
- 新增 `@ms/common` 的 `http` 下载功能
- 2020-02-27
- 发布 `v0.3.0` 版本
- 新增 `@ms/i18n` 国际化包的支持
- 修复 `@ms/plugin` 对 `servers` 相关处理异常
- 优化 `@ms/api` 的 `Channel` 处理增加 扩展原始数据
- 2020-02-26
- 优化 `@ms/container` 使用 `autoProvide` 自动注入依赖
- 2020-02-25
- 修复 `@ms/api` 对 `evnet` 的类型处理异常
- 2020-02-24
- 发布 `v0.2.1` 版本
- 完善 对 `Nukkit` 端的支持
- 新增 `@ms/api` 通道相关的支持
- 2020-02-23
- 新增 `@ms/nukkit` 包 对 `Nukkit` 端的支持
- 新增 `@ms/type` 的 `nukkit` 类型自动补全
- 2020-02-22
- 发布 `v0.2.0` 版本
- 新增 `@ms/plugin` 的 `@config` 注解 目前支持 `json` `yml` 格式的配置
- 2020-02-15
- 新增 `SourceMap` 的支持 用于跟踪源代码行数
- 2020-02-09
- 新增 `core-js` 用于支持大部分新ES语法
- 2020-01-31
- 优化 `@ms/ployfill` 全局处理
- 2020-01-15
- 新增 `@ms/bungee` 包 对 `BungeeCord` 端的支持
- 2020-01-14
- 新增 `@ms/type` 的 `bungee` 类型自动补全
- 2019-11-10
- 新增 `WebSocket` 的注入支持
- 2019-11-07
- 新增 `@ms/type` 的 `jdk` 类型自动补全
- 2019-09-27
- 新增 `CatServer` MOD端的支持
- 2019-09-25
- 完善 `Sponge` 类型自动补全
- 新增 `@ms/type` 的 `sponge` 类型自动补全
- 2019-09-24
- 完善 `Bukkit` 类型自动补全
- 新增 `@ms/type` 的 `bukkit` 类型自动补全
## 插件简介
@@ -163,6 +208,10 @@ import { plugin, interfaces, cmd, listener, tab } from '@ms/plugin'
export class HelloWorld extends interfaces.Plugin {
@inject(server.Server)
private Server: server.Server
@config()
private config = {
version: 1.0.0
}
load() {
this.logger.log('Plugin load from MiaoScript Plugin System...');
@@ -409,6 +458,19 @@ ServerConnected(e: any) {
}
```
## 配置文件
配置文件 默认读取的是 `MiaoScript根目录/plugins/插件名称/配置名称.配置格式`
例如下面文件 默认处理的是 `plugins/MiaoScript/plugins/HelloWorld/config.yml`
```ts
@config()
private config = {
version: 1.0.0
}
```
## 插件列表
暂无

View File

@@ -1,5 +1,5 @@
{
"version": "0.3.1",
"version": "0.3.2",
"useWorkspaces": true,
"npmClient": "yarn",
"packages": [

View File

@@ -1,6 +1,6 @@
{
"name": "@ms/api",
"version": "0.3.1",
"version": "0.3.2",
"description": "MiaoScript api package",
"keywords": [
"miaoscript",
@@ -22,7 +22,7 @@
"test": "echo \"Error: run tests from root\" && exit 1"
},
"dependencies": {
"@ms/container": "^0.3.1",
"@ms/container": "^0.3.2",
"@ms/ployfill": "^0.3.1",
"source-map-builder": "^0.0.7"
},

View File

@@ -146,7 +146,7 @@ export class MiaoScriptConsole implements Console {
}
}
}
cache.push(` §e->§c ${className}.${trace.methodName}(§4${fileName}:${trace.lineNumber}§c)`);
cache.push(` §e->§c ${className}.${trace.methodName}(§4${fileName}:${lineNumber}§c)`);
}
});
return cache;

View File

@@ -1,5 +1,3 @@
import { injectable, DefaultContainer as container } from "@ms/container";
export namespace task {
export const TaskManager = Symbol('TaskManager')
export interface TaskManager {

View File

@@ -1,6 +1,6 @@
{
"name": "@ms/bukkit",
"version": "0.3.1",
"version": "0.3.2",
"description": "MiaoScript bukkit package",
"keywords": [
"miaoscript",
@@ -27,8 +27,8 @@
"typescript": "^3.8.3"
},
"dependencies": {
"@ms/api": "^0.3.1",
"@ms/api": "^0.3.2",
"@ms/common": "^0.3.1",
"@ms/container": "^0.3.1"
"@ms/container": "^0.3.2"
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "@ms/bungee",
"version": "0.3.1",
"version": "0.3.2",
"description": "MiaoScript bungee package",
"keywords": [
"miaoscript",
@@ -27,8 +27,8 @@
"typescript": "^3.8.3"
},
"dependencies": {
"@ms/api": "^0.3.1",
"@ms/api": "^0.3.2",
"@ms/common": "^0.3.1",
"@ms/container": "^0.3.1"
"@ms/container": "^0.3.2"
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "@ms/container",
"version": "0.3.1",
"version": "0.3.2",
"description": "MiaoScript container package",
"keywords": [
"miaoscript",
@@ -27,6 +27,7 @@
"typescript": "^3.8.3"
},
"dependencies": {
"inversify": "^5.0.1",
"inversify-binding-decorators": "^4.0.0"
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "@ms/core",
"version": "0.3.1",
"version": "0.3.2",
"description": "MiaoScript api package",
"keywords": [
"miaoscript",
@@ -27,8 +27,8 @@
"typescript": "^3.8.3"
},
"dependencies": {
"@ms/api": "^0.3.1",
"@ms/container": "^0.3.1"
"@ms/api": "^0.3.2",
"@ms/container": "^0.3.2"
},
"gitHead": "781524f83e52cad26d7c480513e3c525df867121"
}

View File

@@ -1,6 +1,6 @@
{
"name": "@ms/nukkit",
"version": "0.3.1",
"version": "0.3.2",
"description": "MiaoScript nukkit package",
"keywords": [
"miaoscript",
@@ -27,8 +27,8 @@
"typescript": "^3.8.3"
},
"dependencies": {
"@ms/api": "^0.3.1",
"@ms/api": "^0.3.2",
"@ms/common": "^0.3.1",
"@ms/container": "^0.3.1"
"@ms/container": "^0.3.2"
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "@ms/plugin",
"version": "0.3.1",
"version": "0.3.2",
"description": "MiaoScript api package",
"keywords": [
"miaoscript",
@@ -28,9 +28,9 @@
"typescript": "^3.8.3"
},
"dependencies": {
"@ms/api": "^0.3.1",
"@ms/api": "^0.3.2",
"@ms/common": "^0.3.1",
"@ms/container": "^0.3.1",
"@ms/container": "^0.3.2",
"@ms/i18n": "^0.3.1",
"js-yaml": "^3.13.1"
}

View File

@@ -64,20 +64,20 @@ export class PluginManagerImpl implements plugin.PluginManager {
enable(...args: any[]): void {
this.checkAndGet(args[0]).forEach((plugin: interfaces.Plugin) => {
this.logStage(plugin, i18n.translate("ms.plugin.manager.stage.enable"))
this.runCatch(plugin, 'enable')
this.runCatch(plugin, `${this.serverType}enable`)
this.registryCommand(plugin)
this.registryListener(plugin)
this.runCatch(plugin, 'enable')
this.runCatch(plugin, `${this.serverType}enable`)
})
}
disable(...args: any[]): void {
this.checkAndGet(args[0]).forEach((plugin: interfaces.Plugin) => {
this.logStage(plugin, i18n.translate("ms.plugin.manager.stage.disable"))
this.runCatch(plugin, 'disable')
this.runCatch(plugin, `${this.serverType}disable`)
this.unregistryCommand(plugin)
this.unregistryListener(plugin)
this.runCatch(plugin, 'disable')
this.runCatch(plugin, `${this.serverType}disable`)
})
}

View File

@@ -1,7 +1,7 @@
{
"private": true,
"name": "@ms/plugins",
"version": "0.3.1",
"version": "0.3.2",
"description": "MiaoScript plugins package",
"keywords": [
"miaoscript",
@@ -28,8 +28,8 @@
"typescript": "^3.8.3"
},
"dependencies": {
"@ms/api": "^0.3.1",
"@ms/container": "^0.3.1",
"@ms/plugin": "^0.3.1"
"@ms/api": "^0.3.2",
"@ms/container": "^0.3.2",
"@ms/plugin": "^0.3.2"
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "@ms/sponge",
"version": "0.3.1",
"version": "0.3.2",
"description": "MiaoScript api package",
"keywords": [
"miaoscript",
@@ -27,8 +27,8 @@
"typescript": "^3.8.3"
},
"dependencies": {
"@ms/api": "^0.3.1",
"@ms/api": "^0.3.2",
"@ms/common": "^0.3.1",
"@ms/container": "^0.3.1"
"@ms/container": "^0.3.2"
}
}