@tantawowa/hosanna-tools 3.1.0 → 3.3.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/README.md +26 -30
- package/dist/build-info.json +3 -3
- package/dist/cli.js +42 -30
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/lib/env-info.d.ts +2 -0
- package/dist/lib/env-info.js +53 -26
- package/dist/lib/env-info.js.map +1 -1
- package/dist/lib/spawn-env.d.ts +1 -0
- package/dist/lib/spawn-env.js +36 -0
- package/dist/lib/spawn-env.js.map +1 -0
- package/dist/native/native-project.js +2 -2
- package/dist/native/native-project.js.map +1 -1
- package/dist/run/android-emulator.js +23 -8
- package/dist/run/android-emulator.js.map +1 -1
- package/dist/run/apple-tv.js +1 -1
- package/dist/run/apple-tv.js.map +1 -1
- package/dist/run/executor.d.ts +6 -0
- package/dist/run/executor.js +49 -8
- package/dist/run/executor.js.map +1 -1
- package/dist/run/hsconfig-static-assets.d.ts +20 -0
- package/dist/run/hsconfig-static-assets.js +306 -0
- package/dist/run/hsconfig-static-assets.js.map +1 -0
- package/dist/run/ios-simulator.js +1 -1
- package/dist/run/ios-simulator.js.map +1 -1
- package/dist/run/planner.d.ts +3 -1
- package/dist/run/planner.js +180 -51
- package/dist/run/planner.js.map +1 -1
- package/dist/run/run-config.d.ts +10 -0
- package/dist/run/run-config.js +20 -4
- package/dist/run/run-config.js.map +1 -1
- package/dist/run/run-controller.js +44 -50
- package/dist/run/run-controller.js.map +1 -1
- package/dist/run/targets.d.ts +1 -1
- package/dist/run/targets.js +6 -14
- package/dist/run/targets.js.map +1 -1
- package/dist/run/types.d.ts +2 -2
- package/dist/run/types.js +6 -6
- package/dist/run/types.js.map +1 -1
- package/dist/support-tools/android-metro-build.d.ts +1 -0
- package/dist/support-tools/android-metro-build.js +2 -0
- package/dist/support-tools/android-metro-build.js.map +1 -1
- package/dist/support-tools/apple-bundler.d.ts +1 -0
- package/dist/support-tools/apple-bundler.js +20 -4
- package/dist/support-tools/apple-bundler.js.map +1 -1
- package/dist/support-tools/build-config-resolver.js +13 -4
- package/dist/support-tools/build-config-resolver.js.map +1 -1
- package/dist/support-tools/command-debugger.d.ts +8 -0
- package/dist/support-tools/command-debugger.js +86 -0
- package/dist/support-tools/command-debugger.js.map +1 -1
- package/dist/support-tools/mcp-server/client.d.ts +23 -0
- package/dist/support-tools/mcp-server/client.js +91 -11
- package/dist/support-tools/mcp-server/client.js.map +1 -1
- package/dist/support-tools/mcp-server/tools.js +400 -3
- package/dist/support-tools/mcp-server/tools.js.map +1 -1
- package/dist/updater/sdk-manager.js +28 -5
- package/dist/updater/sdk-manager.js.map +1 -1
- package/package.json +1 -1
package/dist/run/run-config.d.ts
CHANGED
|
@@ -4,15 +4,22 @@ export interface RunPlatformDefaults {
|
|
|
4
4
|
device?: string;
|
|
5
5
|
model?: string;
|
|
6
6
|
vitePort?: number;
|
|
7
|
+
profile?: string;
|
|
8
|
+
appConfig?: string;
|
|
9
|
+
passthroughArgs?: string[];
|
|
7
10
|
sourceRoot?: string;
|
|
8
11
|
appPackage?: string;
|
|
9
12
|
files?: string[];
|
|
13
|
+
hsconfig?: string;
|
|
10
14
|
hscProject?: string;
|
|
11
15
|
}
|
|
12
16
|
export interface RunAppDefaults {
|
|
13
17
|
appName?: string;
|
|
14
18
|
env?: string;
|
|
15
19
|
vitePort?: number;
|
|
20
|
+
profile?: string;
|
|
21
|
+
appConfig?: string;
|
|
22
|
+
passthroughArgs?: string[];
|
|
16
23
|
platforms?: Partial<Record<RunPlatform, RunPlatformDefaults>>;
|
|
17
24
|
}
|
|
18
25
|
export interface RunConfig {
|
|
@@ -22,6 +29,9 @@ export interface RunConfig {
|
|
|
22
29
|
appName?: string;
|
|
23
30
|
env?: string;
|
|
24
31
|
vitePort?: number;
|
|
32
|
+
profile?: string;
|
|
33
|
+
appConfig?: string;
|
|
34
|
+
passthroughArgs?: string[];
|
|
25
35
|
platforms?: Partial<Record<RunPlatform, RunPlatformDefaults>>;
|
|
26
36
|
};
|
|
27
37
|
apps?: Record<string, RunAppDefaults>;
|
package/dist/run/run-config.js
CHANGED
|
@@ -43,6 +43,7 @@ function normalizeRunConfig(raw, filePath) {
|
|
|
43
43
|
if (typeof defaultsRecord.vitePort === 'number' && Number.isFinite(defaultsRecord.vitePort)) {
|
|
44
44
|
config.defaults.vitePort = defaultsRecord.vitePort;
|
|
45
45
|
}
|
|
46
|
+
normalizeSharedDefaults(defaultsRecord, config.defaults);
|
|
46
47
|
const defaultsPlatforms = normalizePlatformDefaults(defaultsRecord.platforms, filePath);
|
|
47
48
|
if (defaultsPlatforms) {
|
|
48
49
|
config.defaults.platforms = defaultsPlatforms;
|
|
@@ -69,11 +70,25 @@ function normalizeRunAppDefaults(raw, filePath, appKey) {
|
|
|
69
70
|
normalized.env = raw.env.trim();
|
|
70
71
|
if (typeof raw.vitePort === 'number' && Number.isFinite(raw.vitePort))
|
|
71
72
|
normalized.vitePort = raw.vitePort;
|
|
73
|
+
normalizeSharedDefaults(raw, normalized);
|
|
72
74
|
const platforms = normalizePlatformDefaults(raw.platforms, `${filePath} apps.${appKey}`);
|
|
73
75
|
if (platforms)
|
|
74
76
|
normalized.platforms = platforms;
|
|
75
77
|
return normalized;
|
|
76
78
|
}
|
|
79
|
+
function normalizeSharedDefaults(raw, normalized) {
|
|
80
|
+
if (typeof raw.profile === 'string' && raw.profile.trim())
|
|
81
|
+
normalized.profile = raw.profile.trim();
|
|
82
|
+
if (typeof raw.appConfig === 'string' && raw.appConfig.trim())
|
|
83
|
+
normalized.appConfig = raw.appConfig.trim();
|
|
84
|
+
if (Array.isArray(raw.passthroughArgs)) {
|
|
85
|
+
const passthroughArgs = raw.passthroughArgs
|
|
86
|
+
.filter((item) => typeof item === 'string' && item.trim().length > 0)
|
|
87
|
+
.map(item => item.trim());
|
|
88
|
+
if (passthroughArgs.length > 0)
|
|
89
|
+
normalized.passthroughArgs = passthroughArgs;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
77
92
|
function normalizePlatformDefaults(platforms, filePath) {
|
|
78
93
|
if (!platforms || typeof platforms !== 'object')
|
|
79
94
|
return undefined;
|
|
@@ -96,10 +111,13 @@ function normalizePlatformDefaults(platforms, filePath) {
|
|
|
96
111
|
normalized.model = record.model.trim();
|
|
97
112
|
if (typeof record.vitePort === 'number' && Number.isFinite(record.vitePort))
|
|
98
113
|
normalized.vitePort = record.vitePort;
|
|
114
|
+
normalizeSharedDefaults(record, normalized);
|
|
99
115
|
if (typeof record.sourceRoot === 'string' && record.sourceRoot.trim())
|
|
100
116
|
normalized.sourceRoot = record.sourceRoot.trim();
|
|
101
117
|
if (typeof record.appPackage === 'string' && record.appPackage.trim())
|
|
102
118
|
normalized.appPackage = record.appPackage.trim();
|
|
119
|
+
if (typeof record.hsconfig === 'string' && record.hsconfig.trim())
|
|
120
|
+
normalized.hsconfig = record.hsconfig.trim();
|
|
103
121
|
if (typeof record.hscProject === 'string' && record.hscProject.trim())
|
|
104
122
|
normalized.hscProject = record.hscProject.trim();
|
|
105
123
|
if (Array.isArray(record.files)) {
|
|
@@ -112,10 +130,8 @@ function normalizePlatformDefaults(platforms, filePath) {
|
|
|
112
130
|
return Object.keys(normalizedPlatforms).length > 0 ? normalizedPlatforms : undefined;
|
|
113
131
|
}
|
|
114
132
|
function normalizeConfigTarget(value) {
|
|
115
|
-
if (
|
|
116
|
-
return
|
|
117
|
-
if ((0, types_js_1.isRunTargetKind)(value))
|
|
118
|
-
return value;
|
|
133
|
+
if ((0, types_js_1.isRunTargetInput)(value))
|
|
134
|
+
return (0, types_js_1.canonicalizeRunTargetKind)(value);
|
|
119
135
|
return undefined;
|
|
120
136
|
}
|
|
121
137
|
function mergeRunConfig(base, overlay) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-config.js","sourceRoot":"","sources":["../../src/run/run-config.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"run-config.js","sourceRoot":"","s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AAR,QAAQ,CAAE,SAAS,EAAE,WAAW,CAAC,SAAS,CAAC,GAC7E,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;AAC7D,CAAC;AAED,SAAS,qBAAqB,CAC5B,IAAiC,EACjC,OAAoC;;IAEpC,IAAI,CAAC,IAAI,IAAI,CAAC,OAAO;QAAE,OAAO,SAAS,CAAC;IACxC,MAAM,MAAM,GAAsD,EAAE,CAAC;IACrE,KAAK,MAAM,QAAQ,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,EAAE,CAAkB,EAAE,CAAC;QAChE,MAAM,CAAC,QAAQ,CAAC,qBAAQ,CAAC,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAG,QAAQ,CAAC,mCAAI,EAAE,CAAC,CAAE,CAAC;IACrD,CAAC;IACD,KAAK,MAAM,QAAQ,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE,CAAkB,EAAE,CAAC;QACnE,MAAM,CAAC,QAAQ,CAAC,mCACX,CAAC,MAAA,MAAM,CAAC,QAAQ,CAAC,mCAAI,EAAE,CAAC,GACxB,CAAC,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAG,QAAQ,CAAC,mCAAI,EAAE,CAAC,CAC/B,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -59,17 +59,14 @@ async function runHosanna(inputOptions) {
|
|
|
59
59
|
}
|
|
60
60
|
const config = ((_a = options.loadConfig) !== null && _a !== void 0 ? _a : run_config_js_1.loadRunConfig)({ cwd: options.cwd });
|
|
61
61
|
const platformDefaults = (_d = (_c = (_b = config.defaults) === null || _b === void 0 ? void 0 : _b.platforms) === null || _c === void 0 ? void 0 : _c[options.platform]) !== null && _d !== void 0 ? _d : {};
|
|
62
|
-
const target =
|
|
62
|
+
const target = resolveTargetKind(options.platform, (_e = options.target) !== null && _e !== void 0 ? _e : platformDefaults.target);
|
|
63
63
|
const appName = (_h = (_f = options.appName) !== null && _f !== void 0 ? _f : (_g = config.defaults) === null || _g === void 0 ? void 0 : _g.appName) !== null && _h !== void 0 ? _h : inferAppName(options.cwd);
|
|
64
64
|
const device = (_k = (_j = options.device) !== null && _j !== void 0 ? _j : envString(options.env, 'HS_TARGET')) !== null && _k !== void 0 ? _k : platformDefaults.device;
|
|
65
65
|
if (target === 'web') {
|
|
66
66
|
return runWebTarget(options, options.platform, appName, options.device, (_p = (_m = (_l = options.vitePort) !== null && _l !== void 0 ? _l : platformDefaults.vitePort) !== null && _m !== void 0 ? _m : (_o = config.defaults) === null || _o === void 0 ? void 0 : _o.vitePort) !== null && _p !== void 0 ? _p : 5173);
|
|
67
67
|
}
|
|
68
68
|
if (options.platform === 'ios') {
|
|
69
|
-
if (target === '
|
|
70
|
-
throw new Error('iOS uses --target simulator for Apple simulators, or --target device for a physical iPhone. The emulator target is for Android platforms.');
|
|
71
|
-
}
|
|
72
|
-
if (target === 'simulator') {
|
|
69
|
+
if (target === 'sim') {
|
|
73
70
|
await prepareNativeRunProject(options, 'ios', target);
|
|
74
71
|
return runIosSimulator(options, appName, device);
|
|
75
72
|
}
|
|
@@ -80,10 +77,7 @@ async function runHosanna(inputOptions) {
|
|
|
80
77
|
throw new Error(`hst run --platform ios --target ${target} is not implemented in this phase.`);
|
|
81
78
|
}
|
|
82
79
|
if (options.platform === 'apple-tv') {
|
|
83
|
-
if (target === '
|
|
84
|
-
throw new Error('Apple TV uses --target simulator for tvOS simulators, or --target device for a physical Apple TV. The emulator target is for Android platforms.');
|
|
85
|
-
}
|
|
86
|
-
if (target === 'simulator') {
|
|
80
|
+
if (target === 'sim') {
|
|
87
81
|
await prepareNativeRunProject(options, 'apple-tv', target);
|
|
88
82
|
return runAppleTvSimulator(options, appName, device);
|
|
89
83
|
}
|
|
@@ -94,10 +88,7 @@ async function runHosanna(inputOptions) {
|
|
|
94
88
|
throw new Error(`hst run --platform apple-tv --target ${target} is not implemented in this phase.`);
|
|
95
89
|
}
|
|
96
90
|
if (options.platform === 'android') {
|
|
97
|
-
if (target === '
|
|
98
|
-
throw new Error('Android uses --target emulator. The simulator target is for Apple platforms.');
|
|
99
|
-
}
|
|
100
|
-
if (target === 'emulator') {
|
|
91
|
+
if (target === 'sim') {
|
|
101
92
|
await prepareNativeRunProject(options, 'android', target);
|
|
102
93
|
return runAndroidEmulator(options, appName, device);
|
|
103
94
|
}
|
|
@@ -108,10 +99,7 @@ async function runHosanna(inputOptions) {
|
|
|
108
99
|
throw new Error(`hst run --platform android --target ${target} is not implemented in this phase.`);
|
|
109
100
|
}
|
|
110
101
|
if (options.platform === 'android-tv') {
|
|
111
|
-
if (target === '
|
|
112
|
-
throw new Error('Android TV uses --target emulator. The simulator target is for Apple platforms.');
|
|
113
|
-
}
|
|
114
|
-
if (target === 'emulator') {
|
|
102
|
+
if (target === 'sim') {
|
|
115
103
|
await prepareNativeRunProject(options, 'android-tv', target);
|
|
116
104
|
return runAndroidTvEmulator(options, appName, device);
|
|
117
105
|
}
|
|
@@ -373,15 +361,7 @@ function resolveTargetKind(platform, target) {
|
|
|
373
361
|
return (0, types_js_1.canonicalizeRunTargetKind)(target);
|
|
374
362
|
if (platform === 'web' || platform === 'roku')
|
|
375
363
|
return 'web';
|
|
376
|
-
|
|
377
|
-
return 'simulator';
|
|
378
|
-
return 'emulator';
|
|
379
|
-
}
|
|
380
|
-
function normalizeRunTarget(platform, target) {
|
|
381
|
-
if (platform === 'roku' && (target === 'simulator' || target === 'emulator')) {
|
|
382
|
-
return 'web';
|
|
383
|
-
}
|
|
384
|
-
return target;
|
|
364
|
+
return 'sim';
|
|
385
365
|
}
|
|
386
366
|
async function prepareNativeRunProject(options, platform, target) {
|
|
387
367
|
var _a;
|
|
@@ -395,19 +375,19 @@ async function prepareNativeRunProject(options, platform, target) {
|
|
|
395
375
|
});
|
|
396
376
|
}
|
|
397
377
|
function hasInjectedNativeDriver(options, platform, target) {
|
|
398
|
-
if (platform === 'ios' && target === '
|
|
378
|
+
if (platform === 'ios' && target === 'sim')
|
|
399
379
|
return Boolean(options.iosSimulator);
|
|
400
380
|
if (platform === 'ios' && target === 'device')
|
|
401
381
|
return Boolean(options.iosDevice);
|
|
402
|
-
if (platform === 'apple-tv' && target === '
|
|
382
|
+
if (platform === 'apple-tv' && target === 'sim')
|
|
403
383
|
return Boolean(options.appleTvSimulator);
|
|
404
384
|
if (platform === 'apple-tv' && target === 'device')
|
|
405
385
|
return Boolean(options.appleTvDevice);
|
|
406
|
-
if (platform === 'android' && target === '
|
|
386
|
+
if (platform === 'android' && target === 'sim')
|
|
407
387
|
return Boolean(options.androidEmulator);
|
|
408
388
|
if (platform === 'android' && target === 'device')
|
|
409
389
|
return Boolean(options.androidDevice);
|
|
410
|
-
if (platform === 'android-tv' && target === '
|
|
390
|
+
if (platform === 'android-tv' && target === 'sim')
|
|
411
391
|
return Boolean(options.androidTvEmulator);
|
|
412
392
|
if (platform === 'android-tv' && target === 'device')
|
|
413
393
|
return Boolean(options.androidTvDevice);
|
|
@@ -441,7 +421,7 @@ async function runIosSimulator(options, appName, deviceSelector) {
|
|
|
441
421
|
cwd: options.cwd,
|
|
442
422
|
appName,
|
|
443
423
|
platform: 'ios',
|
|
444
|
-
target: '
|
|
424
|
+
target: 'sim',
|
|
445
425
|
deviceId: target.id,
|
|
446
426
|
});
|
|
447
427
|
let shouldTerminateBeforeLaunch = Boolean(options.replace);
|
|
@@ -450,7 +430,7 @@ async function runIosSimulator(options, appName, deviceSelector) {
|
|
|
450
430
|
return {
|
|
451
431
|
status: 'reused',
|
|
452
432
|
platform: 'ios',
|
|
453
|
-
target: '
|
|
433
|
+
target: 'sim',
|
|
454
434
|
appName,
|
|
455
435
|
session: existingSession,
|
|
456
436
|
};
|
|
@@ -460,7 +440,7 @@ async function runIosSimulator(options, appName, deviceSelector) {
|
|
|
460
440
|
return {
|
|
461
441
|
status: 'reused',
|
|
462
442
|
platform: 'ios',
|
|
463
|
-
target: '
|
|
443
|
+
target: 'sim',
|
|
464
444
|
appName,
|
|
465
445
|
session: existingSession,
|
|
466
446
|
};
|
|
@@ -475,7 +455,7 @@ async function runIosSimulator(options, appName, deviceSelector) {
|
|
|
475
455
|
}
|
|
476
456
|
await driver.buildApp(target, commandOptions);
|
|
477
457
|
if (options.buildOnly) {
|
|
478
|
-
return buildOnlyRunResult('ios', '
|
|
458
|
+
return buildOnlyRunResult('ios', 'sim', appName);
|
|
479
459
|
}
|
|
480
460
|
const launchMode = appleLaunchMode(options);
|
|
481
461
|
if (launchMode.hotReload) {
|
|
@@ -494,7 +474,7 @@ async function runIosSimulator(options, appName, deviceSelector) {
|
|
|
494
474
|
cwd: options.cwd,
|
|
495
475
|
appName,
|
|
496
476
|
platform: 'ios',
|
|
497
|
-
target: '
|
|
477
|
+
target: 'sim',
|
|
498
478
|
pid: process.pid,
|
|
499
479
|
liveness: 'device',
|
|
500
480
|
deviceId: target.id,
|
|
@@ -509,7 +489,7 @@ async function runIosSimulator(options, appName, deviceSelector) {
|
|
|
509
489
|
return {
|
|
510
490
|
status: 'started',
|
|
511
491
|
platform: 'ios',
|
|
512
|
-
target: '
|
|
492
|
+
target: 'sim',
|
|
513
493
|
appName,
|
|
514
494
|
session: recorded,
|
|
515
495
|
};
|
|
@@ -600,7 +580,7 @@ async function runAppleTvSimulator(options, appName, deviceSelector) {
|
|
|
600
580
|
cwd: options.cwd,
|
|
601
581
|
appName,
|
|
602
582
|
platform: 'apple-tv',
|
|
603
|
-
target: '
|
|
583
|
+
target: 'sim',
|
|
604
584
|
deviceId: target.id,
|
|
605
585
|
});
|
|
606
586
|
let shouldTerminateBeforeLaunch = Boolean(options.replace);
|
|
@@ -609,7 +589,7 @@ async function runAppleTvSimulator(options, appName, deviceSelector) {
|
|
|
609
589
|
return {
|
|
610
590
|
status: 'reused',
|
|
611
591
|
platform: 'apple-tv',
|
|
612
|
-
target: '
|
|
592
|
+
target: 'sim',
|
|
613
593
|
appName,
|
|
614
594
|
session: existingSession,
|
|
615
595
|
};
|
|
@@ -619,7 +599,7 @@ async function runAppleTvSimulator(options, appName, deviceSelector) {
|
|
|
619
599
|
return {
|
|
620
600
|
status: 'reused',
|
|
621
601
|
platform: 'apple-tv',
|
|
622
|
-
target: '
|
|
602
|
+
target: 'sim',
|
|
623
603
|
appName,
|
|
624
604
|
session: existingSession,
|
|
625
605
|
};
|
|
@@ -634,7 +614,7 @@ async function runAppleTvSimulator(options, appName, deviceSelector) {
|
|
|
634
614
|
}
|
|
635
615
|
await driver.buildApp(target, commandOptions);
|
|
636
616
|
if (options.buildOnly) {
|
|
637
|
-
return buildOnlyRunResult('apple-tv', '
|
|
617
|
+
return buildOnlyRunResult('apple-tv', 'sim', appName);
|
|
638
618
|
}
|
|
639
619
|
const launchMode = appleLaunchMode(options);
|
|
640
620
|
if (launchMode.hotReload) {
|
|
@@ -653,7 +633,7 @@ async function runAppleTvSimulator(options, appName, deviceSelector) {
|
|
|
653
633
|
cwd: options.cwd,
|
|
654
634
|
appName,
|
|
655
635
|
platform: 'apple-tv',
|
|
656
|
-
target: '
|
|
636
|
+
target: 'sim',
|
|
657
637
|
pid: process.pid,
|
|
658
638
|
liveness: 'device',
|
|
659
639
|
deviceId: target.id,
|
|
@@ -668,7 +648,7 @@ async function runAppleTvSimulator(options, appName, deviceSelector) {
|
|
|
668
648
|
return {
|
|
669
649
|
status: 'started',
|
|
670
650
|
platform: 'apple-tv',
|
|
671
|
-
target: '
|
|
651
|
+
target: 'sim',
|
|
672
652
|
appName,
|
|
673
653
|
session: recorded,
|
|
674
654
|
};
|
|
@@ -755,7 +735,7 @@ async function runAndroidEmulator(options, appName, deviceSelector) {
|
|
|
755
735
|
const launchMode = androidLaunchMode(options, 'android');
|
|
756
736
|
return runAndroidNative(options, appName, deviceSelector, {
|
|
757
737
|
platform: 'android',
|
|
758
|
-
target: '
|
|
738
|
+
target: 'sim',
|
|
759
739
|
label: 'Android emulator',
|
|
760
740
|
driver: (_a = options.androidEmulator) !== null && _a !== void 0 ? _a : (0, android_emulator_js_1.createDefaultAndroidEmulatorDriver)(),
|
|
761
741
|
launchOptions: (0, android_emulator_js_1.androidPhoneLaunchOptions)(options.env, { bundledMode: launchMode.bundled, cwd: options.cwd }),
|
|
@@ -781,7 +761,7 @@ async function runAndroidTvEmulator(options, appName, deviceSelector) {
|
|
|
781
761
|
const launchMode = androidLaunchMode(options, 'android-tv');
|
|
782
762
|
return runAndroidNative(options, appName, deviceSelector, {
|
|
783
763
|
platform: 'android-tv',
|
|
784
|
-
target: '
|
|
764
|
+
target: 'sim',
|
|
785
765
|
label: 'Android TV emulator',
|
|
786
766
|
driver: (_a = options.androidTvEmulator) !== null && _a !== void 0 ? _a : (0, android_emulator_js_1.createDefaultAndroidTvEmulatorDriver)(),
|
|
787
767
|
launchOptions: (0, android_emulator_js_1.androidTvLaunchOptions)(options.env, { bundledMode: launchMode.bundled, cwd: options.cwd }),
|
|
@@ -804,6 +784,10 @@ async function runAndroidTvDevice(options, appName, deviceSelector) {
|
|
|
804
784
|
}
|
|
805
785
|
async function runAndroidNative(options, appName, deviceSelector, profile) {
|
|
806
786
|
var _a, _b, _c;
|
|
787
|
+
if (options.buildOnly) {
|
|
788
|
+
await profile.driver.buildApp(androidBuildOnlyTarget(profile, deviceSelector), androidCommandOptions(options));
|
|
789
|
+
return buildOnlyRunResult(profile.platform, profile.target, appName);
|
|
790
|
+
}
|
|
807
791
|
const selectedTarget = await resolveAndroidNativeTarget(profile.driver, options, deviceSelector, profile);
|
|
808
792
|
let target = selectedTarget;
|
|
809
793
|
if (profile.target === 'device') {
|
|
@@ -850,9 +834,6 @@ async function runAndroidNative(options, appName, deviceSelector, profile) {
|
|
|
850
834
|
await profile.driver.terminateApp(target, commandOptions);
|
|
851
835
|
}
|
|
852
836
|
await profile.driver.buildApp(target, commandOptions);
|
|
853
|
-
if (options.buildOnly) {
|
|
854
|
-
return buildOnlyRunResult(profile.platform, profile.target, appName);
|
|
855
|
-
}
|
|
856
837
|
if (profile.launchMode.hotReload) {
|
|
857
838
|
await ensureNativeService(options, androidNativeServiceOptions(options));
|
|
858
839
|
}
|
|
@@ -883,6 +864,19 @@ async function runAndroidNative(options, appName, deviceSelector, profile) {
|
|
|
883
864
|
session: recorded,
|
|
884
865
|
};
|
|
885
866
|
}
|
|
867
|
+
function androidBuildOnlyTarget(profile, deviceSelector) {
|
|
868
|
+
const id = (deviceSelector === null || deviceSelector === void 0 ? void 0 : deviceSelector.trim()) || `${profile.platform}-${profile.target}-build`;
|
|
869
|
+
return {
|
|
870
|
+
platform: profile.platform,
|
|
871
|
+
target: profile.target,
|
|
872
|
+
id,
|
|
873
|
+
name: id,
|
|
874
|
+
formFactor: profile.platform === 'android-tv' ? 'tv' : 'mobile',
|
|
875
|
+
source: 'builtin',
|
|
876
|
+
online: false,
|
|
877
|
+
state: 'build-only',
|
|
878
|
+
};
|
|
879
|
+
}
|
|
886
880
|
async function resolveIosSimulatorTarget(driver, options, selector) {
|
|
887
881
|
const targets = await driver.listTargets({ cwd: options.cwd, env: options.env });
|
|
888
882
|
if (selector === null || selector === void 0 ? void 0 : selector.trim()) {
|
|
@@ -892,7 +886,7 @@ async function resolveIosSimulatorTarget(driver, options, selector) {
|
|
|
892
886
|
throw new Error(`No iOS simulator matched "${selector}".\n${formatRunTargetChoices(targets)}`);
|
|
893
887
|
}
|
|
894
888
|
if (options.nonInteractive || !process.stdin.isTTY) {
|
|
895
|
-
throw new Error('hst run --platform ios --target
|
|
889
|
+
throw new Error('hst run --platform ios --target sim requires --device <simulator name|UDID> or defaults.platforms.ios.device in .hosanna-tools/run.json for non-interactive runs. Use hst target:list --platform ios --target sim --json to choose a simulator.');
|
|
896
890
|
}
|
|
897
891
|
return promptForRunTarget('iOS simulator', targets);
|
|
898
892
|
}
|
|
@@ -921,7 +915,7 @@ async function resolveAppleTvSimulatorTarget(driver, options, selector) {
|
|
|
921
915
|
throw new Error(`No Apple TV simulator matched "${selector}".\n${formatRunTargetChoices(targets)}`);
|
|
922
916
|
}
|
|
923
917
|
if (options.nonInteractive || !process.stdin.isTTY) {
|
|
924
|
-
throw new Error('hst run --platform apple-tv --target
|
|
918
|
+
throw new Error('hst run --platform apple-tv --target sim requires --device <simulator name|UDID> or defaults.platforms.apple-tv.device in .hosanna-tools/run.json for non-interactive runs. Use hst target:list --platform apple-tv --target sim --json to choose a simulator.');
|
|
925
919
|
}
|
|
926
920
|
return promptForRunTarget('Apple TV simulator', targets);
|
|
927
921
|
}
|
|
@@ -953,7 +947,7 @@ async function resolveAndroidNativeTarget(driver, options, selector, profile) {
|
|
|
953
947
|
if (defaultTarget)
|
|
954
948
|
return defaultTarget;
|
|
955
949
|
if (options.nonInteractive || !process.stdin.isTTY) {
|
|
956
|
-
const targetSelector = profile.target === '
|
|
950
|
+
const targetSelector = profile.target === 'sim' ? 'AVD name|adb serial' : 'device name|adb serial';
|
|
957
951
|
throw new Error(`hst run --platform ${profile.platform} --target ${profile.target} requires --device <${targetSelector}> or defaults.platforms.${profile.platform}.device in .hosanna-tools/run.json for non-interactive runs. Use hst target:list --platform ${profile.platform} --target ${profile.target} --json to choose a target.`);
|
|
958
952
|
}
|
|
959
953
|
return promptForRunTarget(profile.label, targets);
|