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