Commit 921e0c43 authored by nanahira's avatar nanahira

catchup

parent 32f198cb
...@@ -23,7 +23,7 @@ upload_to_minio: ...@@ -23,7 +23,7 @@ upload_to_minio:
tags: tags:
- linux - linux
script: script:
- aws s3 --endpoint=https://minio.mycard.moe:9000 sync --delete dist/ s3://nanahira/koishi-plugin/fortune - aws s3 --endpoint=https://minio.mycard.moe:9000 sync --delete dist/full/full/ s3://nanahira/koishi-plugin/fortune
only: only:
- master - master
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
"typings": "dist/src/index.d.ts", "typings": "dist/src/index.d.ts",
"scripts": { "scripts": {
"lint": "eslint --fix .", "lint": "eslint --fix .",
"build": "webpack" "build": "webpack && env PACK_ALL=1 webpack"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
...@@ -25,13 +25,15 @@ ...@@ -25,13 +25,15 @@
}, },
"homepage": "https://github.com/koishijs/koishi-plugin-fortune", "homepage": "https://github.com/koishijs/koishi-plugin-fortune",
"dependencies": { "dependencies": {
"@stdlib/random-base-mt19937": "^0.0.5",
"moment": "^2.29.1",
"mustache": "^4.2.0",
"source-map-support": "^0.5.20" "source-map-support": "^0.5.20"
}, },
"peerDependencies": { "peerDependencies": {
"koishi": "^4.0.0-alpha.10" "koishi": "^4.0.0-beta.2"
}, },
"devDependencies": { "devDependencies": {
"@stdlib/random-base-mt19937": "^0.0.5",
"@types/mustache": "^4.1.2", "@types/mustache": "^4.1.2",
"@types/node": "^16.10.2", "@types/node": "^16.10.2",
"@typescript-eslint/eslint-plugin": "^4.32.0", "@typescript-eslint/eslint-plugin": "^4.32.0",
...@@ -39,9 +41,7 @@ ...@@ -39,9 +41,7 @@
"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",
"koishi": "^4.0.0-alpha.10", "koishi": "^4.0.0-beta.2",
"moment": "^2.29.1",
"mustache": "^4.2.0",
"prettier": "^2.4.1", "prettier": "^2.4.1",
"raw-loader": "^4.0.2", "raw-loader": "^4.0.2",
"ts-loader": "^9.2.6", "ts-loader": "^9.2.6",
......
...@@ -7,7 +7,7 @@ import Mustache from 'mustache'; ...@@ -7,7 +7,7 @@ import Mustache from 'mustache';
export interface Config { export interface Config {
header?: string; header?: string;
masterKey?: string; masterKey?: string;
results: string[]; results?: string[];
useDatabase?: boolean; useDatabase?: boolean;
} }
...@@ -50,7 +50,7 @@ export class MyPlugin { ...@@ -50,7 +50,7 @@ export class MyPlugin {
if (this.config.useDatabase) this.useDatabase = !!ctx.database; if (this.config.useDatabase) this.useDatabase = !!ctx.database;
}); });
this.ctx = ctx; this.ctx = ctx;
this.config = Schema.validate(config, this.schema); this.config = config;
ctx ctx
.command('fortune', '进行占卜') .command('fortune', '进行占卜')
.usage('占卜结果每天固定。') .usage('占卜结果每天固定。')
......
const path = require("path"); const path = require('path');
const packgeInfo = require('./package.json');
function externalsFromDep() {
return Object.fromEntries(
[
...Object.keys(packgeInfo.dependencies || {}),
...Object.keys(packgeInfo.peerDependencies || {}),
]
.filter((dep) => dep !== 'source-map-support')
.map((dep) => [dep, dep]),
);
}
const packAll = !!process.env.PACK_ALL;
module.exports = { module.exports = {
entry: "./src/index.ts", entry: './src/index.ts',
mode: "production", mode: 'production',
target: "node", target: 'node',
devtool: "source-map", devtool: 'source-map',
module: { module: {
rules: [ rules: [
{ {
test: /\.tsx?$/, test: /\.tsx?$/,
use: "ts-loader", use: 'ts-loader',
exclude: /node_modules/, exclude: /node_modules/,
}, },
{ test: /\.mustache$/, use: "raw-loader" }, { test: /\.mustache$/, use: 'raw-loader' },
], ],
}, },
resolve: { resolve: {
extensions: [".tsx", ".ts", ".js"], extensions: ['.tsx', '.ts', '.js'],
}, },
output: { output: {
filename: "index.js", filename: 'index.js',
library: { library: {
type: "commonjs", type: 'commonjs',
}, },
path: path.resolve(__dirname, "dist"), path: path.resolve(__dirname, packAll ? 'dist/full' : 'dist'),
}, },
externals: { externals: {
'koishi-core': 'koishi-core', koishi: 'koishi',
'koishi': 'koishi', ...(packAll ? {} : externalsFromDep()),
} },
}; };
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