mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
w: 编译提速
This commit is contained in:
1 parent
6c6a0df0f0
commit
d037560f91
5 files changed
+8
-7
No files matched your search
+2
-1
@@ -58,9 +58,10 @@ for (const package of packages) {
|
|||||||
}
|
}
|
||||||
fs.writeFileSync(path.resolve(process.cwd(), 'tsconfig.json'), JSON.stringify(config));
|
fs.writeFileSync(path.resolve(process.cwd(), 'tsconfig.json'), JSON.stringify(config));
|
||||||
|
|
||||||
|
child.execSync('./node_modules/.bin/tsc -b packages/hydrooj', { stdio: 'inherit' });
|
||||||
|
|
||||||
if (argv.watch) {
|
if (argv.watch) {
|
||||||
child.execSync('./node_modules/.bin/tsc -b --watch', { stdio: 'inherit' });
|
child.execSync('./node_modules/.bin/tsc -b --watch', { stdio: 'inherit' });
|
||||||
} else {
|
} else {
|
||||||
child.execSync('cd packages/hydrooj && yarn build', { stdio: 'inherit' });
|
|
||||||
child.execSync('./node_modules/.bin/tsc -b', { stdio: 'inherit' });
|
child.execSync('./node_modules/.bin/tsc -b', { stdio: 'inherit' });
|
||||||
}
|
}
|
||||||
@@ -4,7 +4,7 @@ import xml2js from 'xml2js';
|
|||||||
import fs from 'fs-extra';
|
import fs from 'fs-extra';
|
||||||
import { filter } from 'lodash';
|
import { filter } from 'lodash';
|
||||||
import decodeHTML from 'decode-html';
|
import decodeHTML from 'decode-html';
|
||||||
import { LocalProblemConfig } from 'hydrooj';
|
import type { ProblemConfig } from 'hydrooj';
|
||||||
import {
|
import {
|
||||||
Route, Handler, param, Types,
|
Route, Handler, param, Types,
|
||||||
} from 'hydrooj/dist/service/server';
|
} from 'hydrooj/dist/service/server';
|
||||||
@@ -31,7 +31,7 @@ class FpsProblemImportHandler extends Handler {
|
|||||||
: [],
|
: [],
|
||||||
hint: p.hint,
|
hint: p.hint,
|
||||||
}, 'html', this.translate.bind(this));
|
}, 'html', this.translate.bind(this));
|
||||||
const config: LocalProblemConfig = {
|
const config: ProblemConfig = {
|
||||||
time: p.time_limit[0]._ + p.time_limit[0].$.unit,
|
time: p.time_limit[0]._ + p.time_limit[0].$.unit,
|
||||||
memory: p.memory_limit[0]._ + p.memory_limit[0].$.unit,
|
memory: p.memory_limit[0]._ + p.memory_limit[0].$.unit,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/fps-importer",
|
"name": "@hydrooj/fps-importer",
|
||||||
"version": "1.1.4",
|
"version": "1.1.5",
|
||||||
"description": "Import FPS problems",
|
"description": "Import FPS problems",
|
||||||
"main": "package.json",
|
"main": "package.json",
|
||||||
"repository": "https://github.com/hydro-dev/Hydro.git",
|
"repository": "https://github.com/hydro-dev/Hydro.git",
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import os from 'os';
|
|||||||
import fs from 'fs-extra';
|
import fs from 'fs-extra';
|
||||||
import AdmZip from 'adm-zip';
|
import AdmZip from 'adm-zip';
|
||||||
import yaml from 'js-yaml';
|
import yaml from 'js-yaml';
|
||||||
import { ContentNode, LocalProblemConfig } from 'hydrooj';
|
import type { ContentNode, ProblemConfig } from 'hydrooj';
|
||||||
import { Route, Handler } from 'hydrooj/dist/service/server';
|
import { Route, Handler } from 'hydrooj/dist/service/server';
|
||||||
import storage from 'hydrooj/dist/service/storage';
|
import storage from 'hydrooj/dist/service/storage';
|
||||||
import { BadRequestError, ValidationError } from 'hydrooj/dist/error';
|
import { BadRequestError, ValidationError } from 'hydrooj/dist/error';
|
||||||
@@ -76,7 +76,7 @@ class ImportQduojHandler extends Handler {
|
|||||||
const n = await problem.get(domainId, pdoc.display_id);
|
const n = await problem.get(domainId, pdoc.display_id);
|
||||||
if (n) pdoc.display_id = null;
|
if (n) pdoc.display_id = null;
|
||||||
const pid = await problem.add(domainId, pdoc.display_id, pdoc.title, content, this.user._id, pdoc.tags);
|
const pid = await problem.add(domainId, pdoc.display_id, pdoc.title, content, this.user._id, pdoc.tags);
|
||||||
const config: LocalProblemConfig = {
|
const config: ProblemConfig = {
|
||||||
time: `${pdoc.time_limit}ms`,
|
time: `${pdoc.time_limit}ms`,
|
||||||
memory: `${pdoc.memory_limit}m`,
|
memory: `${pdoc.memory_limit}m`,
|
||||||
subtasks: [],
|
subtasks: [],
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/import-qduoj",
|
"name": "@hydrooj/import-qduoj",
|
||||||
"version": "1.1.2",
|
"version": "1.1.3",
|
||||||
"description": "Import QDUOJ problem export",
|
"description": "Import QDUOJ problem export",
|
||||||
"main": "package.json",
|
"main": "package.json",
|
||||||
"repository": "https://github.com/hydro-dev/Hydro.git",
|
"repository": "https://github.com/hydro-dev/Hydro.git",
|
||||||
|
|||||||
Reference in new issue
Block a user