Skip to content

Commit 109384a

Browse files
committed
chore: merge main into release/v0.1.4
2 parents e1c6653 + 555b2c8 commit 109384a

41 files changed

Lines changed: 8453 additions & 5504 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Nuxt module for [Better Auth](https://better-auth.com) with Nuxt-native route pr
44

55
## Who this is for
66

7-
Use this module if you want Better Auth in a Nuxt 4 app and you want the Nuxt-specific pieces handled for you:
7+
Use this module if you want Better Auth in a Nuxt app and you want the Nuxt-specific pieces handled for you:
88

99
- `useUserSession()` for reactive auth state
1010
- `requireUserSession(event)` and related server helpers
@@ -14,7 +14,7 @@ Use this module if you want Better Auth in a Nuxt 4 app and you want the Nuxt-sp
1414

1515
## Install the module
1616

17-
For the fastest path in a Nuxt 4 app:
17+
For the fastest path in a Nuxt app:
1818

1919
```bash
2020
npx nuxi module add @nuxtjs/better-auth

build.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { defineBuildConfig } from 'unbuild'
22

33
export default defineBuildConfig({
4-
externals: ['consola', '@better-auth/cli', '@better-auth/cli/api', 'drizzle-orm/utils'],
4+
externals: ['consola', 'auth', 'auth/api'],
55
})

docs/app/app.config.ts

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -28,31 +28,8 @@ export default defineAppConfig({
2828
},
2929
},
3030
},
31-
page: {
32-
slots: {
33-
root: 'flex flex-col lg:flex-row lg:gap-8 px-4 sm:px-6 lg:px-8 xl:px-12',
34-
left: 'hidden',
35-
center: 'flex-1 min-w-0 max-w-[var(--fd-content-width,860px)] mx-auto',
36-
right: 'hidden xl:block w-[var(--fd-toc-width,268px)] shrink-0',
37-
},
38-
},
3931
pageBody: {
4032
base: 'mt-8 pb-24 space-y-12',
4133
},
42-
pageAside: {
43-
slots: {
44-
root: 'sticky top-[var(--ui-header-height)] max-h-[calc(100vh-var(--ui-header-height))] overflow-y-auto py-8',
45-
},
46-
},
47-
contentToc: {
48-
slots: {
49-
root: '',
50-
container: '',
51-
header: 'text-sm font-semibold mb-3 text-[var(--ui-text-highlighted)]',
52-
links: 'space-y-1',
53-
link: 'text-sm block py-1.5 text-[var(--ui-text-muted)] hover:text-[var(--ui-text)] transition-colors',
54-
linkActive: 'text-[var(--ui-text-highlighted)]',
55-
},
56-
},
5734
},
5835
})

docs/app/app.vue

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<script setup lang="ts">
22
import type { ContentNavigationItem, PageCollections } from '@nuxt/content'
3-
import { SpeedInsights } from '@vercel/speed-insights/nuxt'
43
54
const route = useRoute()
65
const { locale, isEnabled } = useDocusI18n()
@@ -33,12 +32,5 @@ provide('navigation', navigation)
3332
</ClientOnly>
3433

3534
<UToaster />
36-
<SpeedInsights />
3735
</div>
3836
</template>
39-
40-
<style>
41-
.app-root {
42-
--header-height: var(--ui-header-height, 56px);
43-
}
44-
</style>

docs/app/assets/css/main.css

Lines changed: 136 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,26 @@
66
:root {
77
--ui-radius: 0.125rem;
88
--ui-bg: var(--color-white);
9-
--fd-sidebar-width: 268px;
10-
--fd-toc-width: 268px;
11-
--fd-content-width: 860px;
9+
--header-height: 3.5rem;
10+
/* Mirror better-auth/docs/app/globals.css */
11+
--fd-sidebar-width: 280px;
12+
--fd-toc-width: 0px;
13+
--fd-page-width: 900px;
14+
--fd-layout-width: 100%;
1215
}
1316

17+
@media (min-width: 1024px) {
18+
:root {
19+
--fd-sidebar-width: 300px;
20+
/* same as better-auth: min(100vw - sidebar, 1200px) */
21+
--fd-layout-width: min(calc(100vw - var(--fd-sidebar-width)), 1200px);
22+
}
23+
}
24+
25+
/* 80rem — better-auth enables side TOC here */
1426
@media (min-width: 1280px) {
1527
:root {
16-
--fd-sidebar-width: 286px;
17-
--fd-toc-width: 286px;
28+
--fd-toc-width: 280px;
1829
}
1930
}
2031

@@ -132,3 +143,123 @@ pre, code {
132143
.hero-code > div > div {
133144
margin: 0 !important;
134145
}
146+
147+
/* Native scrollbar: kill light Windows track "glow" on dark bg */
148+
html {
149+
scrollbar-width: thin;
150+
scrollbar-color: color-mix(in srgb, var(--ui-border) 90%, transparent) transparent;
151+
}
152+
153+
html::-webkit-scrollbar,
154+
body::-webkit-scrollbar,
155+
.docs-main::-webkit-scrollbar,
156+
.docs-main *::-webkit-scrollbar {
157+
width: 10px;
158+
height: 10px;
159+
}
160+
161+
html::-webkit-scrollbar-track,
162+
body::-webkit-scrollbar-track,
163+
.docs-main::-webkit-scrollbar-track,
164+
.docs-main *::-webkit-scrollbar-track,
165+
html::-webkit-scrollbar-corner,
166+
body::-webkit-scrollbar-corner {
167+
background: transparent;
168+
}
169+
170+
html::-webkit-scrollbar-thumb,
171+
body::-webkit-scrollbar-thumb,
172+
.docs-main::-webkit-scrollbar-thumb,
173+
.docs-main *::-webkit-scrollbar-thumb {
174+
background-color: color-mix(in srgb, var(--ui-border) 90%, transparent);
175+
border-radius: 9999px;
176+
border: 2px solid transparent;
177+
background-clip: padding-box;
178+
}
179+
180+
html::-webkit-scrollbar-thumb:hover,
181+
body::-webkit-scrollbar-thumb:hover,
182+
.docs-main::-webkit-scrollbar-thumb:hover,
183+
.docs-main *::-webkit-scrollbar-thumb:hover {
184+
background-color: color-mix(in srgb, var(--ui-text-muted) 70%, transparent);
185+
}
186+
187+
188+
/* Docs page — 1:1 with better-auth fumadocs DocsPage (#nd-page / #nd-article / #nd-toc) */
189+
.docs-page,
190+
#nd-page {
191+
display: grid;
192+
grid-template-columns: minmax(0, 1fr) var(--fd-toc-width, 0px);
193+
column-gap: 0;
194+
width: 100%;
195+
max-width: var(--fd-layout-width, 1200px);
196+
margin-inline: auto;
197+
min-width: 0;
198+
padding-inline: 1rem;
199+
box-sizing: border-box;
200+
}
201+
202+
@media (min-width: 640px) {
203+
.docs-page,
204+
#nd-page {
205+
padding-inline: 1.5rem;
206+
}
207+
}
208+
209+
@media (min-width: 1024px) {
210+
.docs-page,
211+
#nd-page {
212+
padding-inline: 2rem;
213+
}
214+
}
215+
216+
@media (min-width: 1280px) {
217+
.docs-page,
218+
#nd-page {
219+
column-gap: 2rem;
220+
}
221+
}
222+
223+
.docs-article,
224+
#nd-article {
225+
min-width: 0;
226+
width: 100%;
227+
max-width: var(--fd-page-width, 900px);
228+
}
229+
230+
.docs-toc,
231+
#nd-toc {
232+
display: none;
233+
min-width: 0;
234+
width: var(--fd-toc-width, 0px);
235+
overflow-x: hidden;
236+
overflow-y: auto;
237+
overscroll-behavior-y: contain;
238+
scrollbar-width: none;
239+
}
240+
241+
.docs-toc::-webkit-scrollbar,
242+
#nd-toc::-webkit-scrollbar {
243+
display: none;
244+
}
245+
246+
/* 80rem — show side TOC; align top with article title (no extra top padding) */
247+
@media (min-width: 1280px) {
248+
.docs-toc,
249+
#nd-toc {
250+
display: block;
251+
position: sticky;
252+
top: calc(var(--header-height, 3.5rem) + 1rem);
253+
align-self: start;
254+
max-height: calc(100dvh - var(--header-height, 3.5rem) - 2rem);
255+
padding-top: 0;
256+
padding-bottom: 4rem;
257+
padding-inline-start: 2rem;
258+
}
259+
}
260+
261+
/* Docs content: keep wide code blocks inside the page */
262+
.docs-main :where(pre, table) {
263+
max-width: 100%;
264+
overflow-x: auto;
265+
}

docs/app/components/AnnouncementBanner.vue

Lines changed: 0 additions & 10 deletions
This file was deleted.

docs/app/components/app/AppHeader.vue

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,8 @@
11
<script setup lang="ts">
22
const appConfig = useAppConfig()
33
const site = useSiteConfig()
4-
const route = useRoute()
5-
const { sidebarOpen, toggle: toggleSidebar } = useDocusSidebar()
64
const { open: searchOpen } = useContentSearch()
75
8-
const isDocsPage = computed(() => route.path.startsWith('/getting-started')
9-
|| route.path.startsWith('/core-concepts')
10-
|| route.path.startsWith('/guides')
11-
|| route.path.startsWith('/integrations')
12-
|| route.path.startsWith('/api')
13-
|| route.path.startsWith('/better-auth'))
14-
156
const navLinks = [
167
{ name: 'docs', path: '/getting-started' },
178
{ name: 'demo', path: 'https://demo-nuxt-better-auth.onmax.me', external: true },
@@ -20,7 +11,7 @@ const navLinks = [
2011
</script>
2112

2213
<template>
23-
<UHeader :ui="{ container: 'max-w-full !gap-0 !px-0 h-14 overflow-hidden', root: 'border-b border-[var(--ui-border)] h-14', left: 'gap-0 h-full', right: 'gap-0 h-full', title: 'h-full items-center' }" to="/" :title="appConfig.header?.title || site.name">
14+
<UHeader :ui="{ container: 'max-w-full !gap-0 !px-0 h-14 overflow-hidden', root: 'border-b border-[var(--ui-border)] h-14', header: '!px-0 h-14', left: 'gap-0 h-full', right: 'gap-0 h-full lg:pr-4', title: 'h-full items-center' }" to="/" :title="appConfig.header?.title || site.name">
2415
<template #title>
2516
<div class="header-logo">
2617
<!-- Nuxt -->
@@ -70,15 +61,12 @@ const navLinks = [
7061
class="flex items-center h-full px-5 border-l border-[var(--ui-border)] text-muted transition-colors group-hover:text-[var(--ui-text)]"
7162
aria-label="GitHub"
7263
>
73-
<UIcon name="i-simple-icons-github" class="size-4" />
64+
<UIcon name="i-simple-icons-github" class="size-5" />
7465
</NuxtLink>
7566
<div class="absolute bottom-0 left-0 h-0.5 w-0 bg-[var(--ui-text-muted)] opacity-0 transition-all duration-500 group-hover:w-full group-hover:opacity-100" />
7667
</li>
7768
</nav>
7869

79-
<!-- Docs sidebar toggle (mobile) -->
80-
<UButton v-if="isDocsPage" color="neutral" variant="ghost" :icon="sidebarOpen ? 'i-lucide-x' : 'i-lucide-panel-left'" class="mobile-header-action lg:hidden" :ui="{ leadingIcon: 'mobile-header-icon' }" @click="toggleSidebar" />
81-
8270
<UButton
8371
color="neutral"
8472
variant="ghost"
@@ -102,15 +90,14 @@ const navLinks = [
10290
color="neutral"
10391
variant="ghost"
10492
:icon="open ? 'i-lucide-x' : 'i-lucide-menu'"
105-
class="mobile-header-action lg:hidden"
93+
class="mobile-header-action mr-4 lg:hidden"
10694
:ui="{ leadingIcon: 'mobile-header-icon' }"
10795
@click="toggle"
10896
/>
10997
</template>
11098

11199
<template #body>
112-
<UNavigationMenu :items="[]" orientation="vertical" class="w-full" />
113-
<nav class="flex flex-col border-t border-[var(--ui-border)] mt-4 pt-4">
100+
<nav class="flex flex-col">
114101
<NuxtLink
115102
v-for="link in navLinks"
116103
:key="link.name"
@@ -135,19 +122,21 @@ const navLinks = [
135122
padding-inline: 1rem;
136123
border-right: 1px solid var(--ui-border);
137124
box-sizing: border-box;
125+
flex-shrink: 0;
138126
}
139127
140128
@media (min-width: 640px) {
141129
.header-logo {
142130
gap: 0.75rem;
143-
width: var(--fd-sidebar-width, 268px);
131+
/* Same token + box model as .docs-sidebar so borders line up */
132+
width: var(--fd-sidebar-width, 280px);
144133
padding-inline: 1.25rem;
145134
}
146135
}
147136
148-
@media (min-width: 1280px) {
137+
@media (min-width: 1024px) {
149138
.header-logo {
150-
width: 286px;
139+
width: var(--fd-sidebar-width, 300px);
151140
}
152141
}
153142
@@ -169,8 +158,8 @@ const navLinks = [
169158
:deep(.mobile-header-action > span),
170159
:deep(.mobile-header-action > svg) {
171160
display: block;
172-
width: 1.375rem;
173-
height: 1.375rem;
161+
width: 1.25rem;
162+
height: 1.25rem;
174163
margin: 0;
175164
flex: none;
176165
}

docs/app/components/content/landing/LandingHero.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,7 @@ function getLang(filename: string) {
122122
</script>
123123

124124
<template>
125-
<AnnouncementBanner />
126-
<section class="relative w-full flex overflow-x-hidden md:items-end md:justify-center bg-white/96 dark:bg-black/[0.96] antialiased min-h-[40rem] md:min-h-[50rem] lg:min-h-[40rem]">
125+
<section class="relative w-full flex overflow-x-clip md:items-end md:justify-center bg-white/96 dark:bg-black/[0.96] antialiased min-h-[40rem] md:min-h-[50rem] lg:min-h-[40rem]">
127126
<!-- Spotlight Effect -->
128127
<LandingSpotlight />
129128

@@ -283,7 +282,7 @@ function getLang(filename: string) {
283282
</UCollapsible>
284283

285284
<ScrollAreaRoot class="w-full min-w-0 overflow-hidden">
286-
<ScrollAreaViewport class="w-full min-w-0 overflow-x-auto overscroll-x-contain">
285+
<ScrollAreaViewport class="w-full min-w-0 overflow-x-auto overflow-y-hidden overscroll-x-contain">
287286
<!-- All files rendered for SSR, animated with CSS -->
288287
<div class="relative">
289288
<div

docs/app/components/docs/DocsSearchButton.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ const { open } = useContentSearch()
1515
align-items: center;
1616
gap: 0.5rem;
1717
width: 100%;
18+
margin: 0;
19+
flex-shrink: 0;
1820
padding: 0.625rem 1.25rem;
1921
font-size: 0.875rem;
2022
color: var(--ui-text-muted);

docs/app/components/docs/DocsSidebar.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,11 @@ const accordionItems = computed(() =>
123123
display: flex;
124124
flex-direction: column;
125125
min-height: 100%;
126+
width: 100%;
127+
}
128+
129+
.docs-sidebar-nav :deep(> *) {
130+
width: 100%;
126131
}
127132
128133
/* Add top border to first accordion item */

0 commit comments

Comments
 (0)