farm-runner 1.1.11 → 1.1.13

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/src/cli.js CHANGED
@@ -10,7 +10,6 @@
10
10
  *
11
11
  * Commands:
12
12
  * start Start the node server (default)
13
- * run prepare-wda Prepare WebDriverAgent for iOS devices
14
13
  * --help, -h Show help message
15
14
  */
16
15
  var __importDefault = (this && this.__importDefault) || function (mod) {
@@ -28,9 +27,6 @@ function parseArgs() {
28
27
  if (args.length === 0 || args[0] === 'start') {
29
28
  return { command: 'start', args: args.slice(1) };
30
29
  }
31
- if (args[0] === 'run' && args[1] === 'prepare-wda') {
32
- return { command: 'run', subcommand: 'prepare-wda', args: args.slice(2) };
33
- }
34
30
  if (args[0] === '--help' || args[0] === '-h') {
35
31
  return { command: 'help', args: [] };
36
32
  }
@@ -49,17 +45,12 @@ Usage:
49
45
 
50
46
  Commands:
51
47
  start Start the node server (default)
52
- run prepare-wda [options] Prepare WebDriverAgent for iOS devices
53
48
  --help, -h Show this help message
54
49
 
55
50
  Examples:
56
51
  farm-runner # Start the server
57
52
  farm-runner start # Start the server
58
53
  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
54
 
64
55
  For more information, visit: https://github.com/your-repo/device-farm
65
56
  `);
@@ -81,24 +72,11 @@ function startServer(args) {
81
72
  process.exit(code || 0);
82
73
  });
83
74
  }
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
75
  /**
98
76
  * Main CLI handler
99
77
  */
100
78
  function main() {
101
- const { command, subcommand, args } = parseArgs();
79
+ const { command, args } = parseArgs();
102
80
  switch (command) {
103
81
  case 'help':
104
82
  showHelp();
@@ -107,16 +85,6 @@ function main() {
107
85
  case 'start':
108
86
  startServer(args);
109
87
  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
88
  default:
121
89
  console.error(`❌ Unknown command: ${command}`);
122
90
  console.log('Run "farm-runner --help" for usage information.');
@@ -1,22 +1,59 @@
1
1
  /**
2
- * WebDriverAgent (WDA) Preparation Script
2
+ * WebDriverAgent (WDA) Preparation Module
3
3
  *
4
- * This script builds, signs, and packages WebDriverAgent for iOS devices.
5
- * It can be run as a CLI command: `node prepare-wda`
4
+ * This module provides functionality to build, sign, and package WebDriverAgent for iOS devices.
5
+ * It is used via the WebSocket API from the hub UI, not as a CLI command.
6
6
  *
7
- * Options:
8
- * --mobile-provisioning-file, -m Path to the mobile provisioning file
9
- * --wda-project-path, -p Path to WebDriverAgent xcode project
10
- * --platform Platform type: ios, tvos, or both (default: ios)
7
+ * The prepareWda function is called with the following options:
8
+ * - provisioningUUID: UUID of the provisioning profile to use (REQUIRED)
9
+ * - isFreeAccount: Whether this is a free or enterprise account (REQUIRED)
10
+ * - outputFileName: Custom output filename without .ipa extension (optional, defaults to 'wda-resign')
11
+ * - uploadToHub: Whether to upload to hub after build (optional, defaults to true)
12
+ * - setAsDefault: Whether to set as default WDA (optional, defaults to false)
13
+ * - wdaProjectPath: Path to WebDriverAgent xcode project (optional, auto-detected if not provided)
14
+ * - platform: Platform type: ios, tvos, or both (optional, defaults to 'ios')
15
+ * - onProgress: Callback for progress updates (optional)
11
16
  */
12
- interface PrepareWdaOptions {
17
+ export interface PrepareWdaOptions {
13
18
  mobileProvisioningFile?: string;
19
+ provisioningUUID: string;
20
+ isFreeAccount: boolean;
21
+ outputFileName?: string;
22
+ uploadToHub?: boolean;
23
+ setAsDefault?: boolean;
14
24
  wdaProjectPath?: string;
15
25
  platform?: 'ios' | 'tvos' | 'both';
26
+ onProgress?: (step: string, message: string, progress?: number) => void;
16
27
  }
28
+ export interface PrepareWdaResult {
29
+ success: boolean;
30
+ message: string;
31
+ ipaPath?: string;
32
+ wdaId?: string;
33
+ bundleId?: string;
34
+ error?: string;
35
+ }
36
+ /**
37
+ * Get provisioning profile path based on Xcode version
38
+ */
39
+ export declare function getProvisioningProfilePath(): Promise<string>;
40
+ /**
41
+ * Main function to prepare WDA (non-interactive, API-driven)
42
+ *
43
+ * This function is called via WebSocket from the hub UI. All parameters
44
+ * must be provided - there are no interactive prompts.
45
+ */
46
+ export declare function prepareWda(options: PrepareWdaOptions): Promise<PrepareWdaResult>;
17
47
  /**
18
- * Main function to prepare WDA
48
+ * List available provisioning profiles on this machine
49
+ * Used by the hub UI to populate the profile selection dropdown
19
50
  */
20
- export declare function prepareWda(options: PrepareWdaOptions): Promise<void>;
21
- export {};
51
+ export declare function listProvisioningProfiles(): Promise<{
52
+ profiles: Array<{
53
+ uuid: string;
54
+ name: string;
55
+ teamName: string;
56
+ filePath: string;
57
+ }>;
58
+ }>;
22
59
  //# sourceMappingURL=prepare-wda.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"prepare-wda.d.ts","sourceRoot":"","sources":["../../../src/scripts/prepare-wda.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAcH,UAAU,iBAAiB;IACzB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;CACpC;AAkTD;;GAEG;AACH,wBAAsB,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAuU1E"}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