Skip to content

Commit c01e87a

Browse files
refactor(cli/migrate): use oxc kit to parse and migrate js/ts files (#10198)
* refactor(cli/migrate): use `oxc` kit to parse and migrate js/ts files closes #10192 * fix tests * use majic-string to perserve formatting * more comments * Discard changes to package.json * Update cli-migrate-enhancemnets.md * Update cli-migrate-enhancemnets.md * more context * add missing quotes, rename getcurrent * fix change file --------- Co-authored-by: Lucas Nogueira <lucas@tauri.app>
1 parent 2c076d6 commit c01e87a

File tree

10 files changed

+692
-70
lines changed

10 files changed

+692
-70
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
"tauri-cli": "patch:enhance"
3+
"@tauri-apps/cli": "patch:enhance"
4+
---
5+
6+
Enhance `tauri migrate` to also migrate variables like `appWindow`:
7+
```ts
8+
import { appWindow } from '@tauri-apps/api/window'
9+
```
10+
will become:
11+
```ts
12+
import { getCurrentWebviewWindow } from '@tauri-apps/api/webviewWindow'
13+
const appWindow = getCurrentWebviewWindow()
14+
```
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"tauri-cli": "patch:bug"
3+
"@tauri-apps/cli": "patch:bug"
4+
---
5+
6+
Fix `tauri migrate` incorrectly migrating `@tauri-apps/api/tauri` module to just `core` and `@tauri-apps/api/window` to just `webviewWindow`.

examples/api/src-tauri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ license = "Apache-2.0 OR MIT"
88

99
[lib]
1010
name = "api_lib"
11-
crate-type = ["staticlib", "cdylib", "rlib"]
11+
crate-type = ["staticlib", "cdylib", "lib"]
1212

1313
[build-dependencies]
1414
tauri-build = { path = "../../../core/tauri-build", features = [

0 commit comments

Comments
 (0)