Skip to content

Commit

Permalink
chore: fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
Gasol committed Aug 14, 2024
1 parent e8a58f4 commit 0dec291
Show file tree
Hide file tree
Showing 99 changed files with 319 additions and 359 deletions.
2 changes: 1 addition & 1 deletion libraries/adb-credential-web/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// cspell: ignore RSASSA

import type { AdbCredentialStore, AdbPrivateKey } from "@yume-chan/adb";
import type { AdbCredentialStore, AdbPrivateKey } from "@gasol/adb";

function openDatabase() {
return new Promise<IDBDatabase>((resolve, reject) => {
Expand Down
17 changes: 8 additions & 9 deletions libraries/adb-daemon-webusb/src/device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@ import type {
AdbDaemonDevice,
AdbPacketData,
AdbPacketInit,
} from "@yume-chan/adb";
} from "@gasol/adb";
import {
AdbPacketHeader,
AdbPacketSerializeStream,
unreachable,
} from "@yume-chan/adb";
} from "@gasol/adb";
import type {
Consumable,
ReadableWritablePair,
WritableStream,
} from "@yume-chan/stream-extra";
} from "@gasol/stream-extra";
import {
DuplexStreamFactory,
MaybeConsumable,
ReadableStream,
pipeFrom,
} from "@yume-chan/stream-extra";
import type { ExactReadable } from "@yume-chan/struct";
import { EMPTY_UINT8_ARRAY } from "@yume-chan/struct";
} from "@gasol/stream-extra";
import type { ExactReadable } from "@gasol/struct";
import { EMPTY_UINT8_ARRAY } from "@gasol/struct";

import type { UsbInterfaceFilter } from "./utils.js";
import {
Expand Down Expand Up @@ -83,8 +83,7 @@ class Uint8ArrayExactReadable implements ExactReadable {
}

export class AdbDaemonWebUsbConnection
implements ReadableWritablePair<AdbPacketData, Consumable<AdbPacketInit>>
{
implements ReadableWritablePair<AdbPacketData, Consumable<AdbPacketInit>> {
#device: AdbDaemonWebUsbDevice;
get device() {
return this.#device;
Expand Down Expand Up @@ -221,7 +220,7 @@ export class AdbDaemonWebUsbConnection
// Add `payload` field to its type, it's assigned below.
const packet = AdbPacketHeader.deserialize(
stream,
) as AdbPacketHeader & { payload: Uint8Array };
) as AdbPacketHeader & { payload: Uint8Array; };

if (packet.magic !== (packet.command ^ 0xffffffff)) {
continue;
Expand Down
25 changes: 12 additions & 13 deletions libraries/adb-scrcpy/src/client.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { Adb, AdbSubprocessProtocol } from "@yume-chan/adb";
import type { Adb, AdbSubprocessProtocol } from "@gasol/adb";
import {
AdbReverseNotSupportedError,
AdbSubprocessNoneProtocol,
} from "@yume-chan/adb";
} from "@gasol/adb";
import type {
ScrcpyAudioStreamDisabledMetadata,
ScrcpyAudioStreamErroredMetadata,
Expand All @@ -11,21 +11,21 @@ import type {
ScrcpyEncoder,
ScrcpyMediaStreamPacket,
ScrcpyVideoStreamMetadata,
} from "@yume-chan/scrcpy";
} from "@gasol/scrcpy";
import {
Av1,
DEFAULT_SERVER_PATH,
ScrcpyControlMessageWriter,
ScrcpyVideoCodecId,
h264ParseConfiguration,
h265ParseConfiguration,
} from "@yume-chan/scrcpy";
} from "@gasol/scrcpy";
import type {
Consumable,
MaybeConsumable,
ReadableStream,
ReadableWritablePair,
} from "@yume-chan/stream-extra";
} from "@gasol/stream-extra";
import {
AbortController,
BufferedReadableStream,
Expand All @@ -34,8 +34,8 @@ import {
SplitStringStream,
TextDecoderStream,
WritableStream,
} from "@yume-chan/stream-extra";
import { ExactReadableEndedError } from "@yume-chan/struct";
} from "@gasol/stream-extra";
import { ExactReadableEndedError } from "@gasol/struct";

import type { AdbScrcpyConnection } from "./connection.js";
import type { AdbScrcpyOptions } from "./options/index.js";
Expand Down Expand Up @@ -80,8 +80,8 @@ interface AdbScrcpyClientInit {
videoStream: ReadableStream<Uint8Array> | undefined;
audioStream: ReadableStream<Uint8Array> | undefined;
controlStream:
| ReadableWritablePair<Uint8Array, Consumable<Uint8Array>>
| undefined;
| ReadableWritablePair<Uint8Array, Consumable<Uint8Array>>
| undefined;
}

export interface AdbScrcpyVideoStream {
Expand Down Expand Up @@ -327,7 +327,7 @@ export class AdbScrcpyClient {
options,
);

this.#parseDeviceMessages(controlStream.readable).catch(() => {});
this.#parseDeviceMessages(controlStream.readable).catch(() => { });
}
}

Expand All @@ -350,7 +350,7 @@ export class AdbScrcpyClient {
}
} catch (e) {
await this.#options.endDeviceMessageStream(e);
buffered.cancel(e).catch(() => {});
buffered.cancel(e).catch(() => { });
}
}

Expand Down Expand Up @@ -434,8 +434,7 @@ export class AdbScrcpyClient {
};
default:
throw new Error(
`Unexpected audio metadata type ${
metadata["type"] as unknown as string
`Unexpected audio metadata type ${metadata["type"] as unknown as string
}`,
);
}
Expand Down
12 changes: 6 additions & 6 deletions libraries/adb-scrcpy/src/connection.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import type { Adb, AdbSocket } from "@yume-chan/adb";
import { AdbReverseNotSupportedError, NOOP } from "@yume-chan/adb";
import type { Adb, AdbSocket } from "@gasol/adb";
import { AdbReverseNotSupportedError, NOOP } from "@gasol/adb";
import { delay } from "@yume-chan/async";
import type { Disposable } from "@yume-chan/event";
import type { Disposable } from "@gasol/event";
import type {
Consumable,
PushReadableStreamController,
ReadableStream,
ReadableStreamDefaultReader,
ReadableWritablePair,
} from "@yume-chan/stream-extra";
} from "@gasol/stream-extra";
import {
BufferedReadableStream,
PushReadableStream,
} from "@yume-chan/stream-extra";
import type { ValueOrPromise } from "@yume-chan/struct";
} from "@gasol/stream-extra";
import type { ValueOrPromise } from "@gasol/struct";

export interface AdbScrcpyConnectionOptions {
scid: number;
Expand Down
6 changes: 3 additions & 3 deletions libraries/adb-scrcpy/src/options/1_16.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { Adb } from "@yume-chan/adb";
import type { Adb } from "@gasol/adb";
import type {
ScrcpyDisplay,
ScrcpyEncoder,
ScrcpyOptionsInit1_16,
} from "@yume-chan/scrcpy";
import { WritableStream } from "@yume-chan/stream-extra";
} from "@gasol/scrcpy";
import { WritableStream } from "@gasol/stream-extra";

import { AdbScrcpyClient, AdbScrcpyExitedError } from "../client.js";
import type {
Expand Down
4 changes: 2 additions & 2 deletions libraries/adb-scrcpy/src/options/1_22.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { Adb } from "@yume-chan/adb";
import type { Adb } from "@gasol/adb";
import type {
ScrcpyDisplay,
ScrcpyEncoder,
ScrcpyOptionsInit1_22,
} from "@yume-chan/scrcpy";
} from "@gasol/scrcpy";

import type { AdbScrcpyConnection } from "../connection.js";

Expand Down
4 changes: 2 additions & 2 deletions libraries/adb-scrcpy/src/options/2_0.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { Adb } from "@yume-chan/adb";
import type { Adb } from "@gasol/adb";
import type {
ScrcpyDisplay,
ScrcpyEncoder,
ScrcpyOptionsInit2_0,
} from "@yume-chan/scrcpy";
} from "@gasol/scrcpy";

import { AdbScrcpyClient, AdbScrcpyExitedError } from "../client.js";
import type { AdbScrcpyConnection } from "../connection.js";
Expand Down
4 changes: 2 additions & 2 deletions libraries/adb-scrcpy/src/options/2_1.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { Adb } from "@yume-chan/adb";
import type { Adb } from "@gasol/adb";
import type {
ScrcpyDisplay,
ScrcpyEncoder,
ScrcpyOptionsInit2_1,
} from "@yume-chan/scrcpy";
} from "@gasol/scrcpy";

import type { AdbScrcpyConnection } from "../connection.js";

Expand Down
8 changes: 4 additions & 4 deletions libraries/adb-scrcpy/src/options/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Adb } from "@yume-chan/adb";
import type { ScrcpyDisplay, ScrcpyEncoder } from "@yume-chan/scrcpy";
import { ScrcpyOptions } from "@yume-chan/scrcpy";
import type { Adb } from "@gasol/adb";
import type { ScrcpyDisplay, ScrcpyEncoder } from "@gasol/scrcpy";
import { ScrcpyOptions } from "@gasol/scrcpy";

import type { AdbScrcpyConnection } from "../connection.js";

Expand All @@ -25,7 +25,7 @@ export abstract class AdbScrcpyOptions<
// but we need to pass an instance here.
// A normal `function` can be used as a constructor, and constructors can return
// any object to override the default return value.
function () {
function() {
return base;
} as never,
// HACK: `base.value` contains `SkipDefaultMark`, so it will be used as is,
Expand Down
9 changes: 4 additions & 5 deletions libraries/adb-server-node-tcp/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import type { AddressInfo, SocketConnectOpts } from "net";
import { Server, Socket } from "net";

import type { AdbIncomingSocketHandler, AdbServerClient } from "@yume-chan/adb";
import type { AdbIncomingSocketHandler, AdbServerClient } from "@gasol/adb";
import {
MaybeConsumable,
PushReadableStream,
tryClose,
WrapWritableStream,
WritableStream,
} from "@yume-chan/stream-extra";
import type { ValueOrPromise } from "@yume-chan/struct";
} from "@gasol/stream-extra";
import type { ValueOrPromise } from "@gasol/struct";

function nodeSocketToConnection(
socket: Socket,
Expand Down Expand Up @@ -59,8 +59,7 @@ function nodeSocketToConnection(
}

export class AdbServerNodeTcpConnector
implements AdbServerClient.ServerConnector
{
implements AdbServerClient.ServerConnector {
readonly spec: SocketConnectOpts;

readonly #listeners = new Map<string, Server>();
Expand Down
10 changes: 5 additions & 5 deletions libraries/adb/src/adb.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type {
MaybeConsumable,
ReadableWritablePair,
} from "@yume-chan/stream-extra";
import { ConcatStringStream, TextDecoderStream } from "@yume-chan/stream-extra";
import type { ValueOrPromise } from "@yume-chan/struct";
} from "@gasol/stream-extra";
import { ConcatStringStream, TextDecoderStream } from "@gasol/stream-extra";
import type { ValueOrPromise } from "@gasol/struct";

import type { AdbBanner } from "./banner.js";
import type { AdbFrameBuffer } from "./commands/index.js";
Expand All @@ -24,7 +24,7 @@ export interface Closeable {

export interface AdbSocket
extends ReadableWritablePair<Uint8Array, MaybeConsumable<Uint8Array>>,
Closeable {
Closeable {
get service(): string;

get closed(): Promise<void>;
Expand Down Expand Up @@ -126,7 +126,7 @@ export class Adb implements Closeable {

async rm(
filenames: string | string[],
options?: { recursive?: boolean; force?: boolean },
options?: { recursive?: boolean; force?: boolean; },
): Promise<string> {
const args = ["rm"];
if (options?.recursive) {
Expand Down
2 changes: 1 addition & 1 deletion libraries/adb/src/commands/base.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AutoDisposable } from "@yume-chan/event";
import { AutoDisposable } from "@gasol/event";

import type { Adb } from "../adb.js";

Expand Down
4 changes: 2 additions & 2 deletions libraries/adb/src/commands/framebuffer.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { BufferedReadableStream } from "@yume-chan/stream-extra";
import Struct, { StructEmptyError } from "@yume-chan/struct";
import { BufferedReadableStream } from "@gasol/stream-extra";
import Struct, { StructEmptyError } from "@gasol/struct";

import type { Adb } from "../adb.js";

Expand Down
6 changes: 3 additions & 3 deletions libraries/adb/src/commands/reverse.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// cspell: ignore killforward

import { AutoDisposable } from "@yume-chan/event";
import { BufferedReadableStream } from "@yume-chan/stream-extra";
import Struct, { ExactReadableEndedError, encodeUtf8 } from "@yume-chan/struct";
import { AutoDisposable } from "@gasol/event";
import { BufferedReadableStream } from "@gasol/stream-extra";
import Struct, { ExactReadableEndedError, encodeUtf8 } from "@gasol/struct";

import type { Adb, AdbIncomingSocketHandler } from "../adb.js";
import { hexToNumber, sequenceEqual } from "../utils/index.js";
Expand Down
2 changes: 1 addition & 1 deletion libraries/adb/src/commands/subprocess/command.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ConcatStringStream, TextDecoderStream } from "@yume-chan/stream-extra";
import { ConcatStringStream, TextDecoderStream } from "@gasol/stream-extra";

import { AdbCommandBase } from "../base.js";

Expand Down
14 changes: 7 additions & 7 deletions libraries/adb/src/commands/subprocess/protocols/none.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import assert from "node:assert";
import { describe, it, mock } from "node:test";

import { PromiseResolver } from "@yume-chan/async";
import { ReadableStream, WritableStream } from "@yume-chan/stream-extra";
import { ReadableStream, WritableStream } from "@gasol/stream-extra";

import type { AdbSocket } from "../../../adb.js";

Expand All @@ -14,7 +14,7 @@ describe("AdbSubprocessNoneProtocol", () => {
const closed = new PromiseResolver<void>();
const socket: AdbSocket = {
service: "",
close: mock.fn(() => {}),
close: mock.fn(() => { }),
closed: closed.promise,
readable: new ReadableStream({
async start(controller) {
Expand Down Expand Up @@ -44,7 +44,7 @@ describe("AdbSubprocessNoneProtocol", () => {
const closed = new PromiseResolver<void>();
const socket: AdbSocket = {
service: "",
close: mock.fn(() => {}),
close: mock.fn(() => { }),
closed: closed.promise,
readable: new ReadableStream({
async start(controller) {
Expand Down Expand Up @@ -83,7 +83,7 @@ describe("AdbSubprocessNoneProtocol", () => {
const closed = new PromiseResolver<void>();
const socket: AdbSocket = {
service: "",
close: mock.fn(() => {}),
close: mock.fn(() => { }),
closed: closed.promise,
readable: new ReadableStream({
async start(controller) {
Expand Down Expand Up @@ -113,7 +113,7 @@ describe("AdbSubprocessNoneProtocol", () => {
const closed = new PromiseResolver<void>();
const socket: AdbSocket = {
service: "",
close: mock.fn(() => {}),
close: mock.fn(() => { }),
closed: closed.promise,
readable: new ReadableStream(),
writable: new WritableStream(),
Expand All @@ -130,7 +130,7 @@ describe("AdbSubprocessNoneProtocol", () => {
it("`resize` shouldn't throw any error", () => {
const socket: AdbSocket = {
service: "",
close: mock.fn(() => {}),
close: mock.fn(() => { }),
closed: new PromiseResolver<void>().promise,
readable: new ReadableStream(),
writable: new WritableStream(),
Expand All @@ -141,7 +141,7 @@ describe("AdbSubprocessNoneProtocol", () => {
});

it("`kill` should close `socket`", async () => {
const close = mock.fn(() => {});
const close = mock.fn(() => { });
const socket: AdbSocket = {
service: "",
close,
Expand Down
Loading

0 comments on commit 0dec291

Please sign in to comment.