Skip to content

Commit ccdb658

Browse files
authored
docs: update documentation to 1.0.0 (#1029)
* docs: update documentation to 1.0.0-rc.1 * docs: rewrite example to fix linter parsing * docs: use dynamic version in the navbar * docs: update to indicate 1.0
1 parent 6b35e5c commit ccdb658

File tree

4 files changed

+83
-2
lines changed

4 files changed

+83
-2
lines changed

docs/.vitepress/routes/navbar.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { DefaultTheme } from 'vitepress'
2+
import packageJson from '../../../package.json'
23

34
export const routes: DefaultTheme.Config['nav'] = [
45
{
@@ -44,8 +45,12 @@ export const routes: DefaultTheme.Config['nav'] = [
4445
],
4546
},
4647
{
47-
text: '0.10.0',
48+
text: packageJson.version,
4849
items: [
50+
{
51+
text: '0.10.0',
52+
link: 'https://github.com/sidebase/nuxt-auth/tree/0.10.1/docs',
53+
},
4954
{
5055
text: '0.9.4',
5156
link: 'https://github.com/sidebase/nuxt-auth/tree/0.9.4/docs',

docs/.vitepress/routes/sidebar/upgrade.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ export const routes: DefaultTheme.SidebarItem[] = [
55
text: 'Versions',
66
base: '/upgrade',
77
items: [
8+
{
9+
text: 'Version 1.0',
10+
link: '/version-1.0'
11+
},
812
{
913
text: 'Version 0.10.0',
1014
link: '/version-0.10.0'

docs/upgrade/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ title: 'Redirecting'
33
editLink: false
44
---
55

6-
<meta http-equiv="refresh" content="0;URL='/upgrade/version-0.10.0'" />
6+
<meta http-equiv="refresh" content="0;URL='/upgrade/version-1.0'" />

docs/upgrade/version-1.0.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Upgrade to 1.0.0
2+
3+
> This release contains breaking changes for `signIn` and `signUp` functions
4+
5+
🎉 We're excited to share that `@sidebase/nuxt-auth` is moving towards its 1.0 release! Read the [full roadmap here](https://github.com/sidebase/nuxt-auth/issues/1028).
6+
7+
## Installation
8+
9+
::: code-group
10+
11+
```bash [npm]
12+
npm i -D @sidebase/nuxt-auth@^1.0.0
13+
```
14+
15+
```bash [pnpm]
16+
pnpm i -D @sidebase/nuxt-auth@^1.0.0
17+
```
18+
19+
```bash [yarn]
20+
yarn add --dev @sidebase/nuxt-auth@^1.0.0
21+
```
22+
23+
:::
24+
25+
## :warning: Breaking changes
26+
27+
### `signUp` function in `local` provider
28+
There's a breaking change in `local` provider `signUp` function which now only accepts 2 parameters. This is due to `signUp` having an [extra parameter](https://github.com/sidebase/nuxt-auth/blob/4b3a5904c9e0d3bce6a6334bf4a463d4835d4a48/src/runtime/composables/local/useAuth.ts#L170) from its initial implementation.
29+
30+
If you used `signUp` with three parameters, merge the third parameter into the second:
31+
```ts diff
32+
await signUp(credentials, { external: true }, { preventLoginFlow: true }) // [!code --]
33+
await signUp(credentials, { external: true, preventLoginFlow: true }) // [!code ++]
34+
35+
await signUp(credentials, undefined, { preventLoginFlow: true }) // [!code --]
36+
await signUp(credentials, { preventLoginFlow: true }) // [!code ++]
37+
```
38+
39+
### `signIn` function in `authjs` provider
40+
This function now [always](https://github.com/sidebase/nuxt-auth/blob/07199b1ccf74577890cab224c2782c7f88a9a9b6/src/runtime/composables/authjs/useAuth.ts#L90) returns an object [`SignInResult`](https://github.com/sidebase/nuxt-auth/blob/07199b1ccf74577890cab224c2782c7f88a9a9b6/src/runtime/composables/authjs/useAuth.ts#L29-L34):
41+
42+
```ts
43+
interface SignInResult {
44+
error: string | null
45+
status: number
46+
ok: boolean
47+
url: any
48+
}
49+
```
50+
51+
This was done to remove the previously missing `| void` from the signature, improving type-safety and usability. If you checked for `void` being returned, adjust your usage accordingly:
52+
53+
```ts diff
54+
const signInResponse = await signIn(/* ... */)
55+
56+
const isResponseDefined = signInResponse // [!code --]
57+
const isResponseDefined = signInResponse.error === null // [!code ++]
58+
59+
if (isResponseDefined) {
60+
// ...
61+
}
62+
```
63+
64+
## Changelog
65+
66+
* feat: return signin response if no redirection by @despatates in https://github.com/sidebase/nuxt-auth/pull/977
67+
* Enh(#843): Allow signup flow return data when preventLoginFlow is true by @iamKiNG-Fr in https://github.com/sidebase/nuxt-auth/pull/903
68+
* chore: display register error message by @DevDengChao in https://github.com/sidebase/nuxt-auth/pull/1015
69+
* bump dependencies by @phoenix-ru in https://github.com/sidebase/nuxt-auth/pull/1016
70+
* chore: refactor useAuth composables to encapsulate context by @phoenix-ru in https://github.com/sidebase/nuxt-auth/pull/1024
71+
72+
**Full Changelog**: https://github.com/sidebase/nuxt-auth/compare/0.10.1...v1.0.0

0 commit comments

Comments
 (0)