core: fix js-yaml options

This commit is contained in:
undefined committed 2026-07-25 11:25:38 +00:00
1 parent 2f99407669
commit 591dbd31c0
9 files changed
+25 -29

No files matched your search

+3 -3
View File
@@ -22,7 +22,7 @@
"@hydrooj/common": "workspace:^",
"@hydrooj/framework": "workspace:^",
"@hydrooj/utils": "workspace:^",
"@mongodb-js/saslprep": "^1.4.12",
"@mongodb-js/saslprep": "^1.4.13",
"@simplewebauthn/server": "13.2.2",
"@undefined-moe/require-resolve-hook": "^1.1.0",
"@zip.js/zip.js": "^2.8.34",
@@ -32,8 +32,8 @@
"csv-stringify": "^6.8.1",
"emoji-regex": "^10.6.0",
"emojis-list": "2.1.0",
"fs-extra": "^11.3.6",
"js-yaml": "^5.2.1",
"fs-extra": "^11.4.0",
"js-yaml": "^5.2.2",
"koa-proxies": "^0.12.4",
"koa-static-cache": "^5.1.4",
"lodash": "^4.18.1",
+2 -2
View File
@@ -113,10 +113,10 @@ ${padEnd(formatSeconds(Math.floor((Date.now() - i.pm2_env.pm_uptime) / 1000), fa
infoDetails['now'] = new Date().toISOString();
infos['now'] = new Date().toISOString();
logger.info('System info:');
console.log(yaml.dump(infos, { noCompatMode: true, noArrayIndent: true, lineWidth: process.stdout.columns || 80 }));
console.log(yaml.dump(infos, { schema: yaml.CORE_SCHEMA, seqNoIndent: true, lineWidth: process.stdout.columns || 80 }));
logger.info('Uploading detail to pastebin...');
const tmpFile = path.join(tmpdir(), 'report.yaml');
fs.writeFileSync(tmpFile, yaml.dump(infoDetails, { noArrayIndent: true, lineWidth: 300 }));
fs.writeFileSync(tmpFile, yaml.dump(infoDetails, { seqNoIndent: true, lineWidth: 300 }));
if (process.env.VSCODE_INJECTION) {
try {
child.exec(`code ${tmpFile}`);
+2 -6
View File
@@ -1,4 +1,5 @@
import { dump } from 'js-yaml';
import { cloneDeepWith } from 'lodash';
import superagent from 'superagent';
import type { StatusUpdate } from '@hydrooj/utils/lib/sysinfo';
import * as sysinfo from '@hydrooj/utils/lib/sysinfo';
@@ -55,12 +56,7 @@ export async function feedback(): Promise<[string, StatusUpdate]> {
info.dbVersion = status.version;
} catch (e) { }
await bus.serial('monitor/collect', info);
const payload = dump(info, {
replacer: (key, value) => {
if (typeof value === 'function') return '';
return value;
},
});
const payload = dump(cloneDeepWith(info, (value) => typeof value === 'function' ? '' : undefined));
if (process.env.CI) return [mid, $update];
superagent.post(`${system.get('server.center')}/report`)
.send({ installId, payload })