@moku-labs/native 0.3.12 → 0.3.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/README.md +50 -13
- package/dist/index.cjs +260 -65
- package/dist/index.d.cts +86 -35
- package/dist/index.d.mts +86 -35
- package/dist/index.mjs +260 -65
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -34,8 +34,10 @@ type BuildFlavor = {
|
|
|
34
34
|
aab?: boolean | undefined;
|
|
35
35
|
/**
|
|
36
36
|
* Build the debug profile instead of the store one: a still-optimized build that installs
|
|
37
|
-
* next to the store app
|
|
38
|
-
* forwards the page console and allows cleartext.
|
|
37
|
+
* next to the store app. On Android native gives it the `.debug` id and "(debug)" name, signs
|
|
38
|
+
* it with the debug keystore, forwards the page console and allows cleartext. On iOS the
|
|
39
|
+
* config names the app, and native adds the local-network keys and the Web Inspector. Unset
|
|
40
|
+
* means the store profile.
|
|
39
41
|
*
|
|
40
42
|
* @example
|
|
41
43
|
* ```ts
|
|
@@ -43,17 +45,30 @@ type BuildFlavor = {
|
|
|
43
45
|
* ```
|
|
44
46
|
*/
|
|
45
47
|
debug?: boolean | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* Build the dev profile instead of the store one: the store build a tester installs, with
|
|
50
|
+
* the same signing, `.aab`, `exportMethod` and delivery, whose page may carry the editor
|
|
51
|
+
* agent. The app config names the separate app (id, name, icon, `projectDir`, `outDir`);
|
|
52
|
+
* native renames nothing. Combining it with `debug` is an error.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```ts
|
|
56
|
+
* await app.build.run({ target: "android", aab: true, dev: true });
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
dev?: boolean | undefined;
|
|
46
60
|
};
|
|
47
61
|
/**
|
|
48
62
|
* Which profile a build is made in. `"store"` is the shippable build; `"debug"` is the
|
|
49
|
-
* on-device test build of {@link BuildFlavor.debug}
|
|
63
|
+
* on-device test build of {@link BuildFlavor.debug}; `"dev"` is the store-signed test build
|
|
64
|
+
* of {@link BuildFlavor.dev}. The page sees `"store"` and `"dev"` as `"release"`.
|
|
50
65
|
*
|
|
51
66
|
* @example
|
|
52
67
|
* ```ts
|
|
53
|
-
* const profile: BuildProfile = flavor.
|
|
68
|
+
* const profile: BuildProfile = flavor.dev ? "dev" : "store";
|
|
54
69
|
* ```
|
|
55
70
|
*/
|
|
56
|
-
type BuildProfile = "store" | "debug";
|
|
71
|
+
type BuildProfile = "store" | "debug" | "dev";
|
|
57
72
|
/**
|
|
58
73
|
* Resolves the packaging targets a host can build with no extra opt-in — the default
|
|
59
74
|
* `config.targets`. Exactly one desktop target per host (`darwin` → `macos`,
|
|
@@ -307,9 +322,9 @@ type CompletenessResult = {
|
|
|
307
322
|
};
|
|
308
323
|
/**
|
|
309
324
|
* Result of the idempotent mobile patch pass: Android release signing and the main
|
|
310
|
-
* activity's manifest attributes, the iOS Xcode build settings, deployment target
|
|
311
|
-
*
|
|
312
|
-
* touched is listed once; a file a patch removed is listed as patched.
|
|
325
|
+
* activity's manifest attributes, the iOS Xcode build settings, deployment target, privacy
|
|
326
|
+
* manifest and `Info.plist`, and the runner command on both platforms. A file several
|
|
327
|
+
* patches touched is listed once; a file a patch removed is listed as patched.
|
|
313
328
|
*/
|
|
314
329
|
type PatchResult = {
|
|
315
330
|
readonly patched: readonly string[];
|
|
@@ -327,8 +342,9 @@ type PatchMobileOptions = {
|
|
|
327
342
|
/**
|
|
328
343
|
* The build profile one Android patch pass applies, with what that profile needs: the
|
|
329
344
|
* debug profile names the app `"<name> (debug)"` and signs with the debug keystore the
|
|
330
|
-
* caller resolved from `ctx.env`. `
|
|
331
|
-
*
|
|
345
|
+
* caller resolved from `ctx.env`. The `dev` build profile applies as `store`: it is the
|
|
346
|
+
* store build a tester installs, signed with the game's key. `log` receives the warning about
|
|
347
|
+
* a network security config this plugin did not write.
|
|
332
348
|
*
|
|
333
349
|
* @example
|
|
334
350
|
* ```ts
|
|
@@ -428,7 +444,7 @@ type TauriConfFragment = Record<string, never> | DeepLinkConf;
|
|
|
428
444
|
/**
|
|
429
445
|
* An Info.ios.plist sidecar entry (src-tauri root, outside gen/), which Tauri merges into
|
|
430
446
|
* the app's Info.plist on every iOS build. No registry row carries one today; the
|
|
431
|
-
* orientation lock
|
|
447
|
+
* orientation lock, `ios.infoPlist` and the iOS debug profile do.
|
|
432
448
|
*/
|
|
433
449
|
type PlistEntry = {
|
|
434
450
|
key: string;
|
|
@@ -480,7 +496,10 @@ type Api$4 = {
|
|
|
480
496
|
* in `config.system`, or implied by the debug profile on android), the
|
|
481
497
|
* `tauri-plugin-moku-shell` crate is generated under `plugins/moku-shell/` too, with the
|
|
482
498
|
* profile baked into its page script. Without the shell, the profile changes one key: the
|
|
483
|
-
* store profile sets `build.removeUnusedCommands` in `tauri.conf.json
|
|
499
|
+
* store profile sets `build.removeUnusedCommands` in `tauri.conf.json`, and the debug and
|
|
500
|
+
* dev profiles do not. An iOS build in the debug profile also opens to Safari Web Inspector
|
|
501
|
+
* (`devtools` on the main window and in the `tauri` features) and to the editor on the local
|
|
502
|
+
* network (`NSLocalNetworkUsageDescription` and `NSAppTransportSecurity` in `Info.ios.plist`).
|
|
484
503
|
*
|
|
485
504
|
* @param opts - The generate options.
|
|
486
505
|
* @param opts.target - The packaging target to generate for.
|
|
@@ -540,15 +559,17 @@ type Api$4 = {
|
|
|
540
559
|
/**
|
|
541
560
|
* Runs the idempotent mobile post-init patch pass. Android gets its build-profile
|
|
542
561
|
* patches (debug: the `.debug` id suffix, the `"<name> (debug)"` label, a cleartext
|
|
543
|
-
* network security config; store: all three reverted to the bytes before), its
|
|
544
|
-
* signing (the debug keystore under `HOME` ?? `USERPROFILE` in the debug profile), the
|
|
562
|
+
* network security config; store and dev: all three reverted to the bytes before), its
|
|
563
|
+
* release signing (the debug keystore under `HOME` ?? `USERPROFILE` in the debug profile), the
|
|
545
564
|
* main activity's manifest attributes (the orientation lock among them) and the status
|
|
546
565
|
* bar style in MainActivity.kt (light icons on a dark `app.backgroundColor`, dark icons
|
|
547
566
|
* on a light one); iOS gets the Xcode entitlements-modification setting, the deployment
|
|
548
567
|
* target (`signing.apple.iosMinimumSystemVersion`, or its default) and the privacy manifest
|
|
549
568
|
* (`ios.privacyManifest`; unset removes one an earlier pass added), each in `project.yml`
|
|
550
|
-
* and `project.pbxproj`, because a kept tree never runs xcodegen again
|
|
551
|
-
*
|
|
569
|
+
* and `project.pbxproj`, because a kept tree never runs xcodegen again, and outside the
|
|
570
|
+
* debug profile it loses the debug keys an earlier debug build merged into
|
|
571
|
+
* `<slug>_iOS/Info.plist`; both get the Xcode/Android-Studio runner-command rewrite when a
|
|
572
|
+
* `runner` is supplied. The build
|
|
552
573
|
* plugin calls it after the mobile init pass, with the runner from `tauri.getRunner()`.
|
|
553
574
|
* A `gen/apple` tree that was never initialised reports nothing.
|
|
554
575
|
*
|
|
@@ -560,7 +581,7 @@ type Api$4 = {
|
|
|
560
581
|
* @throws {Error} `[native]` in the debug profile when the debug keystore is missing,
|
|
561
582
|
* with the `keytool` command that creates it; when `ios.privacyManifest` names no file,
|
|
562
583
|
* before anything is written; when `project.yml` or `project.pbxproj` lacks a line a
|
|
563
|
-
* patch needs.
|
|
584
|
+
* patch needs; when a debug key in `Info.plist` has no value.
|
|
564
585
|
* @example
|
|
565
586
|
* ```ts
|
|
566
587
|
* // app.orientation is "portrait", app.backgroundColor is "#10161d", app.identifier is
|
|
@@ -974,7 +995,7 @@ type Api$3 = {
|
|
|
974
995
|
* @param opts.onOutput - Called with each scrubbed output line.
|
|
975
996
|
* @param opts.env - Extra environment for the tauri CLI, merged over the inherited one, so
|
|
976
997
|
* the web build tauri runs (`beforeBuildCommand`) can read it. Never changes the argv: the
|
|
977
|
-
* debug
|
|
998
|
+
* debug and dev profiles are still release builds (no `--debug`).
|
|
978
999
|
* @returns The completed run's result.
|
|
979
1000
|
* @throws {Error} A classified `TauriError` on a non-zero exit.
|
|
980
1001
|
* @example
|
|
@@ -1077,19 +1098,34 @@ type PhaseTiming = {
|
|
|
1077
1098
|
};
|
|
1078
1099
|
/** Result of one target's full pipeline pass — `phases` always carries all six entries. */
|
|
1079
1100
|
type BuildResult = {
|
|
1080
|
-
target: Target; /** `<outDir>/<target>` for a store build, `<outDir>/<target>-debug` for a debug one. */
|
|
1101
|
+
target: Target; /** `<outDir>/<target>` for a store or dev build, `<outDir>/<target>-debug` for a debug one. */
|
|
1081
1102
|
outPath: string;
|
|
1082
1103
|
artifacts: readonly string[];
|
|
1083
1104
|
durationMs: number;
|
|
1084
1105
|
phases: readonly PhaseTiming[]; /** The profile the artifacts were built in — the same value `native:complete` carries. */
|
|
1085
1106
|
profile: BuildProfile;
|
|
1086
1107
|
};
|
|
1087
|
-
/**
|
|
1108
|
+
/**
|
|
1109
|
+
* Options for a prepare pass: the target, and `debug` for the debug profile (Android, iOS).
|
|
1110
|
+
* It takes no `dev` on purpose: a dev build is only ever a full `run`.
|
|
1111
|
+
*
|
|
1112
|
+
* @example
|
|
1113
|
+
* ```ts
|
|
1114
|
+
* const opts: PrepareOptions = { target: "ios", debug: true };
|
|
1115
|
+
* ```
|
|
1116
|
+
*/
|
|
1088
1117
|
type PrepareOptions = {
|
|
1089
1118
|
target: Target;
|
|
1090
1119
|
debug?: boolean | undefined;
|
|
1091
1120
|
};
|
|
1092
|
-
/**
|
|
1121
|
+
/**
|
|
1122
|
+
* Options for one target's pipeline pass. Platform-specific flags are ignored elsewhere.
|
|
1123
|
+
*
|
|
1124
|
+
* @example
|
|
1125
|
+
* ```ts
|
|
1126
|
+
* const opts: RunOptions = { target: "android", aab: true, dev: true };
|
|
1127
|
+
* ```
|
|
1128
|
+
*/
|
|
1093
1129
|
type RunOptions = BuildFlavor & {
|
|
1094
1130
|
target: Target;
|
|
1095
1131
|
};
|
|
@@ -1121,13 +1157,13 @@ type Api$2 = {
|
|
|
1121
1157
|
*
|
|
1122
1158
|
* @param opts - The target to prepare, and `debug` for the debug profile.
|
|
1123
1159
|
* @returns Nothing; the tree under `projectDir` is ready for the build verb.
|
|
1124
|
-
* @throws {Error} `[native] --debug builds Android only for now (asked for <target>).`
|
|
1125
|
-
* `debug` is set for any target but android — before any phase runs.
|
|
1160
|
+
* @throws {Error} `[native] --debug builds Android and iOS only for now (asked for <target>).`
|
|
1161
|
+
* when `debug` is set for any target but android and ios — before any phase runs.
|
|
1126
1162
|
* @example
|
|
1127
1163
|
* ```ts
|
|
1128
1164
|
* // A consumer prepares the debug tree of the phone build to open it in Android Studio: the
|
|
1129
1165
|
* // shell crate is generated and the debug patches are applied, nothing is compiled.
|
|
1130
|
-
* await
|
|
1166
|
+
* await app.build.prepare({ target: "android", debug: true });
|
|
1131
1167
|
* ```
|
|
1132
1168
|
*/
|
|
1133
1169
|
prepare(opts: PrepareOptions): Promise<void>;
|
|
@@ -1136,32 +1172,43 @@ type Api$2 = {
|
|
|
1136
1172
|
* target, emitting `native:phase` per phase and `native:complete` on success. A store build
|
|
1137
1173
|
* whose page carries the editor agent is refused after the compile, before anything is
|
|
1138
1174
|
* collected; a debug build is delivered into `<outDir>/<target>-debug`, beside the store one.
|
|
1175
|
+
* A dev build is the store build with the agent allowed: same signing, same delivery.
|
|
1139
1176
|
*
|
|
1140
|
-
* @param opts - The target plus the platform flags (`simulator`, `aab`, `debug`).
|
|
1177
|
+
* @param opts - The target plus the platform flags (`simulator`, `aab`, `debug`, `dev`).
|
|
1141
1178
|
* @returns The completed pipeline's result.
|
|
1142
|
-
* @throws {Error} The first failing phase's error;
|
|
1143
|
-
* for `debug` on another target
|
|
1179
|
+
* @throws {Error} The first failing phase's error; before any phase,
|
|
1180
|
+
* `[native] --debug builds Android and iOS only …` for `debug` on another target and
|
|
1181
|
+
* `[native] debug and dev cannot be combined.` for both flags together.
|
|
1144
1182
|
* @example
|
|
1145
1183
|
* ```ts
|
|
1146
1184
|
* // A debug build for the phone, installed beside the store app.
|
|
1147
1185
|
* const result = await app.build.run({ target: "android", debug: true });
|
|
1148
1186
|
* // result.outPath === "dist-native/android-debug", result.profile === "debug"
|
|
1187
|
+
*
|
|
1188
|
+
* // The bundle a tester gets from the Play track, its page carrying the editor agent.
|
|
1189
|
+
* const test = await app.build.run({ target: "android", aab: true, dev: true });
|
|
1190
|
+
* // test.outPath === "dist-native/android", test.profile === "dev"
|
|
1149
1191
|
* ```
|
|
1150
1192
|
*/
|
|
1151
1193
|
run(opts: RunOptions): Promise<BuildResult>;
|
|
1152
1194
|
/**
|
|
1153
1195
|
* Runs the pipeline sequentially for every target in `opts.targets` (default: the configured
|
|
1154
1196
|
* `targets`), stopping at the first failing target. With `debug`, every target is checked up
|
|
1155
|
-
* front and the whole run is refused when one is
|
|
1197
|
+
* front and the whole run is refused when one is neither android nor ios; `debug` and `dev`
|
|
1198
|
+
* together are refused up front too — nothing is half-built.
|
|
1156
1199
|
*
|
|
1157
1200
|
* @param opts - The targets plus the platform flags threaded into every run.
|
|
1158
1201
|
* @returns Every completed target's result, in target order.
|
|
1159
|
-
* @throws {Error}
|
|
1202
|
+
* @throws {Error} The up-front refusals, or whatever the first failing target's pipeline throws.
|
|
1160
1203
|
* @example
|
|
1161
1204
|
* ```ts
|
|
1162
1205
|
* // targets: ["android"] in the app config
|
|
1163
1206
|
* const [phone] = await app.build.runAll({ debug: true });
|
|
1164
1207
|
* // phone.profile === "debug", phone.outPath === "dist-native/android-debug"
|
|
1208
|
+
*
|
|
1209
|
+
* // The test app of both phones in one pass, each in the dev profile.
|
|
1210
|
+
* const results = await app.build.runAll({ targets: ["android", "ios"], dev: true });
|
|
1211
|
+
* // results.map(result => result.profile) is ["dev", "dev"]
|
|
1165
1212
|
* ```
|
|
1166
1213
|
*/
|
|
1167
1214
|
runAll(opts?: RunAllOptions): Promise<readonly BuildResult[]>;
|
|
@@ -1288,25 +1335,29 @@ type Api = {
|
|
|
1288
1335
|
* `{ all: true }` (which ignores any given `target`). The flavor flags pass straight
|
|
1289
1336
|
* through to `build.run`/`build.runAll`. Progress renders live through the plugin's
|
|
1290
1337
|
* `native:phase`/`native:complete` hooks — a debug delivery is marked
|
|
1291
|
-
* `debug build → <outPath>` in the completion panel
|
|
1292
|
-
* editor-agent page included) renders the scrubbed stderr
|
|
1293
|
-
* error line, then rethrows unchanged.
|
|
1338
|
+
* `debug build → <outPath>` in the completion panel, a dev delivery reads like a store one.
|
|
1339
|
+
* A failure (the store refusal of an editor-agent page included) renders the scrubbed stderr
|
|
1340
|
+
* tail before the `[native]` error line, then rethrows unchanged.
|
|
1294
1341
|
*
|
|
1295
1342
|
* @param opts - Build options.
|
|
1296
1343
|
* @param opts.target - The packaging target (default: the resolved host target).
|
|
1297
1344
|
* @param opts.all - Build every configured target instead of one (ignores `target`).
|
|
1298
1345
|
* @param opts.simulator - iOS: build for the host's simulator arch instead of a device archive.
|
|
1299
1346
|
* @param opts.aab - Android: emit a store bundle (`.aab`) instead of an `.apk`.
|
|
1300
|
-
* @param opts.debug - Build the debug profile (Android
|
|
1347
|
+
* @param opts.debug - Build the debug profile (Android, iOS), delivered to `<outDir>/<target>-debug`.
|
|
1348
|
+
* @param opts.dev - Build the dev profile: the store build a tester installs, agent allowed.
|
|
1301
1349
|
* @returns Resolves once the build (or all builds) complete.
|
|
1302
1350
|
* @throws {Error} Whatever the pipeline throws — after rendering the failure.
|
|
1303
|
-
* `[native] --debug builds Android only …` when `debug` is set with
|
|
1304
|
-
* (or `all: true` with
|
|
1351
|
+
* `[native] --debug builds Android and iOS only …` when `debug` is set with another target
|
|
1352
|
+
* (or `all: true` with another target); `[native] debug and dev cannot be combined.` for
|
|
1353
|
+
* both flags together.
|
|
1305
1354
|
* @example
|
|
1306
1355
|
* ```ts
|
|
1307
1356
|
* // A debug build for the phone, installed beside the store app; the completion panel
|
|
1308
1357
|
* // reads "debug build → dist-native/android-debug".
|
|
1309
1358
|
* await app.cli.build({ target: "android", debug: true });
|
|
1359
|
+
* // The bundle a tester gets from the Play track, in dist-native/android.
|
|
1360
|
+
* await app.cli.build({ target: "android", aab: true, dev: true });
|
|
1310
1361
|
* // Every configured target, store profile.
|
|
1311
1362
|
* await app.cli.build({ all: true });
|
|
1312
1363
|
* ```
|
package/dist/index.d.mts
CHANGED
|
@@ -35,8 +35,10 @@ type BuildFlavor = {
|
|
|
35
35
|
aab?: boolean | undefined;
|
|
36
36
|
/**
|
|
37
37
|
* Build the debug profile instead of the store one: a still-optimized build that installs
|
|
38
|
-
* next to the store app
|
|
39
|
-
* forwards the page console and allows cleartext.
|
|
38
|
+
* next to the store app. On Android native gives it the `.debug` id and "(debug)" name, signs
|
|
39
|
+
* it with the debug keystore, forwards the page console and allows cleartext. On iOS the
|
|
40
|
+
* config names the app, and native adds the local-network keys and the Web Inspector. Unset
|
|
41
|
+
* means the store profile.
|
|
40
42
|
*
|
|
41
43
|
* @example
|
|
42
44
|
* ```ts
|
|
@@ -44,17 +46,30 @@ type BuildFlavor = {
|
|
|
44
46
|
* ```
|
|
45
47
|
*/
|
|
46
48
|
debug?: boolean | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* Build the dev profile instead of the store one: the store build a tester installs, with
|
|
51
|
+
* the same signing, `.aab`, `exportMethod` and delivery, whose page may carry the editor
|
|
52
|
+
* agent. The app config names the separate app (id, name, icon, `projectDir`, `outDir`);
|
|
53
|
+
* native renames nothing. Combining it with `debug` is an error.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```ts
|
|
57
|
+
* await app.build.run({ target: "android", aab: true, dev: true });
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
dev?: boolean | undefined;
|
|
47
61
|
};
|
|
48
62
|
/**
|
|
49
63
|
* Which profile a build is made in. `"store"` is the shippable build; `"debug"` is the
|
|
50
|
-
* on-device test build of {@link BuildFlavor.debug}
|
|
64
|
+
* on-device test build of {@link BuildFlavor.debug}; `"dev"` is the store-signed test build
|
|
65
|
+
* of {@link BuildFlavor.dev}. The page sees `"store"` and `"dev"` as `"release"`.
|
|
51
66
|
*
|
|
52
67
|
* @example
|
|
53
68
|
* ```ts
|
|
54
|
-
* const profile: BuildProfile = flavor.
|
|
69
|
+
* const profile: BuildProfile = flavor.dev ? "dev" : "store";
|
|
55
70
|
* ```
|
|
56
71
|
*/
|
|
57
|
-
type BuildProfile = "store" | "debug";
|
|
72
|
+
type BuildProfile = "store" | "debug" | "dev";
|
|
58
73
|
/**
|
|
59
74
|
* Resolves the packaging targets a host can build with no extra opt-in — the default
|
|
60
75
|
* `config.targets`. Exactly one desktop target per host (`darwin` → `macos`,
|
|
@@ -308,9 +323,9 @@ type CompletenessResult = {
|
|
|
308
323
|
};
|
|
309
324
|
/**
|
|
310
325
|
* Result of the idempotent mobile patch pass: Android release signing and the main
|
|
311
|
-
* activity's manifest attributes, the iOS Xcode build settings, deployment target
|
|
312
|
-
*
|
|
313
|
-
* touched is listed once; a file a patch removed is listed as patched.
|
|
326
|
+
* activity's manifest attributes, the iOS Xcode build settings, deployment target, privacy
|
|
327
|
+
* manifest and `Info.plist`, and the runner command on both platforms. A file several
|
|
328
|
+
* patches touched is listed once; a file a patch removed is listed as patched.
|
|
314
329
|
*/
|
|
315
330
|
type PatchResult = {
|
|
316
331
|
readonly patched: readonly string[];
|
|
@@ -328,8 +343,9 @@ type PatchMobileOptions = {
|
|
|
328
343
|
/**
|
|
329
344
|
* The build profile one Android patch pass applies, with what that profile needs: the
|
|
330
345
|
* debug profile names the app `"<name> (debug)"` and signs with the debug keystore the
|
|
331
|
-
* caller resolved from `ctx.env`. `
|
|
332
|
-
*
|
|
346
|
+
* caller resolved from `ctx.env`. The `dev` build profile applies as `store`: it is the
|
|
347
|
+
* store build a tester installs, signed with the game's key. `log` receives the warning about
|
|
348
|
+
* a network security config this plugin did not write.
|
|
333
349
|
*
|
|
334
350
|
* @example
|
|
335
351
|
* ```ts
|
|
@@ -429,7 +445,7 @@ type TauriConfFragment = Record<string, never> | DeepLinkConf;
|
|
|
429
445
|
/**
|
|
430
446
|
* An Info.ios.plist sidecar entry (src-tauri root, outside gen/), which Tauri merges into
|
|
431
447
|
* the app's Info.plist on every iOS build. No registry row carries one today; the
|
|
432
|
-
* orientation lock
|
|
448
|
+
* orientation lock, `ios.infoPlist` and the iOS debug profile do.
|
|
433
449
|
*/
|
|
434
450
|
type PlistEntry = {
|
|
435
451
|
key: string;
|
|
@@ -481,7 +497,10 @@ type Api$4 = {
|
|
|
481
497
|
* in `config.system`, or implied by the debug profile on android), the
|
|
482
498
|
* `tauri-plugin-moku-shell` crate is generated under `plugins/moku-shell/` too, with the
|
|
483
499
|
* profile baked into its page script. Without the shell, the profile changes one key: the
|
|
484
|
-
* store profile sets `build.removeUnusedCommands` in `tauri.conf.json
|
|
500
|
+
* store profile sets `build.removeUnusedCommands` in `tauri.conf.json`, and the debug and
|
|
501
|
+
* dev profiles do not. An iOS build in the debug profile also opens to Safari Web Inspector
|
|
502
|
+
* (`devtools` on the main window and in the `tauri` features) and to the editor on the local
|
|
503
|
+
* network (`NSLocalNetworkUsageDescription` and `NSAppTransportSecurity` in `Info.ios.plist`).
|
|
485
504
|
*
|
|
486
505
|
* @param opts - The generate options.
|
|
487
506
|
* @param opts.target - The packaging target to generate for.
|
|
@@ -541,15 +560,17 @@ type Api$4 = {
|
|
|
541
560
|
/**
|
|
542
561
|
* Runs the idempotent mobile post-init patch pass. Android gets its build-profile
|
|
543
562
|
* patches (debug: the `.debug` id suffix, the `"<name> (debug)"` label, a cleartext
|
|
544
|
-
* network security config; store: all three reverted to the bytes before), its
|
|
545
|
-
* signing (the debug keystore under `HOME` ?? `USERPROFILE` in the debug profile), the
|
|
563
|
+
* network security config; store and dev: all three reverted to the bytes before), its
|
|
564
|
+
* release signing (the debug keystore under `HOME` ?? `USERPROFILE` in the debug profile), the
|
|
546
565
|
* main activity's manifest attributes (the orientation lock among them) and the status
|
|
547
566
|
* bar style in MainActivity.kt (light icons on a dark `app.backgroundColor`, dark icons
|
|
548
567
|
* on a light one); iOS gets the Xcode entitlements-modification setting, the deployment
|
|
549
568
|
* target (`signing.apple.iosMinimumSystemVersion`, or its default) and the privacy manifest
|
|
550
569
|
* (`ios.privacyManifest`; unset removes one an earlier pass added), each in `project.yml`
|
|
551
|
-
* and `project.pbxproj`, because a kept tree never runs xcodegen again
|
|
552
|
-
*
|
|
570
|
+
* and `project.pbxproj`, because a kept tree never runs xcodegen again, and outside the
|
|
571
|
+
* debug profile it loses the debug keys an earlier debug build merged into
|
|
572
|
+
* `<slug>_iOS/Info.plist`; both get the Xcode/Android-Studio runner-command rewrite when a
|
|
573
|
+
* `runner` is supplied. The build
|
|
553
574
|
* plugin calls it after the mobile init pass, with the runner from `tauri.getRunner()`.
|
|
554
575
|
* A `gen/apple` tree that was never initialised reports nothing.
|
|
555
576
|
*
|
|
@@ -561,7 +582,7 @@ type Api$4 = {
|
|
|
561
582
|
* @throws {Error} `[native]` in the debug profile when the debug keystore is missing,
|
|
562
583
|
* with the `keytool` command that creates it; when `ios.privacyManifest` names no file,
|
|
563
584
|
* before anything is written; when `project.yml` or `project.pbxproj` lacks a line a
|
|
564
|
-
* patch needs.
|
|
585
|
+
* patch needs; when a debug key in `Info.plist` has no value.
|
|
565
586
|
* @example
|
|
566
587
|
* ```ts
|
|
567
588
|
* // app.orientation is "portrait", app.backgroundColor is "#10161d", app.identifier is
|
|
@@ -975,7 +996,7 @@ type Api$3 = {
|
|
|
975
996
|
* @param opts.onOutput - Called with each scrubbed output line.
|
|
976
997
|
* @param opts.env - Extra environment for the tauri CLI, merged over the inherited one, so
|
|
977
998
|
* the web build tauri runs (`beforeBuildCommand`) can read it. Never changes the argv: the
|
|
978
|
-
* debug
|
|
999
|
+
* debug and dev profiles are still release builds (no `--debug`).
|
|
979
1000
|
* @returns The completed run's result.
|
|
980
1001
|
* @throws {Error} A classified `TauriError` on a non-zero exit.
|
|
981
1002
|
* @example
|
|
@@ -1078,19 +1099,34 @@ type PhaseTiming = {
|
|
|
1078
1099
|
};
|
|
1079
1100
|
/** Result of one target's full pipeline pass — `phases` always carries all six entries. */
|
|
1080
1101
|
type BuildResult = {
|
|
1081
|
-
target: Target; /** `<outDir>/<target>` for a store build, `<outDir>/<target>-debug` for a debug one. */
|
|
1102
|
+
target: Target; /** `<outDir>/<target>` for a store or dev build, `<outDir>/<target>-debug` for a debug one. */
|
|
1082
1103
|
outPath: string;
|
|
1083
1104
|
artifacts: readonly string[];
|
|
1084
1105
|
durationMs: number;
|
|
1085
1106
|
phases: readonly PhaseTiming[]; /** The profile the artifacts were built in — the same value `native:complete` carries. */
|
|
1086
1107
|
profile: BuildProfile;
|
|
1087
1108
|
};
|
|
1088
|
-
/**
|
|
1109
|
+
/**
|
|
1110
|
+
* Options for a prepare pass: the target, and `debug` for the debug profile (Android, iOS).
|
|
1111
|
+
* It takes no `dev` on purpose: a dev build is only ever a full `run`.
|
|
1112
|
+
*
|
|
1113
|
+
* @example
|
|
1114
|
+
* ```ts
|
|
1115
|
+
* const opts: PrepareOptions = { target: "ios", debug: true };
|
|
1116
|
+
* ```
|
|
1117
|
+
*/
|
|
1089
1118
|
type PrepareOptions = {
|
|
1090
1119
|
target: Target;
|
|
1091
1120
|
debug?: boolean | undefined;
|
|
1092
1121
|
};
|
|
1093
|
-
/**
|
|
1122
|
+
/**
|
|
1123
|
+
* Options for one target's pipeline pass. Platform-specific flags are ignored elsewhere.
|
|
1124
|
+
*
|
|
1125
|
+
* @example
|
|
1126
|
+
* ```ts
|
|
1127
|
+
* const opts: RunOptions = { target: "android", aab: true, dev: true };
|
|
1128
|
+
* ```
|
|
1129
|
+
*/
|
|
1094
1130
|
type RunOptions = BuildFlavor & {
|
|
1095
1131
|
target: Target;
|
|
1096
1132
|
};
|
|
@@ -1122,13 +1158,13 @@ type Api$2 = {
|
|
|
1122
1158
|
*
|
|
1123
1159
|
* @param opts - The target to prepare, and `debug` for the debug profile.
|
|
1124
1160
|
* @returns Nothing; the tree under `projectDir` is ready for the build verb.
|
|
1125
|
-
* @throws {Error} `[native] --debug builds Android only for now (asked for <target>).`
|
|
1126
|
-
* `debug` is set for any target but android — before any phase runs.
|
|
1161
|
+
* @throws {Error} `[native] --debug builds Android and iOS only for now (asked for <target>).`
|
|
1162
|
+
* when `debug` is set for any target but android and ios — before any phase runs.
|
|
1127
1163
|
* @example
|
|
1128
1164
|
* ```ts
|
|
1129
1165
|
* // A consumer prepares the debug tree of the phone build to open it in Android Studio: the
|
|
1130
1166
|
* // shell crate is generated and the debug patches are applied, nothing is compiled.
|
|
1131
|
-
* await
|
|
1167
|
+
* await app.build.prepare({ target: "android", debug: true });
|
|
1132
1168
|
* ```
|
|
1133
1169
|
*/
|
|
1134
1170
|
prepare(opts: PrepareOptions): Promise<void>;
|
|
@@ -1137,32 +1173,43 @@ type Api$2 = {
|
|
|
1137
1173
|
* target, emitting `native:phase` per phase and `native:complete` on success. A store build
|
|
1138
1174
|
* whose page carries the editor agent is refused after the compile, before anything is
|
|
1139
1175
|
* collected; a debug build is delivered into `<outDir>/<target>-debug`, beside the store one.
|
|
1176
|
+
* A dev build is the store build with the agent allowed: same signing, same delivery.
|
|
1140
1177
|
*
|
|
1141
|
-
* @param opts - The target plus the platform flags (`simulator`, `aab`, `debug`).
|
|
1178
|
+
* @param opts - The target plus the platform flags (`simulator`, `aab`, `debug`, `dev`).
|
|
1142
1179
|
* @returns The completed pipeline's result.
|
|
1143
|
-
* @throws {Error} The first failing phase's error;
|
|
1144
|
-
* for `debug` on another target
|
|
1180
|
+
* @throws {Error} The first failing phase's error; before any phase,
|
|
1181
|
+
* `[native] --debug builds Android and iOS only …` for `debug` on another target and
|
|
1182
|
+
* `[native] debug and dev cannot be combined.` for both flags together.
|
|
1145
1183
|
* @example
|
|
1146
1184
|
* ```ts
|
|
1147
1185
|
* // A debug build for the phone, installed beside the store app.
|
|
1148
1186
|
* const result = await app.build.run({ target: "android", debug: true });
|
|
1149
1187
|
* // result.outPath === "dist-native/android-debug", result.profile === "debug"
|
|
1188
|
+
*
|
|
1189
|
+
* // The bundle a tester gets from the Play track, its page carrying the editor agent.
|
|
1190
|
+
* const test = await app.build.run({ target: "android", aab: true, dev: true });
|
|
1191
|
+
* // test.outPath === "dist-native/android", test.profile === "dev"
|
|
1150
1192
|
* ```
|
|
1151
1193
|
*/
|
|
1152
1194
|
run(opts: RunOptions): Promise<BuildResult>;
|
|
1153
1195
|
/**
|
|
1154
1196
|
* Runs the pipeline sequentially for every target in `opts.targets` (default: the configured
|
|
1155
1197
|
* `targets`), stopping at the first failing target. With `debug`, every target is checked up
|
|
1156
|
-
* front and the whole run is refused when one is
|
|
1198
|
+
* front and the whole run is refused when one is neither android nor ios; `debug` and `dev`
|
|
1199
|
+
* together are refused up front too — nothing is half-built.
|
|
1157
1200
|
*
|
|
1158
1201
|
* @param opts - The targets plus the platform flags threaded into every run.
|
|
1159
1202
|
* @returns Every completed target's result, in target order.
|
|
1160
|
-
* @throws {Error}
|
|
1203
|
+
* @throws {Error} The up-front refusals, or whatever the first failing target's pipeline throws.
|
|
1161
1204
|
* @example
|
|
1162
1205
|
* ```ts
|
|
1163
1206
|
* // targets: ["android"] in the app config
|
|
1164
1207
|
* const [phone] = await app.build.runAll({ debug: true });
|
|
1165
1208
|
* // phone.profile === "debug", phone.outPath === "dist-native/android-debug"
|
|
1209
|
+
*
|
|
1210
|
+
* // The test app of both phones in one pass, each in the dev profile.
|
|
1211
|
+
* const results = await app.build.runAll({ targets: ["android", "ios"], dev: true });
|
|
1212
|
+
* // results.map(result => result.profile) is ["dev", "dev"]
|
|
1166
1213
|
* ```
|
|
1167
1214
|
*/
|
|
1168
1215
|
runAll(opts?: RunAllOptions): Promise<readonly BuildResult[]>;
|
|
@@ -1289,25 +1336,29 @@ type Api = {
|
|
|
1289
1336
|
* `{ all: true }` (which ignores any given `target`). The flavor flags pass straight
|
|
1290
1337
|
* through to `build.run`/`build.runAll`. Progress renders live through the plugin's
|
|
1291
1338
|
* `native:phase`/`native:complete` hooks — a debug delivery is marked
|
|
1292
|
-
* `debug build → <outPath>` in the completion panel
|
|
1293
|
-
* editor-agent page included) renders the scrubbed stderr
|
|
1294
|
-
* error line, then rethrows unchanged.
|
|
1339
|
+
* `debug build → <outPath>` in the completion panel, a dev delivery reads like a store one.
|
|
1340
|
+
* A failure (the store refusal of an editor-agent page included) renders the scrubbed stderr
|
|
1341
|
+
* tail before the `[native]` error line, then rethrows unchanged.
|
|
1295
1342
|
*
|
|
1296
1343
|
* @param opts - Build options.
|
|
1297
1344
|
* @param opts.target - The packaging target (default: the resolved host target).
|
|
1298
1345
|
* @param opts.all - Build every configured target instead of one (ignores `target`).
|
|
1299
1346
|
* @param opts.simulator - iOS: build for the host's simulator arch instead of a device archive.
|
|
1300
1347
|
* @param opts.aab - Android: emit a store bundle (`.aab`) instead of an `.apk`.
|
|
1301
|
-
* @param opts.debug - Build the debug profile (Android
|
|
1348
|
+
* @param opts.debug - Build the debug profile (Android, iOS), delivered to `<outDir>/<target>-debug`.
|
|
1349
|
+
* @param opts.dev - Build the dev profile: the store build a tester installs, agent allowed.
|
|
1302
1350
|
* @returns Resolves once the build (or all builds) complete.
|
|
1303
1351
|
* @throws {Error} Whatever the pipeline throws — after rendering the failure.
|
|
1304
|
-
* `[native] --debug builds Android only …` when `debug` is set with
|
|
1305
|
-
* (or `all: true` with
|
|
1352
|
+
* `[native] --debug builds Android and iOS only …` when `debug` is set with another target
|
|
1353
|
+
* (or `all: true` with another target); `[native] debug and dev cannot be combined.` for
|
|
1354
|
+
* both flags together.
|
|
1306
1355
|
* @example
|
|
1307
1356
|
* ```ts
|
|
1308
1357
|
* // A debug build for the phone, installed beside the store app; the completion panel
|
|
1309
1358
|
* // reads "debug build → dist-native/android-debug".
|
|
1310
1359
|
* await app.cli.build({ target: "android", debug: true });
|
|
1360
|
+
* // The bundle a tester gets from the Play track, in dist-native/android.
|
|
1361
|
+
* await app.cli.build({ target: "android", aab: true, dev: true });
|
|
1311
1362
|
* // Every configured target, store profile.
|
|
1312
1363
|
* await app.cli.build({ all: true });
|
|
1313
1364
|
* ```
|