refactor: rename scope to @ccms
Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
parent
be4fe82588
commit
ca79161505
@ -9,8 +9,9 @@
|
||||
"bs": "lerna bootstrap",
|
||||
"clean": "lerna run clean",
|
||||
"watch": "lerna run watch --parallel",
|
||||
"build": "lerna run build --scope=\"@ms/!(plugins)\"",
|
||||
"build:plugins": "lerna run build --scope=\"@ms/plugins\"",
|
||||
"build": "lerna run build --scope=\"@ccms/!(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",
|
||||
"lp": "lerna publish"
|
||||
},
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "@ms/api",
|
||||
"name": "@ccms/api",
|
||||
"version": "0.5.0",
|
||||
"description": "MiaoScript api package",
|
||||
"keywords": [
|
||||
@ -12,9 +12,6 @@
|
||||
"homepage": "https://github.com/circlecloud/ms.git",
|
||||
"license": "ISC",
|
||||
"main": "dist/index.js",
|
||||
"publishConfig": {
|
||||
"registry": "https://repo.yumc.pw/repository/npm-hosted/"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rimraf dist",
|
||||
"watch": "tsc --watch",
|
||||
@ -22,8 +19,8 @@
|
||||
"test": "echo \"Error: run tests from root\" && exit 1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ms/container": "^0.5.0",
|
||||
"@ms/ployfill": "^0.5.0",
|
||||
"@ccms/container": "^0.5.0",
|
||||
"@ccms/ployfill": "^0.5.0",
|
||||
"base64-js": "^1.3.1",
|
||||
"source-map-builder": "^0.0.7"
|
||||
},
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { injectable } from "@ms/container";
|
||||
import { injectable } from "@ccms/container";
|
||||
|
||||
export namespace channel {
|
||||
/**
|
||||
|
@ -1,5 +1,5 @@
|
||||
import i18n from '@ms/i18n'
|
||||
import { injectable } from "@ms/container";
|
||||
import i18n from '@ccms/i18n'
|
||||
import { injectable } from "@ccms/container";
|
||||
|
||||
export namespace command {
|
||||
@injectable()
|
||||
|
@ -1,4 +1,4 @@
|
||||
import i18m from '@ms/i18n'
|
||||
import i18m from '@ccms/i18n'
|
||||
import { SourceMapBuilder } from 'source-map-builder'
|
||||
import * as base64 from 'base64-js'
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
/**
|
||||
* MiaoScript Event处理类
|
||||
*/
|
||||
import i18n from '@ms/i18n'
|
||||
import { injectable, unmanaged } from '@ms/container'
|
||||
import i18n from '@ccms/i18n'
|
||||
import { injectable, unmanaged } from '@ccms/container'
|
||||
|
||||
const Thread = Java.type('java.lang.Thread');
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import "@ms/nashorn"
|
||||
import "@ccms/nashorn"
|
||||
export * from './task'
|
||||
export * from './event'
|
||||
export * from './console'
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "@ms/bukkit",
|
||||
"name": "@ccms/bukkit",
|
||||
"version": "0.5.0",
|
||||
"description": "MiaoScript bukkit package",
|
||||
"keywords": [
|
||||
@ -12,9 +12,6 @@
|
||||
"homepage": "https://github.com/circlecloud/ms.git",
|
||||
"license": "ISC",
|
||||
"main": "dist/index.js",
|
||||
"publishConfig": {
|
||||
"registry": "https://repo.yumc.pw/repository/npm-hosted/"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rimraf dist",
|
||||
"watch": "tsc --watch",
|
||||
@ -27,8 +24,8 @@
|
||||
"typescript": "^3.8.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ms/api": "^0.5.0",
|
||||
"@ms/common": "^0.5.0",
|
||||
"@ms/container": "^0.5.0"
|
||||
"@ccms/api": "^0.5.0",
|
||||
"@ccms/common": "^0.5.0",
|
||||
"@ccms/container": "^0.5.0"
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { channel, plugin } from '@ms/api'
|
||||
import { inject, provideSingleton } from '@ms/container'
|
||||
import { channel, plugin } from '@ccms/api'
|
||||
import { inject, provideSingleton } from '@ccms/container'
|
||||
|
||||
const Bukkit = org.bukkit.Bukkit
|
||||
const PluginMessageListener = Java.type("org.bukkit.plugin.messaging.PluginMessageListener")
|
||||
|
@ -1,8 +1,8 @@
|
||||
import '@ms/nashorn'
|
||||
import '@ccms/nashorn'
|
||||
|
||||
import { command, plugin } from '@ms/api'
|
||||
import * as reflect from '@ms/common/dist/reflect'
|
||||
import { provideSingleton, postConstruct, inject } from '@ms/container'
|
||||
import { command, plugin } from '@ccms/api'
|
||||
import * as reflect from '@ccms/common/dist/reflect'
|
||||
import { provideSingleton, postConstruct, inject } from '@ccms/container'
|
||||
|
||||
let Bukkit = org.bukkit.Bukkit;
|
||||
let TabCompleter = Java.type('org.bukkit.command.TabCompleter');
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { MiaoScriptConsole } from '@ms/api'
|
||||
import { MiaoScriptConsole } from '@ccms/api'
|
||||
|
||||
let Bukkit = org.bukkit.Bukkit;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { event, plugin } from '@ms/api'
|
||||
import { inject, provideSingleton } from '@ms/container';
|
||||
import * as reflect from '@ms/common/dist/reflect'
|
||||
import { event, plugin } from '@ccms/api'
|
||||
import { inject, provideSingleton } from '@ccms/container';
|
||||
import * as reflect from '@ccms/common/dist/reflect'
|
||||
|
||||
const Bukkit = Java.type("org.bukkit.Bukkit");
|
||||
const Event = Java.type("org.bukkit.event.Event");
|
||||
|
@ -1,7 +1,7 @@
|
||||
/// <reference types="@ms/types/dist/typings/bukkit" />
|
||||
/// <reference types="@ccms/types/dist/typings/bukkit" />
|
||||
|
||||
import { server } from '@ms/api'
|
||||
import { Container } from '@ms/container'
|
||||
import { server } from '@ccms/api'
|
||||
import { Container } from '@ccms/container'
|
||||
|
||||
import { BukkitConsole } from './console';
|
||||
import './event';
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { server, constants } from '@ms/api'
|
||||
import { provideSingleton } from '@ms/container';
|
||||
import { server, constants } from '@ccms/api'
|
||||
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'
|
||||
|
||||
let Bukkit = org.bukkit.Bukkit;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { task, plugin } from '@ms/api'
|
||||
import { inject, provideSingleton } from '@ms/container';
|
||||
import { task, plugin } from '@ccms/api'
|
||||
import { inject, provideSingleton } from '@ccms/container';
|
||||
|
||||
const Bukkit = Java.type('org.bukkit.Bukkit');
|
||||
const BukkitRunnable = Java.type('org.bukkit.scheduler.BukkitRunnable');
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "@ms/bungee",
|
||||
"name": "@ccms/bungee",
|
||||
"version": "0.5.0",
|
||||
"description": "MiaoScript bungee package",
|
||||
"keywords": [
|
||||
@ -12,9 +12,6 @@
|
||||
"homepage": "https://github.com/circlecloud/ms.git",
|
||||
"license": "ISC",
|
||||
"main": "dist/index.js",
|
||||
"publishConfig": {
|
||||
"registry": "https://repo.yumc.pw/repository/npm-hosted/"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rimraf dist",
|
||||
"watch": "tsc --watch",
|
||||
@ -27,8 +24,8 @@
|
||||
"typescript": "^3.8.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ms/api": "^0.5.0",
|
||||
"@ms/common": "^0.5.0",
|
||||
"@ms/container": "^0.5.0"
|
||||
"@ccms/api": "^0.5.0",
|
||||
"@ccms/common": "^0.5.0",
|
||||
"@ccms/container": "^0.5.0"
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { channel, event } from '@ms/api'
|
||||
import { provideSingleton, inject } from '@ms/container'
|
||||
import { channel, event } from '@ccms/api'
|
||||
import { provideSingleton, inject } from '@ccms/container'
|
||||
|
||||
const Bungee: net.md_5.bungee.api.ProxyServer = base.getInstance().getProxy()
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { command, plugin } from "@ms/api";
|
||||
import { inject, provideSingleton } from "@ms/container";
|
||||
import { command, plugin } from "@ccms/api";
|
||||
import { inject, provideSingleton } from "@ccms/container";
|
||||
|
||||
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'));
|
||||
|
@ -1,6 +1,6 @@
|
||||
import '@ms/nashorn'
|
||||
import { plugin, MiaoScriptConsole } from '@ms/api'
|
||||
import { inject, injectable } from "@ms/container";
|
||||
import '@ccms/nashorn'
|
||||
import { plugin, MiaoScriptConsole } from '@ccms/api'
|
||||
import { inject, injectable } from "@ccms/container";
|
||||
|
||||
let CommandSender = Java.type("net.md_5.bungee.api.CommandSender")
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { event } from '@ms/api'
|
||||
import { provideSingleton, postConstruct } from '@ms/container'
|
||||
import * as reflect from '@ms/common/dist/reflect'
|
||||
import { event } from '@ccms/api'
|
||||
import { provideSingleton, postConstruct } from '@ccms/container'
|
||||
import * as reflect from '@ccms/common/dist/reflect'
|
||||
|
||||
const Bungee: net.md_5.bungee.api.ProxyServer = base.getInstance().getProxy();
|
||||
const Event = Java.type("net.md_5.bungee.api.plugin.Event");
|
||||
|
@ -1,7 +1,7 @@
|
||||
/// <reference types="@ms/types/dist/typings/bungee" />
|
||||
/// <reference types="@ccms/types/dist/typings/bungee" />
|
||||
|
||||
import { server } from '@ms/api'
|
||||
import { Container } from '@ms/container'
|
||||
import { server } from '@ccms/api'
|
||||
import { Container } from '@ccms/container'
|
||||
|
||||
import { BungeeConsole } from './console';
|
||||
import './event';
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { server, task } from '@ms/api'
|
||||
import { provideSingleton, inject, postConstruct } from '@ms/container'
|
||||
import { server, task } from '@ccms/api'
|
||||
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();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { task, plugin } from '@ms/api'
|
||||
import { inject, provideSingleton } from '@ms/container';
|
||||
import { task, plugin } from '@ccms/api'
|
||||
import { inject, provideSingleton } from '@ccms/container';
|
||||
|
||||
var Runnable = Java.type('java.lang.Runnable')
|
||||
let TimeUnit = Java.type('java.util.concurrent.TimeUnit')
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "@ms/client",
|
||||
"name": "@ccms/client",
|
||||
"version": "0.5.0",
|
||||
"description": "MiaoScript client package",
|
||||
"keywords": [
|
||||
@ -13,9 +13,6 @@
|
||||
"homepage": "https://github.com/circlecloud/ms.git",
|
||||
"license": "ISC",
|
||||
"main": "dist/index.js",
|
||||
"publishConfig": {
|
||||
"registry": "https://repo.yumc.pw/repository/npm-hosted/"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "ts-node-dev --respawn --debounce=1500 src/index.ts",
|
||||
"clean": "rimraf dist",
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "@ms/common",
|
||||
"name": "@ccms/common",
|
||||
"version": "0.5.0",
|
||||
"description": "MiaoScript api package",
|
||||
"keywords": [
|
||||
@ -12,9 +12,6 @@
|
||||
"homepage": "https://github.com/circlecloud/ms.git",
|
||||
"license": "ISC",
|
||||
"main": "dist/index.js",
|
||||
"publishConfig": {
|
||||
"registry": "https://repo.yumc.pw/repository/npm-hosted/"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rimraf dist",
|
||||
"watch": "tsc --watch",
|
||||
@ -27,7 +24,7 @@
|
||||
"typescript": "^3.8.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ms/nashorn": "^0.5.0"
|
||||
"@ccms/nashorn": "^0.5.0"
|
||||
},
|
||||
"gitHead": "562e2d00175c9d3a99c8b672aa07e6d92706a027"
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
import '@ms/nashorn'
|
||||
import '@ccms/nashorn'
|
||||
|
||||
/*global Java, base, module, exports, require, __FILE__*/
|
||||
const Path = Java.type("java.nio.file.Path");
|
||||
|
@ -1,4 +1,4 @@
|
||||
import '@ms/nashorn'
|
||||
import '@ccms/nashorn'
|
||||
|
||||
let Files = Java.type("java.nio.file.Files");
|
||||
let Paths = Java.type("java.nio.file.Paths");
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "@ms/compile",
|
||||
"name": "@ccms/compile",
|
||||
"version": "0.5.0",
|
||||
"description": "MiaoScript compile package",
|
||||
"keywords": [
|
||||
@ -12,9 +12,6 @@
|
||||
"homepage": "https://github.com/circlecloud/ms.git",
|
||||
"license": "ISC",
|
||||
"main": "dist/index.js",
|
||||
"publishConfig": {
|
||||
"registry": "https://repo.yumc.pw/repository/npm-hosted/"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rimraf dist",
|
||||
"watch": "tsc --watch",
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "@ms/container",
|
||||
"name": "@ccms/container",
|
||||
"version": "0.5.0",
|
||||
"description": "MiaoScript container package",
|
||||
"keywords": [
|
||||
@ -12,9 +12,6 @@
|
||||
"homepage": "https://github.com/circlecloud/ms.git",
|
||||
"license": "ISC",
|
||||
"main": "dist/index.js",
|
||||
"publishConfig": {
|
||||
"registry": "https://repo.yumc.pw/repository/npm-hosted/"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rimraf dist",
|
||||
"watch": "tsc --watch",
|
||||
|
@ -2,7 +2,7 @@ import { interfaces, Container } from "inversify";
|
||||
|
||||
let _container: Container;
|
||||
|
||||
const ContainerInstance = Symbol.for("@ms/ioc:Container");
|
||||
const ContainerInstance = Symbol.for("@ccms/ioc:Container");
|
||||
const INJECTION = Symbol.for("INJECTION");
|
||||
|
||||
function _proxyGetter(
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "@ms/core",
|
||||
"name": "@ccms/core",
|
||||
"version": "0.5.0",
|
||||
"description": "MiaoScript api package",
|
||||
"keywords": [
|
||||
@ -12,9 +12,6 @@
|
||||
"homepage": "https://github.com/circlecloud/ms.git",
|
||||
"license": "ISC",
|
||||
"main": "dist/index.js",
|
||||
"publishConfig": {
|
||||
"registry": "https://repo.yumc.pw/repository/npm-hosted/"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rimraf dist",
|
||||
"watch": "tsc --watch",
|
||||
@ -27,8 +24,8 @@
|
||||
"typescript": "^3.8.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ms/api": "^0.5.0",
|
||||
"@ms/container": "^0.5.0"
|
||||
"@ccms/api": "^0.5.0",
|
||||
"@ccms/container": "^0.5.0"
|
||||
},
|
||||
"gitHead": "781524f83e52cad26d7c480513e3c525df867121"
|
||||
}
|
@ -1,8 +1,8 @@
|
||||
let containerStartTime = Date.now();
|
||||
console.i18n("ms.core.ioc.initialize");
|
||||
import { plugin, server, task, constants } from '@ms/api'
|
||||
import { DefaultContainer as container, inject, provideSingleton, ContainerInstance, buildProviderModule } from '@ms/container'
|
||||
console.i18n("ms.core.ioc.completed", { time: (Date.now() - containerStartTime) / 1000 })
|
||||
console.i18n("ms.core.ioc.initialize", { scope: global.scope });
|
||||
import { plugin, server, task, constants } from '@ccms/api'
|
||||
import { DefaultContainer as container, inject, provideSingleton, ContainerInstance, buildProviderModule } from '@ccms/container'
|
||||
console.i18n("ms.core.ioc.completed", { scope: global.scope, time: (Date.now() - containerStartTime) / 1000 })
|
||||
|
||||
@provideSingleton(MiaoScriptCore)
|
||||
class MiaoScriptCore {
|
||||
@ -83,13 +83,13 @@ function initialize() {
|
||||
container.bind(plugin.PluginInstance).toConstantValue(base.getInstance());
|
||||
container.bind(plugin.PluginFolder).toConstantValue('plugins');
|
||||
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);
|
||||
console.i18n("ms.core.package.initialize", { type });
|
||||
require(`@ms/${type}`).default(container);
|
||||
require('@ms/plugin')
|
||||
console.i18n("ms.core.package.initialize", { scope: global.scope, type });
|
||||
require(`${global.scope}/${type}`).default(container);
|
||||
require(`${global.scope}/plugin`)
|
||||
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()
|
||||
console.i18n("ms.core.engine.completed", { time: (Date.now() - global.NashornEngineStartTime) / 1000 });
|
||||
return disable;
|
||||
|
@ -1,12 +1,12 @@
|
||||
ms.ployfill.initialize: "Initialization Java Nashorn ployfill. Please wait..."
|
||||
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.completed: "MiaoScript IOC Container @ms/container loading completed({time}s)!"
|
||||
ms.core.ioc.initialize: "Initialization MiaoScript IOC Container {scope}/container. Please wait..."
|
||||
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.error: "MiaoScript Engine Initialization Error: {error} ..."
|
||||
ms.core.package.initialize: "Initialization MiaoScript Package @ms/core @ms/{type} @ms/plugin. Please wait..."
|
||||
ms.core.package.completed: "MiaoScript Package @ms/core @ms/{type} @ms/plugin loading completed({time}s)!"
|
||||
ms.core.package.initialize: "Initialization MiaoScript Package {scope}/core {scope}/{type} {scope}/plugin. Please wait..."
|
||||
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.completed: "MiaoScript Plugin System loading completed({time}s)!"
|
||||
ms.core.engine.completed: "MiaoScript ScriptEngine loading completed... Done({time}s)!"
|
||||
|
@ -1,12 +1,12 @@
|
||||
ms.ployfill.initialize: "加载 Java Nashorn 补丁. 请稍候..."
|
||||
ms.ployfill.completed: "Java Nashorn 补丁 加载完成... 耗时 ({time}s)!"
|
||||
|
||||
ms.core.ioc.initialize: "初始化 MiaoScript IOC 容器 @ms/container. 请稍候..."
|
||||
ms.core.ioc.completed: "MiaoScript IOC 容器 @ms/container 加载完成 耗时({time}s)"
|
||||
ms.core.ioc.initialize: "初始化 MiaoScript IOC 容器 {scope}/container. 请稍候..."
|
||||
ms.core.ioc.completed: "MiaoScript IOC 容器 {scope}/container 加载完成 耗时({time}s)"
|
||||
ms.core.initialize.detect: "检测到兼容的服务器类型. 设置 ServerType 值 {type} ..."
|
||||
ms.core.initialize.error: "§4MiaoScript 系统初始化失败 §c{error} ..."
|
||||
ms.core.package.initialize: "初始化 MiaoScript 扩展 @ms/core @ms/{type} @ms/plugin. 请稍候..."
|
||||
ms.core.package.completed: "MiaoScript 扩展 @ms/core @ms/{type} @ms/plugin 加载完成 耗时({time}s)"
|
||||
ms.core.package.initialize: "初始化 MiaoScript 扩展 {scope}/core {scope}/{type} {scope}/plugin. 请稍候..."
|
||||
ms.core.package.completed: "MiaoScript 扩展 {scope}/core {scope}/{type} {scope}/plugin 加载完成 耗时({time}s)"
|
||||
ms.core.plugin.initialize: "MiaoScript 开始引导插件系统. 请稍候..."
|
||||
ms.core.plugin.completed: "MiaoScript 插件加载完毕 耗时({time}s)!"
|
||||
ms.core.engine.completed: "MiaoScript 脚本引擎 加载完毕... 耗时({time}s)!"
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "@ms/i18n",
|
||||
"name": "@ccms/i18n",
|
||||
"version": "0.5.0",
|
||||
"description": "MiaoScript i18n package",
|
||||
"keywords": [
|
||||
@ -12,9 +12,6 @@
|
||||
"homepage": "https://github.com/circlecloud/ms.git",
|
||||
"license": "ISC",
|
||||
"main": "dist/index.js",
|
||||
"publishConfig": {
|
||||
"registry": "https://repo.yumc.pw/repository/npm-hosted/"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rimraf dist",
|
||||
"watch": "tsc --watch",
|
||||
@ -28,7 +25,7 @@
|
||||
"typescript": "^3.8.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ms/nashorn": "^0.5.0",
|
||||
"@ccms/nashorn": "^0.5.0",
|
||||
"js-yaml": "^3.13.1"
|
||||
},
|
||||
"gitHead": "781524f83e52cad26d7c480513e3c525df867121"
|
||||
|
@ -1,4 +1,4 @@
|
||||
/// <reference types="@ms/nashorn" />
|
||||
/// <reference types="@ccms/nashorn" />
|
||||
import * as yaml from 'js-yaml'
|
||||
|
||||
const File = Java.type("java.io.File");
|
||||
@ -32,9 +32,9 @@ export class Translate {
|
||||
|
||||
translate(name: string, param?: TranslateParam) {
|
||||
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) {
|
||||
langText = langText.replace("{" + key + "}", param[key])
|
||||
langText = langText.replace(new RegExp("{" + key + "}", 'gm'), param[key])
|
||||
}
|
||||
return langText;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "@ms/nashorn",
|
||||
"name": "@ccms/nashorn",
|
||||
"version": "0.5.0",
|
||||
"description": "MiaoScript api package",
|
||||
"keywords": [
|
||||
@ -13,9 +13,6 @@
|
||||
"license": "ISC",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
"publishConfig": {
|
||||
"registry": "https://repo.yumc.pw/repository/npm-hosted/"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rimraf dist",
|
||||
"watch": "tsc --watch",
|
||||
|
@ -41,6 +41,7 @@ declare global {
|
||||
|
||||
namespace NodeJS {
|
||||
interface Global {
|
||||
scope: string;
|
||||
logger: any;
|
||||
debug: boolean;
|
||||
level: string;
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "@ms/nodejs",
|
||||
"name": "@ccms/nodejs",
|
||||
"version": "0.5.0",
|
||||
"description": "MiaoScript nodejs package",
|
||||
"keywords": [
|
||||
@ -12,9 +12,6 @@
|
||||
"homepage": "https://github.com/circlecloud/ms.git",
|
||||
"license": "ISC",
|
||||
"main": "dist/index.js",
|
||||
"publishConfig": {
|
||||
"registry": "https://repo.yumc.pw/repository/npm-hosted/"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rimraf dist",
|
||||
"watch": "tsc --watch",
|
||||
@ -27,7 +24,7 @@
|
||||
"typescript": "^3.8.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ms/nashorn": "^0.5.0"
|
||||
"@ccms/nashorn": "^0.5.0"
|
||||
},
|
||||
"gitHead": "781524f83e52cad26d7c480513e3c525df867121"
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
import '@ms/nashorn'
|
||||
import '@ccms/nashorn'
|
||||
import { URL } from "url";
|
||||
|
||||
const Path = Java.type("java.nio.file.Path");
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "@ms/nukkit",
|
||||
"name": "@ccms/nukkit",
|
||||
"version": "0.5.0",
|
||||
"description": "MiaoScript nukkit package",
|
||||
"keywords": [
|
||||
@ -12,9 +12,6 @@
|
||||
"homepage": "https://github.com/circlecloud/ms.git",
|
||||
"license": "ISC",
|
||||
"main": "dist/index.js",
|
||||
"publishConfig": {
|
||||
"registry": "https://repo.yumc.pw/repository/npm-hosted/"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rimraf dist",
|
||||
"watch": "tsc --watch",
|
||||
@ -27,8 +24,8 @@
|
||||
"typescript": "^3.8.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ms/api": "^0.5.0",
|
||||
"@ms/common": "^0.5.0",
|
||||
"@ms/container": "^0.5.0"
|
||||
"@ccms/api": "^0.5.0",
|
||||
"@ccms/common": "^0.5.0",
|
||||
"@ccms/container": "^0.5.0"
|
||||
}
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
import '@ms/nashorn'
|
||||
import '@ccms/nashorn'
|
||||
|
||||
import { command, plugin } from '@ms/api'
|
||||
import { inject, provideSingleton, postConstruct } from '@ms/container'
|
||||
import { command, plugin } from '@ccms/api'
|
||||
import { inject, provideSingleton, postConstruct } from '@ccms/container'
|
||||
|
||||
let PluginCommand = Java.type('cn.nukkit.command.PluginCommand');
|
||||
let CommandExecutor = Java.type('cn.nukkit.command.CommandExecutor');
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { MiaoScriptConsole } from '@ms/api'
|
||||
import { MiaoScriptConsole } from '@ccms/api'
|
||||
|
||||
let Nukkit = base.getInstance().getServer();
|
||||
let CommandSender = Java.type('cn.nukkit.command.CommandSender')
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { event, plugin } from '@ms/api'
|
||||
import { inject, provideSingleton } from '@ms/container'
|
||||
import { event, plugin } from '@ccms/api'
|
||||
import { inject, provideSingleton } from '@ccms/container'
|
||||
|
||||
const Nukkit: cn.nukkit.Server = base.getInstance().getServer();
|
||||
const Event = Java.type("cn.nukkit.event.Event");
|
||||
|
@ -1,7 +1,7 @@
|
||||
/// <reference types="@ms/types/dist/typings/nukkit" />
|
||||
/// <reference types="@ccms/types/dist/typings/nukkit" />
|
||||
|
||||
import { server } from '@ms/api'
|
||||
import { Container } from '@ms/container'
|
||||
import { server } from '@ccms/api'
|
||||
import { Container } from '@ccms/container'
|
||||
|
||||
import { NukkitConsole } from './console';
|
||||
import './event';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { server } from '@ms/api'
|
||||
import { provideSingleton } from '@ms/container';
|
||||
import { server } from '@ccms/api'
|
||||
import { provideSingleton } from '@ccms/container';
|
||||
|
||||
let Nukkit: cn.nukkit.Server = base.getInstance().getServer();
|
||||
const File = Java.type("java.io.File");
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { task, plugin } from '@ms/api'
|
||||
import { inject, provideSingleton } from '@ms/container';
|
||||
import { task, plugin } from '@ccms/api'
|
||||
import { inject, provideSingleton } from '@ccms/container';
|
||||
|
||||
const NukkitRunnable = Java.type('cn.nukkit.scheduler.NukkitRunnable');
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "@ms/ployfill",
|
||||
"name": "@ccms/ployfill",
|
||||
"version": "0.5.0",
|
||||
"description": "MiaoScript ployfill package",
|
||||
"author": "MiaoWoo <admin@yumc.pw>",
|
||||
@ -7,9 +7,6 @@
|
||||
"license": "ISC",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
"publishConfig": {
|
||||
"registry": "https://repo.yumc.pw/repository/npm-hosted/"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rimraf dist",
|
||||
"watch": "tsc --watch",
|
||||
@ -17,8 +14,8 @@
|
||||
"test": "echo \"Error: run tests from root\" && exit 1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ms/i18n": "^0.5.0",
|
||||
"@ms/nashorn": "^0.5.0",
|
||||
"@ccms/i18n": "^0.5.0",
|
||||
"@ccms/nashorn": "^0.5.0",
|
||||
"core-js": "^3.6.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
@ -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();
|
||||
i18n.initialize();
|
||||
console.i18n("ms.ployfill.initialize");
|
||||
|
@ -1,4 +1,4 @@
|
||||
import '@ms/nashorn'
|
||||
import '@ccms/nashorn'
|
||||
|
||||
const URL = Java.type("java.net.URL");
|
||||
const Files = Java.type("java.nio.file.Files");
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "@ms/plugin",
|
||||
"name": "@ccms/plugin",
|
||||
"version": "0.5.0",
|
||||
"description": "MiaoScript api package",
|
||||
"keywords": [
|
||||
@ -12,9 +12,6 @@
|
||||
"homepage": "https://github.com/circlecloud/ms.git",
|
||||
"license": "ISC",
|
||||
"main": "dist/index.js",
|
||||
"publishConfig": {
|
||||
"registry": "https://repo.yumc.pw/repository/npm-hosted/"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rimraf dist",
|
||||
"watch": "tsc --watch",
|
||||
@ -28,10 +25,10 @@
|
||||
"typescript": "^3.8.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ms/api": "^0.5.0",
|
||||
"@ms/common": "^0.5.0",
|
||||
"@ms/container": "^0.5.0",
|
||||
"@ms/i18n": "^0.5.0",
|
||||
"@ccms/api": "^0.5.0",
|
||||
"@ccms/common": "^0.5.0",
|
||||
"@ccms/container": "^0.5.0",
|
||||
"@ccms/i18n": "^0.5.0",
|
||||
"js-yaml": "^3.13.1"
|
||||
}
|
||||
}
|
||||
|
@ -1,12 +1,12 @@
|
||||
export const METADATA_KEY = {
|
||||
plugin: "@ms/plugin:plugin",
|
||||
cmd: "@ms/plugin:cmd",
|
||||
tab: "@ms/plugin:tab",
|
||||
listener: "@ms/plugin:listener",
|
||||
config: "@ms/plugin:config",
|
||||
plugin: "@ccms/plugin:plugin",
|
||||
cmd: "@ccms/plugin:cmd",
|
||||
tab: "@ccms/plugin:tab",
|
||||
listener: "@ccms/plugin:listener",
|
||||
config: "@ccms/plugin:config",
|
||||
stage: {
|
||||
load: "@ms/plugin:stage:load",
|
||||
enable: "@ms/plugin:stage:enable",
|
||||
disable: "@ms/plugin:stage:disable"
|
||||
load: "@ccms/plugin:stage:load",
|
||||
enable: "@ccms/plugin:stage:enable",
|
||||
disable: "@ccms/plugin:stage:disable"
|
||||
}
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { injectable, decorate } from "@ms/container";
|
||||
import { injectable, decorate } from "@ccms/container";
|
||||
import { interfaces } from './interfaces'
|
||||
import { METADATA_KEY } from './constants'
|
||||
import { getPluginMetadatas, getPluginCommandMetadata, getPluginListenerMetadata, getPluginTabCompleterMetadata, getPluginConfigMetadata, getPluginStageMetadata } from './utils'
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { server, MiaoScriptConsole, event } from "@ms/api";
|
||||
import { server, MiaoScriptConsole, event } from "@ccms/api";
|
||||
import { METADATA_KEY } from './constants'
|
||||
import { injectable, inject, postConstruct } from "@ms/container";
|
||||
import { injectable, inject, postConstruct } from "@ccms/container";
|
||||
import { getPluginMetadata } from "./utils";
|
||||
|
||||
export namespace interfaces {
|
||||
|
@ -1,7 +1,7 @@
|
||||
import i18n from '@ms/i18n'
|
||||
import { plugin, server, command, event } from '@ms/api'
|
||||
import { inject, provideSingleton, Container, ContainerInstance } from '@ms/container'
|
||||
import * as fs from '@ms/common/dist/fs'
|
||||
import i18n from '@ccms/i18n'
|
||||
import { plugin, server, command, event } from '@ccms/api'
|
||||
import { inject, provideSingleton, Container, ContainerInstance } from '@ccms/container'
|
||||
import * as fs from '@ccms/common/dist/fs'
|
||||
|
||||
import { getPluginMetadatas, getPluginCommandMetadata, getPluginListenerMetadata, getPlugin, getPluginTabCompleterMetadata, getPluginConfigMetadata, getPluginStageMetadata } from './utils'
|
||||
import { interfaces } from './interfaces'
|
||||
@ -54,6 +54,7 @@ export class PluginManagerImpl implements plugin.PluginManager {
|
||||
|
||||
private runPluginStage(plugin: interfaces.Plugin, stage: string, ext: Function) {
|
||||
this.logStage(plugin, i18n.translate(`ms.plugin.manager.stage.${stage}`))
|
||||
ext()
|
||||
this.runCatch(plugin, stage)
|
||||
this.runCatch(plugin, `${this.serverType}${stage}`)
|
||||
this.execPluginStage(plugin, stage)
|
||||
@ -178,7 +179,7 @@ export class PluginManagerImpl implements plugin.PluginManager {
|
||||
|
||||
private createPlugin(file: string) {
|
||||
//@ts-ignore
|
||||
require(file, { cache: false })
|
||||
require(file + '', { cache: false })
|
||||
}
|
||||
|
||||
private buildPlugins() {
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "@ms/sponge",
|
||||
"name": "@ccms/sponge",
|
||||
"version": "0.5.0",
|
||||
"description": "MiaoScript api package",
|
||||
"keywords": [
|
||||
@ -12,9 +12,6 @@
|
||||
"homepage": "https://github.com/circlecloud/ms.git",
|
||||
"license": "ISC",
|
||||
"main": "dist/index.js",
|
||||
"publishConfig": {
|
||||
"registry": "https://repo.yumc.pw/repository/npm-hosted/"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rimraf dist",
|
||||
"watch": "tsc --watch",
|
||||
@ -27,8 +24,8 @@
|
||||
"typescript": "^3.8.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ms/api": "^0.5.0",
|
||||
"@ms/common": "^0.5.0",
|
||||
"@ms/container": "^0.5.0"
|
||||
"@ccms/api": "^0.5.0",
|
||||
"@ccms/common": "^0.5.0",
|
||||
"@ccms/container": "^0.5.0"
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { channel, plugin } from '@ms/api'
|
||||
import { inject, provideSingleton } from '@ms/container'
|
||||
import { channel, plugin } from '@ccms/api'
|
||||
import { inject, provideSingleton } from '@ccms/container'
|
||||
|
||||
const Sponge = org.spongepowered.api.Sponge
|
||||
const RawDataListener = Java.type("org.spongepowered.api.network.RawDataListener")
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { command, plugin } from "@ms/api";
|
||||
import { inject, provideSingleton } from "@ms/container";
|
||||
import { command, plugin } from "@ccms/api";
|
||||
import { inject, provideSingleton } from "@ccms/container";
|
||||
|
||||
let Sponge = Java.type('org.spongepowered.api.Sponge');
|
||||
let Text = Java.type('org.spongepowered.api.text.Text');
|
||||
|
@ -1,5 +1,5 @@
|
||||
import '@ms/nashorn'
|
||||
import { MiaoScriptConsole } from '@ms/api'
|
||||
import '@ccms/nashorn'
|
||||
import { MiaoScriptConsole } from '@ccms/api'
|
||||
|
||||
let Sponge = Java.type('org.spongepowered.api.Sponge');
|
||||
var Text = Java.type('org.spongepowered.api.text.Text');
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { event, plugin } from '@ms/api'
|
||||
import { inject, provideSingleton } from '@ms/container';
|
||||
import { event, plugin } from '@ccms/api'
|
||||
import { inject, provideSingleton } from '@ccms/container';
|
||||
|
||||
let Modifier = Java.type("java.lang.reflect.Modifier");
|
||||
let Order = Java.type("org.spongepowered.api.event.Order");
|
||||
|
@ -1,7 +1,7 @@
|
||||
/// <reference types="@ms/types/dist/typings/sponge" />
|
||||
/// <reference types="@ccms/types/dist/typings/sponge" />
|
||||
|
||||
import { server } from '@ms/api'
|
||||
import { Container } from '@ms/container'
|
||||
import { server } from '@ccms/api'
|
||||
import { Container } from '@ccms/container'
|
||||
|
||||
import { SpongeConsole } from './console';
|
||||
import './event';
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { server, constants } from '@ms/api'
|
||||
import { provideSingleton } from '@ms/container';
|
||||
import { server, constants } from '@ccms/api'
|
||||
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 TextSerializers = org.spongepowered.api.text.serializer.TextSerializers;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { task, plugin } from '@ms/api'
|
||||
import { inject, provideSingleton, postConstruct } from '@ms/container';
|
||||
import { task, plugin } from '@ccms/api'
|
||||
import { inject, provideSingleton, postConstruct } from '@ccms/container';
|
||||
|
||||
const Sponge = Java.type("org.spongepowered.api.Sponge");
|
||||
const Task = Java.type("org.spongepowered.api.scheduler.Task");
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "@ms/websocket",
|
||||
"name": "@ccms/websocket",
|
||||
"version": "0.5.0",
|
||||
"description": "MiaoScript websocket package",
|
||||
"keywords": [
|
||||
@ -12,9 +12,6 @@
|
||||
"homepage": "https://github.com/circlecloud/ms.git",
|
||||
"license": "ISC",
|
||||
"main": "dist/index.js",
|
||||
"publishConfig": {
|
||||
"registry": "https://repo.yumc.pw/repository/npm-hosted/"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rimraf dist",
|
||||
"watch": "tsc --watch",
|
||||
@ -27,6 +24,6 @@
|
||||
"typescript": "^3.8.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ms/nashorn": "^0.5.0"
|
||||
"@ccms/nashorn": "^0.5.0"
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
/// <reference types="@ms/nashorn" />
|
||||
/// <reference types="@ccms/nashorn" />
|
||||
|
||||
import { Server, ServerOptions } from './socket-io'
|
||||
|
||||
@ -41,6 +41,6 @@ type SocketStatic = SocketIOStatic & { Instance?: symbol }
|
||||
let io: SocketStatic = function (pipeline: any, options: ServerOptions) {
|
||||
return new Server(pipeline, options)
|
||||
}
|
||||
io.Instance = Symbol("@ms/websocket")
|
||||
io.Instance = Symbol("@ccms/websocket")
|
||||
export default io
|
||||
export * from './socket-io'
|
||||
|
Loading…
Reference in New Issue
Block a user