diff --git a/app.go b/app.go index af53038..993e720 100644 --- a/app.go +++ b/app.go @@ -25,3 +25,7 @@ func (a *App) startup(ctx context.Context) { func (a *App) Greet(name string) string { return fmt.Sprintf("Hello %s, It's show time!", name) } + +func (a *App) Foo() string { + return "bar" +} \ No newline at end of file diff --git a/frontend/src/App.svelte b/frontend/src/App.svelte index eaed6b9..85c84a7 100644 --- a/frontend/src/App.svelte +++ b/frontend/src/App.svelte @@ -1,5 +1,5 @@ -
- -
{resultText}
-
- - -
-
- - + \ No newline at end of file diff --git a/frontend/src/lib/components/Header.svelte b/frontend/src/lib/components/Header.svelte new file mode 100644 index 0000000..acf4262 --- /dev/null +++ b/frontend/src/lib/components/Header.svelte @@ -0,0 +1,7 @@ + + +
+ a cheeky lil header +
diff --git a/frontend/tsconfig.json b/frontend/tsconfig.json index 36aaa3e..1686a94 100644 --- a/frontend/tsconfig.json +++ b/frontend/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "@tsconfig/svelte/tsconfig.json", "compilerOptions": { + "strict": true, "target": "ESNext", "useDefineForClassFields": true, "module": "ESNext", @@ -15,16 +16,13 @@ "allowJs": true, "checkJs": true, "isolatedModules": true, - "paths": { - "$lib/*": ["src/lib/*"], - "$components/*": ["src/lib/components/*"], - "$router/*": ["src/lib/router/*"] - } + "paths": { + "$lib/*": ["src/lib/*"], + "$components/*": ["src/lib/components/*"], + "$router/*": ["src/lib/router/*"], + "$wails/*": ["wails/go/main/*"] + } }, "include": ["src/**/*.d.ts", "src/**/*.ts", "src/**/*.js", "src/**/*.svelte"], - "references": [ - { - "path": "./tsconfig.node.json" - } - ] + "references": [{ "path": "./tsconfig.node.json" }] } diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index d37616f..b2a2749 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -1,7 +1,17 @@ import {defineConfig} from 'vite' import {svelte} from '@sveltejs/vite-plugin-svelte' +import { join } from "node:path"; // https://vitejs.dev/config/ export default defineConfig({ - plugins: [svelte()] + plugins: [svelte()], + + resolve: { + alias: { + $lib: join(__dirname, 'src/lib'), + $components: join(__dirname, 'src/lib/components'), + $router: join(__dirname, 'src/lib/router'), + $wails: join(__dirname, 'wails'), + } + }, }) diff --git a/frontend/wailsjs/go/main/App.d.ts b/frontend/wailsjs/go/main/App.d.ts index 02a3bb9..d7c0783 100644 --- a/frontend/wailsjs/go/main/App.d.ts +++ b/frontend/wailsjs/go/main/App.d.ts @@ -1,4 +1,6 @@ // Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL // This file is automatically generated. DO NOT EDIT +export function Foo():Promise; + export function Greet(arg1:string):Promise; diff --git a/frontend/wailsjs/go/main/App.js b/frontend/wailsjs/go/main/App.js index c71ae77..5662d74 100644 --- a/frontend/wailsjs/go/main/App.js +++ b/frontend/wailsjs/go/main/App.js @@ -2,6 +2,10 @@ // Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL // This file is automatically generated. DO NOT EDIT +export function Foo() { + return window['go']['main']['App']['Foo'](); +} + export function Greet(arg1) { return window['go']['main']['App']['Greet'](arg1); }