Skip to content

Commit ede7f31

Browse files
authored
standardize ‘app’ to ‘my-sidecar’ to avoid potential recursion (tauri-apps#3557)
1 parent f083807 commit ede7f31

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/content/docs/learn/sidecar-nodejs.mdx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,14 @@ Without the plugin being initialized and configured the example won't work.
105105
```json title="sidecar-app/package.json"
106106
{
107107
"scripts": {
108-
"build": "pkg index.ts --output app"
108+
"build": "pkg index.ts --output my-sidecar"
109109
}
110110
}
111111
```
112112

113113
<CommandTabs npm="npm run build" yarn="yarn build" pnpm="pnpm build" />
114114

115-
This will create the `sidecar-app/app` binary on Linux and macOS, and a `sidecar-app/app.exe` executable on Windows.
115+
This will create the `sidecar-app/my-sidecar` binary on Linux and macOS, and a `sidecar-app/my-sidecar.exe` executable on Windows.
116116

117117
For sidecar applications, we need to ensure that the binary is named in the correct pattern, for more information read [Embedding External Binaries](https://tauri.app/develop/sidecar/)
118118
To rename this file to the expected Tauri sidecar filename and also move to our Tauri project, we can use the following Node.js script as a starting example:
@@ -130,8 +130,8 @@ Without the plugin being initialized and configured the example won't work.
130130
}
131131
// TODO: create `src-tauri/binaries` dir
132132
fs.renameSync(
133-
`app${ext}`,
134-
`../src-tauri/binaries/app-${targetTriple}${ext}`
133+
`my-sidecar${ext}`,
134+
`../src-tauri/binaries/my-sidecar-${targetTriple}${ext}`
135135
);
136136
```
137137

@@ -155,7 +155,7 @@ Without the plugin being initialized and configured the example won't work.
155155
"allow": [
156156
{
157157
"args": true,
158-
"name": "binaries/app",
158+
"name": "binaries/my-sidecar",
159159
"sidecar": true
160160
}
161161
]
@@ -172,12 +172,12 @@ Without the plugin being initialized and configured the example won't work.
172172
```json title="src-tauri/tauri.conf.json"
173173
{
174174
"bundle": {
175-
"externalBin": ["binaries/app"]
175+
"externalBin": ["binaries/my-sidecar"]
176176
}
177177
}
178178
```
179179

180-
The Tauri CLI will handle the bundling of the sidecar binary as long as it exists as `src-tauri/binaries/app-<target-triple>`.
180+
The Tauri CLI will handle the bundling of the sidecar binary as long as it exists as `src-tauri/binaries/my-sidecar-<target-triple>`.
181181

182182
1. ##### Execute the Sidecar
183183

@@ -194,7 +194,7 @@ Without the plugin being initialized and configured the example won't work.
194194

195195
const message = 'Tauri';
196196

197-
const command = Command.sidecar('binaries/app', ['hello', message]);
197+
const command = Command.sidecar('binaries/my-sidecar', ['hello', message]);
198198
const output = await command.execute();
199199
// once everything is configured it should log "Hello Tauri" in the browser console.
200200
console.log(output.stdout)
@@ -213,7 +213,7 @@ Without the plugin being initialized and configured the example won't work.
213213
async fn hello(app: tauri::AppHandle, cmd: String, message: String) -> String {
214214
let sidecar_command = app
215215
.shell()
216-
.sidecar("app")
216+
.sidecar("my-sidecar")
217217
.unwrap()
218218
.arg(cmd)
219219
.arg(message);

0 commit comments

Comments
 (0)