Skip to content

Commit

Permalink
Merge branch 'main' into enh/843-signup-flow-enhancement
Browse files Browse the repository at this point in the history
  • Loading branch information
iamKiNG-Fr committed Sep 8, 2024
2 parents e0136bd + ea5dfd6 commit 7a4ed34
Show file tree
Hide file tree
Showing 85 changed files with 2,917 additions and 1,890 deletions.
13 changes: 0 additions & 13 deletions .editorconfig

This file was deleted.

2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

25 changes: 0 additions & 25 deletions .eslintrc

This file was deleted.

12 changes: 6 additions & 6 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ Before posting an enchantment, please consider the following questions:
- Would it require a major, minor, or patch release?
- Which providers would be impacted by this change?

> [!IMPORTANT]
> [!IMPORTANT]
> The more impact your Enchantment has on the package, the longer it may take to push, as we need to integrate it into our release cycle.
> [!IMPORTANT]
> [!IMPORTANT]
> While we appreciate every request, we cannot accept them all. Please be understanding if we do not accept your request.
## Pull requests
Expand Down Expand Up @@ -94,10 +94,10 @@ To start developing on this package, please follow the quick start guide below.
```
8. [Open a Pull Request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests), and fill out the provided fields.

> [!TIP]
> [!TIP]
> Read more about how to use the included playground [here](../README.md#development).

> [!IMPORTANT]
> [!IMPORTANT]
> By submitting a Pull request, you agree to license your work under the MIT license used by the project.

### Reviews
Expand All @@ -106,7 +106,7 @@ After you submit your Pull request, a member of our core team will review it. Pl
After receiving a review, please address any comments left by the reviewer or debate them if you disagree. This process will repeat until the pull request is approved and merged!
> [!NOTE]
> [!NOTE]
> Besides a manual review of your pull request, we will run an automated CI pipeline on your code.
## Release cycles
Expand All @@ -119,7 +119,7 @@ This package follows [Semantic Versioning 2.0.0](https://semver.org/).
If we release a pre-version of a new release, we will tag it with `next` in the npmjs release and add one of the following additions to the versions:
- **ALPHA**: Early development build of a new release
- **ALPHA**: Early development build of a new release
- Not properly tested yet
- **RC**: Potential release candidate of a new release
- Internally tested on a series of demo apps
Expand Down
1 change: 0 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

### 📚 Description


### 📝 Checklist

- [ ] I have linked an issue or discussion.
Expand Down
4 changes: 2 additions & 2 deletions .github/reproduire/needs-reproduction.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Hello 👋

Please provide a [reproduction](https://nuxt.com/docs/community/reporting-bugs/#create-a-minimal-reproduction) for this issue 🙏
Please provide a [reproduction](https://nuxt.com/docs/community/reporting-bugs/#create-a-minimal-reproduction) for this issue 🙏

<details>
<summary>How can I create a reproduction?</summary>

Please use one of the following links to reproduce your issue.
Please use one of the following links to reproduce your issue.

- https://stackblitz.com/github/nuxt/starter/tree/v3-stackblitz
- https://codesandbox.io/s/github/nuxt/starter/v3-codesandbox
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: nodejs CI
name: CI

on:
push:
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/pkg.pr.new.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Publish Commit
on:
push:
branches:
- '**'
tags:
- '!**'
pull_request:

env:
NODE_VER: 22.5

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20]
steps:
- name: Checkout code
uses: actions/checkout@v2

- uses: pnpm/action-setup@v4
name: Install pnpm
with:
run_install: false

- name: Use Node.js ${{ env.NODE_VER }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VER }}
cache: 'pnpm'

- name: Install deps
run: pnpm i

- name: Build and pack
run: pnpm prepack

- name: Publish package preview
run: pnpx pkg-pr-new publish --compact
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
shamefully-hoist=true
strict-peer-dependencies=false
link-workspace-packages=true
ignore-workspace-root-check=true
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ npx nuxi@latest module add sidebase-auth

<details>
<summary>Or install manually</summary>

#### 1. Install the package as a dev dependency

```sh
Expand All @@ -53,7 +53,7 @@ npx nuxi@latest module add sidebase-auth

```ts
export default defineNuxtConfig({
modules: ['@sidebase/nuxt-auth']
modules: ['@sidebase/nuxt-auth']
})
```
</details>
Expand All @@ -64,8 +64,7 @@ Then visit the [Quick Start documentation](https://auth.sidebase.io/guide/gettin

`@sidebase/nuxt-auth` is a library with the goal of supporting authentication for any universal Nuxt 3 application. At the moment three providers are supported:
- [`authjs`](https://auth.sidebase.io/guide/authjs/quick-start): for non-static apps that want to use [Auth.js / NextAuth.js](https://github.com/nextauthjs/next-auth) to offer the reliability & convenience of a 23k star library to the Nuxt 3 ecosystem with a native developer experience (DX)
- [`local`](https://auth.sidebase.io/guide/local/quick-start): for static pages that rely on an external backend with a credential flow for authentication.
- [`refresh`](https://auth.sidebase.io/guide/local/quick-start#refresh-token): for static pages that rely on an external backend with a credential flow and refresh tokens for authentication.
- [`local`](https://auth.sidebase.io/guide/local/quick-start): for static pages that rely on an external backend with a credential flow for authentication. The Local Provider also supports refresh tokens since `v0.9.0`. Read more [here](https://auth.sidebase.io/upgrade/version-0.9.0).

You can find a full list of our features, as well as which provider supports each feature [on our docs](https://auth.sidebase.io/guide/getting-started/choose-provider).

Expand All @@ -80,7 +79,7 @@ You can find a full list of our features, as well as which provider supports eac
- Methods to `getSession`, `getCsrfToken`, `getProviders`, `signIn` and `signOut`
- Full TypeScript support for all methods and properties

### Application protection
### Application protection
- Application-side middleware protection for the [full application](https://auth.sidebase.io/guide/application-side/protecting-pages#global-middleware) or [specific pages](https://auth.sidebase.io/guide/application-side/protecting-pages#local-middleware)
- Server-side [middleware](https://auth.sidebase.io/guide/authjs/server-side/session-access#server-middleware) and [endpoint protection](https://auth.sidebase.io/guide/authjs/server-side/session-access#endpoint-protection)

Expand Down Expand Up @@ -142,7 +141,6 @@ This module also has it's own playground:
We have one playground per provider:
- [`authjs`](./playground-authjs)
- [`local`](./playground-local)
- [`refresh`](./playground-refresh)
##### How to test static Nuxt 3 apps?
Expand All @@ -162,10 +160,10 @@ To test static Nuxt 3 apps we want to run a static frontend and a separate backe
pnpm dev
# A second Nuxt app should now be running on http://localhost:3001.
# A second Nuxt app should now be running on http://localhost:3001.
# We use this purely for authentication
```
4. Visit [http://localhost:3000](http://localhost:3000) -> this should open the static application. Performing any auth-related actions, the app should send requests to the backend running on port `3001`
4. Visit [http://localhost:3000](http://localhost:3000) -> this should open the static application. Performing any auth-related actions, the app should send requests to the backend running on port `3001`
## Contributing
Expand Down
4 changes: 2 additions & 2 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default defineConfig({
},
editLink: {
pattern: 'https://github.com/sidebase/nuxt-auth/tree/main/docs/:path',
text: 'Edit this page on GitHub'
}
text: 'Edit this page on GitHub',
},
},
})
4 changes: 2 additions & 2 deletions docs/.vitepress/head.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { HeadConfig } from "vitepress"
import type { HeadConfig } from 'vitepress'

const HOST_NAME = 'https://auth.sidebase.io'
const OG_IMAGE_URL = `${HOST_NAME}/nuxt-auth-og.jpg`

export const sitemapConfig = {
hostname: HOST_NAME
hostname: HOST_NAME,
}

export const headConfig: HeadConfig[] = [
Expand Down
12 changes: 10 additions & 2 deletions docs/.vitepress/routes/navbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const routes: DefaultTheme.Config['nav'] = [
link: '/guide/authjs/quick-start',
},
{
text: 'Local / Refresh guide',
text: 'Local guide',
link: '/guide/local/quick-start',
},
],
Expand All @@ -25,6 +25,10 @@ export const routes: DefaultTheme.Config['nav'] = [
text: 'Overview',
link: '/resources/overview',
},
{
text: 'Upgrade Guides',
link: '/upgrade',
},
{
text: 'Recipes',
link: '/recipes/introduction/welcome',
Expand All @@ -40,8 +44,12 @@ export const routes: DefaultTheme.Config['nav'] = [
],
},
{
text: '0.8.0',
text: '0.9.1',
items: [
{
text: '0.8.2',
link: 'https://github.com/sidebase/nuxt-auth/tree/0.8.2/docs',
},
{
text: '0.7.2',
link: 'https://github.com/sidebase/nuxt-auth/tree/0.7.2/docs/content',
Expand Down
2 changes: 1 addition & 1 deletion docs/.vitepress/routes/sidebar/guide.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export const routes: DefaultTheme.SidebarItem[] = [
],
},
{
text: 'Local / Refresh Provider',
text: 'Local Provider',
base: '/guide/local',
items: [
{
Expand Down
4 changes: 3 additions & 1 deletion docs/.vitepress/routes/sidebar/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ import type { DefaultTheme } from 'vitepress'

import { routes as guideRoutes } from './guide'
import { routes as recipesRoutes } from './recipes'
import { routes as upgradeRoutes } from './upgrade'

export const routes: DefaultTheme.Config['sidebar'] = {
'/guide': guideRoutes,
'/recipes': recipesRoutes
'/recipes': recipesRoutes,
'/upgrade': upgradeRoutes
}
18 changes: 18 additions & 0 deletions docs/.vitepress/routes/sidebar/upgrade.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import type { DefaultTheme } from 'vitepress'

export const routes: DefaultTheme.SidebarItem[] = [
{
text: 'Versions',
base: '/upgrade',
items: [
{
text: 'Version 0.9.0',
link: '/version-0.9.0'
},
{
text: 'Version 0.8.0',
link: '/version-0.8.0'
}
],
},
]
6 changes: 3 additions & 3 deletions docs/.vitepress/theme/components/Banner.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<script lang="ts" setup>
import { VPButton } from 'vitepress/theme';
import { VPButton } from 'vitepress/theme'
defineProps<{
text?: string,
text?: string
button?: {
href: string,
href: string
text: string
}
}>()
Expand Down
50 changes: 25 additions & 25 deletions docs/.vitepress/theme/components/GithubStarsButton.vue
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<script lang="ts" setup>
import { ref, onMounted } from 'vue'
import StarIcon from './StarIcon.vue';
import { onMounted, ref } from 'vue'
import StarIcon from './StarIcon.vue'
const props = defineProps<{
owner: string,
owner: string
repo: string
}>()
const count = ref(0)
async function fetchCount () {
async function fetchCount() {
const res = await fetch(`https://api.github.com/repos/${props.owner}/${props.repo}`)
const resJson = await res.json()
count.value = resJson.stargazers_count ?? 0
Expand All @@ -18,27 +18,27 @@ onMounted(fetchCount)
</script>

<template>
<div class="Wrapper">
<a
title="Github"
class="Button"
:href="`https://github.com/${owner}/${repo}`"
target="_blank"
rel="noreferrer noopener"
>
<StarIcon />
Star
</a>
<a
class="Count"
:href="`https://github.com/${owner}/${repo}/stargazers`"
aria-label={label}
target="_blank"
rel="noreferrer noopener"
>
{{ new Intl.NumberFormat().format(count) }}
</a>
</div>
<div class="Wrapper">
<a
title="Github"
class="Button"
:href="`https://github.com/${owner}/${repo}`"
target="_blank"
rel="noreferrer noopener"
>
<StarIcon />
Star
</a>
<a
class="Count"
:href="`https://github.com/${owner}/${repo}/stargazers`"
aria-label="{label}"
target="_blank"
rel="noreferrer noopener"
>
{{ new Intl.NumberFormat().format(count) }}
</a>
</div>
</template>

<style scoped>
Expand Down
Loading

0 comments on commit 7a4ed34

Please sign in to comment.