@moku-labs/native 0.3.14 → 0.3.16
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.cjs +66 -24
- package/dist/index.d.cts +6 -5
- package/dist/index.d.mts +6 -5
- package/dist/index.mjs +66 -24
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -1078,9 +1078,11 @@ const IOS_MANAGER_IMPORT = ["#[cfg(target_os = \"ios\")]", "use tauri::Manager;"
|
|
|
1078
1078
|
* The safe-area setup hook up to the end of the iOS closure, as verified on the iOS 26.3
|
|
1079
1079
|
* simulator. UIKit shrinks a WKWebView page by the safe area while its scroll view stays on
|
|
1080
1080
|
* `.automatic`; `.never` gives the page the whole screen, and CSS `env(safe-area-inset-*)`
|
|
1081
|
-
* still reports the notch.
|
|
1082
|
-
*
|
|
1083
|
-
*
|
|
1081
|
+
* still reports the notch. iOS 26 also draws a scroll edge effect under the status bar, which
|
|
1082
|
+
* Reduce Transparency turns into an opaque band in the page colour (seen on an iPhone 13 mini
|
|
1083
|
+
* and on the iOS 27 simulator), so the hook hides the four edge effects. The `cfg` makes it a
|
|
1084
|
+
* no-op off iOS, so `lib.rs` does not differ per target. The window is tauri's default `main`
|
|
1085
|
+
* label: the generated `app.windows` entry carries none.
|
|
1084
1086
|
*/
|
|
1085
1087
|
const SAFE_AREA_SETUP = [
|
|
1086
1088
|
" .setup(|_app| {",
|
|
@@ -1089,9 +1091,19 @@ const SAFE_AREA_SETUP = [
|
|
|
1089
1091
|
" #[cfg(target_os = \"ios\")]",
|
|
1090
1092
|
" if let Some(window) = _app.get_webview_window(\"main\") {",
|
|
1091
1093
|
" window.with_webview(|webview| unsafe {",
|
|
1092
|
-
" use objc2::{msg_send, runtime::AnyObject};",
|
|
1094
|
+
" use objc2::{msg_send, runtime::AnyObject, sel};",
|
|
1093
1095
|
" let wk = &*(webview.inner() as *mut AnyObject);",
|
|
1094
1096
|
" let scroll: *mut AnyObject = msg_send![wk, scrollView];",
|
|
1097
|
+
" // iOS 26 draws a scroll edge effect under the status bar and the home indicator. With",
|
|
1098
|
+
" // Reduce Transparency it is an opaque band in the page colour over the game, so it is",
|
|
1099
|
+
" // hidden: the page never scrolls. Older iOS has no such selector and is left alone.",
|
|
1100
|
+
" for name in [sel!(topEdgeEffect), sel!(leftEdgeEffect), sel!(bottomEdgeEffect), sel!(rightEdgeEffect)] {",
|
|
1101
|
+
" let has: bool = msg_send![&*scroll, respondsToSelector: name];",
|
|
1102
|
+
" if has {",
|
|
1103
|
+
" let effect: *mut AnyObject = msg_send![&*scroll, performSelector: name];",
|
|
1104
|
+
" let _: () = msg_send![&*effect, setHidden: true];",
|
|
1105
|
+
" }",
|
|
1106
|
+
" }",
|
|
1095
1107
|
" // UIScrollViewContentInsetAdjustmentNever = 2",
|
|
1096
1108
|
" let _: () = msg_send![&*scroll, setContentInsetAdjustmentBehavior: 2isize];"
|
|
1097
1109
|
];
|
|
@@ -3050,13 +3062,16 @@ async function patchAndroidIcon(options) {
|
|
|
3050
3062
|
//#endregion
|
|
3051
3063
|
//#region src/plugins/project/mobile/identity.ts
|
|
3052
3064
|
/**
|
|
3053
|
-
* @file project plugin — the app id a `gen
|
|
3054
|
-
* tree aside when that id is not the configured one. `tauri android init` bakes the
|
|
3055
|
-
* the namespace, the `applicationId` and the Kotlin package path;
|
|
3056
|
-
*
|
|
3065
|
+
* @file project plugin — the app id a mobile `gen/<platform>` tree was initialised for, and
|
|
3066
|
+
* setting a tree aside when that id is not the configured one. `tauri android init` bakes the
|
|
3067
|
+
* id into the namespace, the `applicationId` and the Kotlin package path; `tauri ios init`
|
|
3068
|
+
* bakes it into `project.yml` and the Xcode project. A kept tree never runs init again, so a
|
|
3069
|
+
* changed `app.identifier` would otherwise build against the old package or bundle id.
|
|
3057
3070
|
*/
|
|
3058
3071
|
/** The key of the `applicationId = "<id>"` line; the debug suffix is a separate line. */
|
|
3059
3072
|
const APPLICATION_ID_KEY = "applicationId";
|
|
3073
|
+
/** The key of the `PRODUCT_BUNDLE_IDENTIFIER: <id>` line of `project.yml`. */
|
|
3074
|
+
const BUNDLE_IDENTIFIER_KEY = "PRODUCT_BUNDLE_IDENTIFIER";
|
|
3060
3075
|
/**
|
|
3061
3076
|
* Reads the `applicationId` a `gen/android` tree was initialised for. Only a quoted literal
|
|
3062
3077
|
* is recognised, the form `tauri android init` writes; an expression reads as no id.
|
|
@@ -3077,13 +3092,34 @@ function readAndroidApplicationId(genDirectory) {
|
|
|
3077
3092
|
}
|
|
3078
3093
|
}
|
|
3079
3094
|
/**
|
|
3080
|
-
*
|
|
3095
|
+
* Reads the bundle id a `gen/apple` tree was initialised for, from the
|
|
3096
|
+
* `PRODUCT_BUNDLE_IDENTIFIER` of its `project.yml` — the file the Xcode project is generated
|
|
3097
|
+
* from, so both carry the same id. A quoted value is read without its quotes.
|
|
3098
|
+
*
|
|
3099
|
+
* @param genDirectory - The absolute `src-tauri/gen/apple` directory.
|
|
3100
|
+
* @returns The id, or undefined when `project.yml` is absent or names no bundle id.
|
|
3101
|
+
* @example
|
|
3102
|
+
* ```ts
|
|
3103
|
+
* readAppleBundleIdentifier("/repo/.moku/tauri/src-tauri/gen/apple"); // "com.acme.demo"
|
|
3104
|
+
* ```
|
|
3105
|
+
*/
|
|
3106
|
+
function readAppleBundleIdentifier(genDirectory) {
|
|
3107
|
+
const projectPath = node_path.default.join(genDirectory, "project.yml");
|
|
3108
|
+
if (!(0, node_fs.existsSync)(projectPath)) return void 0;
|
|
3109
|
+
for (const line of (0, node_fs.readFileSync)(projectPath, "utf8").split("\n")) {
|
|
3110
|
+
const [key, value] = line.split(":", 2).map((part) => part.trim());
|
|
3111
|
+
if (key === BUNDLE_IDENTIFIER_KEY && value) return value.replaceAll(/["']/g, "");
|
|
3112
|
+
}
|
|
3113
|
+
}
|
|
3114
|
+
/**
|
|
3115
|
+
* Compares two app ids the way Tauri writes them: a `-` may come out as `_` on Android and
|
|
3116
|
+
* a `_` as `-` on Apple.
|
|
3081
3117
|
*
|
|
3082
3118
|
* @param left - One id.
|
|
3083
3119
|
* @param right - The other id.
|
|
3084
3120
|
* @returns Whether both name the same app.
|
|
3085
3121
|
*/
|
|
3086
|
-
function
|
|
3122
|
+
function sameAppId(left, right) {
|
|
3087
3123
|
return left.replaceAll("-", "_") === right.replaceAll("-", "_");
|
|
3088
3124
|
}
|
|
3089
3125
|
/**
|
|
@@ -3105,24 +3141,30 @@ function freeAsidePath(genDirectory, found) {
|
|
|
3105
3141
|
return candidate;
|
|
3106
3142
|
}
|
|
3107
3143
|
/**
|
|
3108
|
-
* Moves a `gen/android` tree aside when it was initialised for another app id,
|
|
3109
|
-
* `tauri android init` writes a fresh one. The tree is renamed, never deleted:
|
|
3110
|
-
* keystore or hand edits. A tree whose id cannot be read is left to the
|
|
3144
|
+
* Moves a `gen/android` or `gen/apple` tree aside when it was initialised for another app id,
|
|
3145
|
+
* so the next `tauri android|ios init` writes a fresh one. The tree is renamed, never deleted:
|
|
3146
|
+
* it may hold a keystore or hand edits. A tree whose id cannot be read is left to the
|
|
3147
|
+
* completeness gate.
|
|
3111
3148
|
*
|
|
3112
3149
|
* @param options - The check options.
|
|
3113
|
-
* @param options.
|
|
3150
|
+
* @param options.target - The mobile platform the tree belongs to.
|
|
3151
|
+
* @param options.genDirectory - The absolute `src-tauri/gen/<platform>` directory.
|
|
3114
3152
|
* @param options.identifier - The configured `app.identifier`.
|
|
3115
3153
|
* @returns What was found and where it went, or undefined when the tree was kept.
|
|
3116
3154
|
* @example
|
|
3117
3155
|
* ```ts
|
|
3118
|
-
* await
|
|
3156
|
+
* await setAsideStaleMobileTree({
|
|
3157
|
+
* target: "android",
|
|
3158
|
+
* genDirectory,
|
|
3159
|
+
* identifier: "studio.kitto.memorymissing"
|
|
3160
|
+
* });
|
|
3119
3161
|
* // { found: "com.mokulabs.memorymissing", expected: "studio.kitto.memorymissing",
|
|
3120
3162
|
* // movedTo: ".../gen/android.old-com.mokulabs.memorymissing" }
|
|
3121
3163
|
* ```
|
|
3122
3164
|
*/
|
|
3123
|
-
async function
|
|
3124
|
-
const found = readAndroidApplicationId(options.genDirectory);
|
|
3125
|
-
if (found === void 0 ||
|
|
3165
|
+
async function setAsideStaleMobileTree(options) {
|
|
3166
|
+
const found = options.target === "android" ? readAndroidApplicationId(options.genDirectory) : readAppleBundleIdentifier(options.genDirectory);
|
|
3167
|
+
if (found === void 0 || sameAppId(found, options.identifier)) return void 0;
|
|
3126
3168
|
const movedTo = freeAsidePath(options.genDirectory, found);
|
|
3127
3169
|
await (0, node_fs_promises.rename)(options.genDirectory, movedTo);
|
|
3128
3170
|
return {
|
|
@@ -6627,20 +6669,20 @@ function createProjectApi(ctx) {
|
|
|
6627
6669
|
*/
|
|
6628
6670
|
const checkCompleteness = (opts) => completeness(ctx.global.projectDir, opts.target);
|
|
6629
6671
|
/**
|
|
6630
|
-
* Implements {@link Api.setAsideStaleTree}:
|
|
6631
|
-
* was moved.
|
|
6672
|
+
* Implements {@link Api.setAsideStaleTree}: one plain warn line when a tree was moved.
|
|
6632
6673
|
*
|
|
6633
6674
|
* @param opts - See {@link Api.setAsideStaleTree}.
|
|
6634
6675
|
* @param opts.target - The mobile platform whose tree to check.
|
|
6635
6676
|
* @returns See {@link Api.setAsideStaleTree}.
|
|
6636
6677
|
*/
|
|
6637
6678
|
const runSetAsideStaleTree = async (opts) => {
|
|
6638
|
-
|
|
6639
|
-
const aside = await
|
|
6640
|
-
|
|
6679
|
+
const genDirectory = genDirectoryPath(ctx.global.projectDir, opts.target);
|
|
6680
|
+
const aside = await setAsideStaleMobileTree({
|
|
6681
|
+
target: opts.target,
|
|
6682
|
+
genDirectory,
|
|
6641
6683
|
identifier: ctx.global.app.identifier
|
|
6642
6684
|
});
|
|
6643
|
-
if (aside !== void 0) ctx.log.warn(`gen
|
|
6685
|
+
if (aside !== void 0) ctx.log.warn(`gen/${node_path.default.basename(genDirectory)} was made for ${aside.found}, not ${aside.expected}: moved it to ${node_path.default.basename(aside.movedTo)} and generating it again`);
|
|
6644
6686
|
return aside;
|
|
6645
6687
|
};
|
|
6646
6688
|
/**
|
package/dist/index.d.cts
CHANGED
|
@@ -574,11 +574,12 @@ type Api$4 = {
|
|
|
574
574
|
target: Target;
|
|
575
575
|
}): CompletenessResult;
|
|
576
576
|
/**
|
|
577
|
-
* Sets a `gen/android` tree aside when it was initialised for another app id
|
|
578
|
-
* `app.identifier
|
|
579
|
-
*
|
|
580
|
-
*
|
|
581
|
-
* tree
|
|
577
|
+
* Sets a `gen/android` or `gen/apple` tree aside when it was initialised for another app id
|
|
578
|
+
* than `app.identifier` (Android: `applicationId` in `app/build.gradle.kts`; iOS:
|
|
579
|
+
* `PRODUCT_BUNDLE_IDENTIFIER` in `project.yml`): renames it to `gen/<platform>.old-<old id>`
|
|
580
|
+
* (never deletes it, it may hold a keystore or hand edits) and logs one line, so the build's
|
|
581
|
+
* mobile init writes a fresh tree. The build plugin calls it before the completeness read.
|
|
582
|
+
* A missing tree and a tree whose id cannot be read get undefined.
|
|
582
583
|
*
|
|
583
584
|
* @param opts - The check options.
|
|
584
585
|
* @param opts.target - The mobile platform whose tree to check.
|
package/dist/index.d.mts
CHANGED
|
@@ -575,11 +575,12 @@ type Api$4 = {
|
|
|
575
575
|
target: Target;
|
|
576
576
|
}): CompletenessResult;
|
|
577
577
|
/**
|
|
578
|
-
* Sets a `gen/android` tree aside when it was initialised for another app id
|
|
579
|
-
* `app.identifier
|
|
580
|
-
*
|
|
581
|
-
*
|
|
582
|
-
* tree
|
|
578
|
+
* Sets a `gen/android` or `gen/apple` tree aside when it was initialised for another app id
|
|
579
|
+
* than `app.identifier` (Android: `applicationId` in `app/build.gradle.kts`; iOS:
|
|
580
|
+
* `PRODUCT_BUNDLE_IDENTIFIER` in `project.yml`): renames it to `gen/<platform>.old-<old id>`
|
|
581
|
+
* (never deletes it, it may hold a keystore or hand edits) and logs one line, so the build's
|
|
582
|
+
* mobile init writes a fresh tree. The build plugin calls it before the completeness read.
|
|
583
|
+
* A missing tree and a tree whose id cannot be read get undefined.
|
|
583
584
|
*
|
|
584
585
|
* @param opts - The check options.
|
|
585
586
|
* @param opts.target - The mobile platform whose tree to check.
|
package/dist/index.mjs
CHANGED
|
@@ -1051,9 +1051,11 @@ const IOS_MANAGER_IMPORT = ["#[cfg(target_os = \"ios\")]", "use tauri::Manager;"
|
|
|
1051
1051
|
* The safe-area setup hook up to the end of the iOS closure, as verified on the iOS 26.3
|
|
1052
1052
|
* simulator. UIKit shrinks a WKWebView page by the safe area while its scroll view stays on
|
|
1053
1053
|
* `.automatic`; `.never` gives the page the whole screen, and CSS `env(safe-area-inset-*)`
|
|
1054
|
-
* still reports the notch.
|
|
1055
|
-
*
|
|
1056
|
-
*
|
|
1054
|
+
* still reports the notch. iOS 26 also draws a scroll edge effect under the status bar, which
|
|
1055
|
+
* Reduce Transparency turns into an opaque band in the page colour (seen on an iPhone 13 mini
|
|
1056
|
+
* and on the iOS 27 simulator), so the hook hides the four edge effects. The `cfg` makes it a
|
|
1057
|
+
* no-op off iOS, so `lib.rs` does not differ per target. The window is tauri's default `main`
|
|
1058
|
+
* label: the generated `app.windows` entry carries none.
|
|
1057
1059
|
*/
|
|
1058
1060
|
const SAFE_AREA_SETUP = [
|
|
1059
1061
|
" .setup(|_app| {",
|
|
@@ -1062,9 +1064,19 @@ const SAFE_AREA_SETUP = [
|
|
|
1062
1064
|
" #[cfg(target_os = \"ios\")]",
|
|
1063
1065
|
" if let Some(window) = _app.get_webview_window(\"main\") {",
|
|
1064
1066
|
" window.with_webview(|webview| unsafe {",
|
|
1065
|
-
" use objc2::{msg_send, runtime::AnyObject};",
|
|
1067
|
+
" use objc2::{msg_send, runtime::AnyObject, sel};",
|
|
1066
1068
|
" let wk = &*(webview.inner() as *mut AnyObject);",
|
|
1067
1069
|
" let scroll: *mut AnyObject = msg_send![wk, scrollView];",
|
|
1070
|
+
" // iOS 26 draws a scroll edge effect under the status bar and the home indicator. With",
|
|
1071
|
+
" // Reduce Transparency it is an opaque band in the page colour over the game, so it is",
|
|
1072
|
+
" // hidden: the page never scrolls. Older iOS has no such selector and is left alone.",
|
|
1073
|
+
" for name in [sel!(topEdgeEffect), sel!(leftEdgeEffect), sel!(bottomEdgeEffect), sel!(rightEdgeEffect)] {",
|
|
1074
|
+
" let has: bool = msg_send![&*scroll, respondsToSelector: name];",
|
|
1075
|
+
" if has {",
|
|
1076
|
+
" let effect: *mut AnyObject = msg_send![&*scroll, performSelector: name];",
|
|
1077
|
+
" let _: () = msg_send![&*effect, setHidden: true];",
|
|
1078
|
+
" }",
|
|
1079
|
+
" }",
|
|
1068
1080
|
" // UIScrollViewContentInsetAdjustmentNever = 2",
|
|
1069
1081
|
" let _: () = msg_send![&*scroll, setContentInsetAdjustmentBehavior: 2isize];"
|
|
1070
1082
|
];
|
|
@@ -3023,13 +3035,16 @@ async function patchAndroidIcon(options) {
|
|
|
3023
3035
|
//#endregion
|
|
3024
3036
|
//#region src/plugins/project/mobile/identity.ts
|
|
3025
3037
|
/**
|
|
3026
|
-
* @file project plugin — the app id a `gen
|
|
3027
|
-
* tree aside when that id is not the configured one. `tauri android init` bakes the
|
|
3028
|
-
* the namespace, the `applicationId` and the Kotlin package path;
|
|
3029
|
-
*
|
|
3038
|
+
* @file project plugin — the app id a mobile `gen/<platform>` tree was initialised for, and
|
|
3039
|
+
* setting a tree aside when that id is not the configured one. `tauri android init` bakes the
|
|
3040
|
+
* id into the namespace, the `applicationId` and the Kotlin package path; `tauri ios init`
|
|
3041
|
+
* bakes it into `project.yml` and the Xcode project. A kept tree never runs init again, so a
|
|
3042
|
+
* changed `app.identifier` would otherwise build against the old package or bundle id.
|
|
3030
3043
|
*/
|
|
3031
3044
|
/** The key of the `applicationId = "<id>"` line; the debug suffix is a separate line. */
|
|
3032
3045
|
const APPLICATION_ID_KEY = "applicationId";
|
|
3046
|
+
/** The key of the `PRODUCT_BUNDLE_IDENTIFIER: <id>` line of `project.yml`. */
|
|
3047
|
+
const BUNDLE_IDENTIFIER_KEY = "PRODUCT_BUNDLE_IDENTIFIER";
|
|
3033
3048
|
/**
|
|
3034
3049
|
* Reads the `applicationId` a `gen/android` tree was initialised for. Only a quoted literal
|
|
3035
3050
|
* is recognised, the form `tauri android init` writes; an expression reads as no id.
|
|
@@ -3050,13 +3065,34 @@ function readAndroidApplicationId(genDirectory) {
|
|
|
3050
3065
|
}
|
|
3051
3066
|
}
|
|
3052
3067
|
/**
|
|
3053
|
-
*
|
|
3068
|
+
* Reads the bundle id a `gen/apple` tree was initialised for, from the
|
|
3069
|
+
* `PRODUCT_BUNDLE_IDENTIFIER` of its `project.yml` — the file the Xcode project is generated
|
|
3070
|
+
* from, so both carry the same id. A quoted value is read without its quotes.
|
|
3071
|
+
*
|
|
3072
|
+
* @param genDirectory - The absolute `src-tauri/gen/apple` directory.
|
|
3073
|
+
* @returns The id, or undefined when `project.yml` is absent or names no bundle id.
|
|
3074
|
+
* @example
|
|
3075
|
+
* ```ts
|
|
3076
|
+
* readAppleBundleIdentifier("/repo/.moku/tauri/src-tauri/gen/apple"); // "com.acme.demo"
|
|
3077
|
+
* ```
|
|
3078
|
+
*/
|
|
3079
|
+
function readAppleBundleIdentifier(genDirectory) {
|
|
3080
|
+
const projectPath = path.join(genDirectory, "project.yml");
|
|
3081
|
+
if (!existsSync(projectPath)) return void 0;
|
|
3082
|
+
for (const line of readFileSync(projectPath, "utf8").split("\n")) {
|
|
3083
|
+
const [key, value] = line.split(":", 2).map((part) => part.trim());
|
|
3084
|
+
if (key === BUNDLE_IDENTIFIER_KEY && value) return value.replaceAll(/["']/g, "");
|
|
3085
|
+
}
|
|
3086
|
+
}
|
|
3087
|
+
/**
|
|
3088
|
+
* Compares two app ids the way Tauri writes them: a `-` may come out as `_` on Android and
|
|
3089
|
+
* a `_` as `-` on Apple.
|
|
3054
3090
|
*
|
|
3055
3091
|
* @param left - One id.
|
|
3056
3092
|
* @param right - The other id.
|
|
3057
3093
|
* @returns Whether both name the same app.
|
|
3058
3094
|
*/
|
|
3059
|
-
function
|
|
3095
|
+
function sameAppId(left, right) {
|
|
3060
3096
|
return left.replaceAll("-", "_") === right.replaceAll("-", "_");
|
|
3061
3097
|
}
|
|
3062
3098
|
/**
|
|
@@ -3078,24 +3114,30 @@ function freeAsidePath(genDirectory, found) {
|
|
|
3078
3114
|
return candidate;
|
|
3079
3115
|
}
|
|
3080
3116
|
/**
|
|
3081
|
-
* Moves a `gen/android` tree aside when it was initialised for another app id,
|
|
3082
|
-
* `tauri android init` writes a fresh one. The tree is renamed, never deleted:
|
|
3083
|
-
* keystore or hand edits. A tree whose id cannot be read is left to the
|
|
3117
|
+
* Moves a `gen/android` or `gen/apple` tree aside when it was initialised for another app id,
|
|
3118
|
+
* so the next `tauri android|ios init` writes a fresh one. The tree is renamed, never deleted:
|
|
3119
|
+
* it may hold a keystore or hand edits. A tree whose id cannot be read is left to the
|
|
3120
|
+
* completeness gate.
|
|
3084
3121
|
*
|
|
3085
3122
|
* @param options - The check options.
|
|
3086
|
-
* @param options.
|
|
3123
|
+
* @param options.target - The mobile platform the tree belongs to.
|
|
3124
|
+
* @param options.genDirectory - The absolute `src-tauri/gen/<platform>` directory.
|
|
3087
3125
|
* @param options.identifier - The configured `app.identifier`.
|
|
3088
3126
|
* @returns What was found and where it went, or undefined when the tree was kept.
|
|
3089
3127
|
* @example
|
|
3090
3128
|
* ```ts
|
|
3091
|
-
* await
|
|
3129
|
+
* await setAsideStaleMobileTree({
|
|
3130
|
+
* target: "android",
|
|
3131
|
+
* genDirectory,
|
|
3132
|
+
* identifier: "studio.kitto.memorymissing"
|
|
3133
|
+
* });
|
|
3092
3134
|
* // { found: "com.mokulabs.memorymissing", expected: "studio.kitto.memorymissing",
|
|
3093
3135
|
* // movedTo: ".../gen/android.old-com.mokulabs.memorymissing" }
|
|
3094
3136
|
* ```
|
|
3095
3137
|
*/
|
|
3096
|
-
async function
|
|
3097
|
-
const found = readAndroidApplicationId(options.genDirectory);
|
|
3098
|
-
if (found === void 0 ||
|
|
3138
|
+
async function setAsideStaleMobileTree(options) {
|
|
3139
|
+
const found = options.target === "android" ? readAndroidApplicationId(options.genDirectory) : readAppleBundleIdentifier(options.genDirectory);
|
|
3140
|
+
if (found === void 0 || sameAppId(found, options.identifier)) return void 0;
|
|
3099
3141
|
const movedTo = freeAsidePath(options.genDirectory, found);
|
|
3100
3142
|
await rename(options.genDirectory, movedTo);
|
|
3101
3143
|
return {
|
|
@@ -6600,20 +6642,20 @@ function createProjectApi(ctx) {
|
|
|
6600
6642
|
*/
|
|
6601
6643
|
const checkCompleteness = (opts) => completeness(ctx.global.projectDir, opts.target);
|
|
6602
6644
|
/**
|
|
6603
|
-
* Implements {@link Api.setAsideStaleTree}:
|
|
6604
|
-
* was moved.
|
|
6645
|
+
* Implements {@link Api.setAsideStaleTree}: one plain warn line when a tree was moved.
|
|
6605
6646
|
*
|
|
6606
6647
|
* @param opts - See {@link Api.setAsideStaleTree}.
|
|
6607
6648
|
* @param opts.target - The mobile platform whose tree to check.
|
|
6608
6649
|
* @returns See {@link Api.setAsideStaleTree}.
|
|
6609
6650
|
*/
|
|
6610
6651
|
const runSetAsideStaleTree = async (opts) => {
|
|
6611
|
-
|
|
6612
|
-
const aside = await
|
|
6613
|
-
|
|
6652
|
+
const genDirectory = genDirectoryPath(ctx.global.projectDir, opts.target);
|
|
6653
|
+
const aside = await setAsideStaleMobileTree({
|
|
6654
|
+
target: opts.target,
|
|
6655
|
+
genDirectory,
|
|
6614
6656
|
identifier: ctx.global.app.identifier
|
|
6615
6657
|
});
|
|
6616
|
-
if (aside !== void 0) ctx.log.warn(`gen
|
|
6658
|
+
if (aside !== void 0) ctx.log.warn(`gen/${path.basename(genDirectory)} was made for ${aside.found}, not ${aside.expected}: moved it to ${path.basename(aside.movedTo)} and generating it again`);
|
|
6617
6659
|
return aside;
|
|
6618
6660
|
};
|
|
6619
6661
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moku-labs/native",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.16",
|
|
4
4
|
"description": "Node-only native packager framework for Moku — generates a gitignored Tauri project, codegens capabilities/Info.plist/AndroidManifest from composed system plugins, and runs tauri build.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
"@arethetypeswrong/cli": "0.18.3",
|
|
67
67
|
"@arethetypeswrong/core": "0.18.3",
|
|
68
68
|
"@biomejs/biome": "2.4.16",
|
|
69
|
-
"@moku-labs/ci": "1.5.
|
|
70
|
-
"@moku-labs/common": "0.3.
|
|
69
|
+
"@moku-labs/ci": "1.5.8",
|
|
70
|
+
"@moku-labs/common": "0.3.12",
|
|
71
71
|
"@moku-labs/core": "1.7.6",
|
|
72
72
|
"@types/bun": "1.4.2",
|
|
73
73
|
"@vitest/coverage-istanbul": "4.0.18",
|