From 6d2442c6a30ea7d9f04bc042e0e94c9e4b01ab2d Mon Sep 17 00:00:00 2001 From: undefined Date: Thu, 30 Oct 2025 15:38:23 +0800 Subject: [PATCH] core&framework: switch to mongodb-js/saslprep --- framework/eslint-config/package.json | 12 ++++++------ framework/framework/package.json | 11 +++++------ framework/framework/validator.ts | 2 +- packages/hydrooj/package.json | 3 +-- packages/hydrooj/src/model/setting.ts | 2 +- 5 files changed, 14 insertions(+), 16 deletions(-) diff --git a/framework/eslint-config/package.json b/framework/eslint-config/package.json index 52a188e8c..04f429b45 100644 --- a/framework/eslint-config/package.json +++ b/framework/eslint-config/package.json @@ -5,13 +5,13 @@ "main": "base.mjs", "repository": "https://github.com/hydro-dev/Hydro", "dependencies": { - "@antfu/eslint-config": "^6.0.0", - "@eslint-react/eslint-plugin": "^2.2.2", - "@typescript-eslint/eslint-plugin": "^8.46.1", - "@typescript-eslint/parser": "^8.46.1", + "@antfu/eslint-config": "^6.1.0", + "@eslint-react/eslint-plugin": "^2.2.3", + "@typescript-eslint/eslint-plugin": "^8.46.2", + "@typescript-eslint/parser": "^8.46.2", "eslint-plugin-de-morgan": "^2.0.0", "eslint-plugin-github": "^6.0.0", - "eslint-plugin-react-hooks": "^7.0.0", + "eslint-plugin-react-hooks": "^7.0.1", "eslint-plugin-react-refresh": "^0.4.24", "eslint-plugin-simple-import-sort": "^12.1.1", "globals": "^16.4.0" @@ -20,6 +20,6 @@ "eslint": ">= 9" }, "optionalDependencies": { - "typescript": "^5.8.3" + "typescript": "^5.9.3" } } diff --git a/framework/framework/package.json b/framework/framework/package.json index 78fb2e8df..cb9cdb6df 100644 --- a/framework/framework/package.json +++ b/framework/framework/package.json @@ -10,24 +10,23 @@ "dependencies": { "@hydrooj/utils": "workspace:^", "@koa/router": "^14.0.0", + "@mongodb-js/saslprep": "^1.3.2", "emoji-regex": "^10.6.0", "fs-extra": "^11.3.2", "koa": "^3.0.3", - "koa-body": "^6.0.1", + "koa-body": "^7.0.0", "koa-compress": "^5.1.1", "path-to-regexp": "^8.3.0", "sanitize-filename": "^1.6.3", - "saslprep": "^1.0.3", "schemastery": "^3.17.1", "shorty.js": "^1.0.1", "ws": "^8.18.3" }, "devDependencies": { "@types/fs-extra": "^11.0.4", - "@types/koa": "^3.0.0", - "@types/koa-compress": "^4.0.6", - "@types/koa__router": "^12.0.4", - "@types/saslprep": "^1.0.3", + "@types/koa": "^3.0.1", + "@types/koa-compress": "^4.0.7", + "@types/koa__router": "^12.0.5", "@types/ws": "^8.18.1" } } diff --git a/framework/framework/validator.ts b/framework/framework/validator.ts index 26a539340..66510940d 100644 --- a/framework/framework/validator.ts +++ b/framework/framework/validator.ts @@ -1,7 +1,7 @@ import assert from 'assert'; +import saslprep from '@mongodb-js/saslprep'; import emojiRegex from 'emoji-regex'; import sanitize from 'sanitize-filename'; -import saslprep from 'saslprep'; import Schema from 'schemastery'; type InputType = string | number | Record | any[]; diff --git a/packages/hydrooj/package.json b/packages/hydrooj/package.json index 162fdc614..51f4f70a7 100644 --- a/packages/hydrooj/package.json +++ b/packages/hydrooj/package.json @@ -21,6 +21,7 @@ "@hydrooj/common": "workspace:^", "@hydrooj/framework": "workspace:^", "@hydrooj/utils": "workspace:^", + "@mongodb-js/saslprep": "^1.3.2", "@simplewebauthn/server": "13.2.2", "@undefined-moe/require-resolve-hook": "^1.1.0", "@zip.js/zip.js": "^2.8.8", @@ -45,7 +46,6 @@ "notp": "^2.0.3", "p-queue": "^9.0.0", "sanitize-filename": "^1.6.3", - "saslprep": "^1.0.3", "schemastery": "^3.17.1", "semver": "^7.7.3", "shorty.js": "^1.0.1", @@ -65,7 +65,6 @@ "@types/mongodb-uri": "^0.9.4", "@types/nodemailer": "^7.0.3", "@types/notp": "^2.0.5", - "@types/saslprep": "^1.0.3", "@types/semver": "^7.7.1", "@types/superagent": "^8.1.9", "@types/ua-parser-js": "^0.7.39", diff --git a/packages/hydrooj/src/model/setting.ts b/packages/hydrooj/src/model/setting.ts index 386297760..6d5a875f0 100644 --- a/packages/hydrooj/src/model/setting.ts +++ b/packages/hydrooj/src/model/setting.ts @@ -1,10 +1,10 @@ /* eslint-disable max-len */ /* eslint-disable no-await-in-loop */ import fs from 'fs'; +import saslPrep from '@mongodb-js/saslprep'; import yaml from 'js-yaml'; import { Dictionary } from 'lodash'; import moment from 'moment-timezone'; -import saslPrep from 'saslprep'; import Schema from 'schemastery'; import { LangConfig, parseLang } from '@hydrooj/common'; import { findFileSync, randomstring, retry } from '@hydrooj/utils';