diff --git a/.gitignore b/.gitignore index 3e8ffb9f4..b5d7054e9 100644 --- a/.gitignore +++ b/.gitignore @@ -64,3 +64,4 @@ __* .monokle packages/*/public/assets +node_modules.* diff --git a/framework/eslint-config/base.mjs b/framework/eslint-config/base.mjs index 266524317..21e4594d3 100644 --- a/framework/eslint-config/base.mjs +++ b/framework/eslint-config/base.mjs @@ -33,6 +33,7 @@ const base = (option, ...args) => antfu( lessOpinionated: true, plugins: { '@eslint-react': eslintReact, + github, 'react-refresh': reactRefresh, 'simple-import-sort': simpleImportSort, ...(option.plugins || {}), @@ -68,7 +69,6 @@ const base = (option, ...args) => antfu( 'func-names': 0, 'function-call-argument-newline': 0, 'function-paren-newline': 0, - 'github/a11y-svg-has-accessible-name': 0, 'github/array-foreach': 1, 'global-require': 0, 'guard-for-in': 0, @@ -338,7 +338,6 @@ const base = (option, ...args) => antfu( ...(typeof option.stylistic === 'object' ? option.stylistic : {}), }, }, - github.getFlatConfigs().react, deMorgan.configs.recommended, ...((option.vue ?? true) ? [{ files: ['**/*.vue'], diff --git a/framework/eslint-config/package.json b/framework/eslint-config/package.json index f03b21ec8..2d43e9278 100644 --- a/framework/eslint-config/package.json +++ b/framework/eslint-config/package.json @@ -5,10 +5,10 @@ "main": "base.mjs", "repository": "https://github.com/hydro-dev/Hydro", "dependencies": { - "@antfu/eslint-config": "^7.7.3", - "@eslint-react/eslint-plugin": "^3.0.0", - "@typescript-eslint/eslint-plugin": "^8.57.2", - "@typescript-eslint/parser": "^8.57.2", + "@antfu/eslint-config": "^8.0.0", + "@eslint-react/eslint-plugin": "^4.2.3", + "@typescript-eslint/eslint-plugin": "^8.58.0", + "@typescript-eslint/parser": "^8.58.0", "eslint-plugin-de-morgan": "^2.1.1", "eslint-plugin-github": "^6.0.0", "eslint-plugin-react-hooks": "^7.0.1", diff --git a/framework/framework/package.json b/framework/framework/package.json index 99ebd061d..cc5c8c47b 100644 --- a/framework/framework/package.json +++ b/framework/framework/package.json @@ -9,22 +9,22 @@ }, "dependencies": { "@hydrooj/utils": "workspace:^", - "@koa/router": "^15.3.0", + "@koa/router": "^15.4.0", "@mongodb-js/saslprep": "^1.4.6", "emoji-regex": "^10.6.0", - "fs-extra": "^11.3.3", - "koa": "^3.1.2", + "fs-extra": "^11.3.4", + "koa": "^3.2.0", "koa-body": "^7.0.1", "koa-compress": "5.1.1", - "path-to-regexp": "^8.3.0", - "sanitize-filename": "^1.6.3", - "schemastery": "^3.17.2", + "path-to-regexp": "^8.4.2", + "sanitize-filename": "^1.6.4", + "schemastery": "^3.18.0", "shorty.js": "^1.0.1", - "ws": "^8.19.0" + "ws": "^8.20.0" }, "devDependencies": { "@types/fs-extra": "^11.0.4", - "@types/koa": "^3.0.1", + "@types/koa": "^3.0.2", "@types/koa-compress": "^4.0.7", "@types/koa__router": "^12.0.5", "@types/ws": "^8.18.1" diff --git a/framework/utils/package.json b/framework/utils/package.json index 4e94b2219..2cba1edcf 100644 --- a/framework/utils/package.json +++ b/framework/utils/package.json @@ -14,7 +14,7 @@ }, "dependencies": { "@hydrooj/register": "workspace:^", - "cac": "^6.7.14", + "cac": "^7.0.0", "fs-extra": "^11.3.4", "js-yaml": "^4.1.1", "reggol": "^2.1.0", diff --git a/package.json b/package.json index 2ecf3d91d..f6f53e8c3 100644 --- a/package.json +++ b/package.json @@ -38,25 +38,25 @@ "@types/node": "24.10.13", "@types/semver": "^7.7.1", "autocannon": "^8.0.0", - "cac": "^6.7.14", + "cac": "^7.0.0", "chai": "^6.2.2", "cross-env": "^10.1.0", "cross-spawn": "^7.0.6", "esbuild": "0.25.2", - "eslint": "^9.39.3", + "eslint": "^9.39.4", "eslint-import-resolver-typescript": "^4.4.4", - "eslint-import-resolver-webpack": "^0.13.10", - "fs-extra": "^11.3.3", - "globals": "^17.3.0", + "eslint-import-resolver-webpack": "^0.13.11", + "fs-extra": "^11.3.4", + "globals": "^17.4.0", "globby": "~14.0.2", "inspectpack": "^4.7.1", "mongodb-memory-server": "11.0.1", - "nyc": "^17.1.0", + "nyc": "^18.0.0", "ora": "^9.3.0", - "oxlint": "^1.50.0", + "oxlint": "^1.58.0", "package-json": "^10.0.1", "semver": "^7.7.4", - "simple-git": "^3.32.3", + "simple-git": "^3.33.0", "supertest": "^7.2.2", "supports-hyperlinks": "^4.4.0", "typescript": "5.8.3", diff --git a/packages/components/frontend/ConfigEditor.tsx b/packages/components/frontend/ConfigEditor.tsx index 50a98305e..2f6d25979 100644 --- a/packages/components/frontend/ConfigEditor.tsx +++ b/packages/components/frontend/ConfigEditor.tsx @@ -109,7 +109,7 @@ function MonacoContainer({ } model.pushEditOperations([], ops, undefined); }, [editor, config]); - return
; + return
; } export default function ConfigEditor({ diff --git a/packages/components/package.json b/packages/components/package.json index 3cdd5e688..679603ace 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -9,9 +9,9 @@ ], "dependencies": { "allotment": "^1.20.5", - "diff": "^8.0.3", + "diff": "^8.0.4", "js-yaml": "^4.1.1", - "lodash": "^4.17.23", + "lodash": "^4.18.1", "react-dnd": "^16.0.1", "react-dnd-html5-backend": "^16.0.1", "react-toastify": "^11.0.5", @@ -21,7 +21,7 @@ "@types/diff": "^8.0.0", "@types/js-yaml": "^4.0.9", "@types/lodash": "^4.17.24", - "sass": "^1.97.3" + "sass": "^1.99.0" }, "peerDependencies": { "react": "*", diff --git a/packages/elastic/index.ts b/packages/elastic/index.ts index 77b0bfe27..ba40afe62 100644 --- a/packages/elastic/index.ts +++ b/packages/elastic/index.ts @@ -91,7 +91,7 @@ export default class ElasticSearchService extends Service { return true; } - async [Context.init]() { + async [Service.init]() { await this.client.nodes.stats(); this.ctx.on('problem/add', async (doc, docId) => { await this.client.index({ diff --git a/packages/geoip/package.json b/packages/geoip/package.json index e1000fe5a..6e1d29d54 100644 --- a/packages/geoip/package.json +++ b/packages/geoip/package.json @@ -6,7 +6,7 @@ "author": "undefined ", "license": "AGPL-3.0-or-later", "dependencies": { - "maxmind": "^5.0.5" + "maxmind": "^5.0.6" }, "preferUnplugged": true } diff --git a/packages/hydrojudge/package.json b/packages/hydrojudge/package.json index 089220e4b..f18205e4f 100644 --- a/packages/hydrojudge/package.json +++ b/packages/hydrojudge/package.json @@ -11,9 +11,9 @@ "@opentelemetry/api": "^1.9.1", "@opentelemetry/exporter-trace-otlp-http": "^0.214.0", "@opentelemetry/sdk-node": "^0.214.0", - "@zip.js/zip.js": "^2.8.23", - "cac": "^6.7.14", - "p-queue": "^9.1.0", + "@zip.js/zip.js": "^2.8.26", + "cac": "^7.0.0", + "p-queue": "^9.1.1", "schemastery": "^3.18.0", "semver": "^7.7.4", "shell-quote": "^1.8.3", diff --git a/packages/hydrooj/package.json b/packages/hydrooj/package.json index 580d7a8bf..27414f2e2 100644 --- a/packages/hydrooj/package.json +++ b/packages/hydrooj/package.json @@ -17,6 +17,7 @@ "@aws-sdk/s3-presigned-post": "3.726.1", "@aws-sdk/s3-request-presigner": "3.726.1", "@babel/code-frame": "^7.29.0", + "@cordisjs/plugin-logger": "^1.0.1", "@cordisjs/plugin-timer": "1.1.1", "@hydrooj/common": "workspace:^", "@hydrooj/framework": "workspace:^", @@ -24,29 +25,29 @@ "@mongodb-js/saslprep": "^1.4.6", "@simplewebauthn/server": "13.2.2", "@undefined-moe/require-resolve-hook": "^1.1.0", - "@zip.js/zip.js": "^2.8.21", + "@zip.js/zip.js": "^2.8.26", "adm-zip": "0.5.16", - "cac": "^6.7.14", - "cordis": "4.0.0-beta.5", - "csv-stringify": "^6.6.0", + "cac": "^7.0.0", + "cordis": "4.0.0-rc.0", + "csv-stringify": "^6.7.0", "emoji-regex": "^10.6.0", "emojis-list": "2.1.0", - "fs-extra": "^11.3.3", + "fs-extra": "^11.3.4", "js-yaml": "^4.1.1", "koa-proxies": "^0.12.4", "koa-static-cache": "^5.1.4", - "lodash": "^4.17.23", - "lru-cache": "^11.2.6", + "lodash": "^4.18.1", + "lru-cache": "^11.2.7", "mime-types": "^3.0.2", - "moment-timezone": "^0.6.0", - "mongodb": "^7.1.0", + "moment-timezone": "^0.6.1", + "mongodb": "^7.1.1", "mongodb-uri": "^0.9.7", - "nanoid": "^5.1.6", - "nodemailer": "^8.0.1", + "nanoid": "^5.1.7", + "nodemailer": "^8.0.4", "notp": "^2.0.3", - "p-queue": "^9.1.0", - "sanitize-filename": "^1.6.3", - "schemastery": "^3.17.2", + "p-queue": "^9.1.1", + "sanitize-filename": "^1.6.4", + "schemastery": "^3.18.0", "semver": "^7.7.4", "shorty.js": "^1.0.1", "superagent": "^10.3.0", @@ -55,7 +56,7 @@ "ua-parser-js": "1.0.41" }, "devDependencies": { - "@types/adm-zip": "^0.5.7", + "@types/adm-zip": "^0.5.8", "@types/babel__code-frame": "^7.27.0", "@types/fs-extra": "^11.0.4", "@types/js-yaml": "^4.0.9", @@ -68,7 +69,7 @@ "@types/semver": "^7.7.1", "@types/superagent": "^8.1.9", "@types/ua-parser-js": "^0.7.39", - "chokidar": "^4.0.3", + "chokidar": "^5.0.0", "moment": "^2.30.1" } } diff --git a/packages/hydrooj/src/model/oauth.ts b/packages/hydrooj/src/model/oauth.ts index 19b0671e3..3651626ce 100644 --- a/packages/hydrooj/src/model/oauth.ts +++ b/packages/hydrooj/src/model/oauth.ts @@ -48,7 +48,7 @@ export default class OauthModel extends Service { this.coll = ctx.db.collection('oauth'); } - async [Context.init]() { + async [Service.init]() { await this.ctx.db.ensureIndexes(this.coll, { key: { platform: 1, id: 1 }, name: 'platform_id', unique: true }, { key: { uid: 1, platform: 1 }, name: 'uid_platform' }, diff --git a/packages/hydrooj/src/service/db.ts b/packages/hydrooj/src/service/db.ts index f4904bd6d..a1dac420e 100644 --- a/packages/hydrooj/src/service/db.ts +++ b/packages/hydrooj/src/service/db.ts @@ -55,7 +55,7 @@ export class MongoService extends Service { return mongourl; } - async *[Context.init]() { + async *[Service.init]() { const mongourl = await MongoService.getUrl(); const url = mongoUri.parse(mongourl); this.client = await MongoClient.connect(mongourl); diff --git a/packages/hydrooj/src/settings.ts b/packages/hydrooj/src/settings.ts index edd47f333..62d8c4113 100644 --- a/packages/hydrooj/src/settings.ts +++ b/packages/hydrooj/src/settings.ts @@ -44,7 +44,7 @@ export class SettingService extends Service { super(ctx, 'setting'); } - async [Context.init]() { + async [Service.init]() { const payload = await this.ctx.db.collection('system').find({}).toArray(); this.initialValues = Object.fromEntries(payload.map((v) => [v._id, v.value])); return await this.loadConfig(); diff --git a/packages/migrate/package.json b/packages/migrate/package.json index c3837a679..871a4b745 100644 --- a/packages/migrate/package.json +++ b/packages/migrate/package.json @@ -8,8 +8,8 @@ "dependencies": { "bcryptjs": "^3.0.3", "mariadb": "3.4.5", - "mongodb": "^7.1.0", - "turndown": "^7.2.2", + "mongodb": "^7.1.1", + "turndown": "^7.2.4", "xml2js": "^0.6.2" }, "devDependencies": { diff --git a/packages/onsite-toolkit/package.json b/packages/onsite-toolkit/package.json index 8866cd6d2..dd21c391e 100644 --- a/packages/onsite-toolkit/package.json +++ b/packages/onsite-toolkit/package.json @@ -4,7 +4,7 @@ "repository": "https://github.com/hydro-dev/Hydro", "dependencies": { "@react-spring/web": "^10.0.3", - "lru-cache": "^11.2.6", + "lru-cache": "^11.2.7", "react-use": "^17.6.0" } } diff --git a/packages/sonic/index.ts b/packages/sonic/index.ts index 7f51fa267..bc7d88a5c 100644 --- a/packages/sonic/index.ts +++ b/packages/sonic/index.ts @@ -51,7 +51,7 @@ export class SonicService extends Service { super(ctx, 'sonic'); } - *[Context.init]() { + *[Service.init]() { this.search = new Search(this.config); this.ingest = new Ingest(this.config); this.search.connect(getHandler('search', this)); diff --git a/packages/ui-default/backendlib/template.ts b/packages/ui-default/backendlib/template.ts index 4a8ddcdf6..30d2079f0 100644 --- a/packages/ui-default/backendlib/template.ts +++ b/packages/ui-default/backendlib/template.ts @@ -4,13 +4,15 @@ import { findFileSync, getAlphabeticId } from '@hydrooj/utils/lib/utils'; import { avatar, Context, difficultyAlgorithm, fs, PERM, PRIV, Service, STATUS, yaml, } from 'hydrooj'; +import { cac } from 'cac'; import { convert } from 'html-to-text'; import jsesc from 'jsesc'; import nunjucks from 'nunjucks'; import markdown from './markdown'; import { ensureTag, xss } from './markdown-it-xss'; import * as misc from './misc'; -const argv = require('cac')().parse(); + +const argv = cac().parse(); let { template } = argv.options; if (!template || typeof template !== 'string') template = findFileSync('@hydrooj/ui-default/templates'); @@ -251,7 +253,7 @@ export class TemplateService extends Service { }); } - async [Context.init]() { + async [Service.init]() { const pending = Object.values(global.addons); const logger = this.ctx.logger('template'); for (const i of pending) { diff --git a/packages/ui-default/package.json b/packages/ui-default/package.json index 6b5a61da7..38b42aebf 100644 --- a/packages/ui-default/package.json +++ b/packages/ui-default/package.json @@ -20,11 +20,11 @@ "@fontsource/source-code-pro": "^5.2.7", "@fontsource/ubuntu-mono": "^5.2.8", "@hydrooj/utils": "workspace:^", - "@mantine/core": "^8.3.15", - "@mantine/hooks": "^8.3.15", - "@mantine/notifications": "^8.3.15", - "@sentry/browser": "^10.40.0", - "@sentry/webpack-plugin": "^4.9.1", + "@mantine/core": "^9.0.0", + "@mantine/hooks": "^9.0.0", + "@mantine/notifications": "^9.0.0", + "@sentry/browser": "^10.47.0", + "@sentry/webpack-plugin": "^5.1.1", "@simplewebauthn/browser": "13.2.2", "@svgr/webpack": "^8.1.0", "@types/html-to-text": "^9.0.4", @@ -42,26 +42,26 @@ "@types/uuid": "^11.0.0", "@types/webpack-env": "^1.18.8", "@vavt/cm-extension": "^1.11.2", - "@vscode/codicons": "^0.0.44", + "@vscode/codicons": "^0.0.45", "ajv": "^8.18.0", "allotment": "^1.20.5", - "autoprefixer": "^10.4.24", + "autoprefixer": "^10.4.27", "browser-update": "^3.3.63", "chalk": "^5.6.2", "classnames": "^2.5.1", "clean-webpack-plugin": "^4.0.0", "clipboard": "^2.0.11", - "copy-webpack-plugin": "^13.0.1", - "cordis": "4.0.0-beta.5", - "core-js": "^3.48.0", - "core-js-compat": "^3.48.0", + "copy-webpack-plugin": "^14.0.0", + "cordis": "4.0.0-rc.0", + "core-js": "^3.49.0", + "core-js-compat": "^3.49.0", "css-loader": "^7.1.4", - "diff": "^8.0.3", + "diff": "^8.0.4", "diff-dom": "^5.2.1", "echarts": "^6.0.0", "emojis-keywords": "2.0.0", "emojis-list": "2.1.0", - "esbuild-loader": "^4.4.2", + "esbuild-loader": "^4.4.3", "flatpickr": "^4.6.13", "idb": "^8.0.3", "jquery": "^3.7.1", @@ -69,18 +69,18 @@ "jquery.transit": "^0.9.12", "mantine-contextmenu": "^8.3.13", "matchmedia-polyfill": "^0.3.2", - "md-editor-rt": "^6.3.1", - "mini-css-extract-plugin": "^2.10.0", + "md-editor-rt": "^6.4.1", + "mini-css-extract-plugin": "^2.10.2", "moment": "^2.30.1", "monaco-editor": "0.52.2", "monaco-editor-nls": "^3.1.0", "monaco-editor-webpack-plugin": "^7.1.1", "monaco-themes": "0.4.7", - "monaco-yaml": "5.1.1", - "nanoid": "^5.1.6", + "monaco-yaml": "5.4.1", + "nanoid": "^5.1.7", "normalize.css": "^8.0.1", "nprogress": "^0.2.0", - "p-queue": "^9.1.0", + "p-queue": "^9.1.1", "pickadate": "patch:pickadate@npm%3A3.6.4#~/.yarn/patches/pickadate-npm-3.6.4-5795acb19d.patch", "postcss-loader": "7.3.4", "postcss-preset-mantine": "^1.18.0", @@ -101,9 +101,9 @@ "redux-promise-middleware": "^6.2.0", "redux-thunk": "^3.1.0", "rupture": "^0.7.1", - "sass": "^1.97.3", + "sass": "^1.99.0", "sass-loader": "^16.0.7", - "schemastery": "^3.17.2", + "schemastery": "^3.18.0", "shorty.js": "^1.0.1", "slideout": "^1.0.1", "sticky-kit": "^1.1.3", @@ -115,10 +115,10 @@ "tether-drop": "^1.4.2", "timeago-react": "^3.0.7", "timeago.js": "^4.0.2", - "ts-loader": "^9.5.4", + "ts-loader": "^9.5.7", "web-streams-polyfill": "^4.2.0", - "webpack": "^5.105.3", - "webpack-bundle-analyzer": "^5.2.0", + "webpack": "^5.105.4", + "webpack-bundle-analyzer": "^5.3.0", "webpack-dev-server": "^5.2.3", "webpack-manifest-plugin": "^6.0.1", "webpackbar": "^7.0.0" @@ -128,12 +128,12 @@ "ansi_up": "^6.0.6", "cssfilter": "^0.0.11", "esbuild": "0.25.2", - "fs-extra": "^11.3.3", + "fs-extra": "^11.3.4", "html-to-text": "^9.0.5", "js-yaml": "^4.1.1", "jsesc": "^3.1.0", - "katex": "^0.16.33", - "lodash": "^4.17.23", + "katex": "^0.16.44", + "lodash": "^4.18.1", "markdown-it": "^14.1.1", "markdown-it-anchor": "^9.2.0", "markdown-it-attrs": "^4.3.1", @@ -141,7 +141,7 @@ "markdown-it-imsize": "^2.0.1", "markdown-it-mark": "^4.0.0", "markdown-it-merge-cells": "^2.0.0", - "markdown-it-table-of-contents": "^1.1.0", + "markdown-it-table-of-contents": "^1.2.0", "nunjucks": "^3.2.4", "schemastery-jsonschema": "^1.1.1", "streamsaver": "^2.0.6", diff --git a/packages/ui-next/package.json b/packages/ui-next/package.json index 9d90899d3..6a04b84a4 100644 --- a/packages/ui-next/package.json +++ b/packages/ui-next/package.json @@ -8,14 +8,14 @@ "preview": "vite preview" }, "dependencies": { - "@vitejs/plugin-react": "^5.1.4", + "@vitejs/plugin-react": "^6.0.1", "react": "^19.2.4", "react-dom": "^19.2.4" }, "devDependencies": { "@types/react": "^19.2.14", "@types/react-dom": "^19.2.3", - "@vitejs/plugin-react-swc": "^4.2.3", - "vite": "^8.0.0-beta.16" + "@vitejs/plugin-react-swc": "^4.3.0", + "vite": "^8.0.3" } } diff --git a/packages/vjudge/package.json b/packages/vjudge/package.json index de95449b6..0588d6ee9 100644 --- a/packages/vjudge/package.json +++ b/packages/vjudge/package.json @@ -9,12 +9,12 @@ "preferUnplugged": true, "dependencies": { "@hydrooj/utils": "workspace:^", - "jsdom": "^28.1.0", + "jsdom": "^29.0.1", "superagent-charset": "^1.2.0", "superagent-proxy": "^3.0.0" }, "devDependencies": { - "@types/jsdom": "^27.0.0", + "@types/jsdom": "^28.0.1", "@types/superagent-proxy": "^3.0.4" } } diff --git a/packages/vjudge/src/index.ts b/packages/vjudge/src/index.ts index 283cda16d..3fe20fb80 100644 --- a/packages/vjudge/src/index.ts +++ b/packages/vjudge/src/index.ts @@ -191,7 +191,7 @@ class VJudgeService extends Service { accounts: RemoteAccount[] = []; private providers: Record = {}; private pool: Record = {}; - async [Context.init]() { + async [Service.init]() { if (process.env.NODE_APP_INSTANCE !== '0') return; if (process.env.HYDRO_CLI) return; this.accounts = await coll.find().toArray();