refactor: rename scope to @ccms

Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
MiaoWoo 2020-05-03 00:14:47 +08:00
parent edf8410cd1
commit c34d3027e4
73 changed files with 217 additions and 268 deletions

View File

@ -9,8 +9,9 @@
"bs": "lerna bootstrap", "bs": "lerna bootstrap",
"clean": "lerna run clean", "clean": "lerna run clean",
"watch": "lerna run watch --parallel", "watch": "lerna run watch --parallel",
"build": "lerna run build --scope=\"@ms/!(plugins)\"", "build": "lerna run build --scope=\"@ccms/!(plugins)\"",
"build:plugins": "lerna run build --scope=\"@ms/plugins\"", "build:plugins": "lerna run build --scope=\"@ccms/plugins\"",
"publish": "yarn lerna exec \"npm publish --access=public\" --scope=\"@ccms/!(plugins|client|types)\"",
"ug": "yarn upgrade-interactive --latest", "ug": "yarn upgrade-interactive --latest",
"lp": "lerna publish" "lp": "lerna publish"
}, },

View File

@ -1,5 +1,5 @@
{ {
"name": "@ms/api", "name": "@ccms/api",
"version": "0.5.0", "version": "0.5.0",
"description": "MiaoScript api package", "description": "MiaoScript api package",
"keywords": [ "keywords": [
@ -12,9 +12,6 @@
"homepage": "https://github.com/circlecloud/ms.git", "homepage": "https://github.com/circlecloud/ms.git",
"license": "ISC", "license": "ISC",
"main": "dist/index.js", "main": "dist/index.js",
"publishConfig": {
"registry": "https://repo.yumc.pw/repository/npm-hosted/"
},
"scripts": { "scripts": {
"clean": "rimraf dist", "clean": "rimraf dist",
"watch": "tsc --watch", "watch": "tsc --watch",
@ -22,8 +19,8 @@
"test": "echo \"Error: run tests from root\" && exit 1" "test": "echo \"Error: run tests from root\" && exit 1"
}, },
"dependencies": { "dependencies": {
"@ms/container": "^0.5.0", "@ccms/container": "^0.5.0",
"@ms/ployfill": "^0.5.0", "@ccms/ployfill": "^0.5.0",
"base64-js": "^1.3.1", "base64-js": "^1.3.1",
"source-map-builder": "^0.0.7" "source-map-builder": "^0.0.7"
}, },

View File

@ -1,4 +1,4 @@
import { injectable } from "@ms/container"; import { injectable } from "@ccms/container";
export namespace channel { export namespace channel {
/** /**

View File

@ -1,5 +1,5 @@
import i18n from '@ms/i18n' import i18n from '@ccms/i18n'
import { injectable } from "@ms/container"; import { injectable } from "@ccms/container";
export namespace command { export namespace command {
@injectable() @injectable()

View File

@ -1,4 +1,4 @@
import i18m from '@ms/i18n' import i18m from '@ccms/i18n'
import { SourceMapBuilder } from 'source-map-builder' import { SourceMapBuilder } from 'source-map-builder'
import * as base64 from 'base64-js' import * as base64 from 'base64-js'

View File

@ -1,8 +1,8 @@
/** /**
* MiaoScript Event处理类 * MiaoScript Event处理类
*/ */
import i18n from '@ms/i18n' import i18n from '@ccms/i18n'
import { injectable, unmanaged } from '@ms/container' import { injectable, unmanaged } from '@ccms/container'
const Thread = Java.type('java.lang.Thread'); const Thread = Java.type('java.lang.Thread');

View File

@ -1,4 +1,4 @@
import "@ms/nashorn" import "@ccms/nashorn"
export * from './task' export * from './task'
export * from './event' export * from './event'
export * from './console' export * from './console'

View File

@ -1,5 +1,5 @@
{ {
"name": "@ms/bukkit", "name": "@ccms/bukkit",
"version": "0.5.0", "version": "0.5.0",
"description": "MiaoScript bukkit package", "description": "MiaoScript bukkit package",
"keywords": [ "keywords": [
@ -12,9 +12,6 @@
"homepage": "https://github.com/circlecloud/ms.git", "homepage": "https://github.com/circlecloud/ms.git",
"license": "ISC", "license": "ISC",
"main": "dist/index.js", "main": "dist/index.js",
"publishConfig": {
"registry": "https://repo.yumc.pw/repository/npm-hosted/"
},
"scripts": { "scripts": {
"clean": "rimraf dist", "clean": "rimraf dist",
"watch": "tsc --watch", "watch": "tsc --watch",
@ -27,8 +24,8 @@
"typescript": "^3.8.3" "typescript": "^3.8.3"
}, },
"dependencies": { "dependencies": {
"@ms/api": "^0.5.0", "@ccms/api": "^0.5.0",
"@ms/common": "^0.5.0", "@ccms/common": "^0.5.0",
"@ms/container": "^0.5.0" "@ccms/container": "^0.5.0"
} }
} }

View File

@ -1,5 +1,5 @@
import { channel, plugin } from '@ms/api' import { channel, plugin } from '@ccms/api'
import { inject, provideSingleton } from '@ms/container' import { inject, provideSingleton } from '@ccms/container'
const Bukkit = org.bukkit.Bukkit const Bukkit = org.bukkit.Bukkit
const PluginMessageListener = Java.type("org.bukkit.plugin.messaging.PluginMessageListener") const PluginMessageListener = Java.type("org.bukkit.plugin.messaging.PluginMessageListener")

View File

@ -1,8 +1,8 @@
import '@ms/nashorn' import '@ccms/nashorn'
import { command, plugin } from '@ms/api' import { command, plugin } from '@ccms/api'
import * as reflect from '@ms/common/dist/reflect' import * as reflect from '@ccms/common/dist/reflect'
import { provideSingleton, postConstruct, inject } from '@ms/container' import { provideSingleton, postConstruct, inject } from '@ccms/container'
let Bukkit = org.bukkit.Bukkit; let Bukkit = org.bukkit.Bukkit;
let TabCompleter = Java.type('org.bukkit.command.TabCompleter'); let TabCompleter = Java.type('org.bukkit.command.TabCompleter');

View File

@ -1,4 +1,4 @@
import { MiaoScriptConsole } from '@ms/api' import { MiaoScriptConsole } from '@ccms/api'
let Bukkit = org.bukkit.Bukkit; let Bukkit = org.bukkit.Bukkit;

View File

@ -1,6 +1,6 @@
import { event, plugin } from '@ms/api' import { event, plugin } from '@ccms/api'
import { inject, provideSingleton } from '@ms/container'; import { inject, provideSingleton } from '@ccms/container';
import * as reflect from '@ms/common/dist/reflect' import * as reflect from '@ccms/common/dist/reflect'
const Bukkit = Java.type("org.bukkit.Bukkit"); const Bukkit = Java.type("org.bukkit.Bukkit");
const Event = Java.type("org.bukkit.event.Event"); const Event = Java.type("org.bukkit.event.Event");

View File

@ -1,7 +1,7 @@
/// <reference types="@ms/types/dist/typings/bukkit" /> /// <reference types="@ccms/types/dist/typings/bukkit" />
import { server } from '@ms/api' import { server } from '@ccms/api'
import { Container } from '@ms/container' import { Container } from '@ccms/container'
import { BukkitConsole } from './console'; import { BukkitConsole } from './console';
import './event'; import './event';

View File

@ -1,7 +1,7 @@
import { server, constants } from '@ms/api' import { server, constants } from '@ccms/api'
import { provideSingleton } from '@ms/container'; import { provideSingleton } from '@ccms/container';
import * as reflect from '@ms/common/dist/reflect' import * as reflect from '@ccms/common/dist/reflect'
import chat from './enhance/chat' import chat from './enhance/chat'
let Bukkit = org.bukkit.Bukkit; let Bukkit = org.bukkit.Bukkit;

View File

@ -1,5 +1,5 @@
import { task, plugin } from '@ms/api' import { task, plugin } from '@ccms/api'
import { inject, provideSingleton } from '@ms/container'; import { inject, provideSingleton } from '@ccms/container';
const Bukkit = Java.type('org.bukkit.Bukkit'); const Bukkit = Java.type('org.bukkit.Bukkit');
const BukkitRunnable = Java.type('org.bukkit.scheduler.BukkitRunnable'); const BukkitRunnable = Java.type('org.bukkit.scheduler.BukkitRunnable');

View File

@ -1,5 +1,5 @@
{ {
"name": "@ms/bungee", "name": "@ccms/bungee",
"version": "0.5.0", "version": "0.5.0",
"description": "MiaoScript bungee package", "description": "MiaoScript bungee package",
"keywords": [ "keywords": [
@ -12,9 +12,6 @@
"homepage": "https://github.com/circlecloud/ms.git", "homepage": "https://github.com/circlecloud/ms.git",
"license": "ISC", "license": "ISC",
"main": "dist/index.js", "main": "dist/index.js",
"publishConfig": {
"registry": "https://repo.yumc.pw/repository/npm-hosted/"
},
"scripts": { "scripts": {
"clean": "rimraf dist", "clean": "rimraf dist",
"watch": "tsc --watch", "watch": "tsc --watch",
@ -27,8 +24,8 @@
"typescript": "^3.8.3" "typescript": "^3.8.3"
}, },
"dependencies": { "dependencies": {
"@ms/api": "^0.5.0", "@ccms/api": "^0.5.0",
"@ms/common": "^0.5.0", "@ccms/common": "^0.5.0",
"@ms/container": "^0.5.0" "@ccms/container": "^0.5.0"
} }
} }

View File

@ -1,5 +1,5 @@
import { channel, event } from '@ms/api' import { channel, event } from '@ccms/api'
import { provideSingleton, inject } from '@ms/container' import { provideSingleton, inject } from '@ccms/container'
const Bungee: net.md_5.bungee.api.ProxyServer = base.getInstance().getProxy() const Bungee: net.md_5.bungee.api.ProxyServer = base.getInstance().getProxy()

View File

@ -1,5 +1,5 @@
import { command, plugin } from "@ms/api"; import { command, plugin } from "@ccms/api";
import { inject, provideSingleton } from "@ms/container"; import { inject, provideSingleton } from "@ccms/container";
const Arrays = Java.type('java.util.Arrays') const Arrays = Java.type('java.util.Arrays')
const Command = Java.extend(Java.type('net.md_5.bungee.api.plugin.Command'), Java.type('net.md_5.bungee.api.plugin.TabExecutor')); const Command = Java.extend(Java.type('net.md_5.bungee.api.plugin.Command'), Java.type('net.md_5.bungee.api.plugin.TabExecutor'));

View File

@ -1,6 +1,6 @@
import '@ms/nashorn' import '@ccms/nashorn'
import { plugin, MiaoScriptConsole } from '@ms/api' import { plugin, MiaoScriptConsole } from '@ccms/api'
import { inject, injectable } from "@ms/container"; import { inject, injectable } from "@ccms/container";
let CommandSender = Java.type("net.md_5.bungee.api.CommandSender") let CommandSender = Java.type("net.md_5.bungee.api.CommandSender")

View File

@ -1,6 +1,6 @@
import { event } from '@ms/api' import { event } from '@ccms/api'
import { provideSingleton, postConstruct } from '@ms/container' import { provideSingleton, postConstruct } from '@ccms/container'
import * as reflect from '@ms/common/dist/reflect' import * as reflect from '@ccms/common/dist/reflect'
const Bungee: net.md_5.bungee.api.ProxyServer = base.getInstance().getProxy(); const Bungee: net.md_5.bungee.api.ProxyServer = base.getInstance().getProxy();
const Event = Java.type("net.md_5.bungee.api.plugin.Event"); const Event = Java.type("net.md_5.bungee.api.plugin.Event");

View File

@ -1,7 +1,7 @@
/// <reference types="@ms/types/dist/typings/bungee" /> /// <reference types="@ccms/types/dist/typings/bungee" />
import { server } from '@ms/api' import { server } from '@ccms/api'
import { Container } from '@ms/container' import { Container } from '@ccms/container'
import { BungeeConsole } from './console'; import { BungeeConsole } from './console';
import './event'; import './event';

View File

@ -1,7 +1,7 @@
import { server, task } from '@ms/api' import { server, task } from '@ccms/api'
import { provideSingleton, inject, postConstruct } from '@ms/container' import { provideSingleton, inject, postConstruct } from '@ccms/container'
import * as reflect from '@ms/common/dist/reflect' import * as reflect from '@ccms/common/dist/reflect'
let Bungee: net.md_5.bungee.api.ProxyServer = base.getInstance().getProxy(); let Bungee: net.md_5.bungee.api.ProxyServer = base.getInstance().getProxy();

View File

@ -1,5 +1,5 @@
import { task, plugin } from '@ms/api' import { task, plugin } from '@ccms/api'
import { inject, provideSingleton } from '@ms/container'; import { inject, provideSingleton } from '@ccms/container';
var Runnable = Java.type('java.lang.Runnable') var Runnable = Java.type('java.lang.Runnable')
let TimeUnit = Java.type('java.util.concurrent.TimeUnit') let TimeUnit = Java.type('java.util.concurrent.TimeUnit')

View File

@ -1,6 +1,6 @@
{ {
"private": true, "private": true,
"name": "@ms/client", "name": "@ccms/client",
"version": "0.5.0", "version": "0.5.0",
"description": "MiaoScript client package", "description": "MiaoScript client package",
"keywords": [ "keywords": [
@ -13,9 +13,6 @@
"homepage": "https://github.com/circlecloud/ms.git", "homepage": "https://github.com/circlecloud/ms.git",
"license": "ISC", "license": "ISC",
"main": "dist/index.js", "main": "dist/index.js",
"publishConfig": {
"registry": "https://repo.yumc.pw/repository/npm-hosted/"
},
"scripts": { "scripts": {
"dev": "ts-node-dev --respawn --debounce=1500 src/index.ts", "dev": "ts-node-dev --respawn --debounce=1500 src/index.ts",
"clean": "rimraf dist", "clean": "rimraf dist",

View File

@ -1,5 +1,5 @@
{ {
"name": "@ms/common", "name": "@ccms/common",
"version": "0.5.0", "version": "0.5.0",
"description": "MiaoScript api package", "description": "MiaoScript api package",
"keywords": [ "keywords": [
@ -12,9 +12,6 @@
"homepage": "https://github.com/circlecloud/ms.git", "homepage": "https://github.com/circlecloud/ms.git",
"license": "ISC", "license": "ISC",
"main": "dist/index.js", "main": "dist/index.js",
"publishConfig": {
"registry": "https://repo.yumc.pw/repository/npm-hosted/"
},
"scripts": { "scripts": {
"clean": "rimraf dist", "clean": "rimraf dist",
"watch": "tsc --watch", "watch": "tsc --watch",
@ -27,7 +24,7 @@
"typescript": "^3.8.3" "typescript": "^3.8.3"
}, },
"dependencies": { "dependencies": {
"@ms/nashorn": "^0.5.0" "@ccms/nashorn": "^0.5.0"
}, },
"gitHead": "562e2d00175c9d3a99c8b672aa07e6d92706a027" "gitHead": "562e2d00175c9d3a99c8b672aa07e6d92706a027"
} }

View File

@ -1,4 +1,4 @@
import '@ms/nashorn' import '@ccms/nashorn'
/*global Java, base, module, exports, require, __FILE__*/ /*global Java, base, module, exports, require, __FILE__*/
const Path = Java.type("java.nio.file.Path"); const Path = Java.type("java.nio.file.Path");

View File

@ -1,4 +1,4 @@
import '@ms/nashorn' import '@ccms/nashorn'
let Files = Java.type("java.nio.file.Files"); let Files = Java.type("java.nio.file.Files");
let Paths = Java.type("java.nio.file.Paths"); let Paths = Java.type("java.nio.file.Paths");

View File

@ -1,5 +1,5 @@
{ {
"name": "@ms/compile", "name": "@ccms/compile",
"version": "0.5.0", "version": "0.5.0",
"description": "MiaoScript compile package", "description": "MiaoScript compile package",
"keywords": [ "keywords": [
@ -12,9 +12,6 @@
"homepage": "https://github.com/circlecloud/ms.git", "homepage": "https://github.com/circlecloud/ms.git",
"license": "ISC", "license": "ISC",
"main": "dist/index.js", "main": "dist/index.js",
"publishConfig": {
"registry": "https://repo.yumc.pw/repository/npm-hosted/"
},
"scripts": { "scripts": {
"clean": "rimraf dist", "clean": "rimraf dist",
"watch": "tsc --watch", "watch": "tsc --watch",

View File

@ -1,5 +1,5 @@
{ {
"name": "@ms/container", "name": "@ccms/container",
"version": "0.5.0", "version": "0.5.0",
"description": "MiaoScript container package", "description": "MiaoScript container package",
"keywords": [ "keywords": [
@ -12,9 +12,6 @@
"homepage": "https://github.com/circlecloud/ms.git", "homepage": "https://github.com/circlecloud/ms.git",
"license": "ISC", "license": "ISC",
"main": "dist/index.js", "main": "dist/index.js",
"publishConfig": {
"registry": "https://repo.yumc.pw/repository/npm-hosted/"
},
"scripts": { "scripts": {
"clean": "rimraf dist", "clean": "rimraf dist",
"watch": "tsc --watch", "watch": "tsc --watch",

View File

@ -2,7 +2,7 @@ import { interfaces, Container } from "inversify";
let _container: Container; let _container: Container;
const ContainerInstance = Symbol.for("@ms/ioc:Container"); const ContainerInstance = Symbol.for("@ccms/ioc:Container");
const INJECTION = Symbol.for("INJECTION"); const INJECTION = Symbol.for("INJECTION");
function _proxyGetter( function _proxyGetter(

View File

@ -1,5 +1,5 @@
{ {
"name": "@ms/core", "name": "@ccms/core",
"version": "0.5.0", "version": "0.5.0",
"description": "MiaoScript api package", "description": "MiaoScript api package",
"keywords": [ "keywords": [
@ -12,9 +12,6 @@
"homepage": "https://github.com/circlecloud/ms.git", "homepage": "https://github.com/circlecloud/ms.git",
"license": "ISC", "license": "ISC",
"main": "dist/index.js", "main": "dist/index.js",
"publishConfig": {
"registry": "https://repo.yumc.pw/repository/npm-hosted/"
},
"scripts": { "scripts": {
"clean": "rimraf dist", "clean": "rimraf dist",
"watch": "tsc --watch", "watch": "tsc --watch",
@ -27,8 +24,8 @@
"typescript": "^3.8.3" "typescript": "^3.8.3"
}, },
"dependencies": { "dependencies": {
"@ms/api": "^0.5.0", "@ccms/api": "^0.5.0",
"@ms/container": "^0.5.0" "@ccms/container": "^0.5.0"
}, },
"gitHead": "781524f83e52cad26d7c480513e3c525df867121" "gitHead": "781524f83e52cad26d7c480513e3c525df867121"
} }

View File

@ -1,8 +1,8 @@
let containerStartTime = Date.now(); let containerStartTime = Date.now();
console.i18n("ms.core.ioc.initialize"); console.i18n("ms.core.ioc.initialize", { scope: global.scope });
import { plugin, server, task, constants } from '@ms/api' import { plugin, server, task, constants } from '@ccms/api'
import { DefaultContainer as container, inject, provideSingleton, ContainerInstance, buildProviderModule } from '@ms/container' import { DefaultContainer as container, inject, provideSingleton, ContainerInstance, buildProviderModule } from '@ccms/container'
console.i18n("ms.core.ioc.completed", { time: (Date.now() - containerStartTime) / 1000 }) console.i18n("ms.core.ioc.completed", { scope: global.scope, time: (Date.now() - containerStartTime) / 1000 })
@provideSingleton(MiaoScriptCore) @provideSingleton(MiaoScriptCore)
class MiaoScriptCore { class MiaoScriptCore {
@ -83,13 +83,13 @@ function initialize() {
container.bind(plugin.PluginInstance).toConstantValue(base.getInstance()); container.bind(plugin.PluginInstance).toConstantValue(base.getInstance());
container.bind(plugin.PluginFolder).toConstantValue('plugins'); container.bind(plugin.PluginFolder).toConstantValue('plugins');
let type = detectServer(); let type = detectServer();
console.i18n("ms.core.initialize.detect", { type }); console.i18n("ms.core.initialize.detect", { scope: global.scope, type });
container.bind(server.ServerType).toConstantValue(type); container.bind(server.ServerType).toConstantValue(type);
console.i18n("ms.core.package.initialize", { type }); console.i18n("ms.core.package.initialize", { scope: global.scope, type });
require(`@ms/${type}`).default(container); require(`${global.scope}/${type}`).default(container);
require('@ms/plugin') require(`${global.scope}/plugin`)
container.load(buildProviderModule()); container.load(buildProviderModule());
console.i18n("ms.core.package.completed", { type, time: (Date.now() - corePackageStartTime) / 1000 }); console.i18n("ms.core.package.completed", { scope: global.scope, type, time: (Date.now() - corePackageStartTime) / 1000 });
let disable = container.get<MiaoScriptCore>(MiaoScriptCore).enable() let disable = container.get<MiaoScriptCore>(MiaoScriptCore).enable()
console.i18n("ms.core.engine.completed", { time: (Date.now() - global.NashornEngineStartTime) / 1000 }); console.i18n("ms.core.engine.completed", { time: (Date.now() - global.NashornEngineStartTime) / 1000 });
return disable; return disable;

View File

@ -1,12 +1,12 @@
ms.ployfill.initialize: "Initialization Java Nashorn ployfill. Please wait..." ms.ployfill.initialize: "Initialization Java Nashorn ployfill. Please wait..."
ms.ployfill.completed: "Java Nashorn ployfill loading completed... Cost ({time}s)!" ms.ployfill.completed: "Java Nashorn ployfill loading completed... Cost ({time}s)!"
ms.core.ioc.initialize: "Initialization MiaoScript IOC Container @ms/container. Please wait..." ms.core.ioc.initialize: "Initialization MiaoScript IOC Container {scope}/container. Please wait..."
ms.core.ioc.completed: "MiaoScript IOC Container @ms/container loading completed({time}s)!" ms.core.ioc.completed: "MiaoScript IOC Container {scope}/container loading completed({time}s)!"
ms.core.initialize.detect: "Detect Compatible Server set ServerType to {type} ..." ms.core.initialize.detect: "Detect Compatible Server set ServerType to {type} ..."
ms.core.initialize.error: "MiaoScript Engine Initialization Error: {error} ..." ms.core.initialize.error: "MiaoScript Engine Initialization Error: {error} ..."
ms.core.package.initialize: "Initialization MiaoScript Package @ms/core @ms/{type} @ms/plugin. Please wait..." ms.core.package.initialize: "Initialization MiaoScript Package {scope}/core {scope}/{type} {scope}/plugin. Please wait..."
ms.core.package.completed: "MiaoScript Package @ms/core @ms/{type} @ms/plugin loading completed({time}s)!" ms.core.package.completed: "MiaoScript Package {scope}/core {scope}/{type} {scope}/plugin loading completed({time}s)!"
ms.core.plugin.initialize: "Initialization MiaoScript Plugin System. Please wait..." ms.core.plugin.initialize: "Initialization MiaoScript Plugin System. Please wait..."
ms.core.plugin.completed: "MiaoScript Plugin System loading completed({time}s)!" ms.core.plugin.completed: "MiaoScript Plugin System loading completed({time}s)!"
ms.core.engine.completed: "MiaoScript ScriptEngine loading completed... Done({time}s)!" ms.core.engine.completed: "MiaoScript ScriptEngine loading completed... Done({time}s)!"

View File

@ -1,12 +1,12 @@
ms.ployfill.initialize: "加载 Java Nashorn 补丁. 请稍候..." ms.ployfill.initialize: "加载 Java Nashorn 补丁. 请稍候..."
ms.ployfill.completed: "Java Nashorn 补丁 加载完成... 耗时 ({time}s)!" ms.ployfill.completed: "Java Nashorn 补丁 加载完成... 耗时 ({time}s)!"
ms.core.ioc.initialize: "初始化 MiaoScript IOC 容器 @ms/container. 请稍候..." ms.core.ioc.initialize: "初始化 MiaoScript IOC 容器 {scope}/container. 请稍候..."
ms.core.ioc.completed: "MiaoScript IOC 容器 @ms/container 加载完成 耗时({time}s)" ms.core.ioc.completed: "MiaoScript IOC 容器 {scope}/container 加载完成 耗时({time}s)"
ms.core.initialize.detect: "检测到兼容的服务器类型. 设置 ServerType 值 {type} ..." ms.core.initialize.detect: "检测到兼容的服务器类型. 设置 ServerType 值 {type} ..."
ms.core.initialize.error: "§4MiaoScript 系统初始化失败 §c{error} ..." ms.core.initialize.error: "§4MiaoScript 系统初始化失败 §c{error} ..."
ms.core.package.initialize: "初始化 MiaoScript 扩展 @ms/core @ms/{type} @ms/plugin. 请稍候..." ms.core.package.initialize: "初始化 MiaoScript 扩展 {scope}/core {scope}/{type} {scope}/plugin. 请稍候..."
ms.core.package.completed: "MiaoScript 扩展 @ms/core @ms/{type} @ms/plugin 加载完成 耗时({time}s)" ms.core.package.completed: "MiaoScript 扩展 {scope}/core {scope}/{type} {scope}/plugin 加载完成 耗时({time}s)"
ms.core.plugin.initialize: "MiaoScript 开始引导插件系统. 请稍候..." ms.core.plugin.initialize: "MiaoScript 开始引导插件系统. 请稍候..."
ms.core.plugin.completed: "MiaoScript 插件加载完毕 耗时({time}s)!" ms.core.plugin.completed: "MiaoScript 插件加载完毕 耗时({time}s)!"
ms.core.engine.completed: "MiaoScript 脚本引擎 加载完毕... 耗时({time}s)!" ms.core.engine.completed: "MiaoScript 脚本引擎 加载完毕... 耗时({time}s)!"

View File

@ -1,5 +1,5 @@
{ {
"name": "@ms/i18n", "name": "@ccms/i18n",
"version": "0.5.0", "version": "0.5.0",
"description": "MiaoScript i18n package", "description": "MiaoScript i18n package",
"keywords": [ "keywords": [
@ -12,9 +12,6 @@
"homepage": "https://github.com/circlecloud/ms.git", "homepage": "https://github.com/circlecloud/ms.git",
"license": "ISC", "license": "ISC",
"main": "dist/index.js", "main": "dist/index.js",
"publishConfig": {
"registry": "https://repo.yumc.pw/repository/npm-hosted/"
},
"scripts": { "scripts": {
"clean": "rimraf dist", "clean": "rimraf dist",
"watch": "tsc --watch", "watch": "tsc --watch",
@ -28,8 +25,8 @@
"typescript": "^3.8.3" "typescript": "^3.8.3"
}, },
"dependencies": { "dependencies": {
"@ms/nashorn": "^0.5.0", "@ccms/nashorn": "^0.5.0",
"js-yaml": "^3.13.1" "js-yaml": "^3.13.1"
}, },
"gitHead": "781524f83e52cad26d7c480513e3c525df867121" "gitHead": "781524f83e52cad26d7c480513e3c525df867121"
} }

View File

@ -1,4 +1,4 @@
/// <reference types="@ms/nashorn" /> /// <reference types="@ccms/nashorn" />
import * as yaml from 'js-yaml' import * as yaml from 'js-yaml'
const File = Java.type("java.io.File"); const File = Java.type("java.io.File");
@ -32,9 +32,9 @@ export class Translate {
translate(name: string, param?: TranslateParam) { translate(name: string, param?: TranslateParam) {
let langText: string = this.langMap[name] || this.fallbackMap[name]; let langText: string = this.langMap[name] || this.fallbackMap[name];
if (!langText) { return '[WARN] @ms/i18n miss lang translate: ' + name } if (!langText) { return '[WARN] @ccms/i18n miss lang translate: ' + name }
for (const key in param) { for (const key in param) {
langText = langText.replace("{" + key + "}", param[key]) langText = langText.replace(new RegExp("{" + key + "}", 'gm'), param[key])
} }
return langText; return langText;
} }

View File

@ -1,5 +1,5 @@
{ {
"name": "@ms/nashorn", "name": "@ccms/nashorn",
"version": "0.5.0", "version": "0.5.0",
"description": "MiaoScript api package", "description": "MiaoScript api package",
"keywords": [ "keywords": [
@ -13,9 +13,6 @@
"license": "ISC", "license": "ISC",
"main": "dist/index.js", "main": "dist/index.js",
"types": "dist/index.d.ts", "types": "dist/index.d.ts",
"publishConfig": {
"registry": "https://repo.yumc.pw/repository/npm-hosted/"
},
"scripts": { "scripts": {
"clean": "rimraf dist", "clean": "rimraf dist",
"watch": "tsc --watch", "watch": "tsc --watch",
@ -27,4 +24,4 @@
"rimraf": "^3.0.2", "rimraf": "^3.0.2",
"typescript": "^3.8.3" "typescript": "^3.8.3"
} }
} }

View File

@ -41,6 +41,7 @@ declare global {
namespace NodeJS { namespace NodeJS {
interface Global { interface Global {
scope: string;
logger: any; logger: any;
debug: boolean; debug: boolean;
level: string; level: string;

View File

@ -1,5 +1,5 @@
{ {
"name": "@ms/nodejs", "name": "@ccms/nodejs",
"version": "0.5.0", "version": "0.5.0",
"description": "MiaoScript nodejs package", "description": "MiaoScript nodejs package",
"keywords": [ "keywords": [
@ -12,9 +12,6 @@
"homepage": "https://github.com/circlecloud/ms.git", "homepage": "https://github.com/circlecloud/ms.git",
"license": "ISC", "license": "ISC",
"main": "dist/index.js", "main": "dist/index.js",
"publishConfig": {
"registry": "https://repo.yumc.pw/repository/npm-hosted/"
},
"scripts": { "scripts": {
"clean": "rimraf dist", "clean": "rimraf dist",
"watch": "tsc --watch", "watch": "tsc --watch",
@ -27,7 +24,7 @@
"typescript": "^3.8.3" "typescript": "^3.8.3"
}, },
"dependencies": { "dependencies": {
"@ms/nashorn": "^0.5.0" "@ccms/nashorn": "^0.5.0"
}, },
"gitHead": "781524f83e52cad26d7c480513e3c525df867121" "gitHead": "781524f83e52cad26d7c480513e3c525df867121"
} }

View File

@ -1,4 +1,4 @@
import '@ms/nashorn' import '@ccms/nashorn'
import { URL } from "url"; import { URL } from "url";
const Path = Java.type("java.nio.file.Path"); const Path = Java.type("java.nio.file.Path");

View File

@ -1,5 +1,5 @@
{ {
"name": "@ms/nukkit", "name": "@ccms/nukkit",
"version": "0.5.0", "version": "0.5.0",
"description": "MiaoScript nukkit package", "description": "MiaoScript nukkit package",
"keywords": [ "keywords": [
@ -12,9 +12,6 @@
"homepage": "https://github.com/circlecloud/ms.git", "homepage": "https://github.com/circlecloud/ms.git",
"license": "ISC", "license": "ISC",
"main": "dist/index.js", "main": "dist/index.js",
"publishConfig": {
"registry": "https://repo.yumc.pw/repository/npm-hosted/"
},
"scripts": { "scripts": {
"clean": "rimraf dist", "clean": "rimraf dist",
"watch": "tsc --watch", "watch": "tsc --watch",
@ -27,8 +24,8 @@
"typescript": "^3.8.3" "typescript": "^3.8.3"
}, },
"dependencies": { "dependencies": {
"@ms/api": "^0.5.0", "@ccms/api": "^0.5.0",
"@ms/common": "^0.5.0", "@ccms/common": "^0.5.0",
"@ms/container": "^0.5.0" "@ccms/container": "^0.5.0"
} }
} }

View File

@ -1,7 +1,7 @@
import '@ms/nashorn' import '@ccms/nashorn'
import { command, plugin } from '@ms/api' import { command, plugin } from '@ccms/api'
import { inject, provideSingleton, postConstruct } from '@ms/container' import { inject, provideSingleton, postConstruct } from '@ccms/container'
let PluginCommand = Java.type('cn.nukkit.command.PluginCommand'); let PluginCommand = Java.type('cn.nukkit.command.PluginCommand');
let CommandExecutor = Java.type('cn.nukkit.command.CommandExecutor'); let CommandExecutor = Java.type('cn.nukkit.command.CommandExecutor');

View File

@ -1,4 +1,4 @@
import { MiaoScriptConsole } from '@ms/api' import { MiaoScriptConsole } from '@ccms/api'
let Nukkit = base.getInstance().getServer(); let Nukkit = base.getInstance().getServer();
let CommandSender = Java.type('cn.nukkit.command.CommandSender') let CommandSender = Java.type('cn.nukkit.command.CommandSender')

View File

@ -1,5 +1,5 @@
import { event, plugin } from '@ms/api' import { event, plugin } from '@ccms/api'
import { inject, provideSingleton } from '@ms/container' import { inject, provideSingleton } from '@ccms/container'
const Nukkit: cn.nukkit.Server = base.getInstance().getServer(); const Nukkit: cn.nukkit.Server = base.getInstance().getServer();
const Event = Java.type("cn.nukkit.event.Event"); const Event = Java.type("cn.nukkit.event.Event");

View File

@ -1,7 +1,7 @@
/// <reference types="@ms/types/dist/typings/nukkit" /> /// <reference types="@ccms/types/dist/typings/nukkit" />
import { server } from '@ms/api' import { server } from '@ccms/api'
import { Container } from '@ms/container' import { Container } from '@ccms/container'
import { NukkitConsole } from './console'; import { NukkitConsole } from './console';
import './event'; import './event';

View File

@ -1,5 +1,5 @@
import { server } from '@ms/api' import { server } from '@ccms/api'
import { provideSingleton } from '@ms/container'; import { provideSingleton } from '@ccms/container';
let Nukkit: cn.nukkit.Server = base.getInstance().getServer(); let Nukkit: cn.nukkit.Server = base.getInstance().getServer();
const File = Java.type("java.io.File"); const File = Java.type("java.io.File");

View File

@ -1,5 +1,5 @@
import { task, plugin } from '@ms/api' import { task, plugin } from '@ccms/api'
import { inject, provideSingleton } from '@ms/container'; import { inject, provideSingleton } from '@ccms/container';
const NukkitRunnable = Java.type('cn.nukkit.scheduler.NukkitRunnable'); const NukkitRunnable = Java.type('cn.nukkit.scheduler.NukkitRunnable');

View File

@ -1,5 +1,5 @@
{ {
"name": "@ms/ployfill", "name": "@ccms/ployfill",
"version": "0.5.0", "version": "0.5.0",
"description": "MiaoScript ployfill package", "description": "MiaoScript ployfill package",
"author": "MiaoWoo <admin@yumc.pw>", "author": "MiaoWoo <admin@yumc.pw>",
@ -7,9 +7,6 @@
"license": "ISC", "license": "ISC",
"main": "dist/index.js", "main": "dist/index.js",
"types": "dist/index.d.ts", "types": "dist/index.d.ts",
"publishConfig": {
"registry": "https://repo.yumc.pw/repository/npm-hosted/"
},
"scripts": { "scripts": {
"clean": "rimraf dist", "clean": "rimraf dist",
"watch": "tsc --watch", "watch": "tsc --watch",
@ -17,8 +14,8 @@
"test": "echo \"Error: run tests from root\" && exit 1" "test": "echo \"Error: run tests from root\" && exit 1"
}, },
"dependencies": { "dependencies": {
"@ms/i18n": "^0.5.0", "@ccms/i18n": "^0.5.0",
"@ms/nashorn": "^0.5.0", "@ccms/nashorn": "^0.5.0",
"core-js": "^3.6.4" "core-js": "^3.6.4"
}, },
"devDependencies": { "devDependencies": {

View File

@ -1,6 +1,6 @@
/// <reference types="@ms/nashorn" /> /// <reference types="@ccms/nashorn" />
import i18n from '@ms/i18n' import i18n from '@ccms/i18n'
let ployfillStartTime = new Date().getTime(); let ployfillStartTime = new Date().getTime();
i18n.initialize(); i18n.initialize();
console.i18n("ms.ployfill.initialize"); console.i18n("ms.ployfill.initialize");

View File

@ -1,4 +1,4 @@
import '@ms/nashorn' import '@ccms/nashorn'
const URL = Java.type("java.net.URL"); const URL = Java.type("java.net.URL");
const Files = Java.type("java.nio.file.Files"); const Files = Java.type("java.nio.file.Files");

View File

@ -1,5 +1,5 @@
{ {
"name": "@ms/plugin", "name": "@ccms/plugin",
"version": "0.5.0", "version": "0.5.0",
"description": "MiaoScript api package", "description": "MiaoScript api package",
"keywords": [ "keywords": [
@ -12,9 +12,6 @@
"homepage": "https://github.com/circlecloud/ms.git", "homepage": "https://github.com/circlecloud/ms.git",
"license": "ISC", "license": "ISC",
"main": "dist/index.js", "main": "dist/index.js",
"publishConfig": {
"registry": "https://repo.yumc.pw/repository/npm-hosted/"
},
"scripts": { "scripts": {
"clean": "rimraf dist", "clean": "rimraf dist",
"watch": "tsc --watch", "watch": "tsc --watch",
@ -28,10 +25,10 @@
"typescript": "^3.8.3" "typescript": "^3.8.3"
}, },
"dependencies": { "dependencies": {
"@ms/api": "^0.5.0", "@ccms/api": "^0.5.0",
"@ms/common": "^0.5.0", "@ccms/common": "^0.5.0",
"@ms/container": "^0.5.0", "@ccms/container": "^0.5.0",
"@ms/i18n": "^0.5.0", "@ccms/i18n": "^0.5.0",
"js-yaml": "^3.13.1" "js-yaml": "^3.13.1"
} }
} }

View File

@ -1,12 +1,12 @@
export const METADATA_KEY = { export const METADATA_KEY = {
plugin: "@ms/plugin:plugin", plugin: "@ccms/plugin:plugin",
cmd: "@ms/plugin:cmd", cmd: "@ccms/plugin:cmd",
tab: "@ms/plugin:tab", tab: "@ccms/plugin:tab",
listener: "@ms/plugin:listener", listener: "@ccms/plugin:listener",
config: "@ms/plugin:config", config: "@ccms/plugin:config",
stage: { stage: {
load: "@ms/plugin:stage:load", load: "@ccms/plugin:stage:load",
enable: "@ms/plugin:stage:enable", enable: "@ccms/plugin:stage:enable",
disable: "@ms/plugin:stage:disable" disable: "@ccms/plugin:stage:disable"
} }
}; };

View File

@ -1,4 +1,4 @@
import { injectable, decorate } from "@ms/container"; import { injectable, decorate } from "@ccms/container";
import { interfaces } from './interfaces' import { interfaces } from './interfaces'
import { METADATA_KEY } from './constants' import { METADATA_KEY } from './constants'
import { getPluginMetadatas, getPluginCommandMetadata, getPluginListenerMetadata, getPluginTabCompleterMetadata, getPluginConfigMetadata, getPluginStageMetadata } from './utils' import { getPluginMetadatas, getPluginCommandMetadata, getPluginListenerMetadata, getPluginTabCompleterMetadata, getPluginConfigMetadata, getPluginStageMetadata } from './utils'

View File

@ -1,6 +1,6 @@
import { server, MiaoScriptConsole, event } from "@ms/api"; import { server, MiaoScriptConsole, event } from "@ccms/api";
import { METADATA_KEY } from './constants' import { METADATA_KEY } from './constants'
import { injectable, inject, postConstruct } from "@ms/container"; import { injectable, inject, postConstruct } from "@ccms/container";
import { getPluginMetadata } from "./utils"; import { getPluginMetadata } from "./utils";
export namespace interfaces { export namespace interfaces {

View File

@ -1,7 +1,7 @@
import i18n from '@ms/i18n' import i18n from '@ccms/i18n'
import { plugin, server, command, event } from '@ms/api' import { plugin, server, command, event } from '@ccms/api'
import { inject, provideSingleton, Container, ContainerInstance } from '@ms/container' import { inject, provideSingleton, Container, ContainerInstance } from '@ccms/container'
import * as fs from '@ms/common/dist/fs' import * as fs from '@ccms/common/dist/fs'
import { getPluginMetadatas, getPluginCommandMetadata, getPluginListenerMetadata, getPlugin, getPluginTabCompleterMetadata, getPluginConfigMetadata, getPluginStageMetadata } from './utils' import { getPluginMetadatas, getPluginCommandMetadata, getPluginListenerMetadata, getPlugin, getPluginTabCompleterMetadata, getPluginConfigMetadata, getPluginStageMetadata } from './utils'
import { interfaces } from './interfaces' import { interfaces } from './interfaces'
@ -54,6 +54,7 @@ export class PluginManagerImpl implements plugin.PluginManager {
private runPluginStage(plugin: interfaces.Plugin, stage: string, ext: Function) { private runPluginStage(plugin: interfaces.Plugin, stage: string, ext: Function) {
this.logStage(plugin, i18n.translate(`ms.plugin.manager.stage.${stage}`)) this.logStage(plugin, i18n.translate(`ms.plugin.manager.stage.${stage}`))
ext()
this.runCatch(plugin, stage) this.runCatch(plugin, stage)
this.runCatch(plugin, `${this.serverType}${stage}`) this.runCatch(plugin, `${this.serverType}${stage}`)
this.execPluginStage(plugin, stage) this.execPluginStage(plugin, stage)
@ -178,7 +179,7 @@ export class PluginManagerImpl implements plugin.PluginManager {
private createPlugin(file: string) { private createPlugin(file: string) {
//@ts-ignore //@ts-ignore
require(file, { cache: false }) require(file + '', { cache: false })
} }
private buildPlugins() { private buildPlugins() {

View File

@ -1,6 +1,6 @@
{ {
"private": true, "private": true,
"name": "@ms/plugins", "name": "@ccms/plugins",
"version": "0.5.0", "version": "0.5.0",
"description": "MiaoScript plugins package", "description": "MiaoScript plugins package",
"keywords": [ "keywords": [
@ -13,9 +13,6 @@
"homepage": "https://github.com/circlecloud/ms.git", "homepage": "https://github.com/circlecloud/ms.git",
"license": "ISC", "license": "ISC",
"main": "dist/index.js", "main": "dist/index.js",
"publishConfig": {
"registry": "https://repo.yumc.pw/repository/npm-hosted/"
},
"scripts": { "scripts": {
"clean": "rimraf dist", "clean": "rimraf dist",
"watch": "tsc --watch", "watch": "tsc --watch",
@ -28,8 +25,8 @@
"typescript": "^3.8.3" "typescript": "^3.8.3"
}, },
"dependencies": { "dependencies": {
"@ms/api": "^0.5.0", "@ccms/api": "^0.5.0",
"@ms/container": "^0.5.0", "@ccms/container": "^0.5.0",
"@ms/plugin": "^0.5.0" "@ccms/plugin": "^0.5.0"
} }
} }

View File

@ -1,11 +1,11 @@
/// <reference types="@ms/types/dist/typings/bukkit" /> /// <reference types="@ccms/types/dist/typings/bukkit" />
/// <reference types="@ms/types/dist/typings/sponge" /> /// <reference types="@ccms/types/dist/typings/sponge" />
/// <reference types="@ms/types/dist/typings/bungee" /> /// <reference types="@ccms/types/dist/typings/bungee" />
/// <reference types="@ms/types/dist/typings/nukkit" /> /// <reference types="@ccms/types/dist/typings/nukkit" />
import { server } from '@ms/api'; import { server } from '@ccms/api';
import { inject } from '@ms/container'; import { inject } from '@ccms/container';
import { plugin, interfaces, cmd, listener, tab } from '@ms/plugin' import { plugin, interfaces, cmd, listener, tab } from '@ccms/plugin'
@plugin({ name: 'HelloWorld', version: '1.0.0', author: 'MiaoWoo', source: __filename }) @plugin({ name: 'HelloWorld', version: '1.0.0', author: 'MiaoWoo', source: __filename })
export class HelloWorld extends interfaces.Plugin { export class HelloWorld extends interfaces.Plugin {

View File

@ -1,11 +1,11 @@
/// <reference types="@ms/types/dist/typings/bukkit" /> /// <reference types="@ccms/types/dist/typings/bukkit" />
/// <reference types="@ms/types/dist/typings/sponge" /> /// <reference types="@ccms/types/dist/typings/sponge" />
/// <reference types="@ms/types/dist/typings/bungee" /> /// <reference types="@ccms/types/dist/typings/bungee" />
import { server, plugin as pluginApi, channel, constants } from '@ms/api' import { server, plugin as pluginApi, channel, constants } from '@ccms/api'
import { inject, optional } from '@ms/container'; import { inject, optional } from '@ccms/container';
import { plugin, interfaces, cmd, listener, tab, config, enable } from '@ms/plugin' import { plugin, interfaces, cmd, listener, tab, config, enable } from '@ccms/plugin'
import Tellraw from '@ms/common/dist/tellraw' import Tellraw from '@ccms/common/dist/tellraw'
const ByteArrayInputStream = Java.type("java.io.ByteArrayInputStream"); const ByteArrayInputStream = Java.type("java.io.ByteArrayInputStream");
const ByteArrayOutputStream = Java.type("java.io.ByteArrayOutputStream"); const ByteArrayOutputStream = Java.type("java.io.ByteArrayOutputStream");

View File

@ -1,11 +1,11 @@
/// <reference types="@ms/types/dist/typings/bukkit" /> /// <reference types="@ccms/types/dist/typings/bukkit" />
/// <reference types="@ms/types/dist/typings/sponge" /> /// <reference types="@ccms/types/dist/typings/sponge" />
/// <reference types="@ms/types/dist/typings/bungee" /> /// <reference types="@ccms/types/dist/typings/bungee" />
import { plugin as pluginApi, server, task } from '@ms/api' import { plugin as pluginApi, server, task } from '@ccms/api'
import { plugin, interfaces, cmd } from '@ms/plugin' import { plugin, interfaces, cmd } from '@ccms/plugin'
import { inject, ContainerInstance, Container } from '@ms/container' import { inject, ContainerInstance, Container } from '@ccms/container'
import io, { Server as SocketIOServer, Socket as SocketIOSocket } from '@ms/websocket' import io, { Server as SocketIOServer, Socket as SocketIOSocket } from '@ccms/websocket'
const suffixMap = { const suffixMap = {
ts: 'typescript', ts: 'typescript',
@ -101,7 +101,7 @@ export class MiaoConsole extends interfaces.Plugin {
private runCode(code: string, namespace: any, client: any) { private runCode(code: string, namespace: any, client: any) {
let tfunc = new Function('namespace', 'client', ` let tfunc = new Function('namespace', 'client', `
var reflect = require('@ms/common/dist/reflect'); var reflect = require('@ccms/common/dist/reflect');
var tempconcent = ''; var tempconcent = '';
function print(text) { function print(text) {
tempconcent += text + "\\n" tempconcent += text + "\\n"

View File

@ -1,11 +1,11 @@
/// <reference types="@ms/types" /> /// <reference types="@ccms/types" />
import { task, server } from "@ms/api"; import { task, server } from "@ccms/api";
import { inject } from "@ms/container"; import { inject } from "@ccms/container";
import { plugin, interfaces, cmd } from "@ms/plugin"; import { plugin, interfaces, cmd } from "@ccms/plugin";
import http from '@ms/common/dist/http' import http from '@ccms/common/dist/http'
import * as fs from '@ms/common/dist/fs' import * as fs from '@ccms/common/dist/fs'
@plugin({ name: 'MiaoPluginManager', prefix: 'MPM', version: '1.0.0', author: 'MiaoWoo', source: __filename }) @plugin({ name: 'MiaoPluginManager', prefix: 'MPM', version: '1.0.0', author: 'MiaoWoo', source: __filename })
export class MiaoPluginManager extends interfaces.Plugin { export class MiaoPluginManager extends interfaces.Plugin {

View File

@ -1,11 +1,11 @@
import { plugin as pluginApi, task, server } from '@ms/api' import { plugin as pluginApi, task, server } from '@ccms/api'
import { Translate } from '@ms/i18n' import { Translate } from '@ccms/i18n'
import { inject } from '@ms/container'; import { inject } from '@ccms/container';
import { interfaces, plugin, cmd, tab } from '@ms/plugin' import { interfaces, plugin, cmd, tab } from '@ccms/plugin'
import * as fs from '@ms/common/dist/fs' import * as fs from '@ccms/common/dist/fs'
import http from '@ms/common/dist/http' import http from '@ccms/common/dist/http'
let help = [ let help = [
'§6========= §6[§aMiaoScriptPackageManager§6] 帮助 §aBy §b喵♂呜 §6=========', '§6========= §6[§aMiaoScriptPackageManager§6] 帮助 §aBy §b喵♂呜 §6=========',

View File

@ -1,9 +1,9 @@
import { plugin as pluginApi } from '@ms/api' import { plugin as pluginApi } from '@ccms/api'
import { plugin, interfaces, cmd, listener, tab } from '@ms/plugin' import { plugin, interfaces, cmd, listener, tab } from '@ccms/plugin'
import { inject } from '@ms/container'; import { inject } from '@ccms/container';
import * as reflect from '@ms/common/dist/reflect'; import * as reflect from '@ccms/common/dist/reflect';
import http from '@ms/common/dist/http'; import http from '@ccms/common/dist/http';
@plugin({ name: 'Test', version: '1.0.0', author: 'MiaoWoo', source: __filename }) @plugin({ name: 'Test', version: '1.0.0', author: 'MiaoWoo', source: __filename })
export class Test extends interfaces.Plugin { export class Test extends interfaces.Plugin {

View File

@ -1,5 +1,5 @@
{ {
"name": "@ms/sponge", "name": "@ccms/sponge",
"version": "0.5.0", "version": "0.5.0",
"description": "MiaoScript api package", "description": "MiaoScript api package",
"keywords": [ "keywords": [
@ -12,9 +12,6 @@
"homepage": "https://github.com/circlecloud/ms.git", "homepage": "https://github.com/circlecloud/ms.git",
"license": "ISC", "license": "ISC",
"main": "dist/index.js", "main": "dist/index.js",
"publishConfig": {
"registry": "https://repo.yumc.pw/repository/npm-hosted/"
},
"scripts": { "scripts": {
"clean": "rimraf dist", "clean": "rimraf dist",
"watch": "tsc --watch", "watch": "tsc --watch",
@ -27,8 +24,8 @@
"typescript": "^3.8.3" "typescript": "^3.8.3"
}, },
"dependencies": { "dependencies": {
"@ms/api": "^0.5.0", "@ccms/api": "^0.5.0",
"@ms/common": "^0.5.0", "@ccms/common": "^0.5.0",
"@ms/container": "^0.5.0" "@ccms/container": "^0.5.0"
} }
} }

View File

@ -1,5 +1,5 @@
import { channel, plugin } from '@ms/api' import { channel, plugin } from '@ccms/api'
import { inject, provideSingleton } from '@ms/container' import { inject, provideSingleton } from '@ccms/container'
const Sponge = org.spongepowered.api.Sponge const Sponge = org.spongepowered.api.Sponge
const RawDataListener = Java.type("org.spongepowered.api.network.RawDataListener") const RawDataListener = Java.type("org.spongepowered.api.network.RawDataListener")

View File

@ -1,5 +1,5 @@
import { command, plugin } from "@ms/api"; import { command, plugin } from "@ccms/api";
import { inject, provideSingleton } from "@ms/container"; import { inject, provideSingleton } from "@ccms/container";
let Sponge = Java.type('org.spongepowered.api.Sponge'); let Sponge = Java.type('org.spongepowered.api.Sponge');
let Text = Java.type('org.spongepowered.api.text.Text'); let Text = Java.type('org.spongepowered.api.text.Text');

View File

@ -1,5 +1,5 @@
import '@ms/nashorn' import '@ccms/nashorn'
import { MiaoScriptConsole } from '@ms/api' import { MiaoScriptConsole } from '@ccms/api'
let Sponge = Java.type('org.spongepowered.api.Sponge'); let Sponge = Java.type('org.spongepowered.api.Sponge');
var Text = Java.type('org.spongepowered.api.text.Text'); var Text = Java.type('org.spongepowered.api.text.Text');

View File

@ -1,5 +1,5 @@
import { event, plugin } from '@ms/api' import { event, plugin } from '@ccms/api'
import { inject, provideSingleton } from '@ms/container'; import { inject, provideSingleton } from '@ccms/container';
let Modifier = Java.type("java.lang.reflect.Modifier"); let Modifier = Java.type("java.lang.reflect.Modifier");
let Order = Java.type("org.spongepowered.api.event.Order"); let Order = Java.type("org.spongepowered.api.event.Order");

View File

@ -1,7 +1,7 @@
/// <reference types="@ms/types/dist/typings/sponge" /> /// <reference types="@ccms/types/dist/typings/sponge" />
import { server } from '@ms/api' import { server } from '@ccms/api'
import { Container } from '@ms/container' import { Container } from '@ccms/container'
import { SpongeConsole } from './console'; import { SpongeConsole } from './console';
import './event'; import './event';

View File

@ -1,7 +1,7 @@
import { server, constants } from '@ms/api' import { server, constants } from '@ccms/api'
import { provideSingleton } from '@ms/container'; import { provideSingleton } from '@ccms/container';
import * as reflect from '@ms/common/dist/reflect' import * as reflect from '@ccms/common/dist/reflect'
const Sponge = org.spongepowered.api.Sponge; const Sponge = org.spongepowered.api.Sponge;
const TextSerializers = org.spongepowered.api.text.serializer.TextSerializers; const TextSerializers = org.spongepowered.api.text.serializer.TextSerializers;

View File

@ -1,5 +1,5 @@
import { task, plugin } from '@ms/api' import { task, plugin } from '@ccms/api'
import { inject, provideSingleton, postConstruct } from '@ms/container'; import { inject, provideSingleton, postConstruct } from '@ccms/container';
const Sponge = Java.type("org.spongepowered.api.Sponge"); const Sponge = Java.type("org.spongepowered.api.Sponge");
const Task = Java.type("org.spongepowered.api.scheduler.Task"); const Task = Java.type("org.spongepowered.api.scheduler.Task");

View File

@ -1,5 +1,5 @@
{ {
"name": "@ms/types", "name": "@ccms/types",
"version": "0.5.0", "version": "0.5.0",
"description": "MiaoScript types package", "description": "MiaoScript types package",
"keywords": [ "keywords": [
@ -12,8 +12,5 @@
"homepage": "https://github.com/circlecloud/ms.git", "homepage": "https://github.com/circlecloud/ms.git",
"license": "ISC", "license": "ISC",
"main": "dist/index.js", "main": "dist/index.js",
"types": "dist/index.d.ts", "types": "dist/index.d.ts"
"publishConfig": { }
"registry": "https://repo.yumc.pw/repository/npm-hosted/"
}
}

View File

@ -1,5 +1,5 @@
{ {
"name": "@ms/websocket", "name": "@ccms/websocket",
"version": "0.5.0", "version": "0.5.0",
"description": "MiaoScript websocket package", "description": "MiaoScript websocket package",
"keywords": [ "keywords": [
@ -12,9 +12,6 @@
"homepage": "https://github.com/circlecloud/ms.git", "homepage": "https://github.com/circlecloud/ms.git",
"license": "ISC", "license": "ISC",
"main": "dist/index.js", "main": "dist/index.js",
"publishConfig": {
"registry": "https://repo.yumc.pw/repository/npm-hosted/"
},
"scripts": { "scripts": {
"clean": "rimraf dist", "clean": "rimraf dist",
"watch": "tsc --watch", "watch": "tsc --watch",
@ -27,6 +24,6 @@
"typescript": "^3.8.3" "typescript": "^3.8.3"
}, },
"dependencies": { "dependencies": {
"@ms/nashorn": "^0.5.0" "@ccms/nashorn": "^0.5.0"
} }
} }

View File

@ -1,4 +1,4 @@
/// <reference types="@ms/nashorn" /> /// <reference types="@ccms/nashorn" />
import { Server, ServerOptions } from './socket-io' import { Server, ServerOptions } from './socket-io'
@ -41,6 +41,6 @@ type SocketStatic = SocketIOStatic & { Instance?: symbol }
let io: SocketStatic = function (pipeline: any, options: ServerOptions) { let io: SocketStatic = function (pipeline: any, options: ServerOptions) {
return new Server(pipeline, options) return new Server(pipeline, options)
} }
io.Instance = Symbol("@ms/websocket") io.Instance = Symbol("@ccms/websocket")
export default io export default io
export * from './socket-io' export * from './socket-io'