Skip to content

Commit 3bec7b1

Browse files
authored
feat(cli): add support to Svelte and Vue.js code on v1 migration (#10544)
* feat(cli): add support to Svelte and Vue.js code on v1 migration * clippy
1 parent 3998570 commit 3bec7b1

File tree

9 files changed

+746
-235
lines changed

9 files changed

+746
-235
lines changed

.changes/migrate-vue-svelte.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"tauri-cli": patch:feat
3+
"@tauri-apps/cli": patch:feat
4+
---
5+
6+
v1 migrate script now migrates Svelte and Vue.js code.

tooling/cli/Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tooling/cli/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ magic_string = "0.3"
100100
phf = { version = "0.11", features = ["macros"] }
101101
walkdir = "2"
102102
elf = "0.7"
103+
memchr = "2"
103104

104105
[target."cfg(windows)".dependencies.windows-sys]
105106
version = "0.52"

tooling/cli/src/helpers/cargo.rs

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// SPDX-License-Identifier: Apache-2.0
33
// SPDX-License-Identifier: MIT
44

5-
use std::{path::Path, process::Command};
5+
use std::process::Command;
66

77
use anyhow::Context;
88

@@ -17,37 +17,6 @@ pub struct CargoInstallOptions<'a> {
1717
pub target: Option<&'a str>,
1818
}
1919

20-
pub fn install(dependencies: &[String], cwd: Option<&Path>) -> crate::Result<()> {
21-
let dependencies_str = if dependencies.len() > 1 {
22-
"dependencies"
23-
} else {
24-
"dependency"
25-
};
26-
log::info!(
27-
"Installing Cargo {dependencies_str} {}...",
28-
dependencies
29-
.iter()
30-
.map(|d| format!("\"{d}\""))
31-
.collect::<Vec<_>>()
32-
.join(", ")
33-
);
34-
35-
let mut cmd = Command::new("cargo");
36-
cmd.arg("add").args(dependencies);
37-
38-
if let Some(cwd) = cwd {
39-
cmd.current_dir(cwd);
40-
}
41-
42-
let status = cmd.status().with_context(|| "failed to run cargo")?;
43-
44-
if !status.success() {
45-
anyhow::bail!("Failed to install Cargo {dependencies_str}");
46-
}
47-
48-
Ok(())
49-
}
50-
5120
pub fn install_one(options: CargoInstallOptions) -> crate::Result<()> {
5221
let mut cargo = Command::new("cargo");
5322
cargo.arg("add");

0 commit comments

Comments
 (0)