upgrade to typescript@5.6 and cordis@3.18

This commit is contained in:
undefined committed 2024-10-02 08:33:52 +08:00
1 parent c3953a3ce7
commit 30e95b4511
22 files changed
+52 -46

No files matched your search

+3 -3
View File
@@ -5,13 +5,13 @@
"main": "react.yaml",
"dependencies": {
"@stylistic/eslint-plugin": "^2.8.0",
"@typescript-eslint/eslint-plugin": "^8.7.0",
"@typescript-eslint/parser": "^8.7.0",
"@typescript-eslint/eslint-plugin": "^8.8.0",
"@typescript-eslint/parser": "^8.8.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-plugin-github": "^5.0.2",
"eslint-plugin-import": "2.30.0",
"eslint-plugin-jsx-a11y": "^6.10.0",
"eslint-plugin-react": "^7.36.1",
"eslint-plugin-react": "^7.37.1",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-simple-import-sort": "^12.1.1"
},
+1 -1
View File
@@ -16,7 +16,7 @@
"koa-router": "^13.0.1",
"lodash": "^4.17.21",
"moment-timezone": "^0.5.45",
"path-to-regexp": "^8.1.0",
"path-to-regexp": "^8.2.0",
"sanitize-filename": "^1.6.3",
"saslprep": "^1.0.3",
"shorty.js": "^1.0.1",
+8 -5
View File
@@ -23,6 +23,8 @@ import serializer from './serializer';
export { WebSocket, WebSocketServer } from 'ws';
const kHandler = Symbol.for('hydro.handler');
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent
export function encodeRFC5987ValueChars(str: string) {
return (
@@ -109,6 +111,7 @@ export interface UserModel {
export interface HandlerCommon { }
export class HandlerCommon {
static [kHandler] = true;
session: Record<string, any>;
args: Record<string, any>;
request: HydroRequest;
@@ -316,6 +319,7 @@ interface WebServiceConfig {
cors?: string;
upload?: string;
port: number;
host?: string;
xff?: string;
xhost?: string;
}
@@ -446,7 +450,7 @@ ${c.response.status} ${endTime - startTime}ms ${c.response.length}`);
wsServer.close();
});
await new Promise((r) => {
httpServer.listen(this.config.port, () => {
httpServer.listen(this.config.port, this.config.host || '127.0.0.1', () => {
logger.success('Server listening at: %d', this.config.port);
r(true);
});
@@ -596,7 +600,7 @@ ${c.response.status} ${endTime - startTime}ms ${c.response.length}`);
private register(type: 'route' | 'conn', routeName: string, path: string, HandlerClass: any, ...permPrivChecker) {
const name = HandlerClass.name;
if (!isClass(HandlerClass)) throw new Error('Invalid registration.');
if (!HandlerClass?.[kHandler] || !isClass(HandlerClass)) throw new Error('Invalid registration.');
if (this.registrationCount[name] && this.registry[name] !== HandlerClass) {
logger.warn('Route with name %s already exists.', name);
}
@@ -625,10 +629,9 @@ ${c.response.status} ${endTime - startTime}ms ${c.response.length}`);
) {
if (this.registry[name]) callback(this.registry[name]);
// @ts-ignore
this.ctx.on(`handler/register/${name}`, callback);
const dispose = this.ctx.on(`handler/register/${name}`, callback);
this[Context.current]?.on('dispose', () => {
// @ts-ignore
this.ctx.off(`handler/register/${name}`, callback);
dispose();
});
}
+1 -1
View File
@@ -7,7 +7,7 @@
"node": ">=16"
},
"dependencies": {
"esbuild": "0.23.0",
"esbuild": "0.24.0",
"source-map-support": "^0.5.21"
},
"devDependencies": {