chore: add wxpusher in default plugin list

pull/90/head
moonrailgun 2 years ago
parent 1c09b17211
commit 1d0427b71f

@ -13,7 +13,7 @@
"start:admin": "cd server/admin && pnpm start", "start:admin": "cd server/admin && pnpm start",
"build": "concurrently npm:build:web npm:build:server npm:build:admin && cp -r client/web/dist/* server/dist/public && cp -r client/web/dist/* server/dist/public", "build": "concurrently npm:build:web npm:build:server npm:build:admin && cp -r client/web/dist/* server/dist/public && cp -r client/web/dist/* server/dist/public",
"build:web": "cd client/web && pnpm build", "build:web": "cd client/web && pnpm build",
"build:server": "cd server && pnpm build && echo \"Install server side plugin:\" && pnpm run plugin:install com.msgbyte.tasks com.msgbyte.linkmeta com.msgbyte.github com.msgbyte.simplenotify com.msgbyte.topic com.msgbyte.agora && mkdir -p ./dist/public && cp -r ./public/plugins ./dist/public && cp ./public/registry-be.json ./dist/public", "build:server": "cd server && pnpm build && echo \"Install server side plugin:\" && pnpm run plugin:install com.msgbyte.tasks com.msgbyte.linkmeta com.msgbyte.github com.msgbyte.simplenotify com.msgbyte.topic com.msgbyte.agora com.msgbyte.wxpusher && mkdir -p ./dist/public && cp -r ./public/plugins ./dist/public && cp ./public/registry-be.json ./dist/public",
"build:admin": "cd server/admin && pnpm build", "build:admin": "cd server/admin && pnpm build",
"check:type": "concurrently npm:check:type:client npm:check:type:server", "check:type": "concurrently npm:check:type:client npm:check:type:server",
"check:type:client": "cd client/web && tsc --noEmit", "check:type:client": "cd client/web && tsc --noEmit",

@ -1942,6 +1942,12 @@ importers:
mini-star: mini-star:
specifier: '*' specifier: '*'
version: 1.3.1 version: 1.3.1
normalize-path:
specifier: ^3.0.0
version: 3.0.0
rollup-plugin-copy:
specifier: ^3.4.0
version: 3.4.0
server/plugins/com.msgbyte.wxpusher/web/plugins/com.msgbyte.wxpusher: server/plugins/com.msgbyte.wxpusher/web/plugins/com.msgbyte.wxpusher:
devDependencies: devDependencies:
@ -13506,7 +13512,7 @@ packages:
/@types/connect@3.4.35: /@types/connect@3.4.35:
resolution: {integrity: sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==} resolution: {integrity: sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==}
dependencies: dependencies:
'@types/node': 15.14.9 '@types/node': 18.15.12
/@types/content-disposition@0.5.5: /@types/content-disposition@0.5.5:
resolution: {integrity: sha512-v6LCdKfK6BwcqMo+wYW05rLS12S0ZO0Fl4w1h4aaZMD7bqT3gVUns6FvLJKGZHQmYn3SX55JWGpziwJRwVgutA==} resolution: {integrity: sha512-v6LCdKfK6BwcqMo+wYW05rLS12S0ZO0Fl4w1h4aaZMD7bqT3gVUns6FvLJKGZHQmYn3SX55JWGpziwJRwVgutA==}
@ -22079,7 +22085,7 @@ packages:
peerDependencies: peerDependencies:
glob: '*' glob: '*'
dependencies: dependencies:
'@types/glob': 8.0.0 '@types/glob': 8.1.0
glob: 7.2.3 glob: 7.2.3
dev: true dev: true
@ -22226,7 +22232,7 @@ packages:
dir-glob: 3.0.1 dir-glob: 3.0.1
fast-glob: 3.2.12 fast-glob: 3.2.12
glob: 7.2.3 glob: 7.2.3
ignore: 5.2.1 ignore: 5.2.4
merge2: 1.4.1 merge2: 1.4.1
slash: 3.0.0 slash: 3.0.0
dev: true dev: true
@ -23305,11 +23311,6 @@ packages:
engines: {node: '>= 4'} engines: {node: '>= 4'}
dev: true dev: true
/ignore@5.2.1:
resolution: {integrity: sha512-d2qQLzTJ9WxQftPAuEQpSPmKqzxePjzVbpAVv62AQ64NTL+wR4JkrVqR/LqFsFEUsHDAiId52mJteHDFuDkElA==}
engines: {node: '>= 4'}
dev: true
/ignore@5.2.4: /ignore@5.2.4:
resolution: {integrity: sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==} resolution: {integrity: sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==}
engines: {node: '>= 4'} engines: {node: '>= 4'}

@ -1,4 +1,9 @@
const path = require('path'); const path = require('path');
const copy = require('rollup-plugin-copy');
const normalize = require('normalize-path');
const pluginRoot = path.resolve(__dirname, './web');
const outDir = path.resolve(__dirname, '../../public');
module.exports = { module.exports = {
externalDeps: [ externalDeps: [
@ -9,6 +14,24 @@ module.exports = {
'zustand', 'zustand',
'zustand/middleware/immer', 'zustand/middleware/immer',
], ],
pluginRoot: path.resolve(__dirname, './web'), pluginRoot,
outDir: path.resolve(__dirname, '../../public'), outDir,
rollupPlugins: ({ pluginName }) => [
copy({
targets: [
{
src: path.resolve(
pluginRoot,
`./plugins/${pluginName}`,
'./assets/**/*'
),
dest: path.resolve(outDir, `./plugins/${pluginName}/assets/`),
},
].map((item) => ({
// For windows
src: normalize(item.src),
dest: normalize(item.dest, false),
})),
}),
],
}; };

@ -12,7 +12,9 @@
}, },
"devDependencies": { "devDependencies": {
"@types/react": "18.0.20", "@types/react": "18.0.20",
"mini-star": "*" "mini-star": "*",
"normalize-path": "^3.0.0",
"rollup-plugin-copy": "^3.4.0"
}, },
"dependencies": { "dependencies": {
"got": "^11.8.3", "got": "^11.8.3",

@ -51,7 +51,7 @@ class WxpusherService extends TcService {
let title = 'new'; let title = 'new';
if (message.groupId) { if (message.groupId) {
const groupInfo = await call(ctx).getGroupInfo(message.groupId); const groupInfo = await call(ctx).getGroupInfo(message.groupId);
title = groupInfo.name; title = `来自群组: ${groupInfo.name}`; // 因为wxpusher插件仅适用于中国大陆因此仅需要中文即可
} }
const content = message.messagePlainContent ?? message.messageSnippet; // 优先使用去节点的内容 const content = message.messagePlainContent ?? message.messageSnippet; // 优先使用去节点的内容

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

@ -2,6 +2,7 @@
"label": "wxpusher", "label": "wxpusher",
"name": "com.msgbyte.wxpusher", "name": "com.msgbyte.wxpusher",
"url": "{BACKEND}/plugins/com.msgbyte.wxpusher/index.js", "url": "{BACKEND}/plugins/com.msgbyte.wxpusher/index.js",
"icon": "{BACKEND}/plugins/com.msgbyte.wxpusher/assets/icon.png",
"version": "0.0.0", "version": "0.0.0",
"author": "moonrailgun", "author": "moonrailgun",
"description": "Add support for wxpusher to notify user", "description": "Add support for wxpusher to notify user",

Loading…
Cancel
Save