-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(app): add simple subscription for Supso Cloud
Showing
28 changed files
with
810 additions
and
272 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,91 +1,93 @@ | ||
{ | ||
"name": "supso", | ||
"version": "0.0.1", | ||
"private": true, | ||
"scripts": { | ||
"dev": "bunx --bun vite dev", | ||
"build": "bunx vite build", | ||
"preview": "bunx vite preview", | ||
"start": "npm run db:migrate && node build/index.js", | ||
"test": "bun run test:integration && bun run test:unit", | ||
"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 .", | ||
"test:integration": "playwright test", | ||
"test:unit": "vitest", | ||
"db:generate": "npx drizzle-kit generate:sqlite", | ||
"db:push": "bunx --bun drizzle-kit push:sqlite", | ||
"db:migrate": "bun ./scripts/migrate.ts" | ||
}, | ||
"devDependencies": { | ||
"@playwright/test": "^1.28.1", | ||
"@sveltejs/adapter-node": "^2.0.2", | ||
"@sveltejs/kit": "^2.0.0", | ||
"@sveltejs/vite-plugin-svelte": "^3.0.0", | ||
"@types/eslint": "8.56.0", | ||
"@types/pg": "^8.10.9", | ||
"@types/swagger-jsdoc": "^6.0.4", | ||
"@typescript-eslint/eslint-plugin": "^6.0.0", | ||
"@typescript-eslint/parser": "^6.0.0", | ||
"autoprefixer": "^10.4.16", | ||
"dotenv": "^16.3.1", | ||
"drizzle-kit": "^0.20.13", | ||
"esbuild": "^0.19.12", | ||
"eslint": "^8.56.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-plugin-svelte": "^2.35.1", | ||
"postcss": "^8.4.32", | ||
"postcss-load-config": "^5.0.2", | ||
"prettier": "^3.1.1", | ||
"prettier-plugin-svelte": "^3.1.2", | ||
"prettier-plugin-tailwindcss": "^0.5.9", | ||
"sass": "^1.70.0", | ||
"svelte": "^4.2.8", | ||
"svelte-check": "^3.6.0", | ||
"tailwindcss": "^3.3.6", | ||
"tslib": "^2.4.1", | ||
"typescript": "^5.0.0", | ||
"vite": "^5.0.3", | ||
"vitest": "^1.0.0" | ||
}, | ||
"type": "module", | ||
"dependencies": { | ||
"@carbon/charts-svelte": "^1.13.18", | ||
"@cartamd/plugin-code": "^3.0.1", | ||
"@cartamd/plugin-emoji": "^3.1.0", | ||
"@cartamd/plugin-slash": "^3.1.0", | ||
"@internationalized/date": "^3.5.1", | ||
"@libsql/client": "^0.3.6", | ||
"@lucia-auth/adapter-drizzle": "^1.0.1", | ||
"bits-ui": "^0.13.0", | ||
"carta-md": "^3.5.0", | ||
"clsx": "^2.1.0", | ||
"cmdk-sv": "^0.0.12", | ||
"date-fns": "^3.0.6", | ||
"dedent": "^1.5.1", | ||
"drizzle-orm": "^0.29.2", | ||
"drizzle-zod": "^0.5.1", | ||
"feed": "^4.2.2", | ||
"formsnap": "^0.4.2", | ||
"isomorphic-dompurify": "^2.3.0", | ||
"lucia": "^3.0.1", | ||
"lucide-svelte": "^0.303.0", | ||
"mode-watcher": "^0.1.2", | ||
"rambda": "^8.6.0", | ||
"shiki": "^1.0.0", | ||
"sse.js": "^2.2.0", | ||
"superjson": "^2.2.1", | ||
"svelte-dnd-list": "^0.1.8", | ||
"svelte-highlight": "^7.4.7", | ||
"svelte-sonner": "^0.3.11", | ||
"sveltekit-superforms": "^1.13.1", | ||
"swagger-jsdoc": "^6.2.8", | ||
"tailwind-merge": "^2.2.0", | ||
"tailwind-variants": "^0.1.19", | ||
"tsx": "^4.7.0", | ||
"ua-parser-js": "2.0.0-beta.1", | ||
"unique-names-generator": "^4.7.1", | ||
"zod": "^3.22.4" | ||
} | ||
"name": "supso", | ||
"version": "0.0.1", | ||
"private": true, | ||
"scripts": { | ||
"dev": "bunx --bun vite dev", | ||
"build": "bunx vite build", | ||
"preview": "bunx vite preview", | ||
"start": "npm run db:migrate && node build/index.js", | ||
"test": "bun run test:integration && bun run test:unit", | ||
"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 .", | ||
"test:integration": "playwright test", | ||
"test:unit": "vitest", | ||
"db:generate": "npx drizzle-kit generate:sqlite", | ||
"db:push": "bunx --bun drizzle-kit push:sqlite", | ||
"db:migrate": "bun ./scripts/migrate.ts" | ||
}, | ||
"devDependencies": { | ||
"@playwright/test": "^1.28.1", | ||
"@sveltejs/adapter-node": "^2.0.2", | ||
"@sveltejs/kit": "^2.0.0", | ||
"@sveltejs/vite-plugin-svelte": "^3.0.0", | ||
"@types/eslint": "8.56.0", | ||
"@types/pg": "^8.10.9", | ||
"@types/swagger-jsdoc": "^6.0.4", | ||
"@typescript-eslint/eslint-plugin": "^6.0.0", | ||
"@typescript-eslint/parser": "^6.0.0", | ||
"autoprefixer": "^10.4.16", | ||
"dotenv": "^16.3.1", | ||
"drizzle-kit": "^0.20.13", | ||
"esbuild": "^0.19.12", | ||
"eslint": "^8.56.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-plugin-svelte": "^2.35.1", | ||
"postcss": "^8.4.32", | ||
"postcss-load-config": "^5.0.2", | ||
"prettier": "^3.1.1", | ||
"prettier-plugin-svelte": "^3.1.2", | ||
"prettier-plugin-tailwindcss": "^0.5.9", | ||
"sass": "^1.70.0", | ||
"svelte": "^4.2.8", | ||
"svelte-check": "^3.6.0", | ||
"tailwindcss": "^3.3.6", | ||
"tslib": "^2.4.1", | ||
"typescript": "^5.0.0", | ||
"vite": "^5.0.3", | ||
"vitest": "^1.0.0" | ||
}, | ||
"type": "module", | ||
"dependencies": { | ||
"@carbon/charts-svelte": "^1.13.18", | ||
"@cartamd/plugin-code": "^3.0.1", | ||
"@cartamd/plugin-emoji": "^3.1.0", | ||
"@cartamd/plugin-slash": "^3.1.0", | ||
"@internationalized/date": "^3.5.1", | ||
"@libsql/client": "^0.3.6", | ||
"@lucia-auth/adapter-drizzle": "^1.0.1", | ||
"bits-ui": "^0.13.0", | ||
"carta-md": "^3.5.0", | ||
"clsx": "^2.1.0", | ||
"cmdk-sv": "^0.0.12", | ||
"crypto": "^1.0.1", | ||
"date-fns": "^3.0.6", | ||
"dedent": "^1.5.1", | ||
"drizzle-orm": "^0.29.2", | ||
"drizzle-zod": "^0.5.1", | ||
"feed": "^4.2.2", | ||
"formsnap": "^0.4.2", | ||
"isomorphic-dompurify": "^2.3.0", | ||
"lemonsqueezy.ts": "^0.1.7", | ||
"lucia": "^3.0.1", | ||
"lucide-svelte": "^0.303.0", | ||
"mode-watcher": "^0.1.2", | ||
"rambda": "^8.6.0", | ||
"shiki": "^1.0.0", | ||
"sse.js": "^2.2.0", | ||
"superjson": "^2.2.1", | ||
"svelte-dnd-list": "^0.1.8", | ||
"svelte-highlight": "^7.4.7", | ||
"svelte-sonner": "^0.3.11", | ||
"sveltekit-superforms": "^1.13.1", | ||
"swagger-jsdoc": "^6.2.8", | ||
"tailwind-merge": "^2.2.0", | ||
"tailwind-variants": "^0.1.19", | ||
"tsx": "^4.7.0", | ||
"ua-parser-js": "2.0.0-beta.1", | ||
"unique-names-generator": "^4.7.1", | ||
"zod": "^3.22.4" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<script lang="ts"> | ||
import * as AlertDialog from '$lib/components/ui/alert-dialog'; | ||
import type { Writable } from 'svelte/store'; | ||
export let open: Writable<string | null>; | ||
</script> | ||
|
||
<AlertDialog.Root open={!!$open} onOpenChange={() => open.set(null)}> | ||
<AlertDialog.Content> | ||
<AlertDialog.Header> | ||
<AlertDialog.Title>Are you absolutely sure?</AlertDialog.Title> | ||
<AlertDialog.Description> | ||
This action cannot be undone. This will permanently delete the comment. | ||
</AlertDialog.Description> | ||
</AlertDialog.Header> | ||
<AlertDialog.Footer> | ||
<AlertDialog.Cancel>Cancel</AlertDialog.Cancel> | ||
<form action="?/deleteComment" method="POST"> | ||
<input type="hidden" name="id" value={$open} /> | ||
<AlertDialog.Action type="submit">Continue</AlertDialog.Action> | ||
</form> | ||
</AlertDialog.Footer> | ||
</AlertDialog.Content> | ||
</AlertDialog.Root> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<script lang="ts"> | ||
import * as Card from '$lib/components/ui/card'; | ||
import * as Avatar from '$lib/components/ui/avatar'; | ||
import { Button } from '$lib/components/ui/button'; | ||
import { type Comment } from '$lib/db/schema'; | ||
import { formatDateShort } from '$lib/format/date'; | ||
import { writable, type Writable } from 'svelte/store'; | ||
import { Textarea } from '$lib/components/ui/textarea'; | ||
import { page } from '$app/stores'; | ||
export let comment: Comment; | ||
export let deleteCommentAlertId: Writable<string | null> | undefined; | ||
export let onReply: ((username: string) => void) | undefined; | ||
export let hideActions: boolean = false; | ||
export let editing = writable<boolean>(false); | ||
export const author = comment.userId === $page.data.user.id; | ||
</script> | ||
|
||
<Card.Root class="flex gap-2 p-4"> | ||
<Avatar.Root class="h-8 w-8 text-sm"> | ||
<Avatar.Fallback>{comment.user.username[0].toUpperCase()}</Avatar.Fallback> | ||
</Avatar.Root> | ||
<div class="flex flex-1 flex-col gap-2"> | ||
<div class="flex gap-2"> | ||
<div class="text-sm">{comment.user.username}</div> | ||
<div class="text-muted-foreground text-sm">{formatDateShort(comment.createdAt)}</div> | ||
</div> | ||
<div class="text-sm"> | ||
{comment.content} | ||
</div> | ||
{#if !hideActions && !$editing} | ||
<div class="flex gap-2"> | ||
{#if onReply} | ||
<Button | ||
variant="link" | ||
class="text-muted-foreground h-5 p-0 text-sm" | ||
on:click={() => onReply?.(comment.user.username)}>Reply</Button | ||
> | ||
{/if} | ||
{#if author} | ||
<Button | ||
variant="link" | ||
class="text-muted-foreground h-5 p-0 text-sm" | ||
on:click={() => editing.set(true)}>Edit</Button | ||
> | ||
{/if} | ||
<Button | ||
variant="link" | ||
class="text-muted-foreground h-5 p-0 text-sm" | ||
on:click={() => deleteCommentAlertId?.set(comment.id)}>Delete</Button | ||
> | ||
</div> | ||
{/if} | ||
{#if $editing} | ||
<form action="?/updateComment" method="POST" class="flex flex-col gap-2"> | ||
<input type="hidden" name="id" value={comment.id} /> | ||
<Textarea name="content" value={comment.content} /> | ||
<Button type="submit" variant="secondary" size="sm" class="self-end">Save</Button> | ||
</form> | ||
{/if} | ||
</div> | ||
</Card.Root> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<script lang="ts"> | ||
import { CartaEditor, Carta } from 'carta-md'; | ||
import { emoji } from '@cartamd/plugin-emoji'; | ||
import { code } from '@cartamd/plugin-code'; | ||
import 'carta-md/dark.css'; | ||
import '$lib/styles/discord.scss'; | ||
export let value: string; | ||
export let onChange: (value: string) => void; | ||
export const carta = new Carta({ | ||
disableIcons: true, | ||
extensions: [ | ||
emoji(), | ||
code(), | ||
{ listeners: [['change', (event) => onChange(event.target.value)]] } | ||
] | ||
}); | ||
</script> | ||
|
||
<CartaEditor | ||
bind:value | ||
placeholder="Leave a comment for this event" | ||
mode="tabs" | ||
theme="discord" | ||
{carta} | ||
></CartaEditor> |
Oops, something went wrong.