mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
core: fix js-yaml options
This commit is contained in:
1 parent
2f99407669
commit
591dbd31c0
9 files changed
+25
-29
No files matched your search
@@ -10,12 +10,12 @@
|
||||
"dependencies": {
|
||||
"@hydrooj/utils": "workspace:^",
|
||||
"@koa/router": "^15.7.0",
|
||||
"@mongodb-js/saslprep": "^1.4.12",
|
||||
"@mongodb-js/saslprep": "^1.4.13",
|
||||
"emoji-regex": "^10.6.0",
|
||||
"fs-extra": "^11.3.6",
|
||||
"fs-extra": "^11.4.0",
|
||||
"koa": "^3.2.1",
|
||||
"koa-body": "^8.0.0",
|
||||
"koa-compress": "5.2.1",
|
||||
"koa-compress": "5.2.2",
|
||||
"path-to-regexp": "^8.4.2",
|
||||
"sanitize-filename": "^1.6.4",
|
||||
"schemastery": "^3.18.0",
|
||||
|
||||
@@ -15,11 +15,11 @@
|
||||
"dependencies": {
|
||||
"@hydrooj/register": "workspace:^",
|
||||
"cac": "^7.0.0",
|
||||
"fs-extra": "^11.3.6",
|
||||
"js-yaml": "^5.2.1",
|
||||
"fs-extra": "^11.4.0",
|
||||
"js-yaml": "^5.2.2",
|
||||
"reggol": "^2.1.0",
|
||||
"search-query-parser": "^1.6.0",
|
||||
"systeminformation": "^5.33.0"
|
||||
"systeminformation": "^5.33.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/fs-extra": "^11.0.4"
|
||||
|
||||
+1
-1
@@ -48,7 +48,7 @@
|
||||
"eslint": "^9.39.5",
|
||||
"eslint-import-resolver-typescript": "^4.4.5",
|
||||
"eslint-import-resolver-webpack": "^0.13.11",
|
||||
"fs-extra": "^11.3.6",
|
||||
"fs-extra": "^11.4.0",
|
||||
"globals": "^17.7.0",
|
||||
"globby": "~14.0.2",
|
||||
"inspectpack": "^4.7.1",
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"dependencies": {
|
||||
"allotment": "^1.20.5",
|
||||
"diff": "^9.0.0",
|
||||
"js-yaml": "^5.2.1",
|
||||
"js-yaml": "^5.2.2",
|
||||
"lodash": "^4.18.1",
|
||||
"react-dnd": "^16.0.1",
|
||||
"react-dnd-html5-backend": "^16.0.1",
|
||||
@@ -21,7 +21,7 @@
|
||||
"@types/diff": "^8.0.0",
|
||||
"@types/js-yaml": "^4.0.9",
|
||||
"@types/lodash": "^4.17.24",
|
||||
"sass": "^1.101.4"
|
||||
"sass": "^1.101.7"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "*",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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}`);
|
||||
|
||||
@@ -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 })
|
||||
|
||||
@@ -98,7 +98,7 @@ export default connect(mapStateToProps, mapDispatchToProps)(class MonacoEditor e
|
||||
async componentDidMount() {
|
||||
const { monaco } = await load(['yaml']);
|
||||
const uri = monaco.Uri.parse('hydro://problem/file/config.yaml');
|
||||
this.model = monaco.editor.createModel(yaml.dump(configYamlFormat(this.props.config), { noArrayIndent: true }), 'yaml', uri);
|
||||
this.model = monaco.editor.createModel(yaml.dump(configYamlFormat(this.props.config), { seqNoIndent: true }), 'yaml', uri);
|
||||
this.vjEditor = Editor.getOrConstruct($(this.containerElement), {
|
||||
language: 'yaml',
|
||||
model: this.model,
|
||||
@@ -114,7 +114,7 @@ export default connect(mapStateToProps, mapDispatchToProps)(class MonacoEditor e
|
||||
|
||||
componentDidUpdate(prevProps) {
|
||||
if (this.__preventUpdate || !this.model || !this.props.config.__valid) return;
|
||||
if (yaml.dump(prevProps.config, { noArrayIndent: true }) === yaml.dump(this.props.config, { noArrayIndent: true })) return;
|
||||
if (yaml.dump(prevProps.config, { seqNoIndent: true }) === yaml.dump(this.props.config, { seqNoIndent: true })) return;
|
||||
const curValue = this.model.getValue();
|
||||
const pending = configYamlFormat(this.props.config);
|
||||
try {
|
||||
@@ -122,7 +122,7 @@ export default connect(mapStateToProps, mapDispatchToProps)(class MonacoEditor e
|
||||
if (isEqual(curConfig, pending)) return;
|
||||
} catch { }
|
||||
this.__preventFormat = true;
|
||||
const diff = diffLines(curValue, yaml.dump(pending, { noArrayIndent: true }));
|
||||
const diff = diffLines(curValue, yaml.dump(pending, { seqNoIndent: true }));
|
||||
const ops = [];
|
||||
let cursor = 1;
|
||||
for (const line of diff) {
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
"@mantine/core": "^9.4.2",
|
||||
"@mantine/hooks": "^9.4.2",
|
||||
"@mantine/notifications": "^9.4.2",
|
||||
"@sentry/browser": "^10.67.0",
|
||||
"@sentry/browser": "^10.68.0",
|
||||
"@sentry/webpack-plugin": "^5.4.0",
|
||||
"@simplewebauthn/browser": "13.2.2",
|
||||
"@svgr/webpack": "^8.1.0",
|
||||
@@ -60,7 +60,7 @@
|
||||
"echarts": "^6.1.0",
|
||||
"emojis-keywords": "2.0.0",
|
||||
"emojis-list": "2.1.0",
|
||||
"esbuild-loader": "^4.4.3",
|
||||
"esbuild-loader": "^4.5.0",
|
||||
"flatpickr": "^4.6.13",
|
||||
"idb": "^8.0.3",
|
||||
"jquery": "^3.7.1",
|
||||
@@ -99,7 +99,7 @@
|
||||
"redux-promise-middleware": "^6.2.0",
|
||||
"redux-thunk": "^3.1.0",
|
||||
"rupture": "^0.7.1",
|
||||
"sass": "^1.101.4",
|
||||
"sass": "^1.101.7",
|
||||
"sass-loader": "^16.0.8",
|
||||
"schemastery": "^3.18.0",
|
||||
"shorty.js": "^1.0.1",
|
||||
@@ -114,7 +114,7 @@
|
||||
"timeago.js": "^4.0.2",
|
||||
"ts-loader": "^9.6.2",
|
||||
"web-streams-polyfill": "^4.3.0",
|
||||
"webpack": "^5.108.4",
|
||||
"webpack": "^5.109.0",
|
||||
"webpack-bundle-analyzer": "^5.3.1",
|
||||
"webpack-dev-server": "^6.0.0",
|
||||
"webpack-manifest-plugin": "^6.0.1",
|
||||
@@ -125,9 +125,9 @@
|
||||
"ansi_up": "^6.0.6",
|
||||
"cssfilter": "^0.0.11",
|
||||
"esbuild": "0.25.2",
|
||||
"fs-extra": "^11.3.6",
|
||||
"fs-extra": "^11.4.0",
|
||||
"html-to-text": "^10.0.0",
|
||||
"js-yaml": "^5.2.1",
|
||||
"js-yaml": "^5.2.2",
|
||||
"jsesc": "^3.1.0",
|
||||
"katex": "^0.18.1",
|
||||
"lodash": "^4.18.1",
|
||||
|
||||
Reference in new issue
Block a user