diff --git a/kitsune-fe/package.json b/kitsune-fe/package.json index 94a566e32..b826d742c 100644 --- a/kitsune-fe/package.json +++ b/kitsune-fe/package.json @@ -12,7 +12,7 @@ "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", "test": "pnpm run test:e2e && pnpm run test:unit -- --run", "lint": "prettier --check . && eslint .", - "format": "prettier --write .", + "fmt": "prettier --write .", "test:e2e": "playwright test", "test:unit": "vitest" }, diff --git a/kitsune-fe/playwright.config.ts b/kitsune-fe/playwright.config.ts index d76ea266e..29284b815 100644 --- a/kitsune-fe/playwright.config.ts +++ b/kitsune-fe/playwright.config.ts @@ -2,7 +2,7 @@ import { defineConfig } from '@playwright/test'; export default defineConfig({ webServer: { - command: 'npm run build && npm run preview', + command: 'pnpm run build && pnpm run preview', port: 4173 }, diff --git a/kitsune-fe/schema.graphql b/kitsune-fe/schema.graphql index adb0820dd..ec2ce284f 100644 --- a/kitsune-fe/schema.graphql +++ b/kitsune-fe/schema.graphql @@ -1,6 +1,6 @@ schema { - query: RootQuery - mutation: RootMutation + query: RootQuery + mutation: RootMutation } """ @@ -10,27 +10,27 @@ Indicates that an Input Object is a OneOf Input Object (and thus requires directive @oneOf on INPUT_OBJECT type Account { - avatar: MediaAttachment - createdAt: DateTime! - displayName: String - header: MediaAttachment - id: UUID! - locked: Boolean! - note: String - posts(after: String, before: String, first: Int, last: Int): PostConnection! - updatedAt: DateTime! - url: String! - username: String! + avatar: MediaAttachment + createdAt: DateTime! + displayName: String + header: MediaAttachment + id: UUID! + locked: Boolean! + note: String + posts(after: String, before: String, first: Int, last: Int): PostConnection! + updatedAt: DateTime! + url: String! + username: String! } enum CaptchaBackend { - H_CAPTCHA - M_CAPTCHA + H_CAPTCHA + M_CAPTCHA } type CaptchaInfo { - backend: CaptchaBackend! - key: String! + backend: CaptchaBackend! + key: String! } """ @@ -44,99 +44,133 @@ format, but it is always normalized to the UTC (Z) offset, e.g. scalar DateTime type Instance { - captcha: CaptchaInfo - characterLimit: Int! - description: String! - domain: String! - localPostCount: Int! - name: String! - registrationsOpen: Boolean! - userCount: Int! - version: String! + captcha: CaptchaInfo + characterLimit: Int! + description: String! + domain: String! + localPostCount: Int! + name: String! + registrationsOpen: Boolean! + userCount: Int! + version: String! } type MediaAttachment { - blurhash: String - contentType: String! - createdAt: DateTime! - description: String - id: UUID! - uploader: Account! - url: String! + blurhash: String + contentType: String! + createdAt: DateTime! + description: String + id: UUID! + uploader: Account! + url: String! } type OAuth2Application { - createdAt: DateTime! - id: UUID! - name: String! - redirectUri: String! - secret: String! - updatedAt: DateTime! + createdAt: DateTime! + id: UUID! + name: String! + redirectUri: String! + secret: String! + updatedAt: DateTime! } -"""Information about pagination in a connection""" +""" +Information about pagination in a connection +""" type PageInfo { - """When paginating forwards, the cursor to continue.""" - endCursor: String - - """When paginating forwards, are there more items?""" - hasNextPage: Boolean! - - """When paginating backwards, are there more items?""" - hasPreviousPage: Boolean! - - """When paginating backwards, the cursor to continue.""" - startCursor: String + """ + When paginating forwards, the cursor to continue. + """ + endCursor: String + + """ + When paginating forwards, are there more items? + """ + hasNextPage: Boolean! + + """ + When paginating backwards, are there more items? + """ + hasPreviousPage: Boolean! + + """ + When paginating backwards, the cursor to continue. + """ + startCursor: String } type Post { - account: Account! - attachments: [MediaAttachment!]! - content: String! - createdAt: DateTime! - id: UUID! - isSensitive: Boolean! - subject: String - updatedAt: DateTime! - url: String! - visibility: Visibility! + account: Account! + attachments: [MediaAttachment!]! + content: String! + createdAt: DateTime! + id: UUID! + isSensitive: Boolean! + subject: String + updatedAt: DateTime! + url: String! + visibility: Visibility! } type PostConnection { - """A list of edges.""" - edges: [PostEdge!]! - - """A list of nodes.""" - nodes: [Post!]! - - """Information to aid in pagination.""" - pageInfo: PageInfo! + """ + A list of edges. + """ + edges: [PostEdge!]! + + """ + A list of nodes. + """ + nodes: [Post!]! + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! } -"""An edge in a connection.""" +""" +An edge in a connection. +""" type PostEdge { - """A cursor for use in pagination""" - cursor: String! - - """The item at the end of the edge""" - node: Post! + """ + A cursor for use in pagination + """ + cursor: String! + + """ + The item at the end of the edge + """ + node: Post! } type RootMutation { - createPost(content: String!, isSensitive: Boolean!, visibility: Visibility!): Post! - deletePost(id: UUID!): UUID! - registerOauthApplication(name: String!, redirectUri: String!): OAuth2Application! - registerUser(captchaToken: String, email: String!, password: String!, username: String!): User! - updateUser(avatar: Upload, displayName: String, header: Upload, locked: Boolean, note: String): Account! + createPost(content: String!, isSensitive: Boolean!, visibility: Visibility!): Post! + deletePost(id: UUID!): UUID! + registerOauthApplication(name: String!, redirectUri: String!): OAuth2Application! + registerUser(captchaToken: String, email: String!, password: String!, username: String!): User! + updateUser( + avatar: Upload + displayName: String + header: Upload + locked: Boolean + note: String + ): Account! } type RootQuery { - getAccountById(id: UUID!): Account - getPostById(id: UUID!): Post! - homeTimeline(after: String, before: String, first: Int, last: Int): PostConnection! - instance: Instance! - myAccount: Account! - publicTimeline(after: String, before: String, first: Int, last: Int, onlyLocal: Boolean! = true): PostConnection! + getAccountById(id: UUID!): Account + getPostById(id: UUID!): Post! + homeTimeline(after: String, before: String, first: Int, last: Int): PostConnection! + instance: Instance! + myAccount: Account! + publicTimeline( + after: String + before: String + first: Int + last: Int + onlyLocal: Boolean! = true + ): PostConnection! } """ @@ -154,17 +188,17 @@ scalar UUID scalar Upload type User { - account: Account! - createdAt: DateTime! - email: String! - id: UUID! - updatedAt: DateTime! - username: String! + account: Account! + createdAt: DateTime! + email: String! + id: UUID! + updatedAt: DateTime! + username: String! } enum Visibility { - FOLLOWER_ONLY - MENTION_ONLY - PUBLIC - UNLISTED + FOLLOWER_ONLY + MENTION_ONLY + PUBLIC + UNLISTED } diff --git a/kitsune-fe/src/routes/+layout.svelte b/kitsune-fe/src/routes/+layout.svelte index a88854938..669c31ce5 100644 --- a/kitsune-fe/src/routes/+layout.svelte +++ b/kitsune-fe/src/routes/+layout.svelte @@ -20,7 +20,7 @@ {@render children()} -