@couch-kit/host 1.2.3 → 1.2.4

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.
@@ -1 +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,CA2E7E"}
1
+ {"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["../src/assets.ts"],"names":[],"mappings":"AAMA,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,CA6E7E"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@couch-kit/host",
3
- "version": "1.2.3",
3
+ "version": "1.2.4",
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": {
package/src/assets.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { useEffect, useState } from "react";
2
- import { Paths, Directory, File } from "expo-file-system/next";
2
+ import * as FileSystem from "expo-file-system";
3
+ import { Paths, Directory } from "expo-file-system/next";
3
4
  import { Platform } from "react-native";
4
5
  import { toErrorMessage } from "@couch-kit/core";
5
6
 
@@ -62,8 +63,8 @@ export function useExtractAssets(manifest: AssetManifest): ExtractAssetsResult {
62
63
  for (const filePath of manifest.files) {
63
64
  if (cancelled) return;
64
65
 
65
- const sourceFile = new File(`asset:///www/${filePath}`);
66
- const destFile = new File(targetDir, filePath);
66
+ const sourceUri = `asset:///www/${filePath}`;
67
+ const destUri = `${targetDir.uri}${filePath}`;
67
68
 
68
69
  // Ensure subdirectory exists (e.g., "assets/" in "assets/index.js")
69
70
  const lastSlash = filePath.lastIndexOf("/");
@@ -77,7 +78,9 @@ export function useExtractAssets(manifest: AssetManifest): ExtractAssetsResult {
77
78
  }
78
79
  }
79
80
 
80
- sourceFile.copy(destFile);
81
+ // Use legacy API — the new File API doesn't support asset:// URIs
82
+ // on Android because it bypasses the AssetManager
83
+ await FileSystem.copyAsync({ from: sourceUri, to: destUri });
81
84
  }
82
85
 
83
86
  if (cancelled) return;