@couch-kit/host 1.1.2 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/assets.d.ts +28 -0
- package/lib/assets.d.ts.map +1 -0
- package/lib/buffer-utils.d.ts +27 -0
- package/lib/buffer-utils.d.ts.map +1 -0
- package/lib/event-emitter.d.ts +27 -0
- package/lib/event-emitter.d.ts.map +1 -0
- package/lib/index.d.ts +6 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/network.d.ts +7 -0
- package/lib/network.d.ts.map +1 -0
- package/lib/provider.d.ts +57 -0
- package/lib/provider.d.ts.map +1 -0
- package/lib/server.d.ts +23 -0
- package/lib/server.d.ts.map +1 -0
- package/lib/websocket.d.ts +65 -0
- package/lib/websocket.d.ts.map +1 -0
- package/package.json +11 -5
package/lib/assets.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface AssetManifest {
|
|
2
|
+
files: string[];
|
|
3
|
+
}
|
|
4
|
+
export interface ExtractAssetsResult {
|
|
5
|
+
/** The filesystem path to the extracted www directory, or undefined if not ready */
|
|
6
|
+
staticDir: string | undefined;
|
|
7
|
+
/** Whether extraction is in progress */
|
|
8
|
+
loading: boolean;
|
|
9
|
+
/** Error message if extraction failed */
|
|
10
|
+
error: string | null;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Extracts bundled web assets from the APK to the filesystem so the native
|
|
14
|
+
* HTTP server can serve them.
|
|
15
|
+
*
|
|
16
|
+
* On Android, assets live inside the APK and cannot be served directly by
|
|
17
|
+
* a native HTTP server. This hook copies each file listed in the manifest
|
|
18
|
+
* from `asset:///www/<file>` to `<Paths.document>/www/<file>`.
|
|
19
|
+
*
|
|
20
|
+
* On iOS, assets are accessible from the bundle directory, so extraction
|
|
21
|
+
* is skipped and `staticDir` is returned as `undefined` (the server falls
|
|
22
|
+
* back to the bundle path).
|
|
23
|
+
*
|
|
24
|
+
* @param manifest - The asset manifest generated by `couch-kit bundle`.
|
|
25
|
+
* Contains a `files` array listing all relative paths.
|
|
26
|
+
*/
|
|
27
|
+
export declare function useExtractAssets(manifest: AssetManifest): ExtractAssetsResult;
|
|
28
|
+
//# sourceMappingURL=assets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["../src/assets.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,mBAAmB;IAClC,oFAAoF;IACpF,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,wCAAwC;IACxC,OAAO,EAAE,OAAO,CAAC;IACjB,yCAAyC;IACzC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,aAAa,GAAG,mBAAmB,CAyE7E"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Buffer management utilities for WebSocket per-client receive buffers.
|
|
3
|
+
* Extracted into a standalone module so they can be tested without
|
|
4
|
+
* react-native dependencies.
|
|
5
|
+
*/
|
|
6
|
+
import { Buffer } from "buffer";
|
|
7
|
+
import type { TcpSocketInstance } from "./declarations";
|
|
8
|
+
export interface ManagedSocket {
|
|
9
|
+
socket: TcpSocketInstance;
|
|
10
|
+
id: string;
|
|
11
|
+
isHandshakeComplete: boolean;
|
|
12
|
+
buffer: Buffer;
|
|
13
|
+
/** Number of valid bytes currently in `buffer` (may be less than buffer.length). */
|
|
14
|
+
bufferLength: number;
|
|
15
|
+
lastPong: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Append data to a managed socket's buffer, growing capacity geometrically
|
|
19
|
+
* to avoid re-allocation on every TCP data event.
|
|
20
|
+
*/
|
|
21
|
+
export declare function appendToBuffer(managed: ManagedSocket, data: Buffer): void;
|
|
22
|
+
/**
|
|
23
|
+
* Compact the buffer by discarding consumed bytes from the front.
|
|
24
|
+
* If all data has been consumed, reset the length to 0 without re-allocating.
|
|
25
|
+
*/
|
|
26
|
+
export declare function compactBuffer(managed: ManagedSocket, consumed: number): void;
|
|
27
|
+
//# sourceMappingURL=buffer-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buffer-utils.d.ts","sourceRoot":"","sources":["../src/buffer-utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAGxD,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,iBAAiB,CAAC;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,mBAAmB,EAAE,OAAO,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,oFAAoF;IACpF,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAazE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAS5E"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lightweight, type-safe EventEmitter implementation for cross-platform compatibility.
|
|
3
|
+
* Works in browser, React Native, and Node.js environments.
|
|
4
|
+
*
|
|
5
|
+
* @typeParam EventMap - A record mapping event names to their listener argument tuples.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* type MyEvents = {
|
|
10
|
+
* data: [payload: string];
|
|
11
|
+
* error: [err: Error];
|
|
12
|
+
* close: [];
|
|
13
|
+
* };
|
|
14
|
+
* const emitter = new EventEmitter<MyEvents>();
|
|
15
|
+
* emitter.on("data", (payload) => { ... }); // payload is typed as string
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare class EventEmitter<EventMap extends Record<string, any[]> = Record<string, any[]>> {
|
|
19
|
+
private listeners;
|
|
20
|
+
on<K extends string & keyof EventMap>(event: K, listener: (...args: EventMap[K]) => void): this;
|
|
21
|
+
once<K extends string & keyof EventMap>(event: K, listener: (...args: EventMap[K]) => void): this;
|
|
22
|
+
off<K extends string & keyof EventMap>(event: K, listener: (...args: EventMap[K]) => void): this;
|
|
23
|
+
emit<K extends string & keyof EventMap>(event: K, ...args: EventMap[K]): boolean;
|
|
24
|
+
removeAllListeners<K extends string & keyof EventMap>(event?: K): this;
|
|
25
|
+
listenerCount<K extends string & keyof EventMap>(event: K): number;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=event-emitter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-emitter.d.ts","sourceRoot":"","sources":["../src/event-emitter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,qBAAa,YAAY,CACvB,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC;IAE9D,OAAO,CAAC,SAAS,CAA2D;IAG5E,EAAE,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,QAAQ,EAClC,KAAK,EAAE,CAAC,EACR,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,IAAI,GACvC,IAAI;IAQP,IAAI,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,QAAQ,EACpC,KAAK,EAAE,CAAC,EACR,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,IAAI,GACvC,IAAI;IASP,GAAG,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,QAAQ,EACnC,KAAK,EAAE,CAAC,EACR,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,IAAI,GACvC,IAAI;IAWP,IAAI,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,QAAQ,EACpC,KAAK,EAAE,CAAC,EACR,GAAG,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,GACnB,OAAO;IAqBV,kBAAkB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,GAAG,IAAI;IAStE,aAAa,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,QAAQ,EAAE,KAAK,EAAE,CAAC,GAAG,MAAM;CAGnE"}
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC"}
|
package/lib/network.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../src/network.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAa/D"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { type IGameState, type IAction } from "@couch-kit/core";
|
|
3
|
+
export interface GameHostConfig<S extends IGameState, A extends IAction> {
|
|
4
|
+
initialState: S;
|
|
5
|
+
reducer: (state: S, action: A) => S;
|
|
6
|
+
port?: number;
|
|
7
|
+
wsPort?: number;
|
|
8
|
+
devMode?: boolean;
|
|
9
|
+
devServerUrl?: string;
|
|
10
|
+
staticDir?: string;
|
|
11
|
+
debug?: boolean;
|
|
12
|
+
/** Called when a player successfully joins. */
|
|
13
|
+
onPlayerJoined?: (playerId: string, name: string) => void;
|
|
14
|
+
/** Called when a player disconnects. */
|
|
15
|
+
onPlayerLeft?: (playerId: string) => void;
|
|
16
|
+
/** Called when a server error occurs. */
|
|
17
|
+
onError?: (error: Error) => void;
|
|
18
|
+
}
|
|
19
|
+
interface GameHostContextValue<S extends IGameState, A extends IAction> {
|
|
20
|
+
state: S;
|
|
21
|
+
dispatch: (action: A) => void;
|
|
22
|
+
serverUrl: string | null;
|
|
23
|
+
serverError: Error | null;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* React context provider that turns a React Native TV app into a local game server.
|
|
27
|
+
*
|
|
28
|
+
* Starts a static file server (for the web controller) and a WebSocket game server
|
|
29
|
+
* (for real-time state sync). Manages the canonical game state using the provided
|
|
30
|
+
* reducer and broadcasts state updates to all connected clients.
|
|
31
|
+
*
|
|
32
|
+
* @param config - Host configuration including reducer, initial state, ports, and callbacks.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```tsx
|
|
36
|
+
* <GameHostProvider config={{ reducer: gameReducer, initialState }}>
|
|
37
|
+
* <GameScreen />
|
|
38
|
+
* </GameHostProvider>
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare function GameHostProvider<S extends IGameState, A extends IAction>({ children, config, }: {
|
|
42
|
+
children: React.ReactNode;
|
|
43
|
+
config: GameHostConfig<S, A>;
|
|
44
|
+
}): React.JSX.Element;
|
|
45
|
+
/**
|
|
46
|
+
* React hook to access the game host context.
|
|
47
|
+
*
|
|
48
|
+
* Must be used within a `<GameHostProvider>`. Returns the canonical game state,
|
|
49
|
+
* a dispatch function for actions, the server URL (for QR codes), and any
|
|
50
|
+
* server startup errors.
|
|
51
|
+
*
|
|
52
|
+
* @returns An object with `state`, `dispatch`, `serverUrl`, and `serverError`.
|
|
53
|
+
* @throws If used outside of a `<GameHostProvider>`.
|
|
54
|
+
*/
|
|
55
|
+
export declare function useGameHost<S extends IGameState, A extends IAction>(): GameHostContextValue<S, A>;
|
|
56
|
+
export {};
|
|
57
|
+
//# sourceMappingURL=provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAQN,MAAM,OAAO,CAAC;AAGf,OAAO,EAML,KAAK,UAAU,EACf,KAAK,OAAO,EAGb,MAAM,iBAAiB,CAAC;AAEzB,MAAM,WAAW,cAAc,CAAC,CAAC,SAAS,UAAU,EAAE,CAAC,SAAS,OAAO;IACrE,YAAY,EAAE,CAAC,CAAC;IAChB,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,+CAA+C;IAC/C,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1D,wCAAwC;IACxC,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,yCAAyC;IACzC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAClC;AAED,UAAU,oBAAoB,CAAC,CAAC,SAAS,UAAU,EAAE,CAAC,SAAS,OAAO;IACpE,KAAK,EAAE,CAAC,CAAC;IACT,QAAQ,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,IAAI,CAAC;IAC9B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,WAAW,EAAE,KAAK,GAAG,IAAI,CAAC;CAC3B;AA4CD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,UAAU,EAAE,CAAC,SAAS,OAAO,EAAE,EACxE,QAAQ,EACR,MAAM,GACP,EAAE;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,MAAM,EAAE,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;CAC9B,qBA+NA;AAED;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,UAAU,EAAE,CAAC,SAAS,OAAO,KAK/C,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC,CAC7C"}
|
package/lib/server.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface CouchKitHostConfig {
|
|
2
|
+
port?: number;
|
|
3
|
+
devMode?: boolean;
|
|
4
|
+
devServerUrl?: string;
|
|
5
|
+
staticDir?: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* React hook that manages a static HTTP file server for serving the web controller.
|
|
9
|
+
*
|
|
10
|
+
* In production mode, starts a `StaticServer` bound to `0.0.0.0` on the configured port,
|
|
11
|
+
* serving files from `staticDir` (or the iOS bundle directory + `/www` by default).
|
|
12
|
+
* On Android, `staticDir` must be provided since bundle assets live inside the APK.
|
|
13
|
+
* In dev mode, skips the server and returns `devServerUrl` directly.
|
|
14
|
+
*
|
|
15
|
+
* @param config - Server configuration including port, dev mode, and static directory.
|
|
16
|
+
* @returns An object with `url` (the server URL or null), `error`, and `loading`.
|
|
17
|
+
*/
|
|
18
|
+
export declare const useStaticServer: (config: CouchKitHostConfig) => {
|
|
19
|
+
url: string | null;
|
|
20
|
+
error: Error | null;
|
|
21
|
+
loading: boolean;
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,eAAe,GAAI,QAAQ,kBAAkB;;;;CAgEzD,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lightweight WebSocket Server Implementation
|
|
3
|
+
* Built on top of react-native-tcp-socket
|
|
4
|
+
*
|
|
5
|
+
* Supports: text frames, close frames, ping/pong, multi-frame TCP packets,
|
|
6
|
+
* server-side keepalive, frame size limits, and robust buffer management per RFC 6455.
|
|
7
|
+
*/
|
|
8
|
+
import { EventEmitter } from "./event-emitter";
|
|
9
|
+
export interface WebSocketConfig {
|
|
10
|
+
port: number;
|
|
11
|
+
debug?: boolean;
|
|
12
|
+
/** Maximum allowed frame payload size in bytes (default: 1 MB). */
|
|
13
|
+
maxFrameSize?: number;
|
|
14
|
+
/** Interval (ms) between server-side keepalive pings (default: 30s). 0 disables. */
|
|
15
|
+
keepaliveInterval?: number;
|
|
16
|
+
/** Timeout (ms) to wait for a pong after a keepalive ping (default: 10s). */
|
|
17
|
+
keepaliveTimeout?: number;
|
|
18
|
+
}
|
|
19
|
+
/** Event map for type-safe event emission. */
|
|
20
|
+
export type WebSocketServerEvents = {
|
|
21
|
+
connection: [socketId: string];
|
|
22
|
+
message: [socketId: string, message: unknown];
|
|
23
|
+
disconnect: [socketId: string];
|
|
24
|
+
listening: [port: number];
|
|
25
|
+
error: [error: Error];
|
|
26
|
+
};
|
|
27
|
+
export declare class GameWebSocketServer extends EventEmitter<WebSocketServerEvents> {
|
|
28
|
+
private server;
|
|
29
|
+
private clients;
|
|
30
|
+
private port;
|
|
31
|
+
private debug;
|
|
32
|
+
private maxFrameSize;
|
|
33
|
+
private keepaliveInterval;
|
|
34
|
+
private keepaliveTimeout;
|
|
35
|
+
private keepaliveTimer;
|
|
36
|
+
constructor(config: WebSocketConfig);
|
|
37
|
+
private log;
|
|
38
|
+
start(): void;
|
|
39
|
+
private startKeepalive;
|
|
40
|
+
private processFrames;
|
|
41
|
+
/**
|
|
42
|
+
* Gracefully stop the server.
|
|
43
|
+
* Sends close frames to all clients before destroying connections.
|
|
44
|
+
*/
|
|
45
|
+
stop(): void;
|
|
46
|
+
/**
|
|
47
|
+
* Send data to a specific client by socket ID.
|
|
48
|
+
* Silently ignores unknown socket IDs and write errors.
|
|
49
|
+
*/
|
|
50
|
+
send(socketId: string, data: unknown): void;
|
|
51
|
+
/**
|
|
52
|
+
* Broadcast data to all connected clients.
|
|
53
|
+
* Wraps each write in try/catch so a single dead socket doesn't skip remaining clients.
|
|
54
|
+
*/
|
|
55
|
+
broadcast(data: unknown, excludeId?: string): void;
|
|
56
|
+
/** Returns the number of currently connected clients. */
|
|
57
|
+
get clientCount(): number;
|
|
58
|
+
private handleHandshake;
|
|
59
|
+
private generateAcceptKey;
|
|
60
|
+
private decodeFrame;
|
|
61
|
+
private encodeFrame;
|
|
62
|
+
private encodeControlFrame;
|
|
63
|
+
private buildFrame;
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=websocket.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"websocket.d.ts","sourceRoot":"","sources":["../src/websocket.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAY/C,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,mEAAmE;IACnE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oFAAoF;IACpF,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,6EAA6E;IAC7E,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,8CAA8C;AAC9C,MAAM,MAAM,qBAAqB,GAAG;IAClC,UAAU,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC/B,OAAO,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAC9C,UAAU,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC/B,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC1B,KAAK,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;CACvB,CAAC;AAwBF,qBAAa,mBAAoB,SAAQ,YAAY,CAAC,qBAAqB,CAAC;IAC1E,OAAO,CAAC,MAAM,CAA0D;IACxE,OAAO,CAAC,OAAO,CAAyC;IACxD,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,KAAK,CAAU;IACvB,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,iBAAiB,CAAS;IAClC,OAAO,CAAC,gBAAgB,CAAS;IACjC,OAAO,CAAC,cAAc,CAA+C;gBAEzD,MAAM,EAAE,eAAe;IASnC,OAAO,CAAC,GAAG;IAMJ,KAAK;IAkFZ,OAAO,CAAC,cAAc;IAkCtB,OAAO,CAAC,aAAa;IAyGrB;;;OAGG;IACI,IAAI;IAqCX;;;OAGG;IACI,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO;IAgB3C;;;OAGG;IACI,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,MAAM;IAclD,yDAAyD;IACzD,IAAW,WAAW,IAAI,MAAM,CAE/B;IAID,OAAO,CAAC,eAAe;IAkDvB,OAAO,CAAC,iBAAiB;IAQzB,OAAO,CAAC,WAAW;IA4DnB,OAAO,CAAC,WAAW;IAKnB,OAAO,CAAC,kBAAkB;IAI1B,OAAO,CAAC,UAAU;CA2BnB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@couch-kit/host",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "React Native host for local multiplayer party games on Android TV — WebSocket server, state management, and static file serving",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -19,13 +19,17 @@
|
|
|
19
19
|
"local-multiplayer",
|
|
20
20
|
"game-host"
|
|
21
21
|
],
|
|
22
|
-
"main": "
|
|
22
|
+
"main": "lib/index.d.ts",
|
|
23
|
+
"types": "lib/index.d.ts",
|
|
23
24
|
"react-native": "src/index.tsx",
|
|
24
25
|
"source": "src/index.tsx",
|
|
25
26
|
"exports": {
|
|
26
27
|
".": {
|
|
27
|
-
"react-native":
|
|
28
|
-
|
|
28
|
+
"react-native": {
|
|
29
|
+
"types": "./lib/index.d.ts",
|
|
30
|
+
"default": "./src/index.tsx"
|
|
31
|
+
},
|
|
32
|
+
"types": "./lib/index.d.ts",
|
|
29
33
|
"default": "./src/index.tsx"
|
|
30
34
|
}
|
|
31
35
|
},
|
|
@@ -39,10 +43,12 @@
|
|
|
39
43
|
"!**/__mocks__"
|
|
40
44
|
],
|
|
41
45
|
"scripts": {
|
|
46
|
+
"build": "tsc -p tsconfig.build.json",
|
|
42
47
|
"test": "bun test",
|
|
43
48
|
"typecheck": "tsc --noEmit",
|
|
44
49
|
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
45
|
-
"clean": "del-cli lib"
|
|
50
|
+
"clean": "del-cli lib",
|
|
51
|
+
"prepublishOnly": "bun run build"
|
|
46
52
|
},
|
|
47
53
|
"dependencies": {
|
|
48
54
|
"@couch-kit/core": "0.3.3",
|