Skip to content

Commit a04ea2f

Browse files
authored
refactor: only inject API IIFE script when withGlobalTauri is true (#1071)
* refactor: only inject API IIFE script when withGlobalTauri is true * fmt * update tauri
1 parent 9dec960 commit a04ea2f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+108
-73
lines changed
Lines changed: 32 additions & 0 deletions

examples/api/src-tauri/gen/schemas/mobile-schema.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2363,7 +2363,7 @@
23632363
"type": "object",
23642364
"required": [
23652365
"args",
2366-
"command",
2366+
"cmd",
23672367
"name",
23682368
"sidecar"
23692369
],
@@ -2376,7 +2376,7 @@
23762376
}
23772377
]
23782378
},
2379-
"command": {
2379+
"cmd": {
23802380
"description": "The command name. It can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.",
23812381
"type": "string"
23822382
},
@@ -2398,7 +2398,7 @@
23982398
"type": "object",
23992399
"required": [
24002400
"args",
2401-
"command",
2401+
"cmd",
24022402
"name",
24032403
"sidecar"
24042404
],
@@ -2411,7 +2411,7 @@
24112411
}
24122412
]
24132413
},
2414-
"command": {
2414+
"cmd": {
24152415
"description": "The command name. It can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.",
24162416
"type": "string"
24172417
},

plugins/authenticator/build.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,7 @@ const COMMANDS: &[&str] = &[
1111
];
1212

1313
fn main() {
14-
tauri_plugin::Builder::new(COMMANDS).build();
14+
tauri_plugin::Builder::new(COMMANDS)
15+
.global_api_script_path("./api-iife.js")
16+
.build();
1517
}

plugins/authenticator/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ fn verify_signature(
7878

7979
pub fn init<R: Runtime>() -> TauriPlugin<R> {
8080
PluginBuilder::new("authenticator")
81-
.js_init_script(include_str!("api-iife.js").to_string())
8281
.invoke_handler(tauri::generate_handler![
8382
init_auth,
8483
register,

plugins/autostart/build.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,7 @@
55
const COMMANDS: &[&str] = &["enable", "disable", "is_enabled"];
66

77
fn main() {
8-
tauri_plugin::Builder::new(COMMANDS).build();
8+
tauri_plugin::Builder::new(COMMANDS)
9+
.global_api_script_path("./api-iife.js")
10+
.build();
911
}

plugins/autostart/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ pub fn init<R: Runtime>(
107107
args: Option<Vec<&'static str>>,
108108
) -> TauriPlugin<R> {
109109
Builder::new("autostart")
110-
.js_init_script(include_str!("api-iife.js").to_string())
111110
.invoke_handler(tauri::generate_handler![enable, disable, is_enabled])
112111
.setup(move |app, _api| {
113112
let mut builder = AutoLaunchBuilder::new();

plugins/barcode-scanner/build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const COMMANDS: &[&str] = &[
1313

1414
fn main() {
1515
if let Err(error) = tauri_plugin::Builder::new(COMMANDS)
16+
.global_api_script_path("./api-iife.js")
1617
.android_path("android")
1718
.ios_path("ios")
1819
.try_build()

0 commit comments

Comments
 (0)