From 4cf6aac436eb3276962361a631b644f763798fcd Mon Sep 17 00:00:00 2001 From: undefined Date: Wed, 18 Sep 2024 03:05:56 +0800 Subject: [PATCH] utils: fix locate-pm2 --- framework/eslint-config/package.json | 14 +++++++------- framework/framework/package.json | 4 ++-- package.json | 10 +++++++--- packages/elastic/package.json | 2 +- packages/hydrojudge/package.json | 2 +- packages/hydrooj/package.json | 10 +++++----- packages/ui-default/package.json | 24 ++++++++++++------------ packages/utils/lib/locate-pm2.ts | 3 +++ 8 files changed, 38 insertions(+), 31 deletions(-) diff --git a/framework/eslint-config/package.json b/framework/eslint-config/package.json index f20a98e8d..0a886527f 100644 --- a/framework/eslint-config/package.json +++ b/framework/eslint-config/package.json @@ -1,17 +1,17 @@ { "name": "@hydrooj/eslint-config", - "version": "1.1.0", + "version": "1.1.1", "license": "MIT", "main": "react.yaml", "dependencies": { - "@stylistic/eslint-plugin": "^2.7.2", - "@typescript-eslint/eslint-plugin": "^8.4.0", - "@typescript-eslint/parser": "^8.4.0", + "@stylistic/eslint-plugin": "^2.8.0", + "@typescript-eslint/eslint-plugin": "^8.6.0", + "@typescript-eslint/parser": "^8.6.0", "eslint-config-airbnb": "^19.0.4", - "eslint-plugin-github": "^5.0.1", - "eslint-plugin-import": "2.29.1", + "eslint-plugin-github": "^5.0.2", + "eslint-plugin-import": "2.30.0", "eslint-plugin-jsx-a11y": "^6.10.0", - "eslint-plugin-react": "^7.35.2", + "eslint-plugin-react": "^7.36.1", "eslint-plugin-react-hooks": "^4.6.2", "eslint-plugin-simple-import-sort": "^12.1.1" }, diff --git a/framework/framework/package.json b/framework/framework/package.json index 44bc11201..5f0c8813f 100644 --- a/framework/framework/package.json +++ b/framework/framework/package.json @@ -8,7 +8,7 @@ }, "dependencies": { "@hydrooj/utils": "workspace:^", - "emoji-regex": "^10.3.0", + "emoji-regex": "^10.4.0", "fs-extra": "^11.2.0", "koa": "^2.15.3", "koa-body": "^6.0.1", @@ -16,7 +16,7 @@ "koa-router": "^12.0.1", "lodash": "^4.17.21", "moment-timezone": "^0.5.45", - "path-to-regexp": "^7.1.0", + "path-to-regexp": "^7.2.0", "sanitize-filename": "^1.6.3", "saslprep": "^1.0.3", "shorty.js": "^1.0.1", diff --git a/package.json b/package.json index a52d257e2..3cfda0938 100644 --- a/package.json +++ b/package.json @@ -45,9 +45,9 @@ "cross-env": "^7.0.3", "cross-spawn": "^7.0.3", "esbuild": "0.23.0", - "eslint": "^8.57.0", + "eslint": "^8.57.1", "eslint-import-resolver-typescript": "^3.6.3", - "eslint-import-resolver-webpack": "^0.13.8", + "eslint-import-resolver-webpack": "^0.13.9", "fs-extra": "^11.2.0", "globby": "^14.0.2", "inspectpack": "^4.7.1", @@ -56,9 +56,13 @@ "ora": "^8.1.0", "package-json": "^10.0.1", "semver": "^7.6.3", - "simple-git": "^3.25.0", + "simple-git": "^3.26.0", "supertest": "^7.0.0", "typescript": "5.3.3", "wtfnode": "^0.9.3" + }, + "resolutions": { + "@cordisjs/logger": "0.3.2", + "reggol": "1.6.3" } } diff --git a/packages/elastic/package.json b/packages/elastic/package.json index 2e1626597..79cbee97d 100644 --- a/packages/elastic/package.json +++ b/packages/elastic/package.json @@ -6,6 +6,6 @@ "author": "undefined ", "license": "AGPL-3.0-or-later", "dependencies": { - "@elastic/elasticsearch": "^8.14.0" + "@elastic/elasticsearch": "^8.15.0" } } diff --git a/packages/hydrojudge/package.json b/packages/hydrojudge/package.json index 88d4ca974..3f047e91b 100644 --- a/packages/hydrojudge/package.json +++ b/packages/hydrojudge/package.json @@ -13,7 +13,7 @@ "schemastery": "^3.14.6", "semver": "^7.6.3", "shell-quote": "^1.8.1", - "superagent": "^9.0.2", + "superagent": "^10.1.0", "ws": "^8.18.0" }, "preferUnplugged": true, diff --git a/packages/hydrooj/package.json b/packages/hydrooj/package.json index 8c6945fe2..49abeee7b 100644 --- a/packages/hydrooj/package.json +++ b/packages/hydrooj/package.json @@ -12,10 +12,10 @@ }, "preferUnplugged": true, "dependencies": { - "@aws-sdk/client-s3": "3.645.0", - "@aws-sdk/lib-storage": "3.645.0", - "@aws-sdk/s3-presigned-post": "3.645.0", - "@aws-sdk/s3-request-presigner": "3.645.0", + "@aws-sdk/client-s3": "3.651.1", + "@aws-sdk/lib-storage": "3.651.1", + "@aws-sdk/s3-presigned-post": "3.651.1", + "@aws-sdk/s3-request-presigner": "3.651.1", "@graphql-tools/schema": "^10.0.6", "@hydrooj/framework": "workspace:^", "@hydrooj/utils": "workspace:^", @@ -49,7 +49,7 @@ "schemastery": "^3.14.6", "semver": "^7.6.3", "shorty.js": "^1.0.1", - "superagent": "^9.0.2", + "superagent": "^10.1.0", "tar": "6.2.1", "thirty-two": "^1.0.2" }, diff --git a/packages/ui-default/package.json b/packages/ui-default/package.json index 9bbf8b00d..842f99e4c 100644 --- a/packages/ui-default/package.json +++ b/packages/ui-default/package.json @@ -16,16 +16,16 @@ "devDependencies": { "@blueprintjs/core": "^5.12.0", "@cordisjs/core": "3.17.3", - "@fontsource/dm-mono": "^5.0.21", - "@fontsource/fira-code": "^5.0.19", - "@fontsource/inconsolata": "^5.0.19", - "@fontsource/jetbrains-mono": "^5.0.21", - "@fontsource/pt-mono": "^5.0.14", - "@fontsource/roboto-mono": "^5.0.19", - "@fontsource/source-code-pro": "^5.0.19", - "@fontsource/ubuntu-mono": "^5.0.21", + "@fontsource/dm-mono": "^5.1.0", + "@fontsource/fira-code": "^5.1.0", + "@fontsource/inconsolata": "^5.1.0", + "@fontsource/jetbrains-mono": "^5.1.0", + "@fontsource/pt-mono": "^5.1.0", + "@fontsource/roboto-mono": "^5.1.0", + "@fontsource/source-code-pro": "^5.1.0", + "@fontsource/ubuntu-mono": "^5.1.0", "@hydrooj/utils": "workspace:^", - "@sentry/browser": "^8.28.0", + "@sentry/browser": "^8.30.0", "@sentry/webpack-plugin": "^2.22.4", "@simplewebauthn/browser": "9.0.1", "@svgr/webpack": "^8.1.0", @@ -37,7 +37,7 @@ "@types/nunjucks": "^3.2.6", "@types/pickadate": "^3.5.35", "@types/qrcode": "^1.5.5", - "@types/react": "^18.3.5", + "@types/react": "^18.3.7", "@types/react-dom": "^18.3.0", "@types/redux-logger": "^3.0.13", "@types/uuid": "^10.0.0", @@ -69,7 +69,7 @@ "jquery.easing": "^1.4.1", "jquery.transit": "^0.9.12", "matchmedia-polyfill": "^0.3.2", - "md-editor-rt": "^4.19.2", + "md-editor-rt": "^4.20.1", "mini-css-extract-plugin": "^2.9.1", "moment": "^2.30.1", "monaco-editor": "0.50.0", @@ -131,7 +131,7 @@ "katex": "^0.16.11", "lodash": "^4.17.21", "markdown-it": "^14.1.0", - "markdown-it-anchor": "^9.1.0", + "markdown-it-anchor": "^9.2.0", "markdown-it-attrs": "^4.2.0", "markdown-it-footnote": "^4.0.0", "markdown-it-imsize": "^2.0.1", diff --git a/packages/utils/lib/locate-pm2.ts b/packages/utils/lib/locate-pm2.ts index 3e2ee58b0..402c7a238 100644 --- a/packages/utils/lib/locate-pm2.ts +++ b/packages/utils/lib/locate-pm2.ts @@ -3,12 +3,15 @@ import path from 'path'; const PATH = process.env.PATH?.split(':') || []; +/* eslint-disable import/no-dynamic-require */ // @ts-ignore const pm2: typeof import('pm2') | null = (() => { for (const dir of PATH) { try { const info = fs.readlinkSync(path.resolve(dir, 'pm2')); const p = path.resolve(dir, info); + if (p.startsWith('/nix')) return require(`${p.split('/bin')[0]}/lib/node_modules/pm2`); + // installed by yarn return require(`${p.split('.bin')[0]}pm2`); // eslint-disable-line import/no-dynamic-require } catch (e) { } }