Skip to content

Commit 04504b1

Browse files
committed
feat: add some temporary code to test bun server sidecar
1 parent 8db8108 commit 04504b1

File tree

4 files changed

+23
-0
lines changed

4 files changed

+23
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Development
22
public/
3+
src-tauri/sidecars/
34

45
# Logs
56
logs

src-tauri/capabilities/plugin-shell.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
"cmd": "java",
1515
"args": true,
1616
"sidecar": false
17+
},
18+
{
19+
"name": "sidecars/bun-sidecar",
20+
"args": true,
21+
"sidecar": true
1722
}
1823
]
1924
},

src-tauri/tauri.conf.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@
3939
4040
"icons/icon.icns",
4141
"icons/icon.ico"
42+
],
43+
"externalBin": [
44+
"sidecars/bun-sidecar"
4245
]
4346
}
4447
}

src/components/layout/Sidebar.vue

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,23 @@
11
<script setup lang="ts">
22
import { inject } from "vue";
3+
import { Command } from '@tauri-apps/plugin-shell';
34
import type {
45
ContextGlobalStatesType,
56
} from "@/types/application/global-states.type.ts";
67
import { GlobalStatesContextKey } from "@/constants/application.ts";
78
import MaterialRipple from "@/components/misc/MaterialRipple.vue";
89
910
const globalStates = inject<ContextGlobalStatesType>(GlobalStatesContextKey);
11+
12+
async function startElysia(): Promise<void> {
13+
const command = Command.sidecar("sidecars/bun-sidecar", [
14+
"hello",
15+
"from a fucking javascript server",
16+
]);
17+
const output = await command.execute();
18+
19+
console.log(output);
20+
}
1021
</script>
1122

1223
<template>
@@ -33,5 +44,8 @@ const globalStates = inject<ContextGlobalStatesType>(GlobalStatesContextKey);
3344
</span>
3445
<MaterialRipple />
3546
</button>
47+
<button key="unknown-button" @click="startElysia">
48+
Heh
49+
</button>
3650
</TransitionGroup>
3751
</template>

0 commit comments

Comments
 (0)