added prettier

This commit is contained in:
Fractal-Tess
2022-08-24 09:57:23 +03:00
parent 40bde372e2
commit 5847abebfb
14 changed files with 1281 additions and 552 deletions

5
.prettierignore Normal file
View File

@@ -0,0 +1,5 @@
target
dist
*.min.js
*.min.css

View File

@@ -7,6 +7,7 @@
"start": "tauri dev",
"dev": "tauri dev",
"build": "tauri build",
"format": "prettier --write --plugin-search-dir=. .",
"svelte:dev": "vite dev",
"svelte:build": "vite build",
"svelte:preview": "vite preview",
@@ -26,6 +27,8 @@
"daisyui": "^2.20.0",
"postcss": "^8.4.14",
"postcss-load-config": "^4.0.1",
"prettier": "^2.7.1",
"prettier-plugin-svelte": "^2.7.0",
"sass": "^1.53.0",
"svelte": "^3.49.0",
"svelte-add": "^2022.7.2-2.0",

1472
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -6,8 +6,8 @@ const config = {
//Some plugins, like tailwindcss/nesting, need to run before Tailwind,
tailwindcss(),
//But others, like autoprefixer, need to run after,
autoprefixer,
],
autoprefixer
]
};
module.exports = config;

8
prettier.config.cjs Normal file
View File

@@ -0,0 +1,8 @@
module.exports = {
singleQuote: true,
trailingComma: 'none',
tabWidth: 2,
printWidth: 80,
arrowParens: 'avoid',
plugins: [require('prettier-plugin-svelte')]
};

View File

@@ -9,7 +9,9 @@
}
</script>
<button on:click={callTauri} class=" font-extrabold btn btn-outline btn-secondary btn-md"
<button
on:click={callTauri}
class=" font-extrabold btn btn-outline btn-secondary btn-md"
>Call Tauri</button
>
<div class="relative">

View File

@@ -3,7 +3,9 @@
class="fixed bottom-0 w-full rounded-b-3xl h-12 items-center flex justify-around bg-base-100 shadow-[0_-10px_15px_-3px_rgba(0,0,0,0.1)]"
>
<a target="_blank" href="https://github.com/Fractal-Tess">
Made by <span class="text-secondary-content bg-secondary p-[4px] rounded-md">Fractal-Tess</span>
Made by <span class="text-secondary-content bg-secondary p-[4px] rounded-md"
>Fractal-Tess</span
>
</a>
<a

View File

@@ -4,8 +4,15 @@
import { appWindow } from '@tauri-apps/api/window';
</script>
<div data-tauri-drag-region class="h-12 bg-base-100 shadow-lg items-center justify-between flex">
<button on:click={theme.toggleTheme} class="hover:text-secondary ml-2" aria-live="polite">
<div
data-tauri-drag-region
class="h-12 bg-base-100 shadow-lg items-center justify-between flex"
>
<button
on:click={theme.toggleTheme}
class="hover:text-secondary ml-2"
aria-live="polite"
>
<ThemeToggleIcon cssClass={'w-8'} />
</button>

View File

@@ -3,7 +3,7 @@ import '@fortawesome/fontawesome-free/js/all.js';
import App from './App.svelte';
const app = new App({
target: document.getElementById('app'),
target: document.getElementById('app')
});
export default app;

View File

@@ -7,9 +7,9 @@ export default {
sveltePreprocess({
postcss: true,
scss: {
prependData: '@use "src/variables.scss" as *;',
prependData: '@use "src/variables.scss" as *;'
},
sourceMap: !!process.env.TAURI_DEBUG,
}),
],
sourceMap: !!process.env.TAURI_DEBUG
})
]
};

View File

@@ -10,9 +10,9 @@ const config = {
theme: {
extend: {
fontFamily: {
sans: ['roboto', ...defaultTheme.fontFamily.sans],
},
},
sans: ['roboto', ...defaultTheme.fontFamily.sans]
}
}
},
daisyui: {
@@ -28,7 +28,7 @@ const config = {
info: '#93BADC',
success: '#12A168',
warning: '#F4C857',
error: '#DE3B4E',
error: '#DE3B4E'
},
dark: {
...require('daisyui/src/colors/themes')['[data-theme=dark]'],
@@ -40,12 +40,12 @@ const config = {
info: '#35B0F3',
success: '#1B743C',
warning: '#F38A12',
error: '#F2215C',
error: '#F2215C'
}
}
]
},
},
],
},
plugins: [forms, typography, daisyui],
plugins: [forms, typography, daisyui]
};
module.exports = config;

View File

@@ -8,17 +8,17 @@ export default defineConfig({
css: {
preprocessorOptions: {
scss: {
additionalData: '@use "src/styles/variables.scss" as *;',
},
},
additionalData: '@use "src/styles/variables.scss" as *;'
}
}
},
resolve: {
alias: {
$styles: resolve('src/styles/app.scss'),
$lib: resolve('src/lib'),
$src: resolve('src/'),
},
$src: resolve('src/')
}
},
publicDir: false,
@@ -27,7 +27,7 @@ export default defineConfig({
server: {
strictPort: true,
port: 3000,
port: 3000
},
envPrefix: ['VITE_', 'TAURI_'],
@@ -35,6 +35,6 @@ export default defineConfig({
build: {
target: ['es2021', 'chrome100', 'safari13'],
minify: !process.env.TAURI_DEBUG ? 'esbuild' : false,
sourcemap: !!process.env.TAURI_DEBUG,
},
sourcemap: !!process.env.TAURI_DEBUG
}
});