utils: fix locate-pm2

This commit is contained in:
undefined committed 2024-09-18 03:05:56 +08:00
1 parent e521d00a03
commit 4cf6aac436
8 files changed
+38 -31

No files matched your search

+7 -7
View File
@@ -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"
},
+2 -2
View File
@@ -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",
+7 -3
View File
@@ -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"
}
}
+1 -1
View File
@@ -6,6 +6,6 @@
"author": "undefined <i@undefined.moe>",
"license": "AGPL-3.0-or-later",
"dependencies": {
"@elastic/elasticsearch": "^8.14.0"
"@elastic/elasticsearch": "^8.15.0"
}
}
+1 -1
View File
@@ -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,
+5 -5
View File
@@ -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"
},
+12 -12
View File
@@ -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",
+3
View File
@@ -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) { }
}