farm-runner 1.1.10 → 1.1.11
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/README.md +77 -2
- package/dist/src/bundle.js +1 -1
- package/dist/src/cli.js +128 -0
- package/dist/src/config/node.config.d.ts +88 -0
- package/dist/src/config/node.config.d.ts.map +1 -0
- package/dist/src/config/node.config.js +180 -0
- package/dist/src/config/node.config.js.map +1 -0
- package/dist/src/scripts/prepare-wda-cli.d.ts +3 -0
- package/dist/src/scripts/prepare-wda-cli.d.ts.map +1 -1
- package/dist/src/scripts/prepare-wda-cli.js +11 -5
- package/dist/src/scripts/prepare-wda-cli.js.map +1 -1
- package/package.json +18 -5
package/dist/src/cli.js
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
/**
|
|
4
|
+
* Farm Runner CLI
|
|
5
|
+
*
|
|
6
|
+
* Main entry point for the farm-runner CLI tool
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* farm-runner [command] [options]
|
|
10
|
+
*
|
|
11
|
+
* Commands:
|
|
12
|
+
* start Start the node server (default)
|
|
13
|
+
* run prepare-wda Prepare WebDriverAgent for iOS devices
|
|
14
|
+
* --help, -h Show help message
|
|
15
|
+
*/
|
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
const child_process_1 = require("child_process");
|
|
21
|
+
const fs_1 = __importDefault(require("fs"));
|
|
22
|
+
const path_1 = __importDefault(require("path"));
|
|
23
|
+
/**
|
|
24
|
+
* Parse CLI arguments
|
|
25
|
+
*/
|
|
26
|
+
function parseArgs() {
|
|
27
|
+
const args = process.argv.slice(2);
|
|
28
|
+
if (args.length === 0 || args[0] === 'start') {
|
|
29
|
+
return { command: 'start', args: args.slice(1) };
|
|
30
|
+
}
|
|
31
|
+
if (args[0] === 'run' && args[1] === 'prepare-wda') {
|
|
32
|
+
return { command: 'run', subcommand: 'prepare-wda', args: args.slice(2) };
|
|
33
|
+
}
|
|
34
|
+
if (args[0] === '--help' || args[0] === '-h') {
|
|
35
|
+
return { command: 'help', args: [] };
|
|
36
|
+
}
|
|
37
|
+
// If no recognized command, treat as start with all args
|
|
38
|
+
return { command: 'start', args };
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Show help message
|
|
42
|
+
*/
|
|
43
|
+
function showHelp() {
|
|
44
|
+
console.log(`
|
|
45
|
+
Farm Runner - Device Farm Node Server
|
|
46
|
+
|
|
47
|
+
Usage:
|
|
48
|
+
farm-runner [command] [options]
|
|
49
|
+
|
|
50
|
+
Commands:
|
|
51
|
+
start Start the node server (default)
|
|
52
|
+
run prepare-wda [options] Prepare WebDriverAgent for iOS devices
|
|
53
|
+
--help, -h Show this help message
|
|
54
|
+
|
|
55
|
+
Examples:
|
|
56
|
+
farm-runner # Start the server
|
|
57
|
+
farm-runner start # Start the server
|
|
58
|
+
farm-runner start --config ./node.config.json # Start with custom config
|
|
59
|
+
farm-runner run prepare-wda # Prepare WDA (interactive)
|
|
60
|
+
farm-runner run prepare-wda -m ./profile.mobileprovision
|
|
61
|
+
farm-runner run prepare-wda --platform ios
|
|
62
|
+
farm-runner run prepare-wda -h # Show prepare-wda help
|
|
63
|
+
|
|
64
|
+
For more information, visit: https://github.com/your-repo/device-farm
|
|
65
|
+
`);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Start the node server
|
|
69
|
+
*/
|
|
70
|
+
function startServer(args) {
|
|
71
|
+
// In production, use the bundled version if available
|
|
72
|
+
// In development, fall back to server.js
|
|
73
|
+
const bundlePath = path_1.default.join(__dirname, 'bundle.js');
|
|
74
|
+
const serverPath = path_1.default.join(__dirname, 'server.js');
|
|
75
|
+
const targetPath = fs_1.default.existsSync(bundlePath) ? bundlePath : serverPath;
|
|
76
|
+
const child = (0, child_process_1.spawn)('node', [targetPath, ...args], {
|
|
77
|
+
stdio: 'inherit',
|
|
78
|
+
env: process.env,
|
|
79
|
+
});
|
|
80
|
+
child.on('exit', code => {
|
|
81
|
+
process.exit(code || 0);
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Run prepare-wda script
|
|
86
|
+
*/
|
|
87
|
+
function runPrepareWda(args) {
|
|
88
|
+
const scriptPath = path_1.default.join(__dirname, 'scripts', 'prepare-wda-cli.js');
|
|
89
|
+
const child = (0, child_process_1.spawn)('node', [scriptPath, ...args], {
|
|
90
|
+
stdio: 'inherit',
|
|
91
|
+
env: process.env,
|
|
92
|
+
});
|
|
93
|
+
child.on('exit', code => {
|
|
94
|
+
process.exit(code || 0);
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Main CLI handler
|
|
99
|
+
*/
|
|
100
|
+
function main() {
|
|
101
|
+
const { command, subcommand, args } = parseArgs();
|
|
102
|
+
switch (command) {
|
|
103
|
+
case 'help':
|
|
104
|
+
showHelp();
|
|
105
|
+
process.exit(0);
|
|
106
|
+
break;
|
|
107
|
+
case 'start':
|
|
108
|
+
startServer(args);
|
|
109
|
+
break;
|
|
110
|
+
case 'run':
|
|
111
|
+
if (subcommand === 'prepare-wda') {
|
|
112
|
+
runPrepareWda(args);
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
console.error(`❌ Unknown subcommand: ${subcommand}`);
|
|
116
|
+
console.log('Run "farm-runner --help" for usage information.');
|
|
117
|
+
process.exit(1);
|
|
118
|
+
}
|
|
119
|
+
break;
|
|
120
|
+
default:
|
|
121
|
+
console.error(`❌ Unknown command: ${command}`);
|
|
122
|
+
console.log('Run "farm-runner --help" for usage information.');
|
|
123
|
+
process.exit(1);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
// Run the CLI
|
|
127
|
+
main();
|
|
128
|
+
//# sourceMappingURL=cli.js.map
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
export interface AppiumServerConfig {
|
|
2
|
+
/** Enable embedded Appium server */
|
|
3
|
+
enabled?: boolean;
|
|
4
|
+
/**
|
|
5
|
+
* Appium server arguments - pass everything here exactly as Appium expects
|
|
6
|
+
* All server configuration goes in this object and will be passed directly to Appium
|
|
7
|
+
*
|
|
8
|
+
* Defaults (applied if not specified):
|
|
9
|
+
* - "log-level": "debug" (for complete log visibility including ADB commands, proxying, etc.)
|
|
10
|
+
* - "log-timestamp": true (shows timestamps in logs)
|
|
11
|
+
*
|
|
12
|
+
* Common options:
|
|
13
|
+
* - port: 4723 (if not specified, will auto-detect)
|
|
14
|
+
* - address: '0.0.0.0' or '127.0.0.1'
|
|
15
|
+
* - "allow-cors": true
|
|
16
|
+
* - "use-drivers": ["uiautomator2", "xcuitest"]
|
|
17
|
+
* - "use-plugins": ["images", "relaxed-caps"]
|
|
18
|
+
* - "relaxed-security": true
|
|
19
|
+
* - "session-override": true
|
|
20
|
+
* - "base-path": "/wd/hub"
|
|
21
|
+
* - "log-level": "debug" (or "info", "warn", "error")
|
|
22
|
+
* - "log-timestamp": true
|
|
23
|
+
* - "allow-insecure": ["adb_shell"]
|
|
24
|
+
* - "default-capabilities": { key: "value" }
|
|
25
|
+
* - appiumHome: "/path/to/.appium"
|
|
26
|
+
*
|
|
27
|
+
* For all available options, see:
|
|
28
|
+
* @see https://appium.io/docs/en/latest/guides/config/
|
|
29
|
+
*/
|
|
30
|
+
serverArgs?: Record<string, unknown>;
|
|
31
|
+
}
|
|
32
|
+
export interface NodeConfig {
|
|
33
|
+
hubUrl: string;
|
|
34
|
+
accessKey: string;
|
|
35
|
+
token: string;
|
|
36
|
+
name: string;
|
|
37
|
+
host: string;
|
|
38
|
+
os: string;
|
|
39
|
+
tags: string | null;
|
|
40
|
+
capabilityPortRange?: {
|
|
41
|
+
min: number;
|
|
42
|
+
max: number;
|
|
43
|
+
};
|
|
44
|
+
chromeDriverPath?: string;
|
|
45
|
+
platform?: 'android' | 'ios' | 'both';
|
|
46
|
+
bootedSimulators?: boolean;
|
|
47
|
+
/** iOS device type filter */
|
|
48
|
+
iosDeviceType?: 'real' | 'simulated' | 'both';
|
|
49
|
+
/** Android device type filter */
|
|
50
|
+
androidDeviceType?: 'real' | 'simulated' | 'both';
|
|
51
|
+
/** Appium server configuration */
|
|
52
|
+
appiumServer?: AppiumServerConfig;
|
|
53
|
+
/** Temporary session logs directory (default: './tmp') - logs are uploaded to hub after session ends */
|
|
54
|
+
tempLogsDir?: string;
|
|
55
|
+
/** Absolute path to store WDA resigned IPA files (default: ~/.cache/device-farm) */
|
|
56
|
+
wdaResignedIpaPath?: string;
|
|
57
|
+
/** List of Android app package names to uninstall after session ends (e.g., ["com.example.app1", "com.example.app2"]) */
|
|
58
|
+
androidCleanUpApps?: string[];
|
|
59
|
+
/** List of iOS app bundle IDs to uninstall after session ends (e.g., ["com.example.app1", "com.example.app2"]) */
|
|
60
|
+
iosCleanUpApps?: string[];
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Load configuration from file or return default
|
|
64
|
+
*/
|
|
65
|
+
export declare function loadConfig(configPath?: string): Partial<NodeConfig>;
|
|
66
|
+
/**
|
|
67
|
+
* Save configuration to file
|
|
68
|
+
*/
|
|
69
|
+
export declare function saveConfig(config: NodeConfig, configPath?: string): void;
|
|
70
|
+
/**
|
|
71
|
+
* Parse CLI arguments
|
|
72
|
+
*/
|
|
73
|
+
export declare function parseCLIArgs(): Partial<NodeConfig>;
|
|
74
|
+
/**
|
|
75
|
+
* Get config file path from CLI arguments
|
|
76
|
+
*/
|
|
77
|
+
export declare function getConfigPathFromCLI(): string | undefined;
|
|
78
|
+
/**
|
|
79
|
+
* Merge config from file, CLI args, and environment variables
|
|
80
|
+
*/
|
|
81
|
+
export declare function getMergedConfig(configPath?: string): NodeConfig;
|
|
82
|
+
/**
|
|
83
|
+
* Get the temporary logs directory path
|
|
84
|
+
* @param configPath - Optional config path override
|
|
85
|
+
* @returns Absolute path to temp logs directory
|
|
86
|
+
*/
|
|
87
|
+
export declare function getTempLogsDir(configPath?: string): string;
|
|
88
|
+
//# sourceMappingURL=node.config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.config.d.ts","sourceRoot":"","sources":["../../../src/config/node.config.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,kBAAkB;IACjC,oCAAoC;IACpC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AAED,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,mBAAmB,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IACnD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,EAAE,SAAS,GAAG,KAAK,GAAG,MAAM,CAAC;IACtC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,6BAA6B;IAC7B,aAAa,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,MAAM,CAAC;IAC9C,iCAAiC;IACjC,iBAAiB,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,MAAM,CAAC;IAClD,kCAAkC;IAClC,YAAY,CAAC,EAAE,kBAAkB,CAAC;IAClC,wGAAwG;IACxG,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oFAAoF;IACpF,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,yHAAyH;IACzH,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,kHAAkH;IAClH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAiBnE;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,UAAU,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CASxE;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAAC,UAAU,CAAC,CAyElD;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,GAAG,SAAS,CAQzD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,UAAU,CAkC/D;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAS1D"}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.loadConfig = loadConfig;
|
|
7
|
+
exports.saveConfig = saveConfig;
|
|
8
|
+
exports.parseCLIArgs = parseCLIArgs;
|
|
9
|
+
exports.getConfigPathFromCLI = getConfigPathFromCLI;
|
|
10
|
+
exports.getMergedConfig = getMergedConfig;
|
|
11
|
+
exports.getTempLogsDir = getTempLogsDir;
|
|
12
|
+
const fs_1 = __importDefault(require("fs"));
|
|
13
|
+
const path_1 = __importDefault(require("path"));
|
|
14
|
+
/**
|
|
15
|
+
* Load configuration from file or return default
|
|
16
|
+
*/
|
|
17
|
+
function loadConfig(configPath) {
|
|
18
|
+
const defaultConfigPath = path_1.default.resolve(process.cwd(), 'node.config.json');
|
|
19
|
+
const configFile = configPath || defaultConfigPath;
|
|
20
|
+
let config = {};
|
|
21
|
+
// Try to load from file if it exists
|
|
22
|
+
if (fs_1.default.existsSync(configFile)) {
|
|
23
|
+
try {
|
|
24
|
+
const fileContent = fs_1.default.readFileSync(configFile, 'utf-8');
|
|
25
|
+
config = JSON.parse(fileContent);
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
console.warn(`Warning: Failed to parse config file ${configFile}:`, error);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return config;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Save configuration to file
|
|
35
|
+
*/
|
|
36
|
+
function saveConfig(config, configPath) {
|
|
37
|
+
const defaultConfigPath = path_1.default.resolve(process.cwd(), 'node.config.json');
|
|
38
|
+
const configFile = configPath || defaultConfigPath;
|
|
39
|
+
try {
|
|
40
|
+
fs_1.default.writeFileSync(configFile, JSON.stringify(config, null, 2), 'utf-8');
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
console.error(`Failed to save config file ${configFile}:`, error);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Parse CLI arguments
|
|
48
|
+
*/
|
|
49
|
+
function parseCLIArgs() {
|
|
50
|
+
const args = process.argv.slice(2);
|
|
51
|
+
const config = {};
|
|
52
|
+
for (let i = 0; i < args.length; i++) {
|
|
53
|
+
const arg = args[i];
|
|
54
|
+
const nextArg = args[i + 1];
|
|
55
|
+
switch (arg) {
|
|
56
|
+
case '--hub-url':
|
|
57
|
+
case '-u':
|
|
58
|
+
if (nextArg) {
|
|
59
|
+
config.hubUrl = nextArg;
|
|
60
|
+
i++;
|
|
61
|
+
}
|
|
62
|
+
break;
|
|
63
|
+
case '--access-key':
|
|
64
|
+
case '-a':
|
|
65
|
+
if (nextArg) {
|
|
66
|
+
config.accessKey = nextArg;
|
|
67
|
+
i++;
|
|
68
|
+
}
|
|
69
|
+
break;
|
|
70
|
+
case '--token':
|
|
71
|
+
case '-t':
|
|
72
|
+
if (nextArg) {
|
|
73
|
+
config.token = nextArg;
|
|
74
|
+
i++;
|
|
75
|
+
}
|
|
76
|
+
break;
|
|
77
|
+
case '--name':
|
|
78
|
+
case '-n':
|
|
79
|
+
if (nextArg) {
|
|
80
|
+
config.name = nextArg;
|
|
81
|
+
i++;
|
|
82
|
+
}
|
|
83
|
+
break;
|
|
84
|
+
case '--host':
|
|
85
|
+
case '-h':
|
|
86
|
+
if (nextArg) {
|
|
87
|
+
config.host = nextArg;
|
|
88
|
+
i++;
|
|
89
|
+
}
|
|
90
|
+
break;
|
|
91
|
+
case '--os':
|
|
92
|
+
if (nextArg) {
|
|
93
|
+
config.os = nextArg;
|
|
94
|
+
i++;
|
|
95
|
+
}
|
|
96
|
+
break;
|
|
97
|
+
case '--tags':
|
|
98
|
+
if (nextArg) {
|
|
99
|
+
config.tags = nextArg;
|
|
100
|
+
i++;
|
|
101
|
+
}
|
|
102
|
+
break;
|
|
103
|
+
case '--temp-logs-dir':
|
|
104
|
+
if (nextArg) {
|
|
105
|
+
config.tempLogsDir = nextArg;
|
|
106
|
+
i++;
|
|
107
|
+
}
|
|
108
|
+
break;
|
|
109
|
+
case '--config':
|
|
110
|
+
case '-c':
|
|
111
|
+
if (nextArg) {
|
|
112
|
+
// This will be handled separately
|
|
113
|
+
i++;
|
|
114
|
+
}
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return config;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Get config file path from CLI arguments
|
|
122
|
+
*/
|
|
123
|
+
function getConfigPathFromCLI() {
|
|
124
|
+
const args = process.argv.slice(2);
|
|
125
|
+
for (let i = 0; i < args.length; i++) {
|
|
126
|
+
if ((args[i] === '--config' || args[i] === '-c') && args[i + 1]) {
|
|
127
|
+
return args[i + 1];
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return undefined;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Merge config from file, CLI args, and environment variables
|
|
134
|
+
*/
|
|
135
|
+
function getMergedConfig(configPath) {
|
|
136
|
+
// Get config path from CLI if not provided
|
|
137
|
+
const cliConfigPath = getConfigPathFromCLI();
|
|
138
|
+
const finalConfigPath = configPath || cliConfigPath;
|
|
139
|
+
// Load from file
|
|
140
|
+
const baseConfig = finalConfigPath ? loadConfig(finalConfigPath) : loadConfig();
|
|
141
|
+
// Parse CLI args (excluding config path)
|
|
142
|
+
const cliConfig = parseCLIArgs();
|
|
143
|
+
// Merge: file config < CLI args < environment variables
|
|
144
|
+
const merged = {
|
|
145
|
+
hubUrl: process.env.HUB_URL || cliConfig.hubUrl || baseConfig.hubUrl || '',
|
|
146
|
+
accessKey: process.env.ACCESS_KEY || cliConfig.accessKey || baseConfig.accessKey || '',
|
|
147
|
+
token: process.env.TOKEN || cliConfig.token || baseConfig.token || '',
|
|
148
|
+
name: cliConfig.name || baseConfig.name || '',
|
|
149
|
+
host: cliConfig.host || baseConfig.host || '',
|
|
150
|
+
os: cliConfig.os || baseConfig.os || '',
|
|
151
|
+
tags: cliConfig.tags !== undefined ? cliConfig.tags : (baseConfig.tags ?? null),
|
|
152
|
+
capabilityPortRange: cliConfig.capabilityPortRange || baseConfig.capabilityPortRange,
|
|
153
|
+
chromeDriverPath: cliConfig.chromeDriverPath || baseConfig.chromeDriverPath,
|
|
154
|
+
platform: baseConfig.platform,
|
|
155
|
+
bootedSimulators: baseConfig.bootedSimulators,
|
|
156
|
+
iosDeviceType: baseConfig.iosDeviceType,
|
|
157
|
+
androidDeviceType: baseConfig.androidDeviceType,
|
|
158
|
+
appiumServer: cliConfig.appiumServer || baseConfig.appiumServer,
|
|
159
|
+
tempLogsDir: cliConfig.tempLogsDir || baseConfig.tempLogsDir,
|
|
160
|
+
wdaResignedIpaPath: process.env.WDA_RESIGNED_IPA_PATH || baseConfig.wdaResignedIpaPath,
|
|
161
|
+
androidCleanUpApps: baseConfig.androidCleanUpApps,
|
|
162
|
+
iosCleanUpApps: baseConfig.iosCleanUpApps,
|
|
163
|
+
};
|
|
164
|
+
return merged;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Get the temporary logs directory path
|
|
168
|
+
* @param configPath - Optional config path override
|
|
169
|
+
* @returns Absolute path to temp logs directory
|
|
170
|
+
*/
|
|
171
|
+
function getTempLogsDir(configPath) {
|
|
172
|
+
const config = getMergedConfig(configPath);
|
|
173
|
+
const tempLogsDir = config.tempLogsDir || './tmp';
|
|
174
|
+
// If it's a relative path, resolve it from cwd
|
|
175
|
+
if (!path_1.default.isAbsolute(tempLogsDir)) {
|
|
176
|
+
return path_1.default.resolve(process.cwd(), tempLogsDir);
|
|
177
|
+
}
|
|
178
|
+
return tempLogsDir;
|
|
179
|
+
}
|
|
180
|
+
//# sourceMappingURL=node.config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.config.js","sourceRoot":"","sources":["../../../src/config/node.config.ts"],"names":[],"mappings":";;;;;AAkEA,gCAiBC;AAKD,gCASC;AAKD,oCAyEC;AAKD,oDAQC;AAKD,0CAkCC;AAOD,wCASC;AAnPD,4CAAoB;AACpB,gDAAwB;AA8DxB;;GAEG;AACH,SAAgB,UAAU,CAAC,UAAmB;IAC5C,MAAM,iBAAiB,GAAG,cAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,kBAAkB,CAAC,CAAC;IAC1E,MAAM,UAAU,GAAG,UAAU,IAAI,iBAAiB,CAAC;IAEnD,IAAI,MAAM,GAAwB,EAAE,CAAC;IAErC,qCAAqC;IACrC,IAAI,YAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC9B,IAAI,CAAC;YACH,MAAM,WAAW,GAAG,YAAE,CAAC,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;YACzD,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,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AE,CAAC;QAClC,OAAO,cAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,WAAW,CAAC,CAAC;IAClD,CAAC;IACD,OAAO,WAAW,CAAC;AACrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prepare-wda-cli.d.ts","sourceRoot":"","sources":["../../../src/scripts/prepare-wda-cli.ts"],"names":[],"mappings":";AACA
|
|
1
|
+
{"version":3,"file":"prepare-wda-cli.d.ts","sourceRoot":"","sources":["../../../src/scripts/prepare-wda-cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;GAaG"}
|
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
* CLI entry point for WebDriverAgent preparation
|
|
5
5
|
*
|
|
6
6
|
* Usage:
|
|
7
|
+
* farm-runner run prepare-wda [options]
|
|
8
|
+
*
|
|
9
|
+
* Development:
|
|
7
10
|
* npm run prepare-wda -- [options]
|
|
8
11
|
*
|
|
9
12
|
* Options:
|
|
@@ -42,7 +45,7 @@ for (let i = 0; i < args.length; i++) {
|
|
|
42
45
|
WebDriverAgent Preparation Tool
|
|
43
46
|
|
|
44
47
|
Usage:
|
|
45
|
-
|
|
48
|
+
farm-runner run prepare-wda [options]
|
|
46
49
|
|
|
47
50
|
Options:
|
|
48
51
|
-m, --mobile-provisioning-file <path> Path to mobile provisioning file
|
|
@@ -51,10 +54,13 @@ Options:
|
|
|
51
54
|
-h, --help Show this help message
|
|
52
55
|
|
|
53
56
|
Examples:
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
57
|
+
farm-runner run prepare-wda
|
|
58
|
+
farm-runner run prepare-wda -m ~/Library/MobileDevice/Provisioning\\ Profiles/my-profile.mobileprovision
|
|
59
|
+
farm-runner run prepare-wda -p ~/WebDriverAgent --platform ios
|
|
60
|
+
farm-runner run prepare-wda -m ./profile.mobileprovision -p ./WebDriverAgent --platform both
|
|
61
|
+
|
|
62
|
+
Development (from source):
|
|
63
|
+
npm run prepare-wda -- [options]
|
|
58
64
|
`);
|
|
59
65
|
process.exit(0);
|
|
60
66
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prepare-wda-cli.js","sourceRoot":"","sources":["../../../src/scripts/prepare-wda-cli.ts"],"names":[],"mappings":";;AACA
|
|
1
|
+
{"version":3,"file":"prepare-wda-cli.js","sourceRoot":"","sources":["../../../src/scripts/prepare-wda-cli.ts"],"names":[],"mappings":";;AACA;;;;;;;;;;;;;GAaG;;AAEH,+CAA2C;AAE3C,sBAAsB;AACtB,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACnC,MAAM,OAAO,GAIT,EAAE,CAAC;AAEP,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;IACrC,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;IAEpB,IAAI,CAAC,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,4BAA4B,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;QAC1E,OAAO,CAAC,sBAAsB,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QAC7C,CAAC,EAAE,CAAC;IACN,CAAC;SAAM,IAAI,CAAC,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,oBAAoB,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;QACzE,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QACrC,CAAC,EAAE,CAAC;IACN,CAAC;SAAM,IAAI,GAAG,KAAK,YAAY,IAAI,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;QAC/C,MAAM,QAAQ,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QAC7B,IAAI,QAAQ,KAAK,KAAK,IAAI,QAAQ,KAAK,MAAM,IAAI,QAAQ,KAAK,MAAM,EAAE,CAAC;YACrE,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAC9B,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,KAAK,CAAC,uBAAuB,QAAQ,qCAAqC,CAAC,CAAC;YACpF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QACD,CAAC,EAAE,CAAC;IACN,CAAC;SAAM,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC5C,OAAO,CAAC,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;KAoBX,CAAC,CAAC;QACH,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,6BAA6B;AAC7B,IAAA,wBAAU,EAAC,OAAO,CAAC;KAChB,IAAI,CAAC,GAAG,EAAE;IACT,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC;KACD,KAAK,CAAC,KAAK,CAAC,EAAE;IACb,OAAO,CAAC,KAAK,CAAC,cAAc,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;IAC/C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "farm-runner",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.11",
|
|
4
4
|
"description": "Node package with Express server",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"bin": {
|
|
8
|
-
"farm-runner": "./dist/src/
|
|
8
|
+
"farm-runner": "./dist/src/cli.js"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
|
-
"bundle": "rimraf dist && npm run build && webpack",
|
|
12
|
-
"build": "tsc",
|
|
11
|
+
"bundle": "rimraf dist && npm run build && webpack && npm run postbuild",
|
|
12
|
+
"build": "tsc && npm run postbuild",
|
|
13
|
+
"postbuild": "chmod +x dist/src/cli.js dist/src/scripts/prepare-wda-cli.js 2>/dev/null || true",
|
|
13
14
|
"build:watch": "tsc --watch",
|
|
14
15
|
"clean": "rm -rf dist",
|
|
16
|
+
"cli": "ts-node src/cli.ts",
|
|
15
17
|
"start": "ts-node src/server.ts",
|
|
16
18
|
"start:dev": "ts-node --watch src/server.ts",
|
|
17
19
|
"start:prod": "node dist/server.js",
|
|
@@ -103,7 +105,18 @@
|
|
|
103
105
|
"webpack-shebang-plugin": "^1.1.8"
|
|
104
106
|
},
|
|
105
107
|
"files": [
|
|
108
|
+
"dist/src/cli.js",
|
|
106
109
|
"dist/src/bundle.js",
|
|
107
|
-
"dist/src/
|
|
110
|
+
"dist/src/server.js",
|
|
111
|
+
"dist/src/scripts",
|
|
112
|
+
"dist/src/config",
|
|
113
|
+
"dist/src/common",
|
|
114
|
+
"dist/src/services",
|
|
115
|
+
"dist/src/utils",
|
|
116
|
+
"dist/src/types",
|
|
117
|
+
"dist/src/controllers",
|
|
118
|
+
"dist/src/routers",
|
|
119
|
+
"dist/src/middleware",
|
|
120
|
+
"dist/src/index.js"
|
|
108
121
|
]
|
|
109
122
|
}
|