diff --git a/README.md b/README.md index d636e69..a5d6fb3 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ # MEMENTO SvelteKit Electron TypeScript Template to create a desktop app with SvelteKit, Electron and TypeScript (with electron-updater, electron-reload and electron-builder) -**This project is still under development: the `todos` section doesn't work!** - ## Get Started This is a project template for [Svelte](https://svelte.dev) and [Electron](https://www.electronjs.org/) apps. It lives at https://github.com/el3um4s/memento-sveltekit-electron-typescript. diff --git a/electron/configureDev.ts b/electron/configureDev.ts index 348f9d1..f1eba83 100644 --- a/electron/configureDev.ts +++ b/electron/configureDev.ts @@ -43,7 +43,6 @@ class ConfigureDev { _build_Dist() { exec("npm run svelte:build"); } _watch_Dist() { require("electron-reload")(path.join(__dirname, "www")); } _serve_Dist() { - // this.loadURL = serve({ directory: pathOnDisk, scheme: "html" }); this.loadURL = serve({ directory: "dist/www" }); } diff --git a/electron/mainWindow.ts b/electron/mainWindow.ts index d4bb10f..aca765a 100644 --- a/electron/mainWindow.ts +++ b/electron/mainWindow.ts @@ -34,7 +34,7 @@ class Main { app.on('ready', () => { - let loading = new BrowserWindow({show: false, frame: false}) + let loading = new BrowserWindow({show: false, frame: false, width: 300, height:300, transparent:true}) loading.once('show', async () => { this.window = await this.createWindow(); diff --git a/package-lock.json b/package-lock.json index 89a3799..123293b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { "name": "memento-sveltekit-electron-typescript", - "version": "0.0.1", + "version": "0.0.3", "lockfileVersion": 2, "requires": true, "packages": { "": { - "version": "0.0.1", + "version": "0.0.3", "license": "MIT", "dependencies": { "electron-reload": "^1.5.0", diff --git a/package.json b/package.json index cbcb1c2..82dc239 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "Memento: how to use Svelte with Electron and TypeScript", "author": "Samuele de Tomasi ", "license": "MIT", - "version": "0.0.3", + "version": "0.0.4", "main": "dist/index.js", "scripts": { "nodemon": "nodemon", diff --git a/svelte/src/lib/form.ts b/svelte/src/lib/form.ts deleted file mode 100644 index a99f449..0000000 --- a/svelte/src/lib/form.ts +++ /dev/null @@ -1,69 +0,0 @@ -// this action (https://svelte.dev/tutorial/actions) allows us to -// progressively enhance a
that already works without JS -export function enhance( - form: HTMLFormElement, - { - pending, - error, - result - }: { - pending?: (data: FormData, form: HTMLFormElement) => void; - error?: (res: Response, error: Error, form: HTMLFormElement) => void; - result: (res: Response, form: HTMLFormElement) => void; - } -) { - - async function handle_submit(e: Event) { - e.preventDefault(); - console.log("HANDLE_SUBMIT"); - console.log(e); - const formData = new FormData(form); - console.log(formData); - console.log(form); - const body = new FormData(form); - if (pending) pending(body, form); - console.log(body); - console.log(form.action); - // const token = (current_token = {}); - - // e.preventDefault(); - - // const body = new FormData(form); - - // if (pending) pending(body, form); - - // try { - // const res = await fetch(form.action, { - // method: form.method, - // headers: { - // accept: 'application/json' - // }, - // body - // }); - - // if (token !== current_token) return; - - // if (res.ok) { - // result(res, form); - // } else if (error) { - // error(res, null, form); - // } else { - // console.error(await res.text()); - // } - // } catch (e) { - // if (error) { - // error(null, e, form); - // } else { - // throw e; - // } - // } - } - - form.addEventListener('submit', handle_submit); - - return { - destroy() { - form.removeEventListener('submit', handle_submit); - } - }; -} diff --git a/svelte/src/routes/todos/index.svelte b/svelte/src/routes/todos/index.svelte index f7e47b2..9dde57b 100644 --- a/svelte/src/routes/todos/index.svelte +++ b/svelte/src/routes/todos/index.svelte @@ -1,26 +1,5 @@ -