From e7ee512952c4bc0297581a85c28ff03aaa1d971c Mon Sep 17 00:00:00 2001 From: Benedikt Schnatterbeck <48836135+benediktms@users.noreply.github.com> Date: Thu, 12 Jan 2023 14:36:44 +0000 Subject: [PATCH] style: add prettier (#34) * style: add prettier style: add prettier ignore file style: apply formatting style: install and apply svelte prettier * Add prettier to recommended extensions * chore: add check and format scripts to package.json * chore: update prettier scripts to avoid conflict with svelte-check --- .github/FUNDING.yml | 6 +- .prettierignore | 3 + .prettierrc | 6 + .vscode/extensions.json | 3 +- CODE_OF_CONDUCT.md | 22 +- README.md | 2 +- docs/themes.md | 3 +- docs/themes/theme-blue/theme.json | 18 +- docs/themes/theme-default/theme.json | 18 +- docs/themes/theme-green/theme.json | 18 +- package.json | 6 +- src/main.ts | 69 +++--- src/routes/App/App.svelte | 42 ++-- src/routes/App/lib/CalculationResult.svelte | 100 ++++---- src/routes/App/lib/Footer.svelte | 22 +- src/routes/App/lib/SearchBar.svelte | 82 +++---- src/routes/App/lib/SearchResult.svelte | 57 ++--- src/routes/Settings/Settings.svelte | 108 ++++----- src/routes/Settings/lib/CheckBox.svelte | 109 ++++----- src/routes/Settings/lib/MenuButton.svelte | 62 ++--- .../lib/controls/MenuBarIconControl.svelte | 80 +++---- .../lib/controls/ShortcutControl.svelte | 226 +++++++++--------- .../lib/controls/StartAtLoginControl.svelte | 73 +++--- src/style.css | 8 +- svelte.config.js | 2 +- vite.config.ts | 10 +- yarn.lock | 10 + 27 files changed, 591 insertions(+), 574 deletions(-) create mode 100644 .prettierignore create mode 100644 .prettierrc diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 8b02cc0..da8dd74 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -2,4 +2,8 @@ github: [parthjadhav] ko_fi: parthjadhav -custom: ["https://paypal.me/parthJadhav22", "https://www.buymeacoffee.com/Parthjadhav"] +custom: + [ + 'https://paypal.me/parthJadhav22', + 'https://www.buymeacoffee.com/Parthjadhav', + ] diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..48dbe6a --- /dev/null +++ b/.prettierignore @@ -0,0 +1,3 @@ +node_modules +src-tauri +dist diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..4984e01 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,6 @@ +{ + "tabWidth": 2, + "semi": true, + "singleQuote": true, + "arrowParens": "avoid" +} diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 61343e9..18073bb 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -2,6 +2,7 @@ "recommendations": [ "svelte.svelte-vscode", "tauri-apps.tauri-vscode", - "rust-lang.rust-analyzer" + "rust-lang.rust-analyzer", + "esbenp.prettier-vscode" ] } diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index c622909..37bab1b 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -17,23 +17,23 @@ diverse, inclusive, and healthy community. Examples of behavior that contributes to a positive environment for our community include: -* Demonstrating empathy and kindness toward other people -* Being respectful of differing opinions, viewpoints, and experiences -* Giving and gracefully accepting constructive feedback -* Accepting responsibility and apologizing to those affected by our mistakes, +- Demonstrating empathy and kindness toward other people +- Being respectful of differing opinions, viewpoints, and experiences +- Giving and gracefully accepting constructive feedback +- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience -* Focusing on what is best not just for us as individuals, but for the +- Focusing on what is best not just for us as individuals, but for the overall community Examples of unacceptable behavior include: -* The use of sexualized language or imagery, and sexual attention or +- The use of sexualized language or imagery, and sexual attention or advances of any kind -* Trolling, insulting or derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or email +- Trolling, insulting or derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or email address, without their explicit permission -* Other conduct which could reasonably be considered inappropriate in a +- Other conduct which could reasonably be considered inappropriate in a professional setting ## Enforcement Responsibilities @@ -106,7 +106,7 @@ Violating these terms may lead to a permanent ban. ### 4. Permanent Ban **Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an +standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. **Consequence**: A permanent ban from any sort of public interaction within diff --git a/README.md b/README.md index c3d5328..267a6a7 100644 --- a/README.md +++ b/README.md @@ -16,8 +16,8 @@ Verve is a lightweight and blazingly fast launcher for accessing and opening app drawing ## 🚀 Features -drawing +drawing ## 📥 Downloading diff --git a/docs/themes.md b/docs/themes.md index 5381ba3..d99e46c 100644 --- a/docs/themes.md +++ b/docs/themes.md @@ -15,7 +15,6 @@ Download: [theme-blue.json](./themes/theme-blue/theme.json) ![Verve Dracula Theme](./themes/theme-green/theme-green.png) - Download: [theme-green.json](./themes/theme-green/theme.json) ### Create your own theme @@ -26,4 +25,4 @@ You can create your own theme by editing the theme.json file. You can find the t Save the file & Restart the app. -Create a Pull request to add your theme to the list. \ No newline at end of file +Create a Pull request to add your theme to the list. diff --git a/docs/themes/theme-blue/theme.json b/docs/themes/theme-blue/theme.json index d5ce8d4..0954235 100644 --- a/docs/themes/theme-blue/theme.json +++ b/docs/themes/theme-blue/theme.json @@ -1,10 +1,10 @@ { - "primary_bg_color": "rgba(20, 20, 80, 0.6)", - "secondary_bg_color": "rgba(84, 101, 115, 0.6)", - "primary_text_color": "#FFFFFF", - "secondary_text_color": "#878787", - "primary_accent_color": "#556CE5", - "secondary_accent_color": "#48A5FF", - "highlight_overlay": "rgba(255, 255, 255, 0.1)", - "dark_overlay": "rgba(0, 0, 0, 0.1)" -} \ No newline at end of file + "primary_bg_color": "rgba(20, 20, 80, 0.6)", + "secondary_bg_color": "rgba(84, 101, 115, 0.6)", + "primary_text_color": "#FFFFFF", + "secondary_text_color": "#878787", + "primary_accent_color": "#556CE5", + "secondary_accent_color": "#48A5FF", + "highlight_overlay": "rgba(255, 255, 255, 0.1)", + "dark_overlay": "rgba(0, 0, 0, 0.1)" +} diff --git a/docs/themes/theme-default/theme.json b/docs/themes/theme-default/theme.json index 2c86d67..b3f0110 100644 --- a/docs/themes/theme-default/theme.json +++ b/docs/themes/theme-default/theme.json @@ -1,10 +1,10 @@ { - "primary_bg_color": "rgba(20, 20, 30, 0.6)", - "secondary_bg_color": "rgba(84, 101, 115, 0.6)", - "primary_text_color": "#FFFFFF", - "secondary_text_color": "#878787", - "primary_accent_color": "#556CE5", - "secondary_accent_color": "#48A5FF", - "highlight_overlay": "rgba(255, 255, 255, 0.1)", - "dark_overlay": "rgba(0, 0, 0, 0.1)" -} \ No newline at end of file + "primary_bg_color": "rgba(20, 20, 30, 0.6)", + "secondary_bg_color": "rgba(84, 101, 115, 0.6)", + "primary_text_color": "#FFFFFF", + "secondary_text_color": "#878787", + "primary_accent_color": "#556CE5", + "secondary_accent_color": "#48A5FF", + "highlight_overlay": "rgba(255, 255, 255, 0.1)", + "dark_overlay": "rgba(0, 0, 0, 0.1)" +} diff --git a/docs/themes/theme-green/theme.json b/docs/themes/theme-green/theme.json index f5cd52f..27107ff 100644 --- a/docs/themes/theme-green/theme.json +++ b/docs/themes/theme-green/theme.json @@ -1,10 +1,10 @@ { - "primary_bg_color": "rgba(20, 45, 30, 0.6)", - "secondary_bg_color": "rgba(84, 101, 115, 0.6)", - "primary_text_color": "#FFFFFF", - "secondary_text_color": "#878787", - "primary_accent_color": "#556CE5", - "secondary_accent_color": "#48A5FF", - "highlight_overlay": "rgba(255, 255, 255, 0.1)", - "dark_overlay": "rgba(0, 0, 0, 0.1)" -} \ No newline at end of file + "primary_bg_color": "rgba(20, 45, 30, 0.6)", + "secondary_bg_color": "rgba(84, 101, 115, 0.6)", + "primary_text_color": "#FFFFFF", + "secondary_text_color": "#878787", + "primary_accent_color": "#556CE5", + "secondary_accent_color": "#48A5FF", + "highlight_overlay": "rgba(255, 255, 255, 0.1)", + "dark_overlay": "rgba(0, 0, 0, 0.1)" +} diff --git a/package.json b/package.json index d9f03a7..f76047e 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,9 @@ "tauri": "tauri", "package-and-build-arm": "yarn tauri build --target aarch64-apple-darwin && rm -rf ./src-tauri/target/verve_aarch64.dmg && create-dmg --volname Verve --volicon './src-tauri/icons/icon.icns' --background './src/dmg-background.png' --window-pos 200 120 --window-size 653 380 --icon-size 115 --icon 'verve.app' 180 189 --hide-extension 'Verve.app' --app-drop-link 460 185 ./src-tauri/target/aarch64-apple-darwin/release/bundle/verve_aarch64.dmg ./src-tauri/target/aarch64-apple-darwin/release/bundle/macos/verve.app && mv ./src-tauri/target/aarch64-apple-darwin/release/bundle/verve_aarch64.dmg ./src-tauri/target/", "package-and-build-x86_64": "yarn tauri build --target x86_64-apple-darwin && rm -rf ./src-tauri/target/verve_x86_64.dmg && create-dmg --volname Verve --volicon './src-tauri/icons/icon.icns' --background './src/dmg-background.png' --window-pos 200 120 --window-size 653 380 --icon-size 115 --icon 'verve.app' 180 189 --hide-extension 'Verve.app' --app-drop-link 460 185 ./src-tauri/target/x86_64-apple-darwin/release/bundle/verve_x86_64.dmg ./src-tauri/target/x86_64-apple-darwin/release/bundle/macos/verve.app && mv ./src-tauri/target/x86_64-apple-darwin/release/bundle/verve_x86_64.dmg ./src-tauri/target/", - "package-and-build": "yarn package-and-build-arm && yarn package-and-build-x86_64 && open ./src-tauri/target/" + "package-and-build": "yarn package-and-build-arm && yarn package-and-build-x86_64 && open ./src-tauri/target/", + "format:check": "prettier --check .", + "format:write": "prettier --write ." }, "dependencies": { "@tauri-apps/api": "^1.1.0", @@ -22,6 +24,8 @@ "@tauri-apps/cli": "^1.1.0", "@tsconfig/svelte": "^3.0.0", "@types/node": "^18.7.10", + "prettier": "^2.8.2", + "prettier-plugin-svelte": "^2.9.0", "svelte": "^3.49.0", "svelte-check": "^2.8.0", "svelte-preprocess": "^4.10.7", diff --git a/src/main.ts b/src/main.ts index 0efd960..f412a33 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,79 +1,82 @@ -import "./style.css"; +import './style.css'; // @ts-ignore -import App from "./routes/App/App.svelte"; -import { appWindow } from "@tauri-apps/api/window"; -import { register } from '@tauri-apps/api/globalShortcut' -import { appDataDir, join, resolveResource } from "@tauri-apps/api/path"; -import { readTextFile } from "@tauri-apps/api/fs"; -import { invoke } from "@tauri-apps/api/tauri"; -import { preferences, paths } from "./cache"; -import { listen } from '@tauri-apps/api/event' +import App from './routes/App/App.svelte'; +import { appWindow } from '@tauri-apps/api/window'; +import { register } from '@tauri-apps/api/globalShortcut'; +import { appDataDir, join, resolveResource } from '@tauri-apps/api/path'; +import { readTextFile } from '@tauri-apps/api/fs'; +import { invoke } from '@tauri-apps/api/tauri'; +import { preferences, paths } from './cache'; +import { listen } from '@tauri-apps/api/event'; // Create the app const app = new App({ - target: document.getElementById("app"), + target: document.getElementById('app'), }); const fetchPreferencesData = async () => { - const preferencesData = await readTextFile(await join(paths.get("appDataDirPath"), `preferences.json`)).then((data) => JSON.parse(data)); - Object.keys(preferencesData).forEach((key) => { + const preferencesData = await readTextFile( + await join(paths.get('appDataDirPath'), `preferences.json`) + ).then(data => JSON.parse(data)); + Object.keys(preferencesData).forEach(key => { preferences.set(key, preferencesData[key]); }); -} +}; const reloadTheme = async () => { - const theme = await readTextFile(await join(paths.get("appDataDirPath"), `theme.json`)).then((data) => JSON.parse(data)); + const theme = await readTextFile( + await join(paths.get('appDataDirPath'), `theme.json`) + ).then(data => JSON.parse(data)); // @ts-ignore const style = document.styleSheets[0].cssRules[0].style; - style.setProperty("--primary-bg-color", theme.primary_bg_color); - style.setProperty("--secondary-bg-color", theme.secondary_bg_color); - style.setProperty("--primary-text-color", theme.primary_text_color); - style.setProperty("--secondary-text-color", theme.secondary_text_color); - style.setProperty("--primary-accent-color", theme.primary_accent_color); - style.setProperty("--secondary-accent-color", theme.secondary_accent_color); -} + style.setProperty('--primary-bg-color', theme.primary_bg_color); + style.setProperty('--secondary-bg-color', theme.secondary_bg_color); + style.setProperty('--primary-text-color', theme.primary_text_color); + style.setProperty('--secondary-text-color', theme.secondary_text_color); + style.setProperty('--primary-accent-color', theme.primary_accent_color); + style.setProperty('--secondary-accent-color', theme.secondary_accent_color); +}; (async () => { // get and set values - paths.set("appDataDirPath", await appDataDir()); + paths.set('appDataDirPath', await appDataDir()); await fetchPreferencesData(); await reloadTheme(); - document.addEventListener("keydown", (event) => { - if (event.key === "Escape") { + document.addEventListener('keydown', event => { + if (event.key === 'Escape') { appWindow.hide(); } }); // Listen for Menu Bar event to open preferences emitted from main.rs - await listen("PreferencesClicked", (data) => { + await listen('PreferencesClicked', data => { app.$set({ appState: { app: false, - settings: true - } + settings: true, + }, }); }); - - await invoke("launch_on_login", { - enable: preferences.get("launch_on_login"), + await invoke('launch_on_login', { + enable: preferences.get('launch_on_login'), }); - await listenForHotkey(preferences.get("shortcut")); + await listenForHotkey(preferences.get('shortcut')); })(); export async function listenForHotkey(shortcut: string) { await register(shortcut, async () => { if (document.hasFocus()) { - await appWindow.hide() + await appWindow.hide(); } else { await appWindow.show(); await appWindow.center(); await appWindow.setFocus(); document.getElementById('searchBarInput').focus(); } - }) + }); } export default app; diff --git a/src/routes/App/App.svelte b/src/routes/App/App.svelte index 27a0b6d..c47078b 100644 --- a/src/routes/App/App.svelte +++ b/src/routes/App/App.svelte @@ -1,10 +1,10 @@
- +
diff --git a/src/routes/App/lib/Footer.svelte b/src/routes/App/lib/Footer.svelte index 3b447f6..e862f91 100644 --- a/src/routes/App/lib/Footer.svelte +++ b/src/routes/App/lib/Footer.svelte @@ -1,17 +1,17 @@

{footerText}

\ No newline at end of file + .footerText { + text-align: center; + font-size: 12px; + font-weight: 500; + color: var(--secondary-text-color); + font-family: Helvetica; + font-style: normal; + margin-top: 8px; + } + diff --git a/src/routes/App/lib/SearchBar.svelte b/src/routes/App/lib/SearchBar.svelte index f4595e8..5a96971 100644 --- a/src/routes/App/lib/SearchBar.svelte +++ b/src/routes/App/lib/SearchBar.svelte @@ -1,50 +1,50 @@
-
- -
+
+ +
diff --git a/src/routes/App/lib/SearchResult.svelte b/src/routes/App/lib/SearchResult.svelte index 365ee8c..96003b8 100644 --- a/src/routes/App/lib/SearchResult.svelte +++ b/src/routes/App/lib/SearchResult.svelte @@ -2,17 +2,17 @@ export let results: string[]; export let resultType: number; - import { appDataDir, join, resolveResource } from "@tauri-apps/api/path"; - import { convertFileSrc } from "@tauri-apps/api/tauri"; - import { appWindow, LogicalSize } from "@tauri-apps/api/window"; - import { afterUpdate } from "svelte"; - import { FALLBACK_ICON_SYMBOL, icons } from "../../../cache"; - import CalculationResult from "./CalculationResult.svelte"; + import { appDataDir, join, resolveResource } from '@tauri-apps/api/path'; + import { convertFileSrc } from '@tauri-apps/api/tauri'; + import { appWindow, LogicalSize } from '@tauri-apps/api/window'; + import { afterUpdate } from 'svelte'; + import { FALLBACK_ICON_SYMBOL, icons } from '../../../cache'; + import CalculationResult from './CalculationResult.svelte'; afterUpdate(async () => { - const height = document.getElementsByClassName("container")[0].clientHeight; + const height = document.getElementsByClassName('container')[0].clientHeight; await appWindow.setSize(new LogicalSize(750, height)); - if (results.length > 0 && results[0] !== "") { + if (results.length > 0 && results[0] !== '') { const firstResult = document.getElementById(results[0]); firstResult.classList.add('searchResultFocused'); await firstResult.focus(); @@ -29,7 +29,7 @@ if (!fallbackIcon) { fallbackIcon = convertFileSrc( - await resolveResource("assets/default.svg") + await resolveResource('assets/default.svg') ); icons.set(FALLBACK_ICON_SYMBOL, fallbackIcon); } @@ -37,17 +37,15 @@ let iconPath: string; if ( [ - "Migration Assistant", - "System Information", - "Calendar", - "System Settings", - "Photo Booth", - "AirPort Utility", + 'Migration Assistant', + 'System Information', + 'Calendar', + 'System Settings', + 'Photo Booth', + 'AirPort Utility', ].includes(app_name) ) { - iconPath = await resolveResource( - `assets/appIcons/${app_name}.app.png` - ); + iconPath = await resolveResource(`assets/appIcons/${app_name}.app.png`); } else { const appDataDirPath = await appDataDir(); iconPath = await join(appDataDirPath, `appIcons/${app_name}.app.png`); @@ -61,7 +59,7 @@ async function handleKeydown(event) { if (event.keyCode == 38 || event.keyCode == 40) { const current = document.activeElement as HTMLElement | null; - const items = [...document.getElementsByClassName("searchResult")] as + const items = [...document.getElementsByClassName('searchResult')] as | HTMLElement[] | null; const currentIndex = items.indexOf(current); @@ -80,14 +78,14 @@ current.blur(); items[newIndex].focus(); } - } else if (event.key == "Enter") { + } else if (event.key == 'Enter') { const current = document.activeElement as HTMLElement | null; if (current !== null) { current.click(); } } else { const searchBarInput = document.getElementById( - "searchBarInput" + 'searchBarInput' ) as HTMLInputElement | null; searchBarInput.focus(); } @@ -97,31 +95,28 @@
- {#if results.length > 0 && results[0] !== " "} + {#if results.length > 0 && results[0] !== ' '} {#if resultType !== 3} {#each results.slice(0, 5) as result} {/each} {:else} - + {/if} {/if}
diff --git a/src/routes/Settings/Settings.svelte b/src/routes/Settings/Settings.svelte index 3eeb2b3..6843afe 100644 --- a/src/routes/Settings/Settings.svelte +++ b/src/routes/Settings/Settings.svelte @@ -1,68 +1,66 @@
- -
-
- - - + +
+
+ + + +
diff --git a/src/routes/Settings/lib/CheckBox.svelte b/src/routes/Settings/lib/CheckBox.svelte index be44211..4d29260 100644 --- a/src/routes/Settings/lib/CheckBox.svelte +++ b/src/routes/Settings/lib/CheckBox.svelte @@ -1,72 +1,67 @@ diff --git a/src/routes/Settings/lib/MenuButton.svelte b/src/routes/Settings/lib/MenuButton.svelte index 0b4480c..2e6828c 100644 --- a/src/routes/Settings/lib/MenuButton.svelte +++ b/src/routes/Settings/lib/MenuButton.svelte @@ -1,41 +1,41 @@ -
- {#await getIconPath(icon) then iconPath} - general - {/await} -

{text}

+
+ {#await getIconPath(icon) then iconPath} + general + {/await} +

{text}

diff --git a/src/routes/Settings/lib/controls/MenuBarIconControl.svelte b/src/routes/Settings/lib/controls/MenuBarIconControl.svelte index 8790c24..a0edb9a 100644 --- a/src/routes/Settings/lib/controls/MenuBarIconControl.svelte +++ b/src/routes/Settings/lib/controls/MenuBarIconControl.svelte @@ -1,49 +1,49 @@
-

Show in menu bar:

- +

Show in menu bar:

+
\ No newline at end of file + .shortcut-control { + width: 30%; + display: flex; + flex-direction: row; + align-items: center; + justify-content: space-between; + } + p { + font-size: 16px; + color: var(--primary-text-color); + margin: 0; + } + diff --git a/src/routes/Settings/lib/controls/ShortcutControl.svelte b/src/routes/Settings/lib/controls/ShortcutControl.svelte index 4bdfa56..6e97e30 100644 --- a/src/routes/Settings/lib/controls/ShortcutControl.svelte +++ b/src/routes/Settings/lib/controls/ShortcutControl.svelte @@ -1,132 +1,128 @@
-

Hotkey:

- Hotkey:

+ 0 - ? shortcutArray - .map((key) => key) - .join(" + ") - .replace("Meta", "⌘") - .replace("Command", "⌘") - .replace("Control", "⌃") - .replace("Alt", "⌥") - .replace("Shift", "⇧") - : "Recording..."} + ? shortcutArray + .map(key => key) + .join(' + ') + .replace('Meta', '⌘') + .replace('Command', '⌘') + .replace('Control', '⌃') + .replace('Alt', '⌥') + .replace('Shift', '⇧') + : 'Recording...'} on:click={recordShortcut} -/> + />
diff --git a/src/routes/Settings/lib/controls/StartAtLoginControl.svelte b/src/routes/Settings/lib/controls/StartAtLoginControl.svelte index ac1c052..43c0f94 100644 --- a/src/routes/Settings/lib/controls/StartAtLoginControl.svelte +++ b/src/routes/Settings/lib/controls/StartAtLoginControl.svelte @@ -1,49 +1,48 @@
-

Start at login:

- Start at login:

+ + />
- diff --git a/src/style.css b/src/style.css index 9a76ae2..ac6981a 100644 --- a/src/style.css +++ b/src/style.css @@ -4,10 +4,10 @@ --highlight-overlay: rgba(255, 255, 255, 0.1); --dark-overlay: rgba(0, 0, 0, 0.1); --secondary-bg-color: rgba(84, 101, 115, 0.6); - --primary-text-color: #FFFFFF; + --primary-text-color: #ffffff; --secondary-text-color: #878787; - --primary-accent-color: #556CE5; - --secondary-accent-color: #48A5FF; + --primary-accent-color: #556ce5; + --secondary-accent-color: #48a5ff; font-synthesis: none; overflow: hidden; text-rendering: optimizeLegibility; @@ -27,4 +27,4 @@ body { width: 750px; border: 1px solid var(--highlight-overlay); margin-bottom: 40px; -} \ No newline at end of file +} diff --git a/svelte.config.js b/svelte.config.js index 7714a51..2cd95b6 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -1,4 +1,4 @@ -import sveltePreprocess from "svelte-preprocess"; +import sveltePreprocess from 'svelte-preprocess'; export default { // Consult https://github.com/sveltejs/svelte-preprocess diff --git a/vite.config.ts b/vite.config.ts index 75ac84e..d01d0c0 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,5 +1,5 @@ -import { defineConfig } from "vite"; -import { svelte } from "@sveltejs/vite-plugin-svelte"; +import { defineConfig } from 'vite'; +import { svelte } from '@sveltejs/vite-plugin-svelte'; // https://vitejs.dev/config/ export default defineConfig({ @@ -15,12 +15,12 @@ export default defineConfig({ }, // to make use of `TAURI_DEBUG` and other env variables // https://tauri.studio/v1/api/config#buildconfig.beforedevcommand - envPrefix: ["VITE_", "TAURI_"], + envPrefix: ['VITE_', 'TAURI_'], build: { // Tauri supports es2021 - target: ["es2021", "chrome100", "safari13"], + target: ['es2021', 'chrome100', 'safari13'], // don't minify for debug builds - minify: !process.env.TAURI_DEBUG ? "esbuild" : false, + minify: !process.env.TAURI_DEBUG ? 'esbuild' : false, // produce sourcemaps for debug builds sourcemap: !!process.env.TAURI_DEBUG, }, diff --git a/yarn.lock b/yarn.lock index eb9fb89..1b36f9e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -610,6 +610,16 @@ postcss@^8.4.18: picocolors "^1.0.0" source-map-js "^1.0.2" +prettier-plugin-svelte@^2.9.0: + version "2.9.0" + resolved "https://registry.yarnpkg.com/prettier-plugin-svelte/-/prettier-plugin-svelte-2.9.0.tgz#16cc7fa73fa96eaef48b44089753ac9f1f1175e5" + integrity sha512-3doBi5NO4IVgaNPtwewvrgPpqAcvNv0NwJNflr76PIGgi9nf1oguQV1Hpdm9TI2ALIQVn/9iIwLpBO5UcD2Jiw== + +prettier@^2.8.2: + version "2.8.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.2.tgz#c4ea1b5b454d7c4b59966db2e06ed7eec5dfd160" + integrity sha512-BtRV9BcncDyI2tsuS19zzhzoxD8Dh8LiCx7j7tHzrkz8GFXAexeWFdi22mjE1d16dftH2qNaytVxqiRTGlMfpw== + queue-microtask@^1.2.2: version "1.2.3" resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243"