@yume-chan/adb-server-node-tcp
Advanced tools
Comparing version 0.0.23 to 0.0.24
@@ -5,2 +5,8 @@ { | ||
{ | ||
"version": "0.0.24", | ||
"tag": "@yume-chan/adb-server-node-tcp_v0.0.24", | ||
"date": "Tue, 18 Jun 2024 02:49:43 GMT", | ||
"comments": {} | ||
}, | ||
{ | ||
"version": "0.0.23", | ||
@@ -7,0 +13,0 @@ "tag": "@yume-chan/adb-server-node-tcp_v0.0.23", |
# Change Log - @yume-chan/adb-server-node-tcp | ||
This log was last generated on Thu, 21 Mar 2024 03:15:10 GMT and should not be manually modified. | ||
This log was last generated on Tue, 18 Jun 2024 02:49:43 GMT and should not be manually modified. | ||
## 0.0.24 | ||
Tue, 18 Jun 2024 02:49:43 GMT | ||
_Version update only_ | ||
## 0.0.23 | ||
@@ -6,0 +11,0 @@ Thu, 21 Mar 2024 03:15:10 GMT |
/// <reference types="node" resolution-mode="require"/> | ||
import type { SocketConnectOpts } from "net"; | ||
import type { AdbIncomingSocketHandler, AdbServerConnection, AdbServerConnectionOptions, AdbServerConnector } from "@yume-chan/adb"; | ||
import type { AdbIncomingSocketHandler, AdbServerClient } from "@yume-chan/adb"; | ||
import type { ValueOrPromise } from "@yume-chan/struct"; | ||
export declare class AdbServerNodeTcpConnector implements AdbServerConnector { | ||
export declare class AdbServerNodeTcpConnector implements AdbServerClient.ServerConnector { | ||
#private; | ||
readonly spec: SocketConnectOpts; | ||
constructor(spec: SocketConnectOpts); | ||
connect({ unref }?: AdbServerConnectionOptions): Promise<AdbServerConnection>; | ||
connect({ unref }?: AdbServerClient.ServerConnectionOptions): Promise<AdbServerClient.ServerConnection>; | ||
addReverseTunnel(handler: AdbIncomingSocketHandler, address?: string): Promise<string>; | ||
@@ -11,0 +11,0 @@ removeReverseTunnel(address: string): ValueOrPromise<void>; |
import { Server, Socket } from "net"; | ||
import { PushReadableStream, UnwrapConsumableStream, WrapWritableStream, WritableStream, } from "@yume-chan/stream-extra"; | ||
import { MaybeConsumable, PushReadableStream, WrapWritableStream, WritableStream, } from "@yume-chan/stream-extra"; | ||
function nodeSocketToConnection(socket) { | ||
@@ -76,3 +76,3 @@ socket.setNoDelay(true); | ||
readable: connection.readable, | ||
writable: new WrapWritableStream(connection.writable).bePipedThroughFrom(new UnwrapConsumableStream()), | ||
writable: new WrapWritableStream(connection.writable).bePipedThroughFrom(new MaybeConsumable.UnwrapStream()), | ||
get closed() { | ||
@@ -99,3 +99,3 @@ return connection.closed; | ||
else { | ||
throw new Error(`Unsupported protocol ${url.protocol}`); | ||
throw new TypeError(`Unsupported protocol ${url.protocol}`); | ||
} | ||
@@ -102,0 +102,0 @@ } |
{ | ||
"name": "@yume-chan/adb-server-node-tcp", | ||
"version": "0.0.23", | ||
"version": "0.0.24", | ||
"description": "ADB server connector for `@yume-chan/adb` using Node.js' `net` module", | ||
@@ -30,15 +30,13 @@ "keywords": [ | ||
"dependencies": { | ||
"@yume-chan/adb": "^0.0.23", | ||
"@yume-chan/stream-extra": "^0.0.23", | ||
"@yume-chan/struct": "^0.0.23", | ||
"tslib": "^2.6.2" | ||
"@yume-chan/adb": "^0.0.24", | ||
"@yume-chan/stream-extra": "^0.0.24", | ||
"@yume-chan/struct": "^0.0.24" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^20.11.28", | ||
"@types/node": "^20.14.2", | ||
"@yume-chan/eslint-config": "^1.0.0", | ||
"@yume-chan/tsconfig": "^1.0.0", | ||
"eslint": "^8.57.0", | ||
"jest": "^30.0.0-alpha.3", | ||
"prettier": "^3.2.5", | ||
"typescript": "^5.4.2" | ||
"jest": "^30.0.0-alpha.4", | ||
"prettier": "^3.3.2", | ||
"typescript": "^5.4.5" | ||
}, | ||
@@ -48,4 +46,4 @@ "scripts": { | ||
"build:watch": "tsc -b tsconfig.build.json", | ||
"lint": "eslint src/**/*.ts --fix" | ||
"lint": "run-eslint && prettier src/**/*.ts --write --tab-width 4" | ||
} | ||
} |
import type { AddressInfo, SocketConnectOpts } from "net"; | ||
import { Server, Socket } from "net"; | ||
import type { | ||
AdbIncomingSocketHandler, | ||
AdbServerConnection, | ||
AdbServerConnectionOptions, | ||
AdbServerConnector, | ||
} from "@yume-chan/adb"; | ||
import type { AdbIncomingSocketHandler, AdbServerClient } from "@yume-chan/adb"; | ||
import { | ||
MaybeConsumable, | ||
PushReadableStream, | ||
UnwrapConsumableStream, | ||
WrapWritableStream, | ||
@@ -18,3 +13,5 @@ WritableStream, | ||
function nodeSocketToConnection(socket: Socket): AdbServerConnection { | ||
function nodeSocketToConnection( | ||
socket: Socket, | ||
): AdbServerClient.ServerConnection { | ||
socket.setNoDelay(true); | ||
@@ -68,3 +65,5 @@ | ||
export class AdbServerNodeTcpConnector implements AdbServerConnector { | ||
export class AdbServerNodeTcpConnector | ||
implements AdbServerClient.ServerConnector | ||
{ | ||
readonly spec: SocketConnectOpts; | ||
@@ -79,4 +78,4 @@ | ||
async connect( | ||
{ unref }: AdbServerConnectionOptions = { unref: false }, | ||
): Promise<AdbServerConnection> { | ||
{ unref }: AdbServerClient.ServerConnectionOptions = { unref: false }, | ||
): Promise<AdbServerClient.ServerConnection> { | ||
const socket = new Socket(); | ||
@@ -107,3 +106,3 @@ if (unref) { | ||
connection.writable, | ||
).bePipedThroughFrom(new UnwrapConsumableStream()), | ||
).bePipedThroughFrom(new MaybeConsumable.UnwrapStream()), | ||
get closed() { | ||
@@ -128,3 +127,3 @@ return connection.closed; | ||
} else { | ||
throw new Error(`Unsupported protocol ${url.protocol}`); | ||
throw new TypeError(`Unsupported protocol ${url.protocol}`); | ||
} | ||
@@ -131,0 +130,0 @@ } else { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
72026
3
6
333
+ Added@yume-chan/adb@0.0.24(transitive)
+ Added@yume-chan/event@0.0.24(transitive)
+ Added@yume-chan/no-data-view@0.0.24(transitive)
+ Added@yume-chan/stream-extra@0.0.24(transitive)
+ Added@yume-chan/struct@0.0.24(transitive)
- Removedtslib@^2.6.2
- Removed@yume-chan/adb@0.0.23(transitive)
- Removed@yume-chan/dataview-bigint-polyfill@0.0.23(transitive)
- Removed@yume-chan/event@0.0.23(transitive)
- Removed@yume-chan/stream-extra@0.0.23(transitive)
- Removed@yume-chan/struct@0.0.23(transitive)
Updated@yume-chan/adb@^0.0.24
Updated@yume-chan/struct@^0.0.24