mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
enable experimentalDecorators for esbuild
This commit is contained in:
7 files changed
+9
-5
No files matched your search
@@ -107,7 +107,9 @@ class SystemScriptHandler extends SystemHandler {
|
||||
}
|
||||
const rid = await record.add(domainId, -1, this.user._id, '-', id, false, { input: raw, type: 'pretest' });
|
||||
const rdoc = await record.get(rid);
|
||||
const report = (data) => judge.next({ domainId, rid, ...data,rdoc });
|
||||
const report = (data) => judge.next({
|
||||
domainId, rid, ...data, rdoc,
|
||||
});
|
||||
report({ message: `Running script: ${id} `, status: STATUS.STATUS_JUDGING });
|
||||
const start = Date.now();
|
||||
// Maybe async?
|
||||
|
||||
@@ -396,7 +396,7 @@ export function Connection(
|
||||
for (const { name, target } of h.__subscribe || []) disposables.push(bus.on(name, target.bind(h)));
|
||||
let lastHeartbeat = Date.now();
|
||||
let closed = false;
|
||||
let interval: NodeJS.Timer;
|
||||
let interval: NodeJS.Timeout;
|
||||
const clean = () => {
|
||||
if (closed) return;
|
||||
closed = true;
|
||||
|
||||
@@ -47,6 +47,7 @@ const federationPlugin: esbuild.Plugin = {
|
||||
|
||||
const build = async (contents: string) => {
|
||||
const res = await esbuild.build({
|
||||
tsconfigRaw: '{"compilerOptions":{"experimentalDecorators":true}}',
|
||||
format: 'iife' as 'iife',
|
||||
bundle: true,
|
||||
outdir: tmp,
|
||||
|
||||
@@ -2,7 +2,7 @@ import ReconnectingWebSocket from 'reconnecting-websocket';
|
||||
|
||||
export default class Sock {
|
||||
sock: ReconnectingWebSocket;
|
||||
interval: NodeJS.Timer;
|
||||
interval: number;
|
||||
|
||||
constructor(public url: string, nocookie = false) {
|
||||
const i = new URL(url, window.location.href);
|
||||
|
||||
@@ -126,7 +126,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"ansi_up": "^6.0.2",
|
||||
"esbuild": "^0.19.7",
|
||||
"esbuild": "0.19.7",
|
||||
"fs-extra": "^11.1.1",
|
||||
"js-yaml": "^4.1.0",
|
||||
"jsesc": "^3.0.2",
|
||||
|
||||
@@ -26,6 +26,7 @@ const minor = +process.version.split('.')[1];
|
||||
function transform(filename) {
|
||||
const code = fs.readFileSync(filename, 'utf-8');
|
||||
const result = esbuild.transformSync(code, {
|
||||
tsconfigRaw: '{"compilerOptions":{"experimentalDecorators":true}}',
|
||||
sourcefile: filename,
|
||||
sourcemap: 'both',
|
||||
format: 'cjs',
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
"preferUnplugged": true,
|
||||
"dependencies": {
|
||||
"cac": "^6.7.14",
|
||||
"esbuild": "^0.19.7",
|
||||
"esbuild": "0.19.7",
|
||||
"fs-extra": "^11.1.1",
|
||||
"js-yaml": "^4.1.0",
|
||||
"moment-timezone": "^0.5.43",
|
||||
|
||||
Reference in new issue
Block a user