Commit 1ad8b5fc authored by nanahira's avatar nanahira

bump and dev server

parent b4b964b0
...@@ -7,4 +7,13 @@ ...@@ -7,4 +7,13 @@
.dockerignore .dockerignore
Dockerfile Dockerfile
/src /src
/dist/full /dist/full
\ No newline at end of file /coverage
/tests
/dist/tests
/dev
/dist/dev
/webpack.config.js
/.eslint*
.*ignore
.prettierrc*
import { Context } from 'koishi';
export default class ExtrasInDev {
constructor(ctx: Context) {}
}
import { App } from 'koishi';
import TargetPlugin from '../src';
import ConsolePlugin from '@koishijs/plugin-console';
import SandboxPlugin from '@koishijs/plugin-sandbox';
import DatabasePlugin from '@koishijs/plugin-database-memory';
import CachePlugin from '@koishijs/plugin-cache-lru';
import ExtrasInDev from './extras';
const app = new App({
port: 14514,
host: 'localhost',
prefix: '.',
});
// Console and sandbox
app.plugin(SandboxPlugin);
app.plugin(ConsolePlugin, {
open: false,
});
// Some services
app.plugin(CachePlugin);
app.plugin(DatabasePlugin);
// Some extras
app.plugin(ExtrasInDev);
// Target plugin
app.plugin(TargetPlugin, {});
app.start();
This diff is collapsed.
...@@ -6,7 +6,9 @@ ...@@ -6,7 +6,9 @@
"types": "dist/index.d.ts", "types": "dist/index.d.ts",
"scripts": { "scripts": {
"lint": "eslint --fix .", "lint": "eslint --fix .",
"build": "webpack && env PACK_ALL=1 webpack" "build": "webpack && env PACK_ALL=1 webpack",
"start": "ts-node ./dev",
"test": "jest --passWithNoTests"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
...@@ -27,14 +29,19 @@ ...@@ -27,14 +29,19 @@
"homepage": "https://code.mycard.moe/nanahira/koishi-plugin-hisoutensoku-jammer", "homepage": "https://code.mycard.moe/nanahira/koishi-plugin-hisoutensoku-jammer",
"dependencies": { "dependencies": {
"ip": "^1.1.5", "ip": "^1.1.5",
"koishi-thirdeye": "^8.3.2", "koishi-thirdeye": "^8.3.3",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"moment": "^2.29.1", "moment": "^2.29.1",
"source-map-support": "^0.5.21", "source-map-support": "^0.5.21",
"tesseract.js": "^2.1.5" "tesseract.js": "^2.1.5"
}, },
"devDependencies": { "devDependencies": {
"@koishijs/plugin-cache-lru": "^1.0.0-rc.0",
"@koishijs/plugin-console": "^3.1.1",
"@koishijs/plugin-database-memory": "^1.0.2",
"@koishijs/plugin-sandbox": "^1.0.0",
"@types/ip": "^1.1.0", "@types/ip": "^1.1.0",
"@types/jest": "^27.4.0",
"@types/lodash": "^4.14.177", "@types/lodash": "^4.14.177",
"@types/node": "^16.11.9", "@types/node": "^16.11.9",
"@typescript-eslint/eslint-plugin": "^4.33.0", "@typescript-eslint/eslint-plugin": "^4.33.0",
...@@ -42,15 +49,35 @@ ...@@ -42,15 +49,35 @@
"eslint": "^7.32.0", "eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0", "eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^3.4.1", "eslint-plugin-prettier": "^3.4.1",
"jest": "^27.5.1",
"prettier": "^2.4.1", "prettier": "^2.4.1",
"raw-loader": "^4.0.2", "raw-loader": "^4.0.2",
"ts-jest": "^27.1.3",
"ts-loader": "^9.2.6", "ts-loader": "^9.2.6",
"ts-node": "^10.5.0",
"typescript": "^4.5.2", "typescript": "^4.5.2",
"webpack": "^5.64.2", "webpack": "^5.64.2",
"webpack-cli": "^4.9.1", "webpack-cli": "^4.9.1",
"ws": "^8.3.0" "ws": "^8.3.0"
}, },
"peerDependencies": { "peerDependencies": {
"koishi": "^4.2.1" "koishi": "^4.2.2"
},
"jest": {
"moduleFileExtensions": [
"js",
"json",
"ts"
],
"rootDir": "tests",
"testRegex": ".*\\.spec\\.ts$",
"transform": {
"^.+\\.(t|j)s$": "ts-jest"
},
"collectCoverageFrom": [
"**/*.(t|j)s"
],
"coverageDirectory": "../coverage",
"testEnvironment": "node"
} }
} }
import { App } from 'koishi';
import TargetPlugin from '../src';
describe('Test of plugin.', () => {
let app: App;
beforeEach(async () => {
app = new App();
// app.plugin(TargetPlugin);
await app.start();
});
it('should pass', () => {
expect(true).toBe(true);
});
});
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
"allowJs": true, "allowJs": true,
"include": [ "include": [
"*.ts", "*.ts",
"src/**/*.ts" "src/**/*.ts",
"tests/**/*.ts",
"dev/**/*.ts"
] ]
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment