@moku-labs/native 0.3.11 → 0.3.12

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/index.d.cts CHANGED
@@ -39,7 +39,7 @@ type BuildFlavor = {
39
39
  *
40
40
  * @example
41
41
  * ```ts
42
- * await native.build.run({ target: "android", debug: true });
42
+ * await app.build.run({ target: "android", debug: true });
43
43
  * ```
44
44
  */
45
45
  debug?: boolean | undefined;
@@ -113,6 +113,19 @@ type CapabilityConfigMap = {
113
113
  * ```
114
114
  */
115
115
  type Orientation = "portrait" | "landscape" | "any";
116
+ /**
117
+ * One Info.plist value: a `<string>`, a `<true/>`/`<false/>`, an `<array>` or a `<dict>`,
118
+ * nested as deep as the key needs.
119
+ *
120
+ * @example
121
+ * ```ts
122
+ * const encryption: PlistValue = false; // ITSAppUsesNonExemptEncryption
123
+ * const transport: PlistValue = { NSAllowsLocalNetworking: true }; // NSAppTransportSecurity
124
+ * ```
125
+ */
126
+ type PlistValue = string | boolean | readonly PlistValue[] | {
127
+ readonly [key: string]: PlistValue;
128
+ };
116
129
  /** How `tauri ios build` exports the signed archive (`--export-method`). */
117
130
  type AppleExportMethod = "app-store-connect" | "release-testing" | "debugging";
118
131
  /**
@@ -153,8 +166,8 @@ type Config = {
153
166
  * App identity, store metadata and presentation — project.onInit validates
154
167
  * name/identifier are non-empty (reverse-DNS identifier). `icon` is a 1024x1024 PNG
155
168
  * relative to cwd (a placeholder is generated when unset); `category` maps to
156
- * `bundle.category`; `buildNumber` maps to the iOS/macOS `bundleVersion`;
157
- * `orientation` locks the mobile screen at build time; `backgroundColor` paints the
169
+ * `bundle.category`; `buildNumber` maps to the iOS/macOS `bundleVersion` and, a whole
170
+ * number from 1 to 2 100 000 000, to the Android `versionCode`; `orientation` locks the mobile screen at build time; `backgroundColor` paints the
158
171
  * native window behind the page.
159
172
  */
160
173
  app: {
@@ -190,6 +203,16 @@ type Config = {
190
203
  * ```
191
204
  */
192
205
  adaptiveIconInset?: number;
206
+ /**
207
+ * iOS: the app turns the idle timer off at launch, so the screen does not dim while it
208
+ * runs. Android keeps it on from the page. Unset leaves the idle timer on.
209
+ *
210
+ * @example
211
+ * ```ts
212
+ * createApp({ config: { app: { name: "Demo", identifier: "com.acme.demo", keepScreenOn: true } } });
213
+ * ```
214
+ */
215
+ keepScreenOn?: boolean;
193
216
  }; /** Web build/dev wiring codegenned into tauri.conf.json. cwd for monorepo layouts. */
194
217
  web: {
195
218
  build: string;
@@ -206,6 +229,21 @@ type Config = {
206
229
  projectDir: string; /** Installer delivery root. */
207
230
  outDir: string; /** Signing env-var references. */
208
231
  signing: SigningConfig;
232
+ /**
233
+ * What an iOS app adds to its bundle. `infoPlist` merges into `Info.plist`, where
234
+ * `app.orientation` wins a shared key; `privacyManifest` is the absolute path of the file
235
+ * the bundle carries as `PrivacyInfo.xcprivacy`. Unset, a manifest an earlier build left
236
+ * in the generated tree is removed.
237
+ *
238
+ * @example
239
+ * ```ts
240
+ * createApp({ config: { ios: { infoPlist: { ITSAppUsesNonExemptEncryption: false } } } });
241
+ * ```
242
+ */
243
+ ios?: {
244
+ infoPlist?: Readonly<Record<string, PlistValue>>;
245
+ privacyManifest?: string;
246
+ };
209
247
  };
210
248
  /** native:phase payload — one flat event, target as a field (context decision). */
211
249
  type NativePhaseEvent = {
@@ -269,8 +307,9 @@ type CompletenessResult = {
269
307
  };
270
308
  /**
271
309
  * Result of the idempotent mobile patch pass: Android release signing and the main
272
- * activity's manifest attributes, the iOS Xcode build settings, and the runner command
273
- * on both platforms. A file several patches touched is listed once.
310
+ * activity's manifest attributes, the iOS Xcode build settings, deployment target and
311
+ * privacy manifest, and the runner command on both platforms. A file several patches
312
+ * touched is listed once; a file a patch removed is listed as patched.
274
313
  */
275
314
  type PatchResult = {
276
315
  readonly patched: readonly string[];
@@ -386,21 +425,10 @@ type DeepLinkConf = {
386
425
  * the app at startup.
387
426
  */
388
427
  type TauriConfFragment = Record<string, never> | DeepLinkConf;
389
- /**
390
- * One Info.plist value: a `<string>`, a `<true/>`/`<false/>`, or an `<array>` of strings.
391
- *
392
- * @example
393
- * ```ts
394
- * const fullScreen: PlistValue = true; // <true/>
395
- * const portrait: PlistValue = ["UIInterfaceOrientationPortrait"];
396
- * // <array><string>UIInterfaceOrientationPortrait</string></array>
397
- * ```
398
- */
399
- type PlistValue = string | boolean | readonly string[];
400
428
  /**
401
429
  * An Info.ios.plist sidecar entry (src-tauri root, outside gen/), which Tauri merges into
402
430
  * the app's Info.plist on every iOS build. No registry row carries one today; the
403
- * orientation lock does.
431
+ * orientation lock and `ios.infoPlist` do.
404
432
  */
405
433
  type PlistEntry = {
406
434
  key: string;
@@ -451,8 +479,8 @@ type Api$4 = {
451
479
  * write-if-changed writer. When the `shell` capability is composed for the target (named
452
480
  * in `config.system`, or implied by the debug profile on android), the
453
481
  * `tauri-plugin-moku-shell` crate is generated under `plugins/moku-shell/` too, with the
454
- * profile baked into its page script. Without the shell, the output is the same for both
455
- * profiles.
482
+ * 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`.
456
484
  *
457
485
  * @param opts - The generate options.
458
486
  * @param opts.target - The packaging target to generate for.
@@ -516,9 +544,13 @@ type Api$4 = {
516
544
  * signing (the debug keystore under `HOME` ?? `USERPROFILE` in the debug profile), the
517
545
  * main activity's manifest attributes (the orientation lock among them) and the status
518
546
  * bar style in MainActivity.kt (light icons on a dark `app.backgroundColor`, dark icons
519
- * on a light one); iOS gets the Xcode entitlements-modification setting; both get the
547
+ * on a light one); iOS gets the Xcode entitlements-modification setting, the deployment
548
+ * target (`signing.apple.iosMinimumSystemVersion`, or its default) and the privacy manifest
549
+ * (`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; both get the
520
551
  * Xcode/Android-Studio runner-command rewrite when a `runner` is supplied. The build
521
552
  * plugin calls it after the mobile init pass, with the runner from `tauri.getRunner()`.
553
+ * A `gen/apple` tree that was never initialised reports nothing.
522
554
  *
523
555
  * @param opts - The patch options.
524
556
  * @param opts.target - The mobile platform to patch.
@@ -526,7 +558,9 @@ type Api$4 = {
526
558
  * @param opts.profile - The build profile; `"store"` when omitted.
527
559
  * @returns The paths patched vs. left unchanged.
528
560
  * @throws {Error} `[native]` in the debug profile when the debug keystore is missing,
529
- * with the `keytool` command that creates it.
561
+ * with the `keytool` command that creates it; when `ios.privacyManifest` names no file,
562
+ * before anything is written; when `project.yml` or `project.pbxproj` lacks a line a
563
+ * patch needs.
530
564
  * @example
531
565
  * ```ts
532
566
  * // app.orientation is "portrait", app.backgroundColor is "#10161d", app.identifier is
@@ -1417,8 +1451,9 @@ declare const doctorPlugin: import("@moku-labs/core").PluginInstance<"doctor", C
1417
1451
  * Complex tier — capability registry + generators/ (the `tauri-plugin-moku-shell` crate
1418
1452
  * among them) + write-if-changed writer + the mobile/ sub-domain (completeness gate, build
1419
1453
  * profile patches, Android signing block, Android manifest attributes, adaptive icon inset,
1420
- * shell link check, Xcode settings, runner-command rewrite) + the build-time orientation
1421
- * lock + the page agent scan + the guarded clean.
1454
+ * shell link check, Xcode settings, iOS deployment target and privacy manifest,
1455
+ * runner-command rewrite) + the build-time orientation lock + the page agent scan + the
1456
+ * guarded clean.
1422
1457
  *
1423
1458
  * @see README.md
1424
1459
  * @example
@@ -1483,4 +1518,4 @@ declare const createApp: <const ExtraPlugins extends readonly import("@moku-labs
1483
1518
  */
1484
1519
  declare const createPlugin: import("@moku-labs/core").BoundCreatePluginFunction<Config, Events, import("@moku-labs/core").CoreApisFromTuple<[import("@moku-labs/core").CorePluginInstance<"log", import("@moku-labs/common").LogConfig, import("@moku-labs/common").LogState, import("@moku-labs/common").LogApi>, import("@moku-labs/core").CorePluginInstance<"env", import("@moku-labs/common").EnvConfig, import("@moku-labs/common").EnvState, import("@moku-labs/common").EnvApi>]>>;
1485
1520
  //#endregion
1486
- export { type AppleExportMethod, type AppleSigning, type types_d_exports as Build, type BuildFlavor, type BuildProfile, type CapabilityConfigMap, type types_d_exports$1 as Cli, type Config, type types_d_exports$2 as Doctor, type Events, type MobileTarget, type NativeCompleteEvent, type NativePhase, type NativePhaseEvent, type Orientation, PHASE_ORDER, type types_d_exports$3 as Project, type SigningConfig, TARGETS, type Target, type types_d_exports$4 as Tauri, TauriError, type TauriRunner, buildPlugin, cliPlugin, createApp, createPlugin, doctorPlugin, hostTargets, projectPlugin, tauriPlugin };
1521
+ export { type AppleExportMethod, type AppleSigning, type types_d_exports as Build, type BuildFlavor, type BuildProfile, type CapabilityConfigMap, type types_d_exports$1 as Cli, type Config, type types_d_exports$2 as Doctor, type Events, type MobileTarget, type NativeCompleteEvent, type NativePhase, type NativePhaseEvent, type Orientation, PHASE_ORDER, type PlistValue, type types_d_exports$3 as Project, type SigningConfig, TARGETS, type Target, type types_d_exports$4 as Tauri, TauriError, type TauriRunner, buildPlugin, cliPlugin, createApp, createPlugin, doctorPlugin, hostTargets, projectPlugin, tauriPlugin };
package/dist/index.d.mts CHANGED
@@ -40,7 +40,7 @@ type BuildFlavor = {
40
40
  *
41
41
  * @example
42
42
  * ```ts
43
- * await native.build.run({ target: "android", debug: true });
43
+ * await app.build.run({ target: "android", debug: true });
44
44
  * ```
45
45
  */
46
46
  debug?: boolean | undefined;
@@ -114,6 +114,19 @@ type CapabilityConfigMap = {
114
114
  * ```
115
115
  */
116
116
  type Orientation = "portrait" | "landscape" | "any";
117
+ /**
118
+ * One Info.plist value: a `<string>`, a `<true/>`/`<false/>`, an `<array>` or a `<dict>`,
119
+ * nested as deep as the key needs.
120
+ *
121
+ * @example
122
+ * ```ts
123
+ * const encryption: PlistValue = false; // ITSAppUsesNonExemptEncryption
124
+ * const transport: PlistValue = { NSAllowsLocalNetworking: true }; // NSAppTransportSecurity
125
+ * ```
126
+ */
127
+ type PlistValue = string | boolean | readonly PlistValue[] | {
128
+ readonly [key: string]: PlistValue;
129
+ };
117
130
  /** How `tauri ios build` exports the signed archive (`--export-method`). */
118
131
  type AppleExportMethod = "app-store-connect" | "release-testing" | "debugging";
119
132
  /**
@@ -154,8 +167,8 @@ type Config = {
154
167
  * App identity, store metadata and presentation — project.onInit validates
155
168
  * name/identifier are non-empty (reverse-DNS identifier). `icon` is a 1024x1024 PNG
156
169
  * relative to cwd (a placeholder is generated when unset); `category` maps to
157
- * `bundle.category`; `buildNumber` maps to the iOS/macOS `bundleVersion`;
158
- * `orientation` locks the mobile screen at build time; `backgroundColor` paints the
170
+ * `bundle.category`; `buildNumber` maps to the iOS/macOS `bundleVersion` and, a whole
171
+ * number from 1 to 2 100 000 000, to the Android `versionCode`; `orientation` locks the mobile screen at build time; `backgroundColor` paints the
159
172
  * native window behind the page.
160
173
  */
161
174
  app: {
@@ -191,6 +204,16 @@ type Config = {
191
204
  * ```
192
205
  */
193
206
  adaptiveIconInset?: number;
207
+ /**
208
+ * iOS: the app turns the idle timer off at launch, so the screen does not dim while it
209
+ * runs. Android keeps it on from the page. Unset leaves the idle timer on.
210
+ *
211
+ * @example
212
+ * ```ts
213
+ * createApp({ config: { app: { name: "Demo", identifier: "com.acme.demo", keepScreenOn: true } } });
214
+ * ```
215
+ */
216
+ keepScreenOn?: boolean;
194
217
  }; /** Web build/dev wiring codegenned into tauri.conf.json. cwd for monorepo layouts. */
195
218
  web: {
196
219
  build: string;
@@ -207,6 +230,21 @@ type Config = {
207
230
  projectDir: string; /** Installer delivery root. */
208
231
  outDir: string; /** Signing env-var references. */
209
232
  signing: SigningConfig;
233
+ /**
234
+ * What an iOS app adds to its bundle. `infoPlist` merges into `Info.plist`, where
235
+ * `app.orientation` wins a shared key; `privacyManifest` is the absolute path of the file
236
+ * the bundle carries as `PrivacyInfo.xcprivacy`. Unset, a manifest an earlier build left
237
+ * in the generated tree is removed.
238
+ *
239
+ * @example
240
+ * ```ts
241
+ * createApp({ config: { ios: { infoPlist: { ITSAppUsesNonExemptEncryption: false } } } });
242
+ * ```
243
+ */
244
+ ios?: {
245
+ infoPlist?: Readonly<Record<string, PlistValue>>;
246
+ privacyManifest?: string;
247
+ };
210
248
  };
211
249
  /** native:phase payload — one flat event, target as a field (context decision). */
212
250
  type NativePhaseEvent = {
@@ -270,8 +308,9 @@ type CompletenessResult = {
270
308
  };
271
309
  /**
272
310
  * Result of the idempotent mobile patch pass: Android release signing and the main
273
- * activity's manifest attributes, the iOS Xcode build settings, and the runner command
274
- * on both platforms. A file several patches touched is listed once.
311
+ * activity's manifest attributes, the iOS Xcode build settings, deployment target and
312
+ * privacy manifest, and the runner command on both platforms. A file several patches
313
+ * touched is listed once; a file a patch removed is listed as patched.
275
314
  */
276
315
  type PatchResult = {
277
316
  readonly patched: readonly string[];
@@ -387,21 +426,10 @@ type DeepLinkConf = {
387
426
  * the app at startup.
388
427
  */
389
428
  type TauriConfFragment = Record<string, never> | DeepLinkConf;
390
- /**
391
- * One Info.plist value: a `<string>`, a `<true/>`/`<false/>`, or an `<array>` of strings.
392
- *
393
- * @example
394
- * ```ts
395
- * const fullScreen: PlistValue = true; // <true/>
396
- * const portrait: PlistValue = ["UIInterfaceOrientationPortrait"];
397
- * // <array><string>UIInterfaceOrientationPortrait</string></array>
398
- * ```
399
- */
400
- type PlistValue = string | boolean | readonly string[];
401
429
  /**
402
430
  * An Info.ios.plist sidecar entry (src-tauri root, outside gen/), which Tauri merges into
403
431
  * the app's Info.plist on every iOS build. No registry row carries one today; the
404
- * orientation lock does.
432
+ * orientation lock and `ios.infoPlist` do.
405
433
  */
406
434
  type PlistEntry = {
407
435
  key: string;
@@ -452,8 +480,8 @@ type Api$4 = {
452
480
  * write-if-changed writer. When the `shell` capability is composed for the target (named
453
481
  * in `config.system`, or implied by the debug profile on android), the
454
482
  * `tauri-plugin-moku-shell` crate is generated under `plugins/moku-shell/` too, with the
455
- * profile baked into its page script. Without the shell, the output is the same for both
456
- * profiles.
483
+ * 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`.
457
485
  *
458
486
  * @param opts - The generate options.
459
487
  * @param opts.target - The packaging target to generate for.
@@ -517,9 +545,13 @@ type Api$4 = {
517
545
  * signing (the debug keystore under `HOME` ?? `USERPROFILE` in the debug profile), the
518
546
  * main activity's manifest attributes (the orientation lock among them) and the status
519
547
  * bar style in MainActivity.kt (light icons on a dark `app.backgroundColor`, dark icons
520
- * on a light one); iOS gets the Xcode entitlements-modification setting; both get the
548
+ * on a light one); iOS gets the Xcode entitlements-modification setting, the deployment
549
+ * target (`signing.apple.iosMinimumSystemVersion`, or its default) and the privacy manifest
550
+ * (`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; both get the
521
552
  * Xcode/Android-Studio runner-command rewrite when a `runner` is supplied. The build
522
553
  * plugin calls it after the mobile init pass, with the runner from `tauri.getRunner()`.
554
+ * A `gen/apple` tree that was never initialised reports nothing.
523
555
  *
524
556
  * @param opts - The patch options.
525
557
  * @param opts.target - The mobile platform to patch.
@@ -527,7 +559,9 @@ type Api$4 = {
527
559
  * @param opts.profile - The build profile; `"store"` when omitted.
528
560
  * @returns The paths patched vs. left unchanged.
529
561
  * @throws {Error} `[native]` in the debug profile when the debug keystore is missing,
530
- * with the `keytool` command that creates it.
562
+ * with the `keytool` command that creates it; when `ios.privacyManifest` names no file,
563
+ * before anything is written; when `project.yml` or `project.pbxproj` lacks a line a
564
+ * patch needs.
531
565
  * @example
532
566
  * ```ts
533
567
  * // app.orientation is "portrait", app.backgroundColor is "#10161d", app.identifier is
@@ -1418,8 +1452,9 @@ declare const doctorPlugin: import("@moku-labs/core").PluginInstance<"doctor", C
1418
1452
  * Complex tier — capability registry + generators/ (the `tauri-plugin-moku-shell` crate
1419
1453
  * among them) + write-if-changed writer + the mobile/ sub-domain (completeness gate, build
1420
1454
  * profile patches, Android signing block, Android manifest attributes, adaptive icon inset,
1421
- * shell link check, Xcode settings, runner-command rewrite) + the build-time orientation
1422
- * lock + the page agent scan + the guarded clean.
1455
+ * shell link check, Xcode settings, iOS deployment target and privacy manifest,
1456
+ * runner-command rewrite) + the build-time orientation lock + the page agent scan + the
1457
+ * guarded clean.
1423
1458
  *
1424
1459
  * @see README.md
1425
1460
  * @example
@@ -1484,4 +1519,4 @@ declare const createApp: <const ExtraPlugins extends readonly import("@moku-labs
1484
1519
  */
1485
1520
  declare const createPlugin: import("@moku-labs/core").BoundCreatePluginFunction<Config, Events, import("@moku-labs/core").CoreApisFromTuple<[import("@moku-labs/core").CorePluginInstance<"log", import("@moku-labs/common").LogConfig, import("@moku-labs/common").LogState, import("@moku-labs/common").LogApi>, import("@moku-labs/core").CorePluginInstance<"env", import("@moku-labs/common").EnvConfig, import("@moku-labs/common").EnvState, import("@moku-labs/common").EnvApi>]>>;
1486
1521
  //#endregion
1487
- export { type AppleExportMethod, type AppleSigning, type types_d_exports as Build, type BuildFlavor, type BuildProfile, type CapabilityConfigMap, type types_d_exports$1 as Cli, type Config, type types_d_exports$2 as Doctor, type Events, type MobileTarget, type NativeCompleteEvent, type NativePhase, type NativePhaseEvent, type Orientation, PHASE_ORDER, type types_d_exports$3 as Project, type SigningConfig, TARGETS, type Target, type types_d_exports$4 as Tauri, TauriError, type TauriRunner, buildPlugin, cliPlugin, createApp, createPlugin, doctorPlugin, hostTargets, projectPlugin, tauriPlugin };
1522
+ export { type AppleExportMethod, type AppleSigning, type types_d_exports as Build, type BuildFlavor, type BuildProfile, type CapabilityConfigMap, type types_d_exports$1 as Cli, type Config, type types_d_exports$2 as Doctor, type Events, type MobileTarget, type NativeCompleteEvent, type NativePhase, type NativePhaseEvent, type Orientation, PHASE_ORDER, type PlistValue, type types_d_exports$3 as Project, type SigningConfig, TARGETS, type Target, type types_d_exports$4 as Tauri, TauriError, type TauriRunner, buildPlugin, cliPlugin, createApp, createPlugin, doctorPlugin, hostTargets, projectPlugin, tauriPlugin };