@react-native-harness/cli 1.0.0-alpha.20 → 1.0.0-alpha.21

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.
Files changed (94) hide show
  1. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  2. package/package.json +3 -3
  3. package/dist/bundlers/metro.d.ts +0 -5
  4. package/dist/bundlers/metro.d.ts.map +0 -1
  5. package/dist/bundlers/metro.js +0 -71
  6. package/dist/bundlers/webpack.d.ts +0 -2
  7. package/dist/bundlers/webpack.d.ts.map +0 -1
  8. package/dist/bundlers/webpack.js +0 -49
  9. package/dist/commands/test.d.ts +0 -3
  10. package/dist/commands/test.d.ts.map +0 -1
  11. package/dist/commands/test.js +0 -140
  12. package/dist/discovery/index.d.ts +0 -3
  13. package/dist/discovery/index.d.ts.map +0 -1
  14. package/dist/discovery/index.js +0 -1
  15. package/dist/discovery/testDiscovery.d.ts +0 -11
  16. package/dist/discovery/testDiscovery.d.ts.map +0 -1
  17. package/dist/discovery/testDiscovery.js +0 -29
  18. package/dist/errors/appNotInstalledError.d.ts +0 -7
  19. package/dist/errors/appNotInstalledError.d.ts.map +0 -1
  20. package/dist/errors/appNotInstalledError.js +0 -12
  21. package/dist/errors/bridgeTimeoutError.d.ts +0 -7
  22. package/dist/errors/bridgeTimeoutError.d.ts.map +0 -1
  23. package/dist/errors/bridgeTimeoutError.js +0 -12
  24. package/dist/errors/errorHandler.d.ts +0 -2
  25. package/dist/errors/errorHandler.d.ts.map +0 -1
  26. package/dist/errors/errorHandler.js +0 -152
  27. package/dist/errors/errors.d.ts +0 -45
  28. package/dist/errors/errors.d.ts.map +0 -1
  29. package/dist/errors/errors.js +0 -89
  30. package/dist/jest.d.ts +0 -2
  31. package/dist/jest.d.ts.map +0 -1
  32. package/dist/jest.js +0 -7
  33. package/dist/platforms/android/build.d.ts +0 -5
  34. package/dist/platforms/android/build.d.ts.map +0 -1
  35. package/dist/platforms/android/build.js +0 -29
  36. package/dist/platforms/android/device.d.ts +0 -5
  37. package/dist/platforms/android/device.d.ts.map +0 -1
  38. package/dist/platforms/android/device.js +0 -36
  39. package/dist/platforms/android/emulator.d.ts +0 -10
  40. package/dist/platforms/android/emulator.d.ts.map +0 -1
  41. package/dist/platforms/android/emulator.js +0 -116
  42. package/dist/platforms/android/index.d.ts +0 -4
  43. package/dist/platforms/android/index.d.ts.map +0 -1
  44. package/dist/platforms/android/index.js +0 -56
  45. package/dist/platforms/ios/build.d.ts +0 -7
  46. package/dist/platforms/ios/build.d.ts.map +0 -1
  47. package/dist/platforms/ios/build.js +0 -48
  48. package/dist/platforms/ios/device.d.ts +0 -11
  49. package/dist/platforms/ios/device.d.ts.map +0 -1
  50. package/dist/platforms/ios/device.js +0 -51
  51. package/dist/platforms/ios/index.d.ts +0 -4
  52. package/dist/platforms/ios/index.d.ts.map +0 -1
  53. package/dist/platforms/ios/index.js +0 -43
  54. package/dist/platforms/ios/simulator.d.ts +0 -11
  55. package/dist/platforms/ios/simulator.d.ts.map +0 -1
  56. package/dist/platforms/ios/simulator.js +0 -129
  57. package/dist/platforms/platform-adapter.d.ts +0 -10
  58. package/dist/platforms/platform-adapter.d.ts.map +0 -1
  59. package/dist/platforms/platform-adapter.js +0 -1
  60. package/dist/platforms/platform-registry.d.ts +0 -3
  61. package/dist/platforms/platform-registry.d.ts.map +0 -1
  62. package/dist/platforms/platform-registry.js +0 -21
  63. package/dist/platforms/vega/build.d.ts +0 -23
  64. package/dist/platforms/vega/build.d.ts.map +0 -1
  65. package/dist/platforms/vega/build.js +0 -55
  66. package/dist/platforms/vega/device.d.ts +0 -57
  67. package/dist/platforms/vega/device.d.ts.map +0 -1
  68. package/dist/platforms/vega/device.js +0 -206
  69. package/dist/platforms/vega/index.d.ts +0 -4
  70. package/dist/platforms/vega/index.d.ts.map +0 -1
  71. package/dist/platforms/vega/index.js +0 -75
  72. package/dist/platforms/web/index.d.ts +0 -4
  73. package/dist/platforms/web/index.d.ts.map +0 -1
  74. package/dist/platforms/web/index.js +0 -9
  75. package/dist/process.d.ts +0 -3
  76. package/dist/process.d.ts.map +0 -1
  77. package/dist/process.js +0 -28
  78. package/dist/reporters/default-reporter.d.ts +0 -3
  79. package/dist/reporters/default-reporter.d.ts.map +0 -1
  80. package/dist/reporters/default-reporter.js +0 -116
  81. package/dist/reporters/junit-reporter.d.ts +0 -3
  82. package/dist/reporters/junit-reporter.d.ts.map +0 -1
  83. package/dist/reporters/junit-reporter.js +0 -119
  84. package/dist/reporters/live-reporter.d.ts +0 -20
  85. package/dist/reporters/live-reporter.d.ts.map +0 -1
  86. package/dist/reporters/live-reporter.js +0 -176
  87. package/dist/src/reporters/default-reporter.js +0 -135
  88. package/dist/test-reporter-demo.js +0 -95
  89. package/dist/utils/status-formatter.d.ts +0 -27
  90. package/dist/utils/status-formatter.d.ts.map +0 -1
  91. package/dist/utils/status-formatter.js +0 -54
  92. package/dist/utils.d.ts +0 -6
  93. package/dist/utils.d.ts.map +0 -1
  94. package/dist/utils.js +0 -26
@@ -1,23 +0,0 @@
1
- export type VegaBuildTarget = 'sim_tv_x86_64' | 'sim_tv_aarch64';
2
- export type VegaBuildType = 'Debug' | 'Release';
3
- /**
4
- * Build Vega app and produce .vpkg file
5
- */
6
- export declare const buildVegaApp: (buildType?: VegaBuildType, target?: VegaBuildTarget) => Promise<void>;
7
- /**
8
- * Clean build artifacts
9
- */
10
- export declare const cleanBuild: () => Promise<void>;
11
- /**
12
- * Get the expected .vpkg file path based on build configuration
13
- */
14
- export declare const getVpkgPath: (appName: string, buildType?: VegaBuildType, target?: VegaBuildTarget) => string;
15
- /**
16
- * Launch an already installed app on specified Vega virtual device
17
- */
18
- export declare const runApp: (deviceId: string, bundleId: string) => Promise<void>;
19
- /**
20
- * Kill/terminate app on specified Vega virtual device
21
- */
22
- export declare const killApp: (deviceId: string, bundleId: string) => Promise<void>;
23
- //# sourceMappingURL=build.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/platforms/vega/build.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,eAAe,GAAG,eAAe,GAAG,gBAAgB,CAAC;AACjE,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,SAAS,CAAC;AAEhD;;GAEG;AACH,eAAO,MAAM,YAAY,GACvB,YAAW,aAAyB,EACpC,SAAS,eAAe,KACvB,OAAO,CAAC,IAAI,CAYd,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,QAAa,OAAO,CAAC,IAAI,CAE/C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,GACtB,SAAS,MAAM,EACf,YAAW,aAAyB,EACpC,SAAQ,eAAiC,KACxC,MAUF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,MAAM,GACjB,UAAU,MAAM,EAChB,UAAU,MAAM,KACf,OAAO,CAAC,IAAI,CASd,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,OAAO,GAClB,UAAU,MAAM,EAChB,UAAU,MAAM,KACf,OAAO,CAAC,IAAI,CASd,CAAC"}
@@ -1,55 +0,0 @@
1
- import path from 'node:path';
2
- import { spawn } from '@react-native-harness/tools';
3
- /**
4
- * Build Vega app and produce .vpkg file
5
- */
6
- export const buildVegaApp = async (buildType = 'Release', target) => {
7
- const args = ['run', 'build:app'];
8
- if (buildType) {
9
- args.push('-b', buildType);
10
- }
11
- if (target) {
12
- args.push('-t', target);
13
- }
14
- await spawn('npm', args);
15
- };
16
- /**
17
- * Clean build artifacts
18
- */
19
- export const cleanBuild = async () => {
20
- await spawn('kepler', ['clean']);
21
- };
22
- /**
23
- * Get the expected .vpkg file path based on build configuration
24
- */
25
- export const getVpkgPath = (appName, buildType = 'Release', target = 'sim_tv_x86_64') => {
26
- const buildTypeStr = buildType.toLowerCase();
27
- const vpkgFileName = `${appName}_${target}.vpkg`;
28
- return path.join(process.cwd(), 'build', `${target}-${buildTypeStr}`, vpkgFileName);
29
- };
30
- /**
31
- * Launch an already installed app on specified Vega virtual device
32
- */
33
- export const runApp = async (deviceId, bundleId) => {
34
- await spawn('kepler', [
35
- 'device',
36
- 'launch-app',
37
- '--device',
38
- deviceId,
39
- '--appName',
40
- bundleId,
41
- ]);
42
- };
43
- /**
44
- * Kill/terminate app on specified Vega virtual device
45
- */
46
- export const killApp = async (deviceId, bundleId) => {
47
- await spawn('kepler', [
48
- 'device',
49
- 'terminate-app',
50
- '--device',
51
- deviceId,
52
- '--appName',
53
- bundleId,
54
- ]);
55
- };
@@ -1,57 +0,0 @@
1
- export type VegaVirtualDeviceStatus = 'running' | 'stopped';
2
- /**
3
- * List all available Vega virtual devices
4
- * Returns array of device identifiers that can be used with kepler commands
5
- */
6
- export declare const listVegaDevices: () => Promise<string[]>;
7
- /**
8
- * Check if a specific Vega virtual device is connected/available
9
- */
10
- export declare const isVegaDeviceConnected: (deviceId: string) => Promise<boolean>;
11
- /**
12
- * Check if an app is installed on the specified Vega virtual device
13
- */
14
- export declare const isAppInstalled: (deviceId: string, bundleId: string) => Promise<boolean>;
15
- /**
16
- * Check if an app is currently running on the specified Vega virtual device
17
- */
18
- export declare const isAppRunning: (deviceId: string, bundleId: string) => Promise<boolean>;
19
- /**
20
- * Install app on specified Vega virtual device using .vpkg file
21
- */
22
- export declare const installApp: (deviceId: string, vpkgPath: string) => Promise<void>;
23
- /**
24
- * Terminate app on specified Vega virtual device
25
- */
26
- export declare const terminateApp: (deviceId: string, bundleId: string) => Promise<void>;
27
- /**
28
- * Uninstall app from specified Vega virtual device
29
- */
30
- export declare const uninstallApp: (deviceId: string, bundleId: string) => Promise<void>;
31
- /**
32
- * Start port forwarding for debugging on specified Vega virtual device
33
- */
34
- export declare const startPortForwarding: (deviceId: string, port: number, forward?: boolean) => Promise<void>;
35
- /**
36
- * Stop port forwarding on specified Vega virtual device
37
- */
38
- export declare const stopPortForwarding: (deviceId: string, port: number, forward?: boolean) => Promise<void>;
39
- /**
40
- * Get status of a specific Vega virtual device
41
- * Note: Vega CLI might manage virtual devices globally, so this checks if the device is available
42
- */
43
- export declare const getVegaDeviceStatus: (deviceId: string) => Promise<VegaVirtualDeviceStatus>;
44
- /**
45
- * Start Vega Virtual Device
46
- * Note: Vega might manage virtual devices globally, this starts the virtual device system
47
- */
48
- export declare const startVirtualDevice: () => Promise<void>;
49
- /**
50
- * Stop Vega Virtual Device
51
- */
52
- export declare const stopVirtualDevice: () => Promise<void>;
53
- /**
54
- * Combined install and run command for specified Vega virtual device (Vega-specific convenience method)
55
- */
56
- export declare const runKepler: (deviceId: string, vpkgPath: string, bundleId: string) => Promise<void>;
57
- //# sourceMappingURL=device.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"device.d.ts","sourceRoot":"","sources":["../../../src/platforms/vega/device.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,uBAAuB,GAAG,SAAS,GAAG,SAAS,CAAC;AAE5D;;;GAGG;AACH,eAAO,MAAM,eAAe,QAAa,OAAO,CAAC,MAAM,EAAE,CAwBxD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qBAAqB,GAChC,UAAU,MAAM,KACf,OAAO,CAAC,OAAO,CAYjB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,GACzB,UAAU,MAAM,EAChB,UAAU,MAAM,KACf,OAAO,CAAC,OAAO,CAcjB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,GACvB,UAAU,MAAM,EAChB,UAAU,MAAM,KACf,OAAO,CAAC,OAAO,CAcjB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,GACrB,UAAU,MAAM,EAChB,UAAU,MAAM,KACf,OAAO,CAAC,IAAI,CASd,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,GACvB,UAAU,MAAM,EAChB,UAAU,MAAM,KACf,OAAO,CAAC,IAAI,CASd,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,GACvB,UAAU,MAAM,EAChB,UAAU,MAAM,KACf,OAAO,CAAC,IAAI,CASd,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAC9B,UAAU,MAAM,EAChB,MAAM,MAAM,EACZ,iBAAc,KACb,OAAO,CAAC,IAAI,CAWd,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAC7B,UAAU,MAAM,EAChB,MAAM,MAAM,EACZ,iBAAc,KACb,OAAO,CAAC,IAAI,CAWd,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,GAC9B,UAAU,MAAM,KACf,OAAO,CAAC,uBAAuB,CAkBjC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,QAAa,OAAO,CAAC,IAAI,CAqBvD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,QAAa,OAAO,CAAC,IAAI,CAEtD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,SAAS,GACpB,UAAU,MAAM,EAChB,UAAU,MAAM,EAChB,UAAU,MAAM,KACf,OAAO,CAAC,IAAI,CAEd,CAAC"}
@@ -1,206 +0,0 @@
1
- import { spawn } from '@react-native-harness/tools';
2
- /**
3
- * List all available Vega virtual devices
4
- * Returns array of device identifiers that can be used with kepler commands
5
- */
6
- export const listVegaDevices = async () => {
7
- try {
8
- const { stdout } = await spawn('kepler', ['device', 'list']);
9
- const lines = stdout.trim().split('\n');
10
- const devices = [];
11
- for (const line of lines) {
12
- if (line.trim()) {
13
- // Parse device line format: "VirtualDevice : tv - x86_64 - OS - hostname"
14
- // or potentially "VegaTV_1 : tv - x86_64 - OS - hostname" for named instances
15
- const deviceId = line.split(' : ')[0].trim();
16
- if (deviceId &&
17
- (deviceId === 'VirtualDevice' || deviceId.startsWith('Vega'))) {
18
- devices.push(deviceId);
19
- }
20
- }
21
- }
22
- return devices;
23
- }
24
- catch {
25
- return [];
26
- }
27
- };
28
- /**
29
- * Check if a specific Vega virtual device is connected/available
30
- */
31
- export const isVegaDeviceConnected = async (deviceId) => {
32
- try {
33
- const { stdout } = await spawn('kepler', [
34
- 'device',
35
- 'is-connected',
36
- '--device',
37
- deviceId,
38
- ]);
39
- return stdout.includes('is connected');
40
- }
41
- catch {
42
- return false;
43
- }
44
- };
45
- /**
46
- * Check if an app is installed on the specified Vega virtual device
47
- */
48
- export const isAppInstalled = async (deviceId, bundleId) => {
49
- try {
50
- await spawn('kepler', [
51
- 'device',
52
- 'is-app-installed',
53
- '--device',
54
- deviceId,
55
- '--appName',
56
- bundleId,
57
- ]);
58
- return true;
59
- }
60
- catch {
61
- return false;
62
- }
63
- };
64
- /**
65
- * Check if an app is currently running on the specified Vega virtual device
66
- */
67
- export const isAppRunning = async (deviceId, bundleId) => {
68
- try {
69
- await spawn('kepler', [
70
- 'device',
71
- 'is-app-running',
72
- '--device',
73
- deviceId,
74
- '--appName',
75
- bundleId,
76
- ]);
77
- return true;
78
- }
79
- catch {
80
- return false;
81
- }
82
- };
83
- /**
84
- * Install app on specified Vega virtual device using .vpkg file
85
- */
86
- export const installApp = async (deviceId, vpkgPath) => {
87
- await spawn('kepler', [
88
- 'device',
89
- 'install-app',
90
- '-p',
91
- vpkgPath,
92
- '--device',
93
- deviceId,
94
- ]);
95
- };
96
- /**
97
- * Terminate app on specified Vega virtual device
98
- */
99
- export const terminateApp = async (deviceId, bundleId) => {
100
- await spawn('kepler', [
101
- 'device',
102
- 'terminate-app',
103
- '--device',
104
- deviceId,
105
- '--appName',
106
- bundleId,
107
- ]);
108
- };
109
- /**
110
- * Uninstall app from specified Vega virtual device
111
- */
112
- export const uninstallApp = async (deviceId, bundleId) => {
113
- await spawn('kepler', [
114
- 'device',
115
- 'uninstall-app',
116
- '--device',
117
- deviceId,
118
- '--appName',
119
- bundleId,
120
- ]);
121
- };
122
- /**
123
- * Start port forwarding for debugging on specified Vega virtual device
124
- */
125
- export const startPortForwarding = async (deviceId, port, forward = true) => {
126
- await spawn('kepler', [
127
- 'device',
128
- 'start-port-forwarding',
129
- '--device',
130
- deviceId,
131
- '--port',
132
- port.toString(),
133
- '--forward',
134
- forward.toString(),
135
- ]);
136
- };
137
- /**
138
- * Stop port forwarding on specified Vega virtual device
139
- */
140
- export const stopPortForwarding = async (deviceId, port, forward = true) => {
141
- await spawn('kepler', [
142
- 'device',
143
- 'stop-port-forwarding',
144
- '--device',
145
- deviceId,
146
- '--port',
147
- port.toString(),
148
- '--forward',
149
- forward.toString(),
150
- ]);
151
- };
152
- /**
153
- * Get status of a specific Vega virtual device
154
- * Note: Vega CLI might manage virtual devices globally, so this checks if the device is available
155
- */
156
- export const getVegaDeviceStatus = async (deviceId) => {
157
- try {
158
- // First check if the device is connected/available
159
- const isConnected = await isVegaDeviceConnected(deviceId);
160
- if (isConnected) {
161
- return 'running';
162
- }
163
- // Check general virtual device status
164
- const { stdout } = await spawn('kepler', ['virtual-device', 'status']);
165
- // Parse the status output to determine if VVD is running
166
- return stdout.toLowerCase().includes('running') ||
167
- stdout.toLowerCase().includes('ready')
168
- ? 'running'
169
- : 'stopped';
170
- }
171
- catch {
172
- return 'stopped';
173
- }
174
- };
175
- /**
176
- * Start Vega Virtual Device
177
- * Note: Vega might manage virtual devices globally, this starts the virtual device system
178
- */
179
- export const startVirtualDevice = async () => {
180
- await spawn('kepler', ['virtual-device', 'start']);
181
- // Poll for VVD status until it's running
182
- let attempts = 0;
183
- const maxAttempts = 30; // 30 seconds timeout
184
- while (attempts < maxAttempts) {
185
- const { stdout } = await spawn('kepler', ['virtual-device', 'status']);
186
- if (stdout.toLowerCase().includes('running') ||
187
- stdout.toLowerCase().includes('ready')) {
188
- return;
189
- }
190
- await new Promise((resolve) => setTimeout(resolve, 1000));
191
- attempts++;
192
- }
193
- throw new Error('Vega Virtual Device failed to start within timeout');
194
- };
195
- /**
196
- * Stop Vega Virtual Device
197
- */
198
- export const stopVirtualDevice = async () => {
199
- await spawn('kepler', ['virtual-device', 'stop']);
200
- };
201
- /**
202
- * Combined install and run command for specified Vega virtual device (Vega-specific convenience method)
203
- */
204
- export const runKepler = async (deviceId, vpkgPath, bundleId) => {
205
- await spawn('kepler', ['run-kepler', vpkgPath, bundleId, '-d', deviceId]);
206
- };
@@ -1,4 +0,0 @@
1
- import { type PlatformAdapter } from '../platform-adapter.js';
2
- declare const vegaPlatformAdapter: PlatformAdapter;
3
- export default vegaPlatformAdapter;
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/platforms/vega/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAe9D,QAAA,MAAM,mBAAmB,EAAE,eAmF1B,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -1,75 +0,0 @@
1
- import { assertVegaRunnerConfig, } from '@react-native-harness/config';
2
- import { logger } from '@react-native-harness/tools';
3
- import { isAppInstalled, getVegaDeviceStatus, isVegaDeviceConnected, startVirtualDevice, stopVirtualDevice, startPortForwarding, stopPortForwarding, } from './device.js';
4
- import { runApp, killApp } from './build.js';
5
- import { killWithAwait } from '../../process.js';
6
- import { runMetro } from '../../bundlers/metro.js';
7
- import { AppNotInstalledError } from '../../errors/errors.js';
8
- const vegaPlatformAdapter = {
9
- name: 'vega',
10
- getEnvironment: async (runner) => {
11
- assertVegaRunnerConfig(runner);
12
- let shouldStopVirtualDevice = false;
13
- // Check if the specific Vega device is available
14
- const deviceStatus = await getVegaDeviceStatus(runner.deviceId);
15
- logger.debug(`Vega device ${runner.deviceId} status: ${deviceStatus}`);
16
- if (deviceStatus === 'stopped') {
17
- logger.debug('Starting Vega Virtual Device system');
18
- await startVirtualDevice();
19
- shouldStopVirtualDevice = true;
20
- // Wait a bit for the device to become available
21
- await new Promise((resolve) => setTimeout(resolve, 2000));
22
- }
23
- // Verify device is now connected
24
- const isConnected = await isVegaDeviceConnected(runner.deviceId);
25
- if (!isConnected) {
26
- throw new Error(`Vega device ${runner.deviceId} is not available. Make sure the virtual device is configured and running.`);
27
- }
28
- // Start Metro bundler
29
- const metroPromise = runMetro();
30
- // Set up port forwarding for debugging (similar to Android)
31
- await Promise.all([
32
- startPortForwarding(runner.deviceId, 8081, false), // reverse port forwarding for JS debugging
33
- startPortForwarding(runner.deviceId, 8080, false),
34
- startPortForwarding(runner.deviceId, 3001, false),
35
- ]);
36
- logger.debug('Port forwarding established');
37
- // Check if app is installed
38
- const isInstalled = await isAppInstalled(runner.deviceId, runner.bundleId);
39
- logger.debug(`App is installed: ${isInstalled}`);
40
- if (!isInstalled) {
41
- throw new AppNotInstalledError(runner.deviceId, runner.bundleId, 'vega');
42
- }
43
- logger.debug('Waiting for Metro to start');
44
- const metro = await metroPromise;
45
- logger.debug('Metro started');
46
- logger.debug('Running Vega app');
47
- await runApp(runner.deviceId, runner.bundleId);
48
- logger.debug('Vega app running');
49
- return {
50
- restart: async () => {
51
- await runApp(runner.deviceId, runner.bundleId);
52
- },
53
- dispose: async () => {
54
- // Kill the app
55
- await killApp(runner.deviceId, runner.bundleId);
56
- // Stop port forwarding
57
- await Promise.all([
58
- stopPortForwarding(runner.deviceId, 8081, false),
59
- stopPortForwarding(runner.deviceId, 8080, false),
60
- stopPortForwarding(runner.deviceId, 3001, false),
61
- ]).catch((error) => {
62
- // Don't fail disposal if port forwarding cleanup fails
63
- logger.debug(`Port forwarding cleanup failed: ${error.message}`);
64
- });
65
- // Stop Virtual Device if we started it
66
- if (shouldStopVirtualDevice) {
67
- await stopVirtualDevice();
68
- }
69
- // Kill Metro
70
- await killWithAwait(metro);
71
- },
72
- };
73
- },
74
- };
75
- export default vegaPlatformAdapter;
@@ -1,4 +0,0 @@
1
- import { PlatformAdapter } from '../platform-adapter.js';
2
- export declare const webPlatformAdapter: PlatformAdapter;
3
- export default webPlatformAdapter;
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/platforms/web/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,eAAO,MAAM,kBAAkB,EAAE,eAOhC,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -1,9 +0,0 @@
1
- import { assertWebRunnerConfig, } from '@react-native-harness/config';
2
- export const webPlatformAdapter = {
3
- name: 'web',
4
- getEnvironment: async (runner) => {
5
- assertWebRunnerConfig(runner);
6
- throw new Error('Web platform is currently disabled.');
7
- },
8
- };
9
- export default webPlatformAdapter;
package/dist/process.d.ts DELETED
@@ -1,3 +0,0 @@
1
- import { type ChildProcess } from 'node:child_process';
2
- export declare const killWithAwait: (child: ChildProcess) => Promise<void>;
3
- //# sourceMappingURL=process.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"process.d.ts","sourceRoot":"","sources":["../src/process.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,eAAO,MAAM,aAAa,GAAI,OAAO,YAAY,KAAG,OAAO,CAAC,IAAI,CA8B/D,CAAC"}
package/dist/process.js DELETED
@@ -1,28 +0,0 @@
1
- export const killWithAwait = (child) => {
2
- return new Promise((resolve) => {
3
- const timeout = setTimeout(() => {
4
- child.kill('SIGTERM');
5
- resolve();
6
- }, 10000);
7
- if (child.killed || child.exitCode !== null) {
8
- clearTimeout(timeout);
9
- resolve();
10
- return;
11
- }
12
- child.on('exit', () => {
13
- clearTimeout(timeout);
14
- resolve();
15
- });
16
- child.on('error', () => {
17
- clearTimeout(timeout);
18
- resolve();
19
- });
20
- try {
21
- child.kill();
22
- }
23
- catch {
24
- clearTimeout(timeout);
25
- resolve();
26
- }
27
- });
28
- };
@@ -1,3 +0,0 @@
1
- import { Reporter } from '@react-native-harness/config';
2
- export declare const defaultReporter: Reporter;
3
- //# sourceMappingURL=default-reporter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"default-reporter.d.ts","sourceRoot":"","sources":["../../src/reporters/default-reporter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAExD,eAAO,MAAM,eAAe,EAAE,QAmC7B,CAAC"}
@@ -1,116 +0,0 @@
1
- import { color, spinner } from '@react-native-harness/tools';
2
- export const defaultReporter = {
3
- report: async (results) => {
4
- const resultsSpinner = spinner();
5
- resultsSpinner.start('Test Results');
6
- for (const suite of results) {
7
- resultsSpinner.message(formatSuiteResult(suite));
8
- }
9
- // Summary
10
- let totalPassed = 0, totalFailed = 0, totalSkipped = 0, totalTodo = 0;
11
- let totalDuration = 0;
12
- for (const suite of results) {
13
- const summary = getTestSummary(suite);
14
- totalPassed += summary.passed;
15
- totalFailed += summary.failed;
16
- totalSkipped += summary.skipped;
17
- totalTodo += summary.todo;
18
- totalDuration += suite.duration || 0;
19
- }
20
- const summaryText = [
21
- color.green(`${totalPassed} passed`),
22
- color.red(`${totalFailed} failed`),
23
- color.yellow(`${totalSkipped} skipped`),
24
- color.blue(`${totalTodo} todo`),
25
- ].join(', ');
26
- resultsSpinner.message(`Summary: ${summaryText}`);
27
- resultsSpinner.message(`Total time: ${formatDuration(totalDuration)}`);
28
- },
29
- };
30
- const formatDuration = (duration) => {
31
- if (duration == null)
32
- return '';
33
- return color.dim(` (${duration}ms)`);
34
- };
35
- const getStatusIcon = (status) => {
36
- switch (status) {
37
- case 'passed':
38
- return color.green('✓');
39
- case 'failed':
40
- return color.red('✗');
41
- case 'skipped':
42
- return color.yellow('○');
43
- case 'todo':
44
- return color.blue('◐');
45
- default:
46
- return '?';
47
- }
48
- };
49
- const formatTestResult = (test, indent = '') => {
50
- const icon = getStatusIcon(test.status);
51
- const name = test.status === 'failed' ? color.red(test.name) : test.name;
52
- const duration = formatDuration(test.duration);
53
- let result = `${indent}${icon} ${name}${duration}`;
54
- if (test.error) {
55
- const errorLines = test.error.message?.split('\n') || [];
56
- result +=
57
- '\n' +
58
- errorLines
59
- .map((line) => `${indent} ${color.red(line)}`)
60
- .join('\n');
61
- }
62
- return result;
63
- };
64
- const formatSuiteResult = (suite, indent = '') => {
65
- const icon = getStatusIcon(suite.status);
66
- const name = suite.status === 'failed' ? color.red(suite.name) : color.bold(suite.name);
67
- const duration = formatDuration(suite.duration);
68
- let result = `${indent}${icon} ${name}${duration}`;
69
- if (suite.error) {
70
- const errorLines = suite.error.message.split('\n');
71
- result +=
72
- '\n' +
73
- errorLines
74
- .map((line) => `${indent} ${color.red(line)}`)
75
- .join('\n');
76
- }
77
- const childIndent = indent + ' ';
78
- // Format tests
79
- for (const test of suite.tests) {
80
- result += '\n' + formatTestResult(test, childIndent);
81
- }
82
- // Format nested suites
83
- for (const childSuite of suite.suites) {
84
- result += '\n' + formatSuiteResult(childSuite, childIndent);
85
- }
86
- return result;
87
- };
88
- const getTestSummary = (suite) => {
89
- let passed = 0, failed = 0, skipped = 0, todo = 0;
90
- // Count tests in current suite
91
- for (const test of suite.tests) {
92
- switch (test.status) {
93
- case 'passed':
94
- passed++;
95
- break;
96
- case 'failed':
97
- failed++;
98
- break;
99
- case 'skipped':
100
- skipped++;
101
- break;
102
- case 'todo':
103
- todo++;
104
- break;
105
- }
106
- }
107
- // Count tests in nested suites
108
- for (const childSuite of suite.suites) {
109
- const childSummary = getTestSummary(childSuite);
110
- passed += childSummary.passed;
111
- failed += childSummary.failed;
112
- skipped += childSummary.skipped;
113
- todo += childSummary.todo;
114
- }
115
- return { passed, failed, skipped, todo };
116
- };
@@ -1,3 +0,0 @@
1
- import { Reporter } from '@react-native-harness/config';
2
- export declare const junitReporter: Reporter;
3
- //# sourceMappingURL=junit-reporter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"junit-reporter.d.ts","sourceRoot":"","sources":["../../src/reporters/junit-reporter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAKxD,eAAO,MAAM,aAAa,EAAE,QAU3B,CAAC"}