feat: use pnpm & lock core-js shim

This commit is contained in:
2023-10-25 11:29:01 +08:00
parent 5bf4b1c09e
commit 54eaae96bd
32 changed files with 444 additions and 178 deletions

View File

@@ -18,7 +18,7 @@
"scripts": {
"clean": "rimraf dist",
"watch": "tsc --watch",
"build": "yarn clean && tsc",
"build": "pnpm clean && tsc",
"test": "echo \"Error: run tests from root\" && exit 1"
},
"dependencies": {
@@ -28,9 +28,6 @@
},
"devDependencies": {
"@ccms/nashorn": "^0.28.0-beta.3",
"@javatypes/tomcat-websocket-api": "^0.0.3",
"reflect-metadata": "^0.1.13",
"rimraf": "^4.4.1",
"typescript": "^4.9.5"
"@javatypes/tomcat-websocket-api": "^0.0.3"
}
}

View File

@@ -9,7 +9,7 @@ export class WebSocketManager {
constructor() {
process.on('exit', () => {
for (const client of this.clients.values()) {
client.close(0, `client ${client.id} close connect`)
client.close(1000, `client ${client.id} close connect due process exit.`)
}
this.clients.clear()
})

View File

@@ -711,6 +711,7 @@ export class Socket extends Emitter<{}, {}, SocketReservedEvents> {
* @api private
*/
private resetPingTimeout() {
// @ts-ignore
this.clearTimeoutFn(this.pingTimeoutTimer)
this.pingTimeoutTimer = this.setTimeoutFn(() => {
this.onClose("ping timeout")
@@ -919,6 +920,7 @@ export class Socket extends Emitter<{}, {}, SocketReservedEvents> {
) {
debug('socket close with reason: "%s"', reason)
// @ts-ignore
// clear timers
this.clearTimeoutFn(this.pingTimeoutTimer)