mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 09:46:28 +08:00
workspace: upgrade deps & sort imports
This commit is contained in:
1 parent
336432cc4f
commit
8b30a9218b
115 files changed
+1534
-628
No files matched your search
@@ -1,8 +1,8 @@
|
||||
import path from 'path';
|
||||
import fs from 'fs-extra';
|
||||
import cac from 'cac';
|
||||
import { Logger } from './log';
|
||||
import fs from 'fs-extra';
|
||||
import { getConfig } from './config';
|
||||
import { Logger } from './log';
|
||||
|
||||
const argv = cac().parse();
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import fs from 'fs-extra';
|
||||
import path from 'path';
|
||||
import fs from 'fs-extra';
|
||||
import yaml from 'js-yaml';
|
||||
import { max, sum } from 'lodash';
|
||||
import readYamlCases, { convertIniConfig } from '@hydrooj/utils/lib/cases';
|
||||
import { changeErrorType } from '@hydrooj/utils/lib/utils';
|
||||
import { FormatError, SystemError } from './error';
|
||||
import { parseTimeMS, parseMemoryMB, ensureFile } from './utils';
|
||||
import { getConfig } from './config';
|
||||
import { FormatError, SystemError } from './error';
|
||||
import { ensureFile, parseMemoryMB, parseTimeMS } from './utils';
|
||||
|
||||
interface Re0 {
|
||||
reg: RegExp,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/* eslint-disable no-template-curly-in-string */
|
||||
import { SystemError } from './error';
|
||||
import { run } from './sandbox';
|
||||
import * as STATUS from './status';
|
||||
import { parse } from './testlib';
|
||||
import { run } from './sandbox';
|
||||
import { SystemError } from './error';
|
||||
|
||||
interface CheckResult {
|
||||
status: number,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { LangConfig } from '@hydrooj/utils/lib/lang';
|
||||
import * as STATUS from './status';
|
||||
import { run, del } from './sandbox';
|
||||
import { CompileError } from './error';
|
||||
import { compilerText } from './utils';
|
||||
import { Execute } from './interface';
|
||||
import { del, run } from './sandbox';
|
||||
import * as STATUS from './status';
|
||||
import { compilerText } from './utils';
|
||||
|
||||
export = async function compile(
|
||||
lang: LangConfig, code: string, target: string, copyIn: any = {}, next?: Function,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* eslint-disable prefer-const */
|
||||
import cac from 'cac';
|
||||
import os from 'os';
|
||||
import path from 'path';
|
||||
import cac from 'cac';
|
||||
import fs from 'fs-extra';
|
||||
import yaml from 'js-yaml';
|
||||
|
||||
|
||||
@@ -12,10 +12,10 @@
|
||||
`-.__ 听取人生经验。 __.-'
|
||||
````- - -.......- - -''' ~
|
||||
~ */
|
||||
import * as Session from './hosts/index';
|
||||
import { sleep, Queue } from './utils';
|
||||
import { getConfig } from './config';
|
||||
import * as Session from './hosts/index';
|
||||
import log from './log';
|
||||
import { Queue, sleep } from './utils';
|
||||
|
||||
declare global {
|
||||
namespace NodeJS {
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
/* eslint-disable no-await-in-loop */
|
||||
import path from 'path';
|
||||
import axios from 'axios';
|
||||
import fs from 'fs-extra';
|
||||
import WebSocket from 'ws';
|
||||
import PQueue from 'p-queue';
|
||||
import cac from 'cac';
|
||||
import fs from 'fs-extra';
|
||||
import { noop } from 'lodash';
|
||||
import { ObjectID } from 'mongodb';
|
||||
import PQueue from 'p-queue';
|
||||
import WebSocket from 'ws';
|
||||
import { LangConfig } from '@hydrooj/utils/lib/lang';
|
||||
import * as tmpfs from '../tmpfs';
|
||||
import readCases from '../cases';
|
||||
import { getConfig } from '../config';
|
||||
import { CompileError, FormatError, SystemError } from '../error';
|
||||
import judge from '../judge';
|
||||
import log from '../log';
|
||||
import { STATUS_COMPILE_ERROR, STATUS_SYSTEM_ERROR } from '../status';
|
||||
import * as sysinfo from '../sysinfo';
|
||||
import * as tmpfs from '../tmpfs';
|
||||
import {
|
||||
compilerText, Lock, md5, Queue,
|
||||
} from '../utils';
|
||||
import { getConfig } from '../config';
|
||||
import { FormatError, CompileError, SystemError } from '../error';
|
||||
import { STATUS_COMPILE_ERROR, STATUS_SYSTEM_ERROR } from '../status';
|
||||
import readCases from '../cases';
|
||||
import judge from '../judge';
|
||||
import * as sysinfo from '../sysinfo';
|
||||
|
||||
const argv = cac().parse();
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import Queue from 'p-queue';
|
||||
import path from 'path';
|
||||
import fs from 'fs-extra';
|
||||
import * as STATUS from '../status';
|
||||
import { CompileError, SystemError } from '../error';
|
||||
import { parseFilename } from '../utils';
|
||||
import { run } from '../sandbox';
|
||||
import compile from '../compile';
|
||||
import signals from '../signals';
|
||||
import Queue from 'p-queue';
|
||||
import { check, compileChecker } from '../check';
|
||||
import compile from '../compile';
|
||||
import { getConfig } from '../config';
|
||||
import { CompileError, SystemError } from '../error';
|
||||
import { run } from '../sandbox';
|
||||
import signals from '../signals';
|
||||
import * as STATUS from '../status';
|
||||
import { parseFilename } from '../utils';
|
||||
|
||||
const Score = {
|
||||
sum: (a: number, b: number) => (a + b),
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
// Not implemented
|
||||
import path from 'path';
|
||||
import fs from 'fs-extra';
|
||||
import * as STATUS from '../status';
|
||||
import { CompileError } from '../error';
|
||||
import { copyInDir, parseFilename } from '../utils';
|
||||
import { run } from '../sandbox';
|
||||
import compile from '../compile';
|
||||
import signals from '../signals';
|
||||
import { check, compileChecker } from '../check';
|
||||
import compile from '../compile';
|
||||
import { CompileError } from '../error';
|
||||
import { run } from '../sandbox';
|
||||
import signals from '../signals';
|
||||
import * as STATUS from '../status';
|
||||
import { copyInDir, parseFilename } from '../utils';
|
||||
|
||||
export const judge = async (ctx) => {
|
||||
if (ctx.config.template) {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import * as def from './default';
|
||||
import * as hack from './hack';
|
||||
import * as interactive from './interactive';
|
||||
import * as run from './run';
|
||||
import * as submit_answer from './submit_answer';
|
||||
import * as hack from './hack';
|
||||
|
||||
export = {
|
||||
default: def, interactive, run, submit_answer, hack, objective: submit_answer,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import Queue from 'p-queue';
|
||||
import fs from 'fs-extra';
|
||||
import Queue from 'p-queue';
|
||||
import compile from '../compile';
|
||||
import { getConfig } from '../config';
|
||||
import { run } from '../sandbox';
|
||||
import signals from '../signals';
|
||||
import * as STATUS from '../status';
|
||||
import { parse } from '../testlib';
|
||||
import { findFileSync, parseFilename } from '../utils';
|
||||
import { run } from '../sandbox';
|
||||
import compile from '../compile';
|
||||
import signals from '../signals';
|
||||
import { getConfig } from '../config';
|
||||
|
||||
const testlibSrc = findFileSync('@hydrooj/hydrojudge/vendor/testlib/testlib.h');
|
||||
const Score = {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import fs from 'fs-extra';
|
||||
import path from 'path';
|
||||
import * as STATUS from '../status';
|
||||
import { run } from '../sandbox';
|
||||
import fs from 'fs-extra';
|
||||
import compile from '../compile';
|
||||
import signals from '../signals';
|
||||
import { compilerText, parseMemoryMB, parseTimeMS } from '../utils';
|
||||
import { CompileError } from '../error';
|
||||
import { run } from '../sandbox';
|
||||
import signals from '../signals';
|
||||
import * as STATUS from '../status';
|
||||
import { compilerText, parseMemoryMB, parseTimeMS } from '../utils';
|
||||
|
||||
export const judge = async (ctx) => {
|
||||
ctx.stat.judge = new Date();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { inspect, InspectOptions, format } from 'util';
|
||||
import { format, inspect, InspectOptions } from 'util';
|
||||
import cac from 'cac';
|
||||
|
||||
const argv = cac().parse();
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import Axios from 'axios';
|
||||
import fs from 'fs-extra';
|
||||
import cac from 'cac';
|
||||
import * as STATUS from './status';
|
||||
import { FormatError, SystemError } from './error';
|
||||
import { cmd, parseMemoryMB } from './utils';
|
||||
import fs from 'fs-extra';
|
||||
import { getConfig } from './config';
|
||||
import { FormatError, SystemError } from './error';
|
||||
import { Logger } from './log';
|
||||
import * as STATUS from './status';
|
||||
import { cmd, parseMemoryMB } from './utils';
|
||||
|
||||
const argv = cac().parse();
|
||||
const logger = new Logger('sandbox');
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
// Hydro Integration
|
||||
/* eslint-disable no-await-in-loop */
|
||||
import 'hydrooj';
|
||||
|
||||
import path from 'path';
|
||||
import { ObjectID } from 'mongodb';
|
||||
import fs from 'fs-extra';
|
||||
import { noop } from 'lodash';
|
||||
import { ObjectID } from 'mongodb';
|
||||
import { Logger } from 'hydrooj/src/logger';
|
||||
import * as monitor from 'hydrooj/src/service/monitor';
|
||||
import * as sysinfo from './sysinfo';
|
||||
import * as tmpfs from './tmpfs';
|
||||
import { FormatError, CompileError, SystemError } from './error';
|
||||
import { STATUS_COMPILE_ERROR, STATUS_SYSTEM_ERROR } from './status';
|
||||
import { compilerText, md5 } from './utils';
|
||||
import readCases from './cases';
|
||||
import { getConfig } from './config';
|
||||
import { CompileError, FormatError, SystemError } from './error';
|
||||
import { STATUS_COMPILE_ERROR, STATUS_SYSTEM_ERROR } from './status';
|
||||
import * as sysinfo from './sysinfo';
|
||||
import * as tmpfs from './tmpfs';
|
||||
import { compilerText, md5 } from './utils';
|
||||
|
||||
declare module 'hydrooj/src/interface' {
|
||||
interface SystemKeys {
|
||||
|
||||
@@ -2,9 +2,9 @@ import path from 'path';
|
||||
import fs from 'fs-extra';
|
||||
import { noop } from 'lodash';
|
||||
import { get as _get } from '@hydrooj/utils/lib/sysinfo';
|
||||
import { getConfig } from './config';
|
||||
import { judge } from './judge/run';
|
||||
import * as tmpfs from './tmpfs';
|
||||
import { getConfig } from './config';
|
||||
|
||||
export { update } from '@hydrooj/utils/lib/sysinfo';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import child from 'child_process';
|
||||
import fs from 'fs-extra';
|
||||
import os from 'os';
|
||||
import fs from 'fs-extra';
|
||||
import log from './log';
|
||||
|
||||
const linux = os.platform() === 'linux';
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import fs from 'fs-extra';
|
||||
import crypto from 'crypto';
|
||||
import path from 'path';
|
||||
import { parse } from 'shell-quote';
|
||||
import _ from 'lodash';
|
||||
import { EventEmitter } from 'events';
|
||||
import path from 'path';
|
||||
import fs from 'fs-extra';
|
||||
import _ from 'lodash';
|
||||
import { parse } from 'shell-quote';
|
||||
import { sleep } from '@hydrooj/utils/lib/utils';
|
||||
import { FormatError } from './error';
|
||||
|
||||
|
||||
Reference in new issue
Block a user