mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-03 10:11:15 +02:00
fix(cli.rs): do not enable all tauri features on plugin template manifest
This commit is contained in:
@@ -86,26 +86,32 @@ impl Plugin {
|
||||
template_target_path
|
||||
));
|
||||
} else {
|
||||
let (tauri_dep, tauri_build_dep) = if let Some(tauri_path) = self.tauri_path {
|
||||
(
|
||||
format!(
|
||||
r#"{{ path = {:?}, features = [ "api-all" ] }}"#,
|
||||
resolve_tauri_path(&tauri_path, "core/tauri")
|
||||
),
|
||||
format!(
|
||||
"{{ path = {:?} }}",
|
||||
resolve_tauri_path(&tauri_path, "core/tauri-build")
|
||||
),
|
||||
)
|
||||
} else {
|
||||
(
|
||||
format!(
|
||||
r#"{{ version = "{}", features = [ "api-all" ] }}"#,
|
||||
metadata.tauri
|
||||
),
|
||||
format!(r#"{{ version = "{}" }}"#, metadata.tauri_build),
|
||||
)
|
||||
};
|
||||
let (tauri_dep, tauri_example_dep, tauri_build_dep) =
|
||||
if let Some(tauri_path) = self.tauri_path {
|
||||
(
|
||||
format!(
|
||||
r#"{{ path = {:?} }}"#,
|
||||
resolve_tauri_path(&tauri_path, "core/tauri")
|
||||
),
|
||||
format!(
|
||||
r#"{{ path = {:?}, features = [ "api-all" ] }}"#,
|
||||
resolve_tauri_path(&tauri_path, "core/tauri")
|
||||
),
|
||||
format!(
|
||||
"{{ path = {:?} }}",
|
||||
resolve_tauri_path(&tauri_path, "core/tauri-build")
|
||||
),
|
||||
)
|
||||
} else {
|
||||
(
|
||||
format!(r#"{{ version = "{}" }}"#, metadata.tauri),
|
||||
format!(
|
||||
r#"{{ version = "{}", features = [ "api-all" ] }}"#,
|
||||
metadata.tauri
|
||||
),
|
||||
format!(r#"{{ version = "{}" }}"#, metadata.tauri_build),
|
||||
)
|
||||
};
|
||||
|
||||
let _ = remove_dir_all(&template_target_path);
|
||||
let handlebars = Handlebars::new();
|
||||
@@ -118,6 +124,7 @@ impl Plugin {
|
||||
to_json(self.plugin_name.to_snake_case()),
|
||||
);
|
||||
data.insert("tauri_dep", to_json(tauri_dep));
|
||||
data.insert("tauri_example_dep", to_json(tauri_example_dep));
|
||||
data.insert("tauri_build_dep", to_json(tauri_build_dep));
|
||||
data.insert("author", to_json(self.author));
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ edition = "2018"
|
||||
[dependencies]
|
||||
serde_json = "1.0"
|
||||
serde = { version = "1.0", features = [ "derive" ] }
|
||||
tauri = {{{ tauri_dep }}}
|
||||
tauri = {{{ tauri_example_dep }}}
|
||||
tauri-plugin-{{ plugin_name }} = { path = "../../../" }
|
||||
|
||||
[build-dependencies]
|
||||
|
||||
@@ -9,7 +9,7 @@ edition = "2018"
|
||||
[dependencies]
|
||||
serde_json = "1.0"
|
||||
serde = { version = "1.0", features = [ "derive" ] }
|
||||
tauri = {{{ tauri_dep }}}
|
||||
tauri = {{{ tauri_example_dep }}}
|
||||
tauri-plugin-{{ plugin_name }} = { path = "../../../" }
|
||||
|
||||
[build-dependencies]
|
||||
|
||||
Reference in New Issue
Block a user