fix: build

This commit is contained in:
Neko Ayaka
2025-03-21 02:43:35 +08:00
parent f3b93ab465
commit 900f72267b
5 changed files with 9 additions and 10 deletions
+1 -2
View File
@@ -1,7 +1,6 @@
import { Format, LogLevel, setGlobalFormat, setGlobalLogLevel } from '@guiiai/logg'
import { Client } from '@proj-airi/server-sdk'
import { runUntilSignal } from './utils/process'
import { runUntilSignal } from '@proj-airi/server-sdk/utils/node'
setGlobalFormat(Format.Pretty)
setGlobalLogLevel(LogLevel.Log)
+5
View File
@@ -19,6 +19,11 @@
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
},
"./utils/node": {
"types": "./dist/utils/node/index.d.ts",
"import": "./dist/utils/node/index.mjs",
"require": "./dist/utils/node/index.cjs"
}
},
"main": "./dist/index.cjs",
+1 -2
View File
@@ -1,5 +1,4 @@
import type { WebSocketBaseEvent, WebSocketEvent, WebSocketEvents } from '@proj-airi/server-shared/types'
import type { Blob } from 'node:buffer'
import WebSocket from 'crossws/websocket'
import { defu } from 'defu'
@@ -131,7 +130,7 @@ export class Client<C = undefined> {
this.websocket.send(JSON.stringify(data))
}
sendRaw(data: string | ArrayBufferLike | Blob | ArrayBufferView): void {
sendRaw(data: string | ArrayBufferLike | ArrayBufferView): void {
this.websocket.send(data)
}
}
@@ -0,0 +1 @@
export * from './process'
@@ -1,7 +1,4 @@
import process from 'node:process'
import { useLogg } from '@guiiai/logg'
const logger = useLogg('process').useGlobalConfig()
let running = true
@@ -10,15 +7,13 @@ function killProcess() {
}
process.on('SIGTERM', () => {
logger.log('SIGTERM received')
killProcess()
})
process.on('SIGINT', () => {
logger.log('SIGINT received')
killProcess()
})
process.on('uncaughtException', (e) => {
logger.withError(e).error('uncaught exception')
console.error(e)
killProcess()
})