Skip to content

Feature: sveltekit demo refactor #12287

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions apps/examples/sveltekit/components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "https://shadcn-svelte.com/schema.json",
"style": "new-york",
"tailwind": {
"config": "tailwind.config.ts",
"css": "src/app.css",
"baseColor": "zinc"
},
"aliases": {
"components": "$lib/components",
"utils": "$lib/utils"
},
"typescript": true
}
12 changes: 11 additions & 1 deletion apps/examples/sveltekit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,23 @@
"@sveltejs/adapter-auto": "3.2.0",
"@sveltejs/kit": "2.8.3",
"@sveltejs/vite-plugin-svelte": "^3.1.0",
"@tailwindcss/typography": "^0.5.14",
"autoprefixer": "^10.4.20",
"bits-ui": "^0.21.16",
"clsx": "^2.1.1",
"postcss": "^8.4.49",
"svelte": "4.2.19",
"svelte-check": "3.6.9",
"svelte-radix": "^1.1.1",
"tailwind-merge": "^2.5.4",
"tailwind-variants": "^0.3.0",
"tailwindcss": "^3.4.13",
"typescript": "5.4.5",
"vite": "5.2.14"
},
"dependencies": {
"@auth/sveltekit": "latest"
"@auth/sveltekit": "latest",
"mode-watcher": "^0.5.0"
},
"type": "module"
}
6 changes: 6 additions & 0 deletions apps/examples/sveltekit/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {}
}
};
78 changes: 78 additions & 0 deletions apps/examples/sveltekit/src/app.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
:root {
--background: 0 0% 100%;
--foreground: 240 10% 3.9%;

--muted: 240 4.8% 95.9%;
--muted-foreground: 240 3.8% 46.1%;

--popover: 0 0% 100%;
--popover-foreground: 240 10% 3.9%;

--card: 0 0% 100%;
--card-foreground: 240 10% 3.9%;

--border: 240 5.9% 90%;
--input: 240 5.9% 90%;

--primary: 240 5.9% 10%;
--primary-foreground: 0 0% 98%;

--secondary: 240 4.8% 95.9%;
--secondary-foreground: 240 5.9% 10%;

--accent: 240 4.8% 95.9%;
--accent-foreground: 240 5.9% 10%;

--destructive: 0 72.2% 50.6%;
--destructive-foreground: 0 0% 98%;

--ring: 240 10% 3.9%;

--radius: 0.5rem;
}

.dark {
--background: 240 10% 3.9%;
--foreground: 0 0% 98%;

--muted: 240 3.7% 15.9%;
--muted-foreground: 240 5% 64.9%;

--popover: 240 10% 3.9%;
--popover-foreground: 0 0% 98%;

--card: 240 10% 3.9%;
--card-foreground: 0 0% 98%;

--border: 240 3.7% 15.9%;
--input: 240 3.7% 15.9%;

--primary: 0 0% 98%;
--primary-foreground: 240 5.9% 10%;

--secondary: 240 3.7% 15.9%;
--secondary-foreground: 0 0% 98%;

--accent: 240 3.7% 15.9%;
--accent-foreground: 0 0% 98%;

--destructive: 0 62.8% 30.6%;
--destructive-foreground: 0 0% 98%;

--ring: 240 4.9% 83.9%;
}
}

@layer base {
* {
@apply border-border;
}
body {
@apply bg-background text-foreground;
}
}
56 changes: 0 additions & 56 deletions apps/examples/sveltekit/src/components/footer.svelte

This file was deleted.

112 changes: 0 additions & 112 deletions apps/examples/sveltekit/src/components/header.svelte

This file was deleted.

47 changes: 47 additions & 0 deletions apps/examples/sveltekit/src/lib/components/footer.svelte
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we moving the components in the lib folder though?

Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<script lang="ts">
import packageJSON from "@auth/sveltekit/package.json"
import ExternalIcon from "./external-icon.svelte"
</script>

<footer
class="mx-0 my-4 flex w-full flex-col gap-4 px-4 text-sm
sm:mx-auto sm:my-12 sm:h-5 sm:max-w-3xl sm:flex-row sm:items-center sm:justify-between sm:px-6"
>
<div class="flex flex-wrap items-center gap-4">
<a
class="flex items-center gap-1 underline underline-offset-4"
target="_blank"
href="https://sveltekit.authjs.dev">Documentation <ExternalIcon /></a
>
<a
class="flex items-center gap-1 underline underline-offset-4"
target="_blank"
href="https://www.npmjs.com/package/next-auth"
>
NPM <ExternalIcon />
</a>
<a
class="flex items-center gap-1 underline underline-offset-4"
target="_blank"
href="https://github.com/nextauthjs/next-auth/tree/main/apps/examples/sveltekit"
>
Source on GitHub <ExternalIcon />
</a>
<a href="/policy">Policy</a>
</div>
<div class="flex items-center gap-2 underline underline-offset-4">
<img
class="size-6"
src="https://authjs.dev/img/logo-sm.png"
alt="Auth.js Logo"
/>
<a
class="flex items-center gap-1"
target="_blank"
href="https://www.npmjs.com/package/@auth/sveltekit"
>
@auth/sveltekit@{packageJSON.version}
<ExternalIcon />
</a>
</div>
</footer>
Loading
Loading