Init: Create & Init ms Project...
Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
4
packages/core/.gitignore
vendored
Normal file
4
packages/core/.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
/node_modules
|
||||
/dist
|
||||
/package-lock.json
|
||||
/yarn.lock
|
22
packages/core/.npmignore
Normal file
22
packages/core/.npmignore
Normal file
@ -0,0 +1,22 @@
|
||||
src
|
||||
test
|
||||
typings
|
||||
bundled
|
||||
build
|
||||
coverage
|
||||
docs
|
||||
wiki
|
||||
gulpfile.js
|
||||
bower.json
|
||||
karma.conf.js
|
||||
tsconfig.json
|
||||
typings.json
|
||||
CONTRIBUTING.md
|
||||
ISSUE_TEMPLATE.md
|
||||
PULL_REQUEST_TEMPLATE.md
|
||||
tslint.json
|
||||
wallaby.js
|
||||
.travis.yml
|
||||
.gitignore
|
||||
.vscode
|
||||
type_definitions
|
33
packages/core/package.json
Normal file
33
packages/core/package.json
Normal file
@ -0,0 +1,33 @@
|
||||
{
|
||||
"name": "@ms/core",
|
||||
"version": "0.0.0",
|
||||
"description": "MiaoScript api package",
|
||||
"keywords": [
|
||||
"miaoscript",
|
||||
"minecraft",
|
||||
"bukkit",
|
||||
"sponge"
|
||||
],
|
||||
"author": "MiaoWoo <admin@yumc.pw>",
|
||||
"homepage": "https://github.com/circlecloud/ms.git",
|
||||
"license": "ISC",
|
||||
"main": "dist/index.js",
|
||||
"publishConfig": {
|
||||
"registry": "https://repo.yumc.pw/repository/npm/"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rimraf dist",
|
||||
"watch": "npx tsc --watch",
|
||||
"build": "yarn clean && npx tsc",
|
||||
"test": "echo \"Error: run tests from root\" && exit 1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"reflect-metadata": "^0.1.13",
|
||||
"rimraf": "^3.0.0",
|
||||
"typescript": "^3.6.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ms/container": "^0.0.0",
|
||||
"@ms/plugin": "^0.0.0"
|
||||
}
|
||||
}
|
17
packages/core/src/index.ts
Normal file
17
packages/core/src/index.ts
Normal file
@ -0,0 +1,17 @@
|
||||
import '@ms/nashorn'
|
||||
|
||||
import { plugin, server, MiaoScriptConsole } from '@ms/api'
|
||||
import { DefaultContainer as container } from '@ms/container'
|
||||
import { PluginManagerImpl } from '@ms/plugin'
|
||||
|
||||
import '@ms/bukkit'
|
||||
|
||||
let Console: MiaoScriptConsole = container.get(server.Console);
|
||||
global.console = new Console();
|
||||
|
||||
container.bind(plugin.PluginManager).to(PluginManagerImpl).inSingletonScope();
|
||||
|
||||
let manager = container.get<plugin.PluginManager>(plugin.PluginManager);
|
||||
manager.scan('plugins');
|
||||
manager.load(container);
|
||||
manager.enable();
|
7
packages/core/tsconfig.json
Normal file
7
packages/core/tsconfig.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"baseUrl": "src",
|
||||
"outDir": "dist"
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user