fix: build
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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,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
-6
@@ -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()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user