Skip to content

Commit

Permalink
Remove Svelte to native Typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
RubenPX committed Mar 7, 2024
1 parent 3bc63a7 commit f0b1b90
Show file tree
Hide file tree
Showing 23 changed files with 159 additions and 851 deletions.
7 changes: 1 addition & 6 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
{
"recommendations": [
"svelte.svelte-vscode",
"tauri-apps.tauri-vscode",
"rust-lang.rust-analyzer",
"1yib.rust-bundle"
]
"recommendations": ["tauri-apps.tauri-vscode", "rust-lang.rust-analyzer"]
}
31 changes: 4 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,7 @@
# Tauri + Svelte + Typescript + C#
# Tauri + Vanilla TS

This template should help get you started developing with Tauri, Svelte and TypeScript in Vite.
This template should help get you started developing with Tauri in vanilla HTML, CSS and Typescript.

This dll can talk with NetHostFX apps

## TODOS

- [X] Invoke from Tauri to NetHostFX
- [ ] Allow Tauri pass to C# String parameters
- [ ] Allow to send & parse JSON Data betwen processes

## Extra

You can replace frontend as you want

To invoke NetHost code, you need install tauri API and run this code

```javascript
import { invoke } from "@tauri-apps/api/tauri"

let name = "";
let greetMsg = ""

async function greet(){
// Learn more about Tauri commands at https://tauri.app/v1/guides/features/command
greetMsg = await invoke("greet", { name })
}
```
## Recommended IDE Setup

- [VS Code](https://code.visualstudio.com/) + [Tauri](https://marketplace.visualstudio.com/items?itemName=tauri-apps.tauri-vscode) + [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer)
48 changes: 44 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,53 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<link rel="stylesheet" href="/src/styles.css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Tauri + Svelte + TS</title>
<title>Tauri App</title>
<script type="module" src="/src/main.ts" defer></script>
<style>
.logo.vite:hover {
filter: drop-shadow(0 0 2em #747bff);
}

.logo.typescript:hover {
filter: drop-shadow(0 0 2em #2d79c7);
}
</style>
</head>

<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
<div class="container">
<h1>Welcome to Tauri!</h1>

<div class="row">
<a href="https://vitejs.dev" target="_blank">
<img src="/src/assets/vite.svg" class="logo vite" alt="Vite logo" />
</a>
<a href="https://tauri.app" target="_blank">
<img
src="/src/assets/tauri.svg"
class="logo tauri"
alt="Tauri logo"
/>
</a>
<a href="https://www.typescriptlang.org/docs" target="_blank">
<img
src="/src/assets/typescript.svg"
class="logo typescript"
alt="typescript logo"
/>
</a>
</div>

<p>Click on the Tauri logo to learn more about the framework</p>

<form class="row" id="greet-form">
<input id="greet-input" placeholder="Enter a name..." />
<button type="submit">Greet</button>
</form>

<p id="greet-msg"></p>
</div>
</body>
</html>
12 changes: 3 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,16 @@
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"build": "tsc && vite build",
"preview": "vite preview",
"check": "svelte-check --tsconfig ./tsconfig.json",
"tauri": "tauri"
},
"dependencies": {
"@tauri-apps/api": "^1"
},
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^3.0.1",
"@tsconfig/svelte": "^5.0.2",
"svelte": "^4.2.8",
"svelte-check": "^3.4.6",
"tslib": "^2.6.0",
"typescript": "^5.0.2",
"@tauri-apps/cli": "^1",
"vite": "^5.0.0",
"@tauri-apps/cli": "^1"
"typescript": "^5.0.2"
}
}
Loading

0 comments on commit f0b1b90

Please sign in to comment.