diff --git a/tooling/cli.rs/src/init.rs b/tooling/cli.rs/src/init.rs index 8967770a9..c3c9a9f5d 100644 --- a/tooling/cli.rs/src/init.rs +++ b/tooling/cli.rs/src/init.rs @@ -101,8 +101,14 @@ impl Init { ) } else { ( - format!(r#"{{ version = "{}" }}"#, metadata.tauri), - format!(r#"{{ version = "{}" }}"#, metadata.tauri_build), + format!( + r#"{{ version = "{}", features = [ "api-all" ] }}"#, + metadata.tauri + ), + format!( + r#"{{ version = "{}", features = [ "api-all" ] }}"#, + metadata.tauri_build + ), ) }; diff --git a/tooling/cli.rs/src/plugin.rs b/tooling/cli.rs/src/plugin.rs index 7f99bb7a1..2fb64ab22 100644 --- a/tooling/cli.rs/src/plugin.rs +++ b/tooling/cli.rs/src/plugin.rs @@ -85,8 +85,14 @@ impl Plugin { ) } else { ( - format!(r#"{{ version = "{}" }}"#, metadata.tauri), - format!(r#"{{ version = "{}" }}"#, metadata.tauri_build), + format!( + r#"{{ version = "{}", features = [ "api-all" ] }}"#, + metadata.tauri + ), + format!( + r#"{{ version = "{}", features = [ "api-all" ] }}"#, + metadata.tauri_build + ), ) }; diff --git a/tooling/cli.rs/templates/plugin/backend/.changes/initial-release.md b/tooling/cli.rs/templates/plugin/backend/.changes/initial-release.md new file mode 100644 index 000000000..fce69c818 --- /dev/null +++ b/tooling/cli.rs/templates/plugin/backend/.changes/initial-release.md @@ -0,0 +1,5 @@ +--- +"tauri-plugin-{{ plugin_name }}": "minor" +--- + +Initial release. diff --git a/tooling/cli.rs/templates/plugin/backend/Cargo.crate-manifest b/tooling/cli.rs/templates/plugin/backend/Cargo.crate-manifest index ae553d94f..25346bee7 100755 --- a/tooling/cli.rs/templates/plugin/backend/Cargo.crate-manifest +++ b/tooling/cli.rs/templates/plugin/backend/Cargo.crate-manifest @@ -1,9 +1,10 @@ [package] name = "tauri-plugin-{{ plugin_name }}" -version = "0.1.0" +version = "0.0.0" authors = [ "You" ] description = "" edition = "2018" +exclude = ["/examples"] [dependencies] tauri = {{{ tauri_dep }}} diff --git a/tooling/cli.rs/templates/plugin/with-api/.changes/initial-release.md b/tooling/cli.rs/templates/plugin/with-api/.changes/initial-release.md new file mode 100644 index 000000000..fce69c818 --- /dev/null +++ b/tooling/cli.rs/templates/plugin/with-api/.changes/initial-release.md @@ -0,0 +1,5 @@ +--- +"tauri-plugin-{{ plugin_name }}": "minor" +--- + +Initial release. diff --git a/tooling/cli.rs/templates/plugin/with-api/examples/svelte-app/src-tauri/src/main.rs b/tooling/cli.rs/templates/plugin/with-api/examples/svelte-app/src-tauri/src/main.rs index 76bb90494..3484c5abe 100644 --- a/tooling/cli.rs/templates/plugin/with-api/examples/svelte-app/src-tauri/src/main.rs +++ b/tooling/cli.rs/templates/plugin/with-api/examples/svelte-app/src-tauri/src/main.rs @@ -3,7 +3,6 @@ windows_subsystem = "windows" )] - fn main() { tauri::Builder::default() .plugin(tauri_plugin_{{ plugin_name_snake_case }}::YourPlugin::default()) diff --git a/tooling/cli.rs/templates/plugin/with-api/examples/svelte-app/src/App.svelte b/tooling/cli.rs/templates/plugin/with-api/examples/svelte-app/src/App.svelte index ed34c5dd3..24e618e8d 100644 --- a/tooling/cli.rs/templates/plugin/with-api/examples/svelte-app/src/App.svelte +++ b/tooling/cli.rs/templates/plugin/with-api/examples/svelte-app/src/App.svelte @@ -4,7 +4,7 @@ let response = '' function updateResponse(returnValue) { - response += (typeof returnValue === 'string' ? returnValue : JSON.stringify(returnValue)) + '
' + response += `[${new Date().toLocaleTimeString()}]` + (typeof returnValue === 'string' ? returnValue : JSON.stringify(returnValue)) + '
' } function _execute() { @@ -14,4 +14,5 @@
+
{@html response}
diff --git a/tooling/cli.rs/templates/plugin/with-api/src/lib.rs b/tooling/cli.rs/templates/plugin/with-api/src/lib.rs index beaa4e5bb..68eb17730 100644 --- a/tooling/cli.rs/templates/plugin/with-api/src/lib.rs +++ b/tooling/cli.rs/templates/plugin/with-api/src/lib.rs @@ -17,9 +17,7 @@ impl Serialize for Error { where S: Serializer, { - match self { - Self::Io(error) => serializer.serialize_str(error.to_string().as_ref()), - } + serializer.serialize_str(self.to_string().as_ref()) } }