mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
bump version AGAIN
This commit is contained in:
1 parent
5d16bc740b
commit
90b2d220c5
13 files changed
+9
-55
No files matched your search
@@ -1 +0,0 @@
|
|||||||
Ensure index for problem search: 初始化 better-search 插件
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
import nodejieba from 'nodejieba';
|
|
||||||
import * as bus from 'hydrooj/dist/service/bus';
|
|
||||||
|
|
||||||
declare module 'hydrooj' {
|
|
||||||
interface Pdoc {
|
|
||||||
search?: string
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const jiebaHook = async (pdoc) => {
|
|
||||||
if (!pdoc.title) return;
|
|
||||||
const segments = nodejieba.cutForSearch(pdoc.title);
|
|
||||||
pdoc.search = segments.join(' ');
|
|
||||||
};
|
|
||||||
|
|
||||||
bus.on('problem/before-add', jiebaHook);
|
|
||||||
bus.on('problem/before-edit', jiebaHook);
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "@hydrooj/better-search",
|
|
||||||
"version": "1.0.3",
|
|
||||||
"description": "Enhance Problem Search",
|
|
||||||
"main": "package.json",
|
|
||||||
"repository": "https://github.com/hydro-dev/Hydro.git",
|
|
||||||
"author": "undefined <i@undefined.moe>",
|
|
||||||
"license": "AGPL-3.0-only",
|
|
||||||
"dependencies": {
|
|
||||||
"nodejieba": "^2.5.1"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
import nodejieba from 'nodejieba';
|
|
||||||
import { Pdoc } from 'hydrooj';
|
|
||||||
import * as document from 'hydrooj/dist/model/document';
|
|
||||||
|
|
||||||
export const description = 'Ensure index for problem search';
|
|
||||||
|
|
||||||
export async function run() {
|
|
||||||
await document.coll.find({ docType: document.TYPE_PROBLEM }).forEach(async (doc: Pdoc) => {
|
|
||||||
const segments = nodejieba.cutForSearch(doc.title);
|
|
||||||
await document.coll.updateOne({ _id: doc._id }, { $set: { search: segments.join(' ') } });
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export const validate = {};
|
|
||||||
|
|
||||||
global.Hydro.script.ensureSearch = { run, description, validate };
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/fps-importer",
|
"name": "@hydrooj/fps-importer",
|
||||||
"version": "1.1.11",
|
"version": "1.1.12",
|
||||||
"description": "Import FPS problems",
|
"description": "Import FPS problems",
|
||||||
"main": "package.json",
|
"main": "package.json",
|
||||||
"repository": "https://github.com/hydro-dev/Hydro.git",
|
"repository": "https://github.com/hydro-dev/Hydro.git",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/geoip",
|
"name": "@hydrooj/geoip",
|
||||||
"version": "1.1.17",
|
"version": "1.1.18",
|
||||||
"main": "package.json",
|
"main": "package.json",
|
||||||
"repository": "git@github.com:hydro-dev/Hydro.git",
|
"repository": "git@github.com:hydro-dev/Hydro.git",
|
||||||
"author": "undefined <i@undefined.moe>",
|
"author": "undefined <i@undefined.moe>",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hydrooj",
|
"name": "hydrooj",
|
||||||
"version": "2.23.0",
|
"version": "2.23.1",
|
||||||
"bin": "bin/hydrooj.js",
|
"bin": "bin/hydrooj.js",
|
||||||
"main": "dist/loader.js",
|
"main": "dist/loader.js",
|
||||||
"typings": "dist/loader.d.ts",
|
"typings": "dist/loader.d.ts",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/import-qduoj",
|
"name": "@hydrooj/import-qduoj",
|
||||||
"version": "1.1.7",
|
"version": "1.1.8",
|
||||||
"description": "Import QDUOJ problem export",
|
"description": "Import QDUOJ problem export",
|
||||||
"main": "package.json",
|
"main": "package.json",
|
||||||
"repository": "https://github.com/hydro-dev/Hydro.git",
|
"repository": "https://github.com/hydro-dev/Hydro.git",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/login-with-github",
|
"name": "@hydrooj/login-with-github",
|
||||||
"version": "0.0.8",
|
"version": "0.0.9",
|
||||||
"main": "package.json",
|
"main": "package.json",
|
||||||
"repository": "git@github.com:hydro-dev/Hydro.git",
|
"repository": "git@github.com:hydro-dev/Hydro.git",
|
||||||
"author": "undefined <i@undefined.moe>",
|
"author": "undefined <i@undefined.moe>",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/login-with-google",
|
"name": "@hydrooj/login-with-google",
|
||||||
"version": "0.0.9",
|
"version": "0.0.10",
|
||||||
"main": "package.json",
|
"main": "package.json",
|
||||||
"repository": "git@github.com:hydro-dev/Hydro.git",
|
"repository": "git@github.com:hydro-dev/Hydro.git",
|
||||||
"author": "undefined <i@undefined.moe>",
|
"author": "undefined <i@undefined.moe>",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/recaptcha",
|
"name": "@hydrooj/recaptcha",
|
||||||
"version": "1.0.1",
|
"version": "1.0.2",
|
||||||
"description": "Google reCAPTCHA",
|
"description": "Google reCAPTCHA",
|
||||||
"main": "package.json",
|
"main": "package.json",
|
||||||
"repository": "https://github.com/hydro-dev/Hydro.git",
|
"repository": "https://github.com/hydro-dev/Hydro.git",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/sonic",
|
"name": "@hydrooj/sonic",
|
||||||
"version": "1.0.1",
|
"version": "1.0.2",
|
||||||
"description": "Sonic search service",
|
"description": "Sonic search service",
|
||||||
"main": "service.js",
|
"main": "service.js",
|
||||||
"typings": "service.d.ts",
|
"typings": "service.d.ts",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/ui-default",
|
"name": "@hydrooj/ui-default",
|
||||||
"version": "4.6.0",
|
"version": "4.6.1",
|
||||||
"author": "undefined <i@undefined.moe>",
|
"author": "undefined <i@undefined.moe>",
|
||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
"main": "hydro.js",
|
"main": "hydro.js",
|
||||||
|
|||||||
Reference in new issue
Block a user