Skip to content

Commit

Permalink
Merge pull request #199 from kinde-oss/peter/fix/build-and-linting
Browse files Browse the repository at this point in the history
chore: linting and build
  • Loading branch information
peterphanouvong authored Aug 19, 2024
2 parents f169d1f + 3b7cdb8 commit cb93131
Show file tree
Hide file tree
Showing 31 changed files with 4,099 additions and 1,087 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

> 6 July 2023
- updated package.json version to fix failed release [`#37`](https://github.com/peterphanouvong/kinde-auth-nextjs/pull/37)
- updated package.json version to fix failed release [`#37`](https://github.com/peterphanouvong/kinde-auth-nextjs/pull/37)
- chore: release v1.8.9 [`37f450f`](https://github.com/peterphanouvong/kinde-auth-nextjs/commit/37f450f95f76507b4cd92761af6abf54f8a667b3)

#### [1.8.8](https://github.com/peterphanouvong/kinde-auth-nextjs/compare/1.8.7...1.8.8)
Expand Down Expand Up @@ -1073,7 +1073,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- Peter/provider type [`#19`](https://github.com/peterphanouvong/kinde-auth-nextjs/pull/19)
- remove module version [`#18`](https://github.com/peterphanouvong/kinde-auth-nextjs/pull/18)
- Add Feature flags [`#17`](https://github.com/peterphanouvong/kinde-auth-nextjs/pull/17)
- Add Feature flags [`#17`](https://github.com/peterphanouvong/kinde-auth-nextjs/pull/17)
- make the challenge last for 15 mins [`#15`](https://github.com/peterphanouvong/kinde-auth-nextjs/pull/15)
- Bump json5 from 2.2.1 to 2.2.3 [`#11`](https://github.com/peterphanouvong/kinde-auth-nextjs/pull/11)
- Bump @sideway/formula from 3.0.0 to 3.0.1 [`#12`](https://github.com/peterphanouvong/kinde-auth-nextjs/pull/12)
Expand Down
7 changes: 6 additions & 1 deletion clientConfig/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,10 @@ export default {
exports: 'named'
}
],
external: ['react', 'react-dom']
external: [
'react',
'react-dom',
'jwt-decode',
'@kinde-oss/kinde-typescript-sdk'
]
};
3 changes: 2 additions & 1 deletion componentConfig/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ export default {
exports: 'named',
format: 'esm'
}
]
],
external: ['react', '@kinde-oss/kinde-typescript-sdk']
};
3 changes: 2 additions & 1 deletion middlewareConfig/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ export default {
exports: 'named',
format: 'esm'
}
]
],
external: ['jwt-decode', '@kinde-oss/kinde-typescript-sdk', 'next/server']
};
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"test": "jest",
"release": "release-it",
"lint": "eslint --ignore-path .eslintignore --ext .js",
"lint:fix": "prettier --write .",
"dev": "cd playground && pnpm run dev"
},
"author": {
Expand Down
2 changes: 1 addition & 1 deletion playground/src/app/api/auth/[...kindeAuth]/route.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { handleAuth } from "@kinde-oss/kinde-auth-nextjs/server";
import {handleAuth} from '@kinde-oss/kinde-auth-nextjs/server';

export const GET = handleAuth();
13 changes: 6 additions & 7 deletions playground/src/app/api/protected/route.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import { getKindeServerSession } from "@kinde-oss/kinde-auth-nextjs/server";
import { NextResponse } from "next/server";
import {getKindeServerSession} from '@kinde-oss/kinde-auth-nextjs/server';
import {NextResponse} from 'next/server';

export async function GET() {
const { getUser, isAuthenticated } = getKindeServerSession();
const {getUser, isAuthenticated} = getKindeServerSession();

if (!(await isAuthenticated())) {
return new Response("Unauthorized", { status: 401 });
return new Response('Unauthorized', {status: 401});
}

const user = await getUser();
const data = { message: "Hello User", id: user?.given_name };
const data = {message: 'Hello User', id: user?.given_name};

return NextResponse.json({ data });
return NextResponse.json({data});
}

6 changes: 3 additions & 3 deletions playground/src/app/api/public/route.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { NextResponse } from "next/server";
import {NextResponse} from 'next/server';

export async function GET() {
const data = { message: "Hello world" };
const data = {message: 'Hello world'};

return NextResponse.json({ data });
return NextResponse.json({data});
}
2 changes: 1 addition & 1 deletion playground/src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
--g-box-shadow: 0px 6px 12px rgba(18, 20, 23, 0.06),
0px 15px 24px rgba(18, 20, 23, 0.07), 0px -4px 12px rgba(18, 20, 23, 0.05);

--g-font-family: "Helvetica";
--g-font-family: 'Helvetica';

--g-font-size-x-small: 0.75rem; /* 12px */
--g-font-size-small: 0.875rem; /* 14px */
Expand Down
20 changes: 10 additions & 10 deletions playground/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import "./globals.css";
import './globals.css';
import {
RegisterLink,
LoginLink,
LogoutLink,
} from "@kinde-oss/kinde-auth-nextjs/components";
import { getKindeServerSession } from "@kinde-oss/kinde-auth-nextjs/server";
import Link from "next/link";
LogoutLink
} from '@kinde-oss/kinde-auth-nextjs/components';
import {getKindeServerSession} from '@kinde-oss/kinde-auth-nextjs/server';
import Link from 'next/link';

export const metadata = {
title: "Kinde Auth",
description: "Kinde with NextJS App Router",
title: 'Kinde Auth',
description: 'Kinde with NextJS App Router'
};

export default async function RootLayout({
children,
children
}: {
children: React.ReactNode;
}) {
const { isAuthenticated, getUser } = getKindeServerSession();
const {isAuthenticated, getUser} = getKindeServerSession();
const user = await getUser();
return (
<html lang="en">
Expand Down Expand Up @@ -65,7 +65,7 @@ export default async function RootLayout({
<div className="container">
<strong className="text-heading-2">KindeAuth</strong>
<p className="footer-tagline text-body-3">
Visit our{" "}
Visit our{' '}
<Link className="link" href="https://kinde.com/docs">
help center
</Link>
Expand Down
4 changes: 3 additions & 1 deletion playground/src/app/page.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@
border-radius: var(--border-radius);
background: rgba(var(--card-rgb), 0);
border: 1px solid rgba(var(--card-border-rgb), 0);
transition: background 200ms, border 200ms;
transition:
background 200ms,
border 200ms;
}

.card span {
Expand Down
2 changes: 1 addition & 1 deletion playground/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Link from "next/link";
import Link from 'next/link';

export default function Home() {
return (
Expand Down
17 changes: 3 additions & 14 deletions playground/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
{
"compilerOptions": {
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": false,
Expand All @@ -22,13 +18,6 @@
}
]
},
"include": [
"next-env.d.ts",
".next/types/**/*.ts",
"**/*.ts",
"**/*.tsx"
],
"exclude": [
"node_modules"
]
"include": ["next-env.d.ts", ".next/types/**/*.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
}
Loading

0 comments on commit cb93131

Please sign in to comment.