diff --git a/.prettierrc b/.prettierrc index 9573023..1e96993 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,8 +1,10 @@ { - "useTabs": true, - "singleQuote": true, - "trailingComma": "none", - "printWidth": 100, - "plugins": ["prettier-plugin-svelte"], - "overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }] + "semi": false, + "printWidth": 100, + "bracketSameLine": true, + "svelteSortOrder": "options-styles-scripts-markup", + "arrowParens": "avoid", + "bracketSpacing": false, + "plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"], + "overrides": [{"files": "*.svelte", "options": {"parser": "svelte"}}] } diff --git a/eslint.config.js b/eslint.config.js index 62dbd03..b8271b4 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -1,33 +1,54 @@ -import js from '@eslint/js'; -import ts from 'typescript-eslint'; -import svelte from 'eslint-plugin-svelte'; -import prettier from 'eslint-config-prettier'; -import globals from 'globals'; +import js from "@eslint/js" +import ts from "typescript-eslint" +import svelte from "eslint-plugin-svelte" +import prettier from "eslint-config-prettier" +import globals from "globals" /** @type {import('eslint').Linter.Config[]} */ export default [ - js.configs.recommended, - ...ts.configs.recommended, - ...svelte.configs['flat/recommended'], - prettier, - ...svelte.configs['flat/prettier'], - { - languageOptions: { - globals: { - ...globals.browser, - ...globals.node - } - } - }, - { - files: ['**/*.svelte'], - languageOptions: { - parserOptions: { - parser: ts.parser - } - } - }, - { - ignores: ['build/', '.svelte-kit/', 'dist/'] - } -]; + js.configs.recommended, + ...ts.configs.recommended, + ...svelte.configs["flat/recommended"], + prettier, + ...svelte.configs["flat/prettier"], + { + languageOptions: { + globals: { + ...globals.browser, + ...globals.node, + }, + }, + }, + { + files: ["**/*.svelte"], + languageOptions: { + parserOptions: { + parser: ts.parser, + }, + }, + }, + { + ignores: ["build/", ".svelte-kit/", "dist/"], + }, + { + rules: { + "a11y-click-events-have-key-events": "off", + "a11y-autofocus": "off", + "no-constant-condition": "off", + "no-unused-vars": "off", + "no-useless-escape": "off", + "no-extra-semi": "off", + "no-async-promise-executor": "off", + "prefer-const": ["error", {destructuring: "all"}], + "svelte/valid-compile": "off", + "svelte/no-at-html-tags": "off", + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-extra-semi": "off", + "@typescript-eslint/ban-ts-comment": "off", + "@typescript-eslint/no-unused-vars": [ + "error", + {args: "none", destructuredArrayIgnorePattern: "^_d?$"}, + ], + }, + }, +] diff --git a/package-lock.json b/package-lock.json index 4808cfb..37a7074 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,8 @@ "@poppanator/sveltekit-svg": "^4.2.1", "@welshman/lib": "^0.0.12", "daisyui": "^4.12.10", - "nostr-login": "^1.5.2" + "nostr-login": "^1.5.2", + "prettier-plugin-tailwindcss": "^0.6.5" }, "devDependencies": { "@sveltejs/adapter-auto": "^3.0.0", @@ -3779,7 +3780,6 @@ "version": "3.3.3", "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", - "dev": true, "bin": { "prettier": "bin/prettier.cjs" }, @@ -3794,12 +3794,85 @@ "version": "3.2.6", "resolved": "https://registry.npmjs.org/prettier-plugin-svelte/-/prettier-plugin-svelte-3.2.6.tgz", "integrity": "sha512-Y1XWLw7vXUQQZmgv1JAEiLcErqUniAF2wO7QJsw8BVMvpLET2dI5WpEIEJx1r11iHVdSMzQxivyfrH9On9t2IQ==", - "dev": true, + "devOptional": true, "peerDependencies": { "prettier": "^3.0.0", "svelte": "^3.2.0 || ^4.0.0-next.0 || ^5.0.0-next.0" } }, + "node_modules/prettier-plugin-tailwindcss": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.6.5.tgz", + "integrity": "sha512-axfeOArc/RiGHjOIy9HytehlC0ZLeMaqY09mm8YCkMzznKiDkwFzOpBvtuhuv3xG5qB73+Mj7OCe2j/L1ryfuQ==", + "engines": { + "node": ">=14.21.3" + }, + "peerDependencies": { + "@ianvs/prettier-plugin-sort-imports": "*", + "@prettier/plugin-pug": "*", + "@shopify/prettier-plugin-liquid": "*", + "@trivago/prettier-plugin-sort-imports": "*", + "@zackad/prettier-plugin-twig-melody": "*", + "prettier": "^3.0", + "prettier-plugin-astro": "*", + "prettier-plugin-css-order": "*", + "prettier-plugin-import-sort": "*", + "prettier-plugin-jsdoc": "*", + "prettier-plugin-marko": "*", + "prettier-plugin-organize-attributes": "*", + "prettier-plugin-organize-imports": "*", + "prettier-plugin-sort-imports": "*", + "prettier-plugin-style-order": "*", + "prettier-plugin-svelte": "*" + }, + "peerDependenciesMeta": { + "@ianvs/prettier-plugin-sort-imports": { + "optional": true + }, + "@prettier/plugin-pug": { + "optional": true + }, + "@shopify/prettier-plugin-liquid": { + "optional": true + }, + "@trivago/prettier-plugin-sort-imports": { + "optional": true + }, + "@zackad/prettier-plugin-twig-melody": { + "optional": true + }, + "prettier-plugin-astro": { + "optional": true + }, + "prettier-plugin-css-order": { + "optional": true + }, + "prettier-plugin-import-sort": { + "optional": true + }, + "prettier-plugin-jsdoc": { + "optional": true + }, + "prettier-plugin-marko": { + "optional": true + }, + "prettier-plugin-organize-attributes": { + "optional": true + }, + "prettier-plugin-organize-imports": { + "optional": true + }, + "prettier-plugin-sort-imports": { + "optional": true + }, + "prettier-plugin-style-order": { + "optional": true + }, + "prettier-plugin-svelte": { + "optional": true + } + } + }, "node_modules/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", diff --git a/package.json b/package.json index 11a6a5f..b87215e 100644 --- a/package.json +++ b/package.json @@ -1,42 +1,43 @@ { - "name": "flotilla", - "version": "0.0.1", - "private": true, - "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", - "lint": "prettier --check . && eslint .", - "format": "prettier --write ." - }, - "devDependencies": { - "@sveltejs/adapter-auto": "^3.0.0", - "@sveltejs/kit": "^2.0.0", - "@sveltejs/vite-plugin-svelte": "^3.0.0", - "@types/eslint": "^9.6.0", - "autoprefixer": "^10.4.19", - "classnames": "^2.5.1", - "eslint": "^9.0.0", - "eslint-config-prettier": "^9.1.0", - "eslint-plugin-svelte": "^2.36.0", - "globals": "^15.0.0", - "postcss": "^8.4.40", - "prettier": "^3.1.1", - "prettier-plugin-svelte": "^3.1.2", - "svelte": "^4.2.7", - "svelte-check": "^3.6.0", - "tailwindcss": "^3.4.7", - "typescript": "^5.0.0", - "typescript-eslint": "^8.0.0", - "vite": "^5.0.3" - }, - "type": "module", - "dependencies": { - "@poppanator/sveltekit-svg": "^4.2.1", - "@welshman/lib": "^0.0.12", - "daisyui": "^4.12.10", - "nostr-login": "^1.5.2" - } + "name": "flotilla", + "version": "0.0.1", + "private": true, + "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", + "lint": "prettier --check . && eslint .", + "format": "prettier --write ." + }, + "devDependencies": { + "@sveltejs/adapter-auto": "^3.0.0", + "@sveltejs/kit": "^2.0.0", + "@sveltejs/vite-plugin-svelte": "^3.0.0", + "@types/eslint": "^9.6.0", + "autoprefixer": "^10.4.19", + "classnames": "^2.5.1", + "eslint": "^9.0.0", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-svelte": "^2.36.0", + "globals": "^15.0.0", + "postcss": "^8.4.40", + "prettier": "^3.1.1", + "prettier-plugin-svelte": "^3.1.2", + "svelte": "^4.2.7", + "svelte-check": "^3.6.0", + "tailwindcss": "^3.4.7", + "typescript": "^5.0.0", + "typescript-eslint": "^8.0.0", + "vite": "^5.0.3" + }, + "type": "module", + "dependencies": { + "@poppanator/sveltekit-svg": "^4.2.1", + "@welshman/lib": "^0.0.12", + "daisyui": "^4.12.10", + "nostr-login": "^1.5.2", + "prettier-plugin-tailwindcss": "^0.6.5" + } } diff --git a/src/app.css b/src/app.css index da829b5..77c0941 100644 --- a/src/app.css +++ b/src/app.css @@ -13,7 +13,8 @@ transition-duration: 150ms; } -.button:active:hover, .button:active:focus { +.button:active:hover, +.button:active:focus { animation: button-pop 0s ease-out; transform: scale(var(--btn-focus-scale, 0.97)); } diff --git a/src/app.d.ts b/src/app.d.ts index 90e425f..82a9d73 100644 --- a/src/app.d.ts +++ b/src/app.d.ts @@ -1,17 +1,17 @@ -import '@poppanator/sveltekit-svg/dist/svg' +import "@poppanator/sveltekit-svg/dist/svg" // See https://kit.svelte.dev/docs/types#app // for information about these interfaces declare global { - namespace App { - // interface Error {} - // interface Locals {} - // interface PageData {} - interface PageState { - modal?: string, - } - // interface Platform {} - } + namespace App { + // interface Error {} + // interface Locals {} + // interface PageData {} + interface PageState { + modal?: string + } + // interface Platform {} + } } -export {}; +export {} diff --git a/src/app.html b/src/app.html index 77a5ff5..84ffad1 100644 --- a/src/app.html +++ b/src/app.html @@ -1,12 +1,12 @@ - - - - - %sveltekit.head% - - -
%sveltekit.body%
- + + + + + %sveltekit.head% + + +
%sveltekit.body%
+ diff --git a/src/app/components/PrimaryNav.svelte b/src/app/components/PrimaryNav.svelte index 4f0d69d..ca66147 100644 --- a/src/app/components/PrimaryNav.svelte +++ b/src/app/components/PrimaryNav.svelte @@ -1,19 +1,28 @@ + + -
-
-
+
+
+
- +
- {#each $spaces as {id, name, picture} (id)} + {#each $spaces as { id, name, picture } (id)}
{name} @@ -21,29 +30,22 @@ {/each} -
+
-
+
-
+
- - diff --git a/src/app/components/SecondaryNav.svelte b/src/app/components/SecondaryNav.svelte index b59eb31..b59cec3 100644 --- a/src/app/components/SecondaryNav.svelte +++ b/src/app/components/SecondaryNav.svelte @@ -1,9 +1,9 @@ -
+
Home @@ -13,11 +13,11 @@ Saved Notes -
+
Conversations
- diff --git a/src/app/state.ts b/src/app/state.ts index f780f9b..cd1002a 100644 --- a/src/app/state.ts +++ b/src/app/state.ts @@ -1,13 +1,14 @@ -import type {ComponentType} from 'svelte' -import {readable, writable} from 'svelte/store' -import type {FlyParams} from 'svelte/transition' -import {fly as baseFly} from 'svelte/transition' -import {randomId} from '@welshman/lib' -import {pushState} from '$app/navigation' +import type {ComponentType} from "svelte" +import {readable, writable} from "svelte/store" +import type {FlyParams} from "svelte/transition" +import {fly as baseFly} from "svelte/transition" +import {randomId} from "@welshman/lib" +import {pushState} from "$app/navigation" // Animations -export const fly = (node: Element, params?: FlyParams | undefined) => baseFly(node, {y: 20, ...params}) +export const fly = (node: Element, params?: FlyParams | undefined) => + baseFly(node, {y: 20, ...params}) // Toast @@ -23,7 +24,10 @@ export type ToastOptions = { export const toast = writable(null) -export const pushToast = ({message = "", id = Math.random()}: Partial, options: ToastOptions) => { +export const pushToast = ( + {message = "", id = Math.random()}: Partial, + options: ToastOptions, +) => { toast.set({id, message, options}) setTimeout(() => popToast(id), options.timeout || 5000) @@ -31,7 +35,7 @@ export const pushToast = ({message = "", id = Math.random()}: Partial, op return id } -export const popToast = (id: number) => toast.update($t => $t?.id === id ? null : $t) +export const popToast = (id: number) => toast.update($t => ($t?.id === id ? null : $t)) // Modals @@ -42,7 +46,7 @@ export const pushModal = (component: ComponentType, props: Record) // TODO: fix memory leak here by listening to history somehow modals.set(id, {component, props}) - pushState('', {modal: id}) + pushState("", {modal: id}) return id } @@ -56,8 +60,9 @@ export const popModal = (id: string) => { export const spaces = readable([ { - id: 'test', + id: "test", name: "Test", - picture: "https://images.unsplash.com/photo-1721853046219-209921be684e?w=800&auto=format&fit=crop&q=60&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxmZWF0dXJlZC1waG90b3MtZmVlZHw0fHx8ZW58MHx8fHx8" - } + picture: + "https://images.unsplash.com/photo-1721853046219-209921be684e?w=800&auto=format&fit=crop&q=60&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxmZWF0dXJlZC1waG90b3MtZmVlZHw0fHx8ZW58MHx8fHx8", + }, ]) diff --git a/src/lib/components/Icon.svelte b/src/lib/components/Icon.svelte index 66f9f75..aafb7f7 100644 --- a/src/lib/components/Icon.svelte +++ b/src/lib/components/Icon.svelte @@ -1,18 +1,25 @@ + + -
-
+
+
diff --git a/src/lib/components/SecondaryNavItem.svelte b/src/lib/components/SecondaryNavItem.svelte index afc91de..e4e65dc 100644 --- a/src/lib/components/SecondaryNavItem.svelte +++ b/src/lib/components/SecondaryNavItem.svelte @@ -3,8 +3,10 @@ export let active - -
+ +
diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 67fab13..7463e40 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -1,24 +1,24 @@ -
+
-
-

Welcome to

-

Flotilla

-
-
+
+

Welcome to

+

Flotilla

+
+

Create a group

-

Invite all your friends, do life together.

+

Invite all your friends, do life together.

+

-
+

Discover groups

-

Find a community based on your hobbies or interests.

+

Find a community based on your hobbies or interests.

+

-
+

Leave feedback

-

Let us know how we can improve by giving us feedback.

+

Let us know how we can improve by giving us feedback.

+

-
+

Donate to Flotilla

-

Support the project by donating to the developer.

+

Support the project by donating to the developer.

+

diff --git a/src/routes/friends/+page.svelte b/src/routes/friends/+page.svelte index 8b13789..e69de29 100644 --- a/src/routes/friends/+page.svelte +++ b/src/routes/friends/+page.svelte @@ -1 +0,0 @@ - diff --git a/svelte.config.js b/svelte.config.js index eb32903..6695d41 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -1,26 +1,25 @@ import * as path from "path" -import adapter from '@sveltejs/adapter-auto'; -import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'; +import adapter from "@sveltejs/adapter-auto" +import {vitePreprocess} from "@sveltejs/vite-plugin-svelte" /** @type {import('@sveltejs/kit').Config} */ const config = { - // Consult https://kit.svelte.dev/docs/integrations#preprocessors - // for more information about preprocessors - preprocess: vitePreprocess(), + // Consult https://kit.svelte.dev/docs/integrations#preprocessors + // for more information about preprocessors + preprocess: vitePreprocess(), - kit: { - // adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list. - // If your environment is not supported, or you settled on a specific environment, switch out the adapter. - // See https://kit.svelte.dev/docs/adapters for more information about adapters. - adapter: adapter(), - alias: { - 'src': "src", - 'app': "src/app", - 'lib': "src/lib", - 'assets': "src/assets", + kit: { + // adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list. + // If your environment is not supported, or you settled on a specific environment, switch out the adapter. + // See https://kit.svelte.dev/docs/adapters for more information about adapters. + adapter: adapter(), + alias: { + src: "src", + app: "src/app", + lib: "src/lib", + assets: "src/assets", }, - } -}; - -export default config; + }, +} +export default config diff --git a/tailwind.config.js b/tailwind.config.js index 3aa7745..00afe2c 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -1,15 +1,15 @@ /** @type {import('tailwindcss').Config} */ export default { - content: ['./src/**/*.{html,js,svelte,ts}'], + content: ["./src/**/*.{html,js,svelte,ts}"], theme: { extend: {}, zIndex: { none: 0, - 'nav-active': 1, - 'nav-item': 2, + "nav-active": 1, + "nav-item": 2, }, }, - plugins: [require('daisyui')], + plugins: [require("daisyui")], daisyui: { themes: [ "light", diff --git a/tsconfig.json b/tsconfig.json index fc93cbd..593dc19 100644 --- a/tsconfig.json +++ b/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/vite.config.ts b/vite.config.ts index 25d14f9..bf65d4c 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,16 +1,16 @@ -import {sveltekit} from '@sveltejs/kit/vite' -import svg from '@poppanator/sveltekit-svg' -import {defineConfig} from 'vite' +import {sveltekit} from "@sveltejs/kit/vite" +import svg from "@poppanator/sveltekit-svg" +import {defineConfig} from "vite" export default defineConfig({ - plugins: [ - sveltekit(), - svg({ + plugins: [ + sveltekit(), + svg({ svgoOptions: { multipass: true, plugins: [ { - name: 'preset-default', + name: "preset-default", params: { overrides: { removeViewBox: false, @@ -20,6 +20,6 @@ export default defineConfig({ "removeDimensions", ], }, - }) - ], -}); + }), + ], +})