@midscene/android-playground 0.19.1-beta-20250613065219.0 → 0.19.1-beta-20250616032243.0

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/dist/es/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/index.ts
2
- import path2 from "path";
2
+ import path from "path";
3
3
  import { AndroidAgent, AndroidDevice } from "@midscene/android";
4
4
  import {
5
5
  PLAYGROUND_SERVER_PORT,
@@ -11,8 +11,6 @@ import PlaygroundServer from "@midscene/web/midscene-server";
11
11
  import { exec } from "child_process";
12
12
  import { createReadStream } from "fs";
13
13
  import { createServer } from "http";
14
- import path from "path";
15
- import { fileURLToPath } from "url";
16
14
  import { promisify } from "util";
17
15
  import { SCRCPY_SERVER_PORT } from "@midscene/shared/constants";
18
16
  import { getDebug } from "@midscene/shared/logger";
@@ -149,12 +147,11 @@ var ScrcpyServer = class {
149
147
  const { AdbScrcpyClient, AdbScrcpyOptions2_1 } = await import("@yume-chan/adb-scrcpy");
150
148
  const { ReadableStream } = await import("@yume-chan/stream-extra");
151
149
  const { ScrcpyOptions3_1, DefaultServerPath } = await import("@yume-chan/scrcpy");
152
- const currentDir = typeof __dirname !== "undefined" ? __dirname : path.dirname(fileURLToPath(import.meta.url));
153
- const serverBinPath = path.resolve(currentDir, "../../bin/server.bin");
150
+ const { BIN } = await import("@yume-chan/fetch-scrcpy-server");
154
151
  try {
155
152
  await AdbScrcpyClient.pushServer(
156
153
  adb,
157
- ReadableStream.from(createReadStream(serverBinPath))
154
+ ReadableStream.from(createReadStream(BIN))
158
155
  );
159
156
  const scrcpyOptions = new ScrcpyOptions3_1({
160
157
  // default options
@@ -416,7 +413,7 @@ var ScrcpyServer = class {
416
413
  };
417
414
 
418
415
  // src/index.ts
419
- var staticDir = path2.join(__dirname, "../../static");
416
+ var staticDir = path.join(__dirname, "../../static");
420
417
  var playgroundServer = new PlaygroundServer(
421
418
  AndroidDevice,
422
419
  AndroidAgent,
package/dist/lib/index.js CHANGED
@@ -23,7 +23,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
23
23
  ));
24
24
 
25
25
  // src/index.ts
26
- var import_node_path2 = __toESM(require("path"));
26
+ var import_node_path = __toESM(require("path"));
27
27
  var import_android = require("@midscene/android");
28
28
  var import_constants2 = require("@midscene/shared/constants");
29
29
  var import_midscene_server = __toESM(require("@midscene/web/midscene-server"));
@@ -32,15 +32,12 @@ var import_midscene_server = __toESM(require("@midscene/web/midscene-server"));
32
32
  var import_node_child_process = require("child_process");
33
33
  var import_node_fs = require("fs");
34
34
  var import_node_http = require("http");
35
- var import_node_path = __toESM(require("path"));
36
- var import_node_url = require("url");
37
35
  var import_node_util = require("util");
38
36
  var import_constants = require("@midscene/shared/constants");
39
37
  var import_logger = require("@midscene/shared/logger");
40
38
  var import_cors = __toESM(require("cors"));
41
39
  var import_express = __toESM(require("express"));
42
40
  var import_socket = require("socket.io");
43
- var import_meta = {};
44
41
  var debugPage = (0, import_logger.getDebug)("android:playground");
45
42
  var promiseExec = (0, import_node_util.promisify)(import_node_child_process.exec);
46
43
  var ScrcpyServer = class {
@@ -171,12 +168,11 @@ var ScrcpyServer = class {
171
168
  const { AdbScrcpyClient, AdbScrcpyOptions2_1 } = await import("@yume-chan/adb-scrcpy");
172
169
  const { ReadableStream } = await import("@yume-chan/stream-extra");
173
170
  const { ScrcpyOptions3_1, DefaultServerPath } = await import("@yume-chan/scrcpy");
174
- const currentDir = typeof __dirname !== "undefined" ? __dirname : import_node_path.default.dirname((0, import_node_url.fileURLToPath)(import_meta.url));
175
- const serverBinPath = import_node_path.default.resolve(currentDir, "../../bin/server.bin");
171
+ const { BIN } = await import("@yume-chan/fetch-scrcpy-server");
176
172
  try {
177
173
  await AdbScrcpyClient.pushServer(
178
174
  adb,
179
- ReadableStream.from((0, import_node_fs.createReadStream)(serverBinPath))
175
+ ReadableStream.from((0, import_node_fs.createReadStream)(BIN))
180
176
  );
181
177
  const scrcpyOptions = new ScrcpyOptions3_1({
182
178
  // default options
@@ -438,7 +434,7 @@ var ScrcpyServer = class {
438
434
  };
439
435
 
440
436
  // src/index.ts
441
- var staticDir = import_node_path2.default.join(__dirname, "../../static");
437
+ var staticDir = import_node_path.default.join(__dirname, "../../static");
442
438
  var playgroundServer = new import_midscene_server.default(
443
439
  import_android.AndroidDevice,
444
440
  import_android.AndroidAgent,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midscene/android-playground",
3
- "version": "0.19.1-beta-20250613065219.0",
3
+ "version": "0.19.1-beta-20250616032243.0",
4
4
  "description": "Android playground for Midscene",
5
5
  "main": "./dist/lib/index.js",
6
6
  "types": "./dist/types/index.d.ts",
@@ -18,15 +18,16 @@
18
18
  "@yume-chan/adb": "^1.1.0",
19
19
  "@yume-chan/adb-scrcpy": "^1.1.0",
20
20
  "@yume-chan/adb-server-node-tcp": "^1.1.0",
21
+ "@yume-chan/fetch-scrcpy-server": "^1.0.0",
21
22
  "@yume-chan/scrcpy": "^1.1.0",
22
23
  "@yume-chan/stream-extra": "^1.0.0",
23
24
  "cors": "2.8.5",
24
25
  "express": "^4.21.2",
25
26
  "open": "10.1.0",
26
27
  "socket.io": "^4.8.1",
27
- "@midscene/shared": "0.19.1-beta-20250613065219.0",
28
- "@midscene/web": "0.19.1-beta-20250613065219.0",
29
- "@midscene/android": "0.19.1-beta-20250613065219.0"
28
+ "@midscene/shared": "0.19.1-beta-20250616032243.0",
29
+ "@midscene/web": "0.19.1-beta-20250616032243.0",
30
+ "@midscene/android": "0.19.1-beta-20250616032243.0"
30
31
  },
31
32
  "devDependencies": {
32
33
  "@modern-js/module-tools": "2.60.6",
@@ -37,6 +38,7 @@
37
38
  },
38
39
  "license": "MIT",
39
40
  "scripts": {
41
+ "postinstall": "fetch-scrcpy-server 3.1",
40
42
  "dev": "modern dev",
41
43
  "dev:server": "npm run build && ./bin/playground",
42
44
  "build": "modern build -c ./modern.config.ts",
package/static/index.html CHANGED
@@ -1 +1 @@
1
- <!doctype html><html><head><title>Midscene Android Playground</title><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><script defer src="/static/js/lib-react.8db3c72f.js"></script><script defer src="/static/js/770.cc6deea1.js"></script><script defer src="/static/js/index.edc1f238.js"></script><link href="/static/css/index.f7a2b731.css" rel="stylesheet"></head><body><div id="root"></div></body></html>
1
+ <!doctype html><html><head><title>Midscene Android Playground</title><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><script defer src="/static/js/lib-react.8db3c72f.js"></script><script defer src="/static/js/770.cc6deea1.js"></script><script defer src="/static/js/index.c9bb312f.js"></script><link href="/static/css/index.f7a2b731.css" rel="stylesheet"></head><body><div id="root"></div></body></html>