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