diff --git a/installer-gui/.prettierignore b/installer-gui/.prettierignore new file mode 100644 index 0000000..d8b83df --- /dev/null +++ b/installer-gui/.prettierignore @@ -0,0 +1 @@ +package-lock.json diff --git a/installer-gui/.prettierrc b/installer-gui/.prettierrc new file mode 100644 index 0000000..fd3282e --- /dev/null +++ b/installer-gui/.prettierrc @@ -0,0 +1,15 @@ +{ + "singleQuote": true, + "tabWidth": 4, + "trailingComma": "es5", + "printWidth": 100, + "plugins": ["prettier-plugin-svelte"], + "overrides": [ + { + "files": "*.svelte", + "options": { + "parser": "svelte" + } + } + ] +} diff --git a/installer-gui/package-lock.json b/installer-gui/package-lock.json index 08ed14f..abd9cc0 100644 --- a/installer-gui/package-lock.json +++ b/installer-gui/package-lock.json @@ -18,6 +18,8 @@ "@sveltejs/kit": "^2.9.0", "@sveltejs/vite-plugin-svelte": "^5.0.0", "@tauri-apps/cli": "^2", + "prettier": "^3.6.2", + "prettier-plugin-svelte": "^3.4.0", "svelte": "^5.0.0", "svelte-check": "^4.0.0", "typescript": "~5.6.2", @@ -1524,6 +1526,33 @@ "node": "^10 || ^12 || >=14" } }, + "node_modules/prettier": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.6.2.tgz", + "integrity": "sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==", + "dev": true, + "license": "MIT", + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/prettier-plugin-svelte": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/prettier-plugin-svelte/-/prettier-plugin-svelte-3.4.0.tgz", + "integrity": "sha512-pn1ra/0mPObzqoIQn/vUTR3ZZI6UuZ0sHqMK5x2jMLGrs53h0sXhkVuDcrlssHwIMk7FYrMjHBPoUSyyEEDlBQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "prettier": "^3.0.0", + "svelte": "^3.2.0 || ^4.0.0-next.0 || ^5.0.0-next.0" + } + }, "node_modules/readdirp": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", diff --git a/installer-gui/package.json b/installer-gui/package.json index d82a188..6ae22be 100644 --- a/installer-gui/package.json +++ b/installer-gui/package.json @@ -1,30 +1,34 @@ { - "name": "installer-gui", - "version": "0.1.0", - "description": "", - "type": "module", - "scripts": { - "dev": "vite dev", - "build": "vite build", - "preview": "vite preview", - "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", - "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", - "tauri": "tauri" - }, - "license": "MIT", - "dependencies": { - "@tauri-apps/api": "^2", - "@tauri-apps/plugin-opener": "^2", - "@tauri-apps/plugin-shell": "^2.3.3" - }, - "devDependencies": { - "@sveltejs/adapter-static": "^3.0.6", - "@sveltejs/kit": "^2.9.0", - "@sveltejs/vite-plugin-svelte": "^5.0.0", - "@tauri-apps/cli": "^2", - "svelte": "^5.0.0", - "svelte-check": "^4.0.0", - "typescript": "~5.6.2", - "vite": "^6.0.3" - } + "name": "installer-gui", + "version": "0.1.0", + "description": "", + "type": "module", + "scripts": { + "dev": "vite dev", + "build": "vite build", + "preview": "vite preview", + "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", + "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", + "format": "prettier --write .", + "lint": "prettier --check .", + "tauri": "tauri" + }, + "license": "MIT", + "dependencies": { + "@tauri-apps/api": "^2", + "@tauri-apps/plugin-opener": "^2", + "@tauri-apps/plugin-shell": "^2.3.3" + }, + "devDependencies": { + "@sveltejs/adapter-static": "^3.0.6", + "@sveltejs/kit": "^2.9.0", + "@sveltejs/vite-plugin-svelte": "^5.0.0", + "@tauri-apps/cli": "^2", + "prettier": "^3.6.2", + "prettier-plugin-svelte": "^3.4.0", + "svelte": "^5.0.0", + "svelte-check": "^4.0.0", + "typescript": "~5.6.2", + "vite": "^6.0.3" + } } diff --git a/installer-gui/src-tauri/capabilities/default.json b/installer-gui/src-tauri/capabilities/default.json index 3a20c12..4ab54b9 100644 --- a/installer-gui/src-tauri/capabilities/default.json +++ b/installer-gui/src-tauri/capabilities/default.json @@ -1,13 +1,7 @@ { - "$schema": "../gen/schemas/desktop-schema.json", - "identifier": "default", - "description": "Capability for the main window", - "windows": [ - "main" - ], - "permissions": [ - "core:default", - "opener:default", - "shell:default" - ] + "$schema": "../gen/schemas/desktop-schema.json", + "identifier": "default", + "description": "Capability for the main window", + "windows": ["main"], + "permissions": ["core:default", "opener:default", "shell:default"] } diff --git a/installer-gui/src-tauri/tauri.conf.json b/installer-gui/src-tauri/tauri.conf.json index 9417199..81152eb 100644 --- a/installer-gui/src-tauri/tauri.conf.json +++ b/installer-gui/src-tauri/tauri.conf.json @@ -1,35 +1,35 @@ { - "$schema": "https://schema.tauri.app/config/2", - "productName": "Rayhunter Installer", - "identifier": "com.rayhunter-installer.app", - "build": { - "beforeDevCommand": "npm run dev", - "devUrl": "http://localhost:1420", - "beforeBuildCommand": "npm run build", - "frontendDist": "../build" - }, - "app": { - "windows": [ - { - "title": "Rayhunter Installer", - "width": 800, - "height": 600 - } - ], - "security": { - "csp": null + "$schema": "https://schema.tauri.app/config/2", + "productName": "Rayhunter Installer", + "identifier": "com.rayhunter-installer.app", + "build": { + "beforeDevCommand": "npm run dev", + "devUrl": "http://localhost:1420", + "beforeBuildCommand": "npm run build", + "frontendDist": "../build" + }, + "app": { + "windows": [ + { + "title": "Rayhunter Installer", + "width": 800, + "height": 600 + } + ], + "security": { + "csp": null + } + }, + "bundle": { + "active": true, + "targets": ["app", "appimage", "deb", "msi", "nsis", "rpm"], + "externalBin": ["binaries/installer-cli"], + "icon": [ + "icons/32x32.png", + "icons/128x128.png", + "icons/128x128@2x.png", + "icons/icon.icns", + "icons/icon.ico" + ] } - }, - "bundle": { - "active": true, - "targets": ["app", "appimage", "deb", "msi", "nsis", "rpm"], - "externalBin": ["binaries/installer-cli"], - "icon": [ - "icons/32x32.png", - "icons/128x128.png", - "icons/128x128@2x.png", - "icons/icon.icns", - "icons/icon.ico" - ] - } } diff --git a/installer-gui/src/app.html b/installer-gui/src/app.html index 92e7e33..fefb5a5 100644 --- a/installer-gui/src/app.html +++ b/installer-gui/src/app.html @@ -1,13 +1,13 @@ - - - - - Tauri + SvelteKit + Typescript App - %sveltekit.head% - - -
%sveltekit.body%
- + + + + + Tauri + SvelteKit + Typescript App + %sveltekit.head% + + +
%sveltekit.body%
+ diff --git a/installer-gui/src/routes/+page.svelte b/installer-gui/src/routes/+page.svelte index eb3daec..2747519 100644 --- a/installer-gui/src/routes/+page.svelte +++ b/installer-gui/src/routes/+page.svelte @@ -1,156 +1,155 @@
-

Welcome to Tauri + Svelte

+

Welcome to Tauri + Svelte

-
- - - - - - - - - -
-

Click on the Tauri, Vite, and SvelteKit logos to learn more.

+
+ + + + + + + + + +
+

Click on the Tauri, Vite, and SvelteKit logos to learn more.

-
- - -
-

{greetMsg}

+
+ + +
+

{greetMsg}

diff --git a/installer-gui/svelte.config.js b/installer-gui/svelte.config.js index 2d45f91..1bb7004 100644 --- a/installer-gui/svelte.config.js +++ b/installer-gui/svelte.config.js @@ -1,15 +1,15 @@ // Tauri doesn't have a Node.js server to do proper SSR // so we will use adapter-static to prerender the app (SSG) // See: https://v2.tauri.app/start/frontend/sveltekit/ for more info -import adapter from "@sveltejs/adapter-static"; -import { vitePreprocess } from "@sveltejs/vite-plugin-svelte"; +import adapter from '@sveltejs/adapter-static'; +import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'; /** @type {import('@sveltejs/kit').Config} */ const config = { - preprocess: vitePreprocess(), - kit: { - adapter: adapter(), - }, + preprocess: vitePreprocess(), + kit: { + adapter: adapter(), + }, }; export default config; diff --git a/installer-gui/tsconfig.json b/installer-gui/tsconfig.json index 593dc19..471ad31 100644 --- a/installer-gui/tsconfig.json +++ b/installer-gui/tsconfig.json @@ -1,19 +1,19 @@ { - "extends": "./.svelte-kit/tsconfig.json", - "compilerOptions": { - "allowJs": true, - "checkJs": true, - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "resolveJsonModule": true, - "skipLibCheck": true, - "sourceMap": true, - "strict": true, - "moduleResolution": "bundler" - } - // Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias - // except $lib which is handled by https://kit.svelte.dev/docs/configuration#files - // - // If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes - // from the referenced tsconfig.json - TypeScript does not merge them in + "extends": "./.svelte-kit/tsconfig.json", + "compilerOptions": { + "allowJs": true, + "checkJs": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true, + "skipLibCheck": true, + "sourceMap": true, + "strict": true, + "moduleResolution": "bundler" + } + // Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias + // except $lib which is handled by https://kit.svelte.dev/docs/configuration#files + // + // If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes + // from the referenced tsconfig.json - TypeScript does not merge them in } diff --git a/installer-gui/vite.config.js b/installer-gui/vite.config.js index 6dee1ec..074b20e 100644 --- a/installer-gui/vite.config.js +++ b/installer-gui/vite.config.js @@ -1,32 +1,32 @@ -import { defineConfig } from "vite"; -import { sveltekit } from "@sveltejs/kit/vite"; +import { defineConfig } from 'vite'; +import { sveltekit } from '@sveltejs/kit/vite'; // @ts-expect-error process is a nodejs global const host = process.env.TAURI_DEV_HOST; // https://vitejs.dev/config/ export default defineConfig(async () => ({ - plugins: [sveltekit()], + plugins: [sveltekit()], - // Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build` - // - // 1. prevent vite from obscuring rust errors - clearScreen: false, - // 2. tauri expects a fixed port, fail if that port is not available - server: { - port: 1420, - strictPort: true, - host: host || false, - hmr: host - ? { - protocol: "ws", - host, - port: 1421, - } - : undefined, - watch: { - // 3. tell vite to ignore watching `src-tauri` - ignored: ["**/src-tauri/**"], + // Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build` + // + // 1. prevent vite from obscuring rust errors + clearScreen: false, + // 2. tauri expects a fixed port, fail if that port is not available + server: { + port: 1420, + strictPort: true, + host: host || false, + hmr: host + ? { + protocol: 'ws', + host, + port: 1421, + } + : undefined, + watch: { + // 3. tell vite to ignore watching `src-tauri` + ignored: ['**/src-tauri/**'], + }, }, - }, }));