From cbe87cc378ceaea90ce7b1308353be4394e8fa3d Mon Sep 17 00:00:00 2001 From: MiaoWoo Date: Tue, 10 Sep 2019 17:22:56 +0800 Subject: [PATCH] feat: add plugins packages and add Test Plugin Signed-off-by: MiaoWoo --- packages/plugins/.gitignore | 4 ++++ packages/plugins/.npmignore | 22 ++++++++++++++++++++++ packages/plugins/package.json | 34 ++++++++++++++++++++++++++++++++++ packages/plugins/src/Test.ts | 14 ++++++++++++++ packages/plugins/tsconfig.json | 7 +++++++ 5 files changed, 81 insertions(+) create mode 100644 packages/plugins/.gitignore create mode 100644 packages/plugins/.npmignore create mode 100644 packages/plugins/package.json create mode 100644 packages/plugins/src/Test.ts create mode 100644 packages/plugins/tsconfig.json diff --git a/packages/plugins/.gitignore b/packages/plugins/.gitignore new file mode 100644 index 00000000..d856d44c --- /dev/null +++ b/packages/plugins/.gitignore @@ -0,0 +1,4 @@ +/node_modules +/dist +/package-lock.json +/yarn.lock diff --git a/packages/plugins/.npmignore b/packages/plugins/.npmignore new file mode 100644 index 00000000..b0eede3b --- /dev/null +++ b/packages/plugins/.npmignore @@ -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 \ No newline at end of file diff --git a/packages/plugins/package.json b/packages/plugins/package.json new file mode 100644 index 00000000..4bdb34f9 --- /dev/null +++ b/packages/plugins/package.json @@ -0,0 +1,34 @@ +{ + "name": "@ms/plugins", + "version": "0.0.0", + "description": "MiaoScript plugins package", + "keywords": [ + "miaoscript", + "minecraft", + "bukkit", + "sponge" + ], + "author": "MiaoWoo ", + "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/plugins": "^0.0.0", + "es6-map": "^0.1.5", + "inversify": "^5.0.1" + } +} diff --git a/packages/plugins/src/Test.ts b/packages/plugins/src/Test.ts new file mode 100644 index 00000000..7d274b0a --- /dev/null +++ b/packages/plugins/src/Test.ts @@ -0,0 +1,14 @@ +import { plugin, interfaces } from '@ms/plugin' + +@plugin({ name: 'Test', version: '1.0.0', author: 'MiaoWoo' }) +export class Test extends interfaces.Plugin { + load() { + this.logger.log(''); + } + enable() { + throw new Error("Method not implemented."); + } + disable() { + throw new Error("Method not implemented."); + } +} diff --git a/packages/plugins/tsconfig.json b/packages/plugins/tsconfig.json new file mode 100644 index 00000000..7aae5d2b --- /dev/null +++ b/packages/plugins/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "baseUrl": "src", + "outDir": "dist" + } +} \ No newline at end of file