Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/http-transport/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"@nmtjs/common": "workspace:*",
"@nmtjs/gateway": "workspace:*",
"@nmtjs/protocol": "workspace:*",
"@nmtjs/server": "workspace:*",
"@nmtjs/server-host": "workspace:*",
"uWebSockets.js": "github:uNetworking/uWebSockets.js#v20.67.0"
},
"peerDependencies": {
Expand All @@ -63,7 +63,7 @@
"@nmtjs/core": "workspace:*",
"@nmtjs/gateway": "workspace:*",
"@nmtjs/protocol": "workspace:*",
"@nmtjs/server": "workspace:*",
"@nmtjs/server-host": "workspace:*",
"@types/bun": "^1.3.0",
"@types/deno": "^2.3.0",
"@types/node": "^24.13.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/http-transport/src/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type {
ServerHost,
ServerHostOptions,
ServerRuntimeName,
} from '@nmtjs/server'
} from '@nmtjs/server-host'

import type { HttpAdapterParams, HttpAdapterServer } from './types.ts'

Expand Down
4 changes: 2 additions & 2 deletions packages/http-transport/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import type { MetadataKind } from '@nmtjs/application'
import { createMeta } from '@nmtjs/application'
import { ErrorCode } from '@nmtjs/protocol'

// Single source in @nmtjs/server: the host enforces the same default bound
export { DEFAULT_MAX_REQUEST_BODY_SIZE } from '@nmtjs/server'
// Single source in @nmtjs/server-host: the host enforces the same default bound
export { DEFAULT_MAX_REQUEST_BODY_SIZE } from '@nmtjs/server-host'

export enum HttpStatus {
Continue = 100,
Expand Down
2 changes: 1 addition & 1 deletion packages/http-transport/src/runtimes/bun.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { ApplicationTransport } from '@nmtjs/application'
import type { ConnectionType } from '@nmtjs/protocol'
import { ProxyableTransportType } from '@nmtjs/gateway'
import { createServerHost } from '@nmtjs/server/bun'
import { createServerHost } from '@nmtjs/server-host/bun'

import type { HttpAdapterParams, HttpTransportOptions } from '../types.ts'
import { createHostAdapter } from '../adapter.ts'
Expand Down
2 changes: 1 addition & 1 deletion packages/http-transport/src/runtimes/deno.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { ApplicationTransport } from '@nmtjs/application'
import type { ConnectionType } from '@nmtjs/protocol'
import { ProxyableTransportType } from '@nmtjs/gateway'
import { createServerHost } from '@nmtjs/server/deno'
import { createServerHost } from '@nmtjs/server-host/deno'

import type { HttpAdapterParams, HttpTransportOptions } from '../types.ts'
import { createHostAdapter } from '../adapter.ts'
Expand Down
2 changes: 1 addition & 1 deletion packages/http-transport/src/runtimes/node.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { ApplicationTransport } from '@nmtjs/application'
import type { ConnectionType } from '@nmtjs/protocol'
import { ProxyableTransportType } from '@nmtjs/gateway'
import { createServerHost } from '@nmtjs/server/node'
import { createServerHost } from '@nmtjs/server-host/node'

import type { HttpAdapterParams, HttpTransportOptions } from '../types.ts'
import { createHostAdapter } from '../adapter.ts'
Expand Down
2 changes: 1 addition & 1 deletion packages/http-transport/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type {
ServerRuntimeName,
ServerRuntimeOptions,
ServerTlsOptions,
} from '@nmtjs/server'
} from '@nmtjs/server-host'

export type { DenoServer }

Expand Down
4 changes: 2 additions & 2 deletions packages/http-transport/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { ErrorCode } from '@nmtjs/protocol'
import { ProtocolError } from '@nmtjs/protocol/server'

// Response helpers and PayloadTooLargeError live in @nmtjs/server: the
// Response helpers and PayloadTooLargeError live in @nmtjs/server-host: the
// runtime hosts throw/build them, and instanceof matching in this package
// requires the same class identity
export {
InternalServerErrorHttpResponse,
NotFoundHttpResponse,
OkResponse,
PayloadTooLargeError,
} from '@nmtjs/server'
} from '@nmtjs/server-host'

export const InternalError = (message = 'Internal Server Error') =>
new ProtocolError(ErrorCode.InternalServerError, message)
Expand Down
2 changes: 1 addition & 1 deletion packages/neem/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"@nmtjs/metrics": "workspace:*",
"@nmtjs/protocol": "workspace:*",
"@nmtjs/proxy": "1.0.0-beta.7",
"@nmtjs/server": "workspace:*",
"@nmtjs/server-host": "workspace:*",
"@nmtjs/ws-transport": "workspace:*",
"@types/node": "^24.13.2",
"uWebSockets.js": "github:uNetworking/uWebSockets.js#v20.67.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { HttpTransport } from '@nmtjs/http-transport/node'
import { JsonFormat } from '@nmtjs/json-format/server'
import { defineRuntimeWorker } from '@nmtjs/neem'
import { ProtocolFormats } from '@nmtjs/protocol/server'
import { createServerHost } from '@nmtjs/server/node'
import { createServerHost } from '@nmtjs/server-host/node'
import { WsTransport } from '@nmtjs/ws-transport/node'

import { record } from '../../shared/support/_events.ts'
Expand Down
2 changes: 1 addition & 1 deletion packages/server/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@nmtjs/server",
"name": "@nmtjs/server-host",
"description": "Shared HTTP server host for Neemata transports across runtimes.",
"type": "module",
"exports": {
Expand Down
4 changes: 2 additions & 2 deletions packages/ws-transport/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"@nmtjs/http-transport": "workspace:*",
"@nmtjs/json-format": "workspace:*",
"@nmtjs/protocol": "workspace:*",
"@nmtjs/server": "workspace:*",
"@nmtjs/server-host": "workspace:*",
"@nmtjs/type": "workspace:*",
"@nmtjs/ws-client": "workspace:*",
"uWebSockets.js": "github:uNetworking/uWebSockets.js#v20.67.0"
Expand All @@ -71,7 +71,7 @@
"@nmtjs/core": "workspace:*",
"@nmtjs/gateway": "workspace:*",
"@nmtjs/protocol": "workspace:*",
"@nmtjs/server": "workspace:*",
"@nmtjs/server-host": "workspace:*",
"@types/bun": "^1.3.0",
"@types/deno": "^2.3.0",
"@types/node": "^24.13.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/ws-transport/src/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type {
ServerHost,
ServerHostOptions,
ServerRuntimeName,
} from '@nmtjs/server'
} from '@nmtjs/server-host'

import type { WsAdapterParams, WsAdapterServer } from './types.ts'

Expand Down
2 changes: 1 addition & 1 deletion packages/ws-transport/src/runtimes/bun.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { ApplicationTransport } from '@nmtjs/application'
import type { ConnectionType } from '@nmtjs/protocol'
import { ProxyableTransportType } from '@nmtjs/gateway'
import { createServerHost } from '@nmtjs/server/bun'
import { createServerHost } from '@nmtjs/server-host/bun'

import type { WsAdapterParams, WsTransportOptions } from '../types.ts'
import { createHostAdapter } from '../adapter.ts'
Expand Down
2 changes: 1 addition & 1 deletion packages/ws-transport/src/runtimes/deno.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { ApplicationTransport } from '@nmtjs/application'
import type { ConnectionType } from '@nmtjs/protocol'
import { ProxyableTransportType } from '@nmtjs/gateway'
import { createServerHost } from '@nmtjs/server/deno'
import { createServerHost } from '@nmtjs/server-host/deno'

import type { WsAdapterParams, WsTransportOptions } from '../types.ts'
import { createHostAdapter } from '../adapter.ts'
Expand Down
4 changes: 2 additions & 2 deletions packages/ws-transport/src/runtimes/node.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { ApplicationTransport } from '@nmtjs/application'
import type { ConnectionType } from '@nmtjs/protocol'
import { ProxyableTransportType } from '@nmtjs/gateway'
import { createServerHost } from '@nmtjs/server/node'
import { createServerHost } from '@nmtjs/server-host/node'

import type { WsAdapterParams, WsTransportOptions } from '../types.ts'
import { createHostAdapter } from '../adapter.ts'
Expand All @@ -14,7 +14,7 @@ export {
DEFAULT_WS_MAX_BACKPRESSURE,
DEFAULT_WS_MAX_PAYLOAD,
resolveUwsWsOptions,
} from '@nmtjs/server/node'
} from '@nmtjs/server-host/node'

function adapterFactory(params: WsAdapterParams<'node'>) {
return createHostAdapter(createServerHost, params)
Expand Down
2 changes: 1 addition & 1 deletion packages/ws-transport/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type {
ServerRuntimeOptions,
ServerTlsOptions,
ServerWebSocketRuntimeOptions,
} from '@nmtjs/server'
} from '@nmtjs/server-host'
import type { Hooks } from 'crossws'

export type WsTransportServerRequest = ServerRequest
Expand Down
4 changes: 2 additions & 2 deletions packages/ws-transport/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { ErrorCode } from '@nmtjs/protocol'
import { ProtocolError } from '@nmtjs/protocol/server'

// Response helpers live in @nmtjs/server, shared by every runtime host
// Response helpers live in @nmtjs/server-host, shared by every runtime host
export {
InternalServerErrorHttpResponse,
NotFoundHttpResponse,
OkResponse as StatusResponse,
} from '@nmtjs/server'
} from '@nmtjs/server-host'

export const InternalError = (message = 'Internal Server Error') =>
new ProtocolError(ErrorCode.InternalServerError, message)
Expand Down
2 changes: 1 addition & 1 deletion packages/ws-transport/tests/shared-server.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { HttpTransport } from '@nmtjs/http-transport/node'
import { createServerHost } from '@nmtjs/server/node'
import { createServerHost } from '@nmtjs/server-host/node'
import { describe, expect, it, vi } from 'vitest'

import { WsTransport } from '../src/runtimes/node.ts'
Expand Down
2 changes: 1 addition & 1 deletion packages/ws-transport/tests/stream-e2e.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type {
TransportWorker,
} from '@nmtjs/gateway'
import type { ConnectionType } from '@nmtjs/protocol'
import type { ServerWebSocketRuntimeOptions } from '@nmtjs/server'
import type { ServerWebSocketRuntimeOptions } from '@nmtjs/server-host'
import { RuntimeClient } from '@nmtjs/client'
import { blobType, c } from '@nmtjs/contract'
import { Container, createLogger, Hooks } from '@nmtjs/core'
Expand Down
6 changes: 3 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading